Search Results

Search found 3168 results on 127 pages for 'directories'.

Page 19/127 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Linux shell to restrict sftp users to their home directories?

    - by hfidgen
    I need to give SFTP access to a directory within my webroot on my server. I've set up ben_files as a user and have set his/her home directory to /var/www/vhosts/mydomain.com/files That's all fine if he/she connects with plain old FTP - he's/she's restricted just to that directory, but to enable SFTP I had to add him/her to bin/bash shell, which suddenly opens up my entire server... Is there a way of giving him/her SFTP access but without opening up all my directories? I'd really like him restricted to only his/her home ;)

    Read the article

  • databind a DropDownList control with a list of all sub directories that exist in a particular direct

    - by sushant
    I am wanting to databind a DropDownList control with a list of all sub directories that exist in a particular directory on the server. The directory I want to search is in the root of the application. I am fairly new to programming and I'm not sure where to even start. I found this code on a website: Dim root As String = "C;\" Dim folders() As String = Directory.GetDirectories(root) Dim sb As New StringBuilder(2048) Dim f As String For Each f In folders Dim foldername As String = Path.GetFileName(f) sb.Append("<option>") sb.Append(foldername) sb.Append("</option>") Next Label3.Text = "<select runat=""sever"" id=""folderlist""" & sb.ToString() & "</select>" I guess this is vb. but my tool is in asp, so is their something similar in vbscript so that I can use it.

    Read the article

  • How to create a zip file and keep entries for directories?

    - by NathanZ
    I would like to create a zip archive from a folder and keep entries for (non-empty) directories. In the code below, FileInputStream throws a FileNotFoundException when a directory is passed to AddToZip. I have tried to put a condition around the actual writing of bytes but it makes the whole archive invalid. How can I add directory entries to the archive? public static void addToZip(File directoryToZip, File file, ZipOutputStream zos) throws FileNotFoundException, IOException { String zipFilePath = file.getCanonicalPath().substring(directoryToZip.getCanonicalPath().length() + 1,file.getCanonicalPath().length()); System.out.println("Writing '" + zipFilePath + "' to zip file"); ZipEntry zipEntry = new ZipEntry(zipFilePath); zos.putNextEntry(zipEntry); FileInputStream fis = new FileInputStream(file); // Throws a FileNotFoundException when directory byte[] bytes = new byte[1024]; int length; while ((length = fis.read(bytes)) >= 0) { zos.write(bytes, 0, length); } zos.closeEntry(); fis.close(); }

    Read the article

  • What is the proper way to set my drawable directories to support the new Dell Streak without losing support for older devices?

    - by emmby
    This seems to be a widespread problem. I have the following drawable directories: drwxr-xr-x 18 mike staff 612 Feb 4 17:28 drawable/ drwxr-xr-x 51 mike staff 1734 Feb 4 17:32 drawable-nodpi/ drwxr-xr-x 44 mike staff 1496 Feb 4 17:30 drawable-normal-mdpi/ My xml drawable resources are in drawable. My resources intended for the large-mdpi (Dell Streak) and normal-hdpi (Droid, Nexus, Incredible, etc.) are all in drawable-nodpi. My resources for normal-mdpi (older phones like the G1) are in drawable-normal-mdpi. Unfortunately, the normal-hdpi phones like the Droid are pulling their resources from drawable-normal-mdpi instead of from drawable-nodpi. This is likely because of the rules in How Android Finds the Best-matching Resource. So the question is, how do I provide support for large-mdpi devices like the Streak along with normal-hdpi devices like the Droid, as well as normal-mdpi devices like the G1? The simplest solution would probably be to make two copies of my large resources, one in normal-hdpi for the droid and one in large-mdpi for the streak, but i'd like to avoid duplicating all of these resources. Update Per Mayra's suggestion, I could make an alias for every resource. However, there are a lot of resources I'd have to make aliases for, which would make maintenance a nightmare going forward, so I'm hoping for another solution.

    Read the article

  • Looking for out-of-place directories in an SVN working copy?

    - by jthg
    An annoyance that I sometimes come across with SVN is the working copy getting corrupted by one of the .svn folders getting moved from its original location. It doesn't happen often if you're careful and use the proper tools for all moves and renames, but it still somehow happens from time to time. First, does anyone know if there's a good way to catch the problem before a commit is even done? Cruise control usually catches the problem, but there are plenty of cases it wouldn't catch. Second, is there a quick and easy way to check for out-of-place .svn folder if I suspect that there is one? I can definitely do it manually by deducing what directory is out of place based on the compiler errors or by diffing the working copy with another clean checkout. But, this seems like a problem that SVN can diagnose in a second by giving me a list of all directories whose parent directory in the working copy doesn't match its parent directory in the repository. There there some way to have SVN give me a list like that? Thanks.

    Read the article

  • Read all sub directories within a certain folder to display a random image.

    - by Andy
    I have this code i have been using....but i need a conditional where it will read all the sub directories of /bg to select an image as opposed to a specific folder if they were on a subpage. Heres my code so far which works perfectly for all subpages to display specific images: //This would tell us its on the homepage if it helps: $this->level() == 0 //This is the code so far $path = '/home/sites/mydomain.co.uk/public_html/public/images/bg/'.$this->slug; $homepagefile = URL_PUBLIC.'public/images/bg/'.$this->slug.'/main.jpg'; $bgimagearray = array(); $iterator = new DirectoryIterator($path); foreach ($iterator as $fileinfo) { if ($fileinfo->isFile() && !preg_match('\.jpg$/', $fileinfo->getFilename())) { $bgimagearray[] = "'" . $fileinfo->getFilename() . "'"; } } $bgimage = array_rand($bgimagearray); ?> <div id="bg"> <div> <table cellspacing="0" cellpadding="0"> <tr> <td><img src="<?php echo $file.trim($bgimagearray[$bgimage], "'"); ?>" alt=""/></td> </tr> </table> </div> </div> Any help would be appreciated, im sure its not rocket science but ive tried a few ways and cant get my head around it. Thanks in advance.

    Read the article

  • .NET Best Way to move many files to and from various directories??

    - by Dan
    I've created a program that moves files to and from various directories. An issue I've come across is when you're trying to move a file and some other program is still using it. And you get an error. Leaving it there isn't an option, so I can only think of having to keep trying to move it over and over again. This though slows the entire program down, so I create a new thread and let it deal with the problem file and move on to the next. The bigger problem is when you have too many of these problem files and the program now has so many threads trying to move these files, that it just crashes with some kernel.dll error. Here's a sample of the code I use to move the files: Public Sub MoveIt() Try File.Move(_FileName, _CopyToFileName) Catch ex As Exception Threading.Thread.Sleep(5000) MoveIt() End Try End Sub As you can see.. I try to move the file, and if it errors, I wait and move it again.. over and over again.. I've tried using FileInfo as well, but that crashes WAY sooner than just using the File object. So has anyone found a fool proof way of moving files without it ever erroring? Note: it takes a lot of files to make it crash. It'll be fine on the weekend, but by the end of the day on monday, it's done.

    Read the article

  • Vim: Use different ~/.vim/plugin/ directories for different versions of vim?

    - by Stefan Lasiewski
    Like many of you, my custom Vim configuration is stored in my ~/.vimrc, with the plugins, colors, etc. stored under ~/.vim/plugins, ~/.vim/colors, etc. I want to share a single Vim configuration among many servers. Some of these servers run Vim 7, some run the older Vim 6. Most Vim plugins are intended for Vim 7, but older versions still exist for those of us on older systems. See DirDiff for an example. If I am on a system which runs Vim 6, how can I configure Vim to only use Vim 6-compatible plugins? I was thinking about storing older plugins in a subdirectory like ~/.vim/plugins6/ and keep the Vim plugins in ~/.vim/plugins, but then how can I tell Vim6 to ignore ~/.vim/plugins and use ~/.vim/plugins6 instead?

    Read the article

  • How do I exclude directories from my Windows 7 backup?

    - by mattalexx
    I'm setting up a backup for a friend's computer onto his USB drive. I was reading this article about the Windows 7 Backup and Restore feature. Everything looks okay, but for the life of me, I can't figure out how to get to this screen: I need to set up some excluded folders, since the backup media is a little smaller than the home folder. I need to exclude the replaceable 100 GB video directory.

    Read the article

  • Best alternatives to recover lost directories in FAT32 external hard drive?

    - by Sergio
    Hi: I have an 320 GB ADATA CH91 external hard drive. I guess it has some problems with the connector of the USB jack. The point is that in certain occasions it fails in write operations generating data losses. Right now I lost a directory with several GB's of very useful information. Since then I have not attempted to write to the disk any more. What tool would you recommend to recover the lost data? The disk is FAT32 formatted (only one partition) and I use both Linux and Windows. What filesystem format would you recommend to avoid future data losses? I currently only use this external hard drive in Linux so there are several available choices (FAT, NTFS, ext3, ext4, reiser, etc.). Regards, Sergio

    Read the article

  • How can I enable http auth in lighttpd for all directories except one?

    - by Nuri Hodges
    I am trying to authenticate access to everything in webroot (/) except anything that resides in a particular directory (/directory/) and I've tried both of these options to no avail: $HTTP["url"] =~ "^(?!(/directory))" { auth.require = ( "" => ( "method" => "basic", "realm" => "auth to this area", "require" => "user=username" ) ) } $HTTP["url"] != "/directory" { auth.require = ( "" => ( "method" => "basic", "realm" => "auth to this area", "require" => "user=username" ) ) }

    Read the article

  • Permission settings for apache2 web content directories with several users?

    - by John
    Hi there. I've got a Debian VPS set up with a LAMP-stack. My apache2 instance runs on the user account 'www-data'. In addition to the root account and the service accounts I have several user accounts belonging to friends, family and myself that includes FTP-access. This is to allow the users to drop files to the root of their domain which is located in their home folder. I am having issues with setting the correct permissions so that Apache is able to serve the content ("403 Forbidden"). I could just do a 'chmod -R 755 *' on the entire www-directory for each domain, but from what I gather that's not a good idea. Here's an example of the structure: apache2 is run by 'www-data' User 'john' has this home folder structure /home/john/domains/somedomain.com/www /home/john/domains/sub.somedomain.com/www How can I keep things safe while still allowing users to upload content via FTP, and allow for file-uploads in lets say Wordpress?

    Read the article

  • Can I create directories that don't exist while creating a new file in emacs?

    - by Jim
    In emacs, I create a file by visiting it with C-x C-f. Let's say I'd like to create /home/myself/new_directory/file.txt. If new_directory does not exist yet, is there a way to have it get created during the creation of file.txt without any extra steps? (I'm thinking of something like using the -p flag to mkdir in Linux.) I feel like there's a different keystroke instead of C-x C-f that can do this, but I can't remember what it is.

    Read the article

  • How do I execute find with GNU xargs to traverse a set of directories?

    - by wilhelmtell
    $ echo {a,b,c}.h d e.h |xargs -IA find A -name '*.h' find: `a.h b.h c.h d e.h': No such file or directory $ echo -e a.h\\nb.h c.h d e.h |xargs -IA find A -name '*.h' a.h find: `b.h c.h d e.h': No such file or directory The problem is that -I implies xargs will assume arguments are delimited by newline. I'm not sure why that is. I reckon I can solve this problem with sed, but I wonder if there's an xargs trick or idiom I'm not familiar with that people use to solve this. I'm looking for a solution that will also work on OS X. On OS X the xargs -J switch seems to work fine. The manpage claims this switch will just control where the arguments are placed for the executable -- which is exactly what I want.

    Read the article

  • How to Submit to an Article Directory

    Article submission involves submitting your article to the article directories. Most article directories allow user to include a link to their site in the resource box. There are also several directories that permit link inclusion within the article body.

    Read the article

  • Cannot Attach Database in SQL Express More Than Two Directories Deep?

    - by Dave Mackey
    I have a database in one of my Visual Studio Express projects. I want to attach it to my local SQLEXPRESS instance so I can run aspnet_regsql on it and add the membership database. When I select Attach Databases and then attempt to browse to the files (C:\Users\username\Documents\Visual Studio 2010\Projects\nameofproject) it only lets me navigate to C:\Users\username...Why? How can I fix this?

    Read the article

  • Bash Shell Scripting - How to iterate through directories, and copy and rename files?

    - by Cypher
    I have a directory setup as follows: /hosted/partner1/logo.png /hosted/partner2/logo.png /hosted/partner3/logo.png /hosted/partner4/logo.png /hosted/partner5/logo.png ..etc. I want to write a script that can COPY those files to a different location, with a different file name, like this: /partners/partner1.png /partners/partner2.png /partners/partner3.png ..etc. Any ideas? I'm not so great with shell scripting and there are a lot of files that I need to migrate to a single directory...

    Read the article

  • Batch file to ZIP only files in directory or sub directory

    - by PaulJavier
    I wanted to know if possible how to create a command line to do the following - if a directory exist ZIP only the contents into a ZIP file. If a directory has sub-directories ZIP only the contents into another ZIP file. Example: C:\Directory\sample.txt ZIP only sample.txt C:\Directory\Directory1\sample1.txt ZIP only sample1.txt C:\Directory\Directory1\Directory2\sample2.txt ZIP only sample2.txt So it would have created 3 zip files in C:\Directory and sub-directories. I will not know the name of the sub-directories so can I also assign some sort of variable that says if there are directories or sub-directories in C:\Directory then start above ZIP(s)? Thank you, Paul

    Read the article

  • how to rename and move files according to directory names?

    - by Shan
    I have bunch of directories containing the file with the same name. I want to move these files to another directory and at the same time renaming them with the directory name so that they are distinguished and are not over-written. EDIT: All the directories are in the same directory. Destination is one directory on the system which could be anything. We read directory and read file form it and rename it exactly as the directory name and put it to the destination. An important constraint is that the name of the file is given which will be in all of the directories. Directories might contain other files bit also the one which is given Thanks a lot

    Read the article

  • How to go about rotating logs which are arbitrary named and placed in deeply nested directories?

    - by Roman Grazhdan
    I have a couple of hosts which are basically a playground for developers. On these hosts, each of them has a directory under /tmp where he is free to do all he wants - store files, write logs etc. Of course, the logs are to be rotated, or else the disc will be 100% full in a week. The files can be plenty, but I've dealt with it with paths like /tmp/[a-e]*/* and so on and lived happily for a while, but as they try new cool stuff on the machine logrotate rules grow ugly and unmanageable, and it's getting more difficult to understand which files hit the glob. Also, logrotate would segfault if asked to rotate a socket. I don't feel like trying to enforce some naming policies in that environment, I think it's going to take quite a lot of time and get people annoyed and still would fail at some point. And I still need to manage the logs, not just rm the dirs at night. So is it a good idea in circumstances like these to write a script which would handle these temporary files? I prefer sticking with standard utilities whenever possible, but here I think logrotate is getting less and less manageable. And probably someone heard of some logrotate alternatives which would work well in such an environment? I don't need emailing logs or some other advanced features, so theoretically some well commented find | xargs would do. P.S. I do have a log aggregator but this stuff is not going to touch my little cute logstash machine.

    Read the article

  • Disable OS X Portable Home Directories for specific hosts for all users, not just individuals?

    - by Paul Nendick
    Would it be possible to block any and all Portable Home Directory services for specific hosts? Something like MCX's "MobileAccountNeverAsk-" but for the whole workstation? We have a network with both portable and stationary machines. I'd like our users to be able to use all machines, going portable on the MacBook but not being bothering with syncing when logged into stationary iMacs or Mac Pros. The Open Directory servers are running Snow Leopard (for now) and all clients are running Lion. Thanks! Paul

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >