Ignoring whitespace changes with svn diff

svn diff --diff-cmd `which diff` -x "-w"

Find any regular files with the criteria -type f, and those modified seven or fewer days ago (-mtime -7).

find / -type f -mtime -7 | xargs tar -rf *.tar

find . -exec grep -l ‘foobar’ {} \; 2>/dev/null

find ./* -exec grep -l -i “foobar” {} \;
find $root -name $filename -exec grep -l ‘something’  {} \; 2>/dev/null

Enable WPA Wireless in Ubuntu

Update the source list run the following command
$ sudo apt-get
$ sudo apt-get install wpasupplicant
$ sudo apt-get install network-manager-gnome network-manager

Comment out everything other than “lo” entries in that file and save the file
$ sudo vi /etc/network/interfaces

Create a file called /etc/default/wpasupplicant, add entry ENABLED=0 and save the file
$ sudo touch /etc/default/wpasupplicant

Reboot the system or use the following command
$ sudo /etc/init.d/dbus restart

Tips & Trick

auto clean: sudo aptitude autoclean
format a new partition as ext3 file system:  sudo mkfs -t ext3 /dev/sdb1
create a new mount point: sudo mkdir /media/mydrive

UserName is not in the sudoers file.

restart the computer with recovery mode.
Select “drop me to root prompt” or some message like this…
Type visudo. this will open /etc/sudoers and add the line…
Username ALL = (ALL) ALL

Save the file and reboot pc.
shutdown -r now

How do I kill zombie process?

# ps aux | awk '{ print $8 " " $2 }' | grep -w Z

Z 26731
Z 26866

You cannot kill zombies, as they are already dead.
But if you have too many zombies then kill parent process or restart service.

How to find parent process?

Another option is the pstree command to show an ascii tree representation of the processes.
You’ll probably want the -p option to show process ids.
# pstree -p | less


How to rotate a PDF file?

N: 0, E: 90, S: 180, W: 270, L: -90, R: +90, D:+180.

pdftk in.pdf cat 1-endS output out.pdf

  • S (south): 180 Grad
  • E (east): +90 Grad
  • W (west): -90 Grad

7 Comments on “Linux

Leave a Reply

Your email address will not be published. Required fields are marked *