Notes by voodoo

Displaying keyword search results 1 - 12
Created by voodoo on January 03, 2012 08:41:21    Last update: February 16, 2012 15:50:06
This is the command to print all regular files in the src folder but excluding all files within the .svn folders: $ find src -name .svn -prune -o -type f -print where -o is the or operator. Define a shortcut: ff () { find $1 -name .svn -prune -o -...
Created by voodoo on November 22, 2011 12:27:12    Last update: November 22, 2011 12:31:50
Unix hidden files are named starting with a dot ".". To find hidden files in the current directory: $ find . -type f -name '.*' or $ find . -type f | grep \\/\\. To find hidden files in the marketing directory: $ find marketing -type f -name '.*' or $ find marketing -type f | grep \\/\\.
Created by voodoo on September 04, 2011 14:48:52    Last update: September 04, 2011 14:49:40
If Ubuntu does not recognize the wifi adapter, use ndiswrapper and Windows XP driver instead: Install the needed Ubuntu packages: $ sudo apt-get install ndisgtk If there's no Internet access, the needed packages are available from the Ubuntu live CD under the directory /pool/main/n . Install both ndiswrapper and ndisgtk . Download and extract the Windows XP driver for your wifi adapter. Install the Windows XP driver: Browse to System/Administration/Windows Wireless drivers Click Install New Driver Select the .inf file, then click Install Connect to wifi networks as you normally do.
Created by voodoo on June 14, 2011 15:16:30    Last update: June 14, 2011 15:18:18
Count the total number of lines of shell scripts (files ending with sh ): $ find . -type f -name \*.sh | xargs wc -l 2... Count the total number of lines for files under the src directory: find src -type f | xargs wc -l Count the total number of lines for files under the current directory whose path contains src/ : find . -type f -path \*src/\* | xargs wc -l
Created by voodoo on April 14, 2011 13:16:18    Last update: April 14, 2011 13:17:48
From Fedora Project wiki : A security context , or security label , is the mechanism used by SELinux to classify resources, such as processes and files, on a SELinux-enabled system. This context allows SELinux to enforce rules for how and by whom a given resource should be accessed. A security context is typically shown as a string consisting of three or four words. Each word specifies a different component of the security context, namely, the user , role , type , and level of that file or process . Each word is separated by a colon. Use the -Z switch to display security context info. Display security context for Apache files: $ ls -Z /var/www/ drwxr-xr-x. root root system_... Display security for files under...
Created by voodoo on April 13, 2011 13:47:34    Last update: April 13, 2011 13:49:20
You get "permission denied" error from Apache HTTPD for a page. And you checked file/directory permissions (the whole directory path, not just the file) and everything in httpd.conf . If everything seemed right, then SELinux may be blocking the access. Open /var/log/httpd/error_log , you may see a line like this: [Wed Apr 13 15:50:35 2011] [notice] SELinux poli... These are the steps to fix: If the directory resides in a user home directory: # setsebool -P httpd_read_user_content 1 Create a policy package from the audit log: # grep httpd /var/log/audit/audit.log | audit2allo... Apply the policy package just created # semodule -i mypol.pp Restart apache httpd: # apachectl restart
Created by voodoo on October 15, 2010 15:48:57    Last update: October 15, 2010 15:49:20
Use the " -r sound:local " switch to redirect sound to the local client. However, for Fedora 13 the sound redirection does not work since it's looking for an OSS compatible audio device: $ rdesktop -xl -r sound:local -f WinXPWs Autose... Bug 530431 was opened to bring support for pulseaudio to rdesktop. But the fix won't be available until Fedora 14. In the meanwhile, use padsp as a workaround: padsp rdesktop -xl -r sound:local -f WinXPWs
Created by voodoo on July 11, 2009 15:14:55    Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations. It's really easy to see HTTP headers with curl: C:\>curl --head http://www.google.com HTTP/1.0 ... or, headers and page together (dump headers to stdout): $ curl --dump-header - http://www.google.com HTTP/... Download openssl from openssl.org: curl http://www.openssl.org/source/openssl-0.9.6m.... C:\>curl --help Usage: curl [options...] <url> ...
Created by voodoo on July 09, 2010 19:41:10    Last update: July 09, 2010 19:41:10
Use the -n switch to copy files without overwriting existing ones in the target directory: cp -R -n sqlexplorer/* eclipse/
Created by voodoo on June 17, 2010 22:01:21    Last update: June 17, 2010 22:02:33
I'm building PostgreSQL 8.4.4 on Solaris 10 and got this ar: Command not found error: ar crs libpgport.a isinf.o getopt.o chklocale.o co... It turned out that the ar command is under the directory /usr/ccs/bin , adding it to the PATH solves the problem: PATH=/usr/ccs/bin:$PATH
Created by voodoo on June 17, 2010 15:23:02    Last update: June 17, 2010 15:35:40
Use useradd to add a user (the switches are not required, but it's a good idea to give them. For example, without -m you'd create a user without a home directory): # -d switch specifies user home directory # -m ... You also need to use the passwd command to set a new password before the user can log in. To delete a user, use the userdel command: userdel demo
Created by voodoo on October 03, 2009 21:34:35    Last update: October 03, 2009 21:34:56
One liners: Oldest find . -printf "%T@ %Tx %TX %p\n" | sort -n | head... Newest find . -printf "%T@ %Tx %TX %p\n" | sort -n -r | h... Shell scripts: Oldest #!/bin/ksh touch -t $(($(date "+%Y") + 1))$(dat... Newest #!/bin/ksh touch -t 197001010000 compareTo N...