Tricks

From CleanPosts

Jump to: navigation, search

Linux Jedi Mind Tricks

  • Make an image of a CD on your hard drive:

dd if=/dev/sr0 of=image.iso

  • Mount that image on your system to make a copy:

mount -o loop image.iso /mnt/temp

  • Make a new .iso image in /mnt/burn from the contents in /mnt/hold:

mkisofs -o /mnt/burn/image.iso /mnt/hold

  • Burn that image to another CD:

cdrecord dev=/dev/sr0 /mnt/burn/image.iso

  • Convert RPM package to DEB package:

alien FILE.RPM

  • List only non-blank lines in a file:

awk 'NF >0' FILE.TXT

  • Create a custom command to list files:

alias l = 'ls -l --color=auto'

  • Add line numbers to a file:

cat -n FILE2.TXT

  • Make a file lowercase:

cat FILE1.TXT | tr '[A-Z]' '[a-z]' > FILE2.TXT

  • Change the owner of a directory and all its contents:

chown -R teresita DIRECTORY

  • Extract tarball:

tar -xvf /dev/hda/file

  • Make archive:

tar -c DIRECTORY | bzip2 > dir.tar.bz2

  • Make a file executable for all users:

chmod u+x FILE

  • Turn a directory into a SquashFS file:

mksquashfs /tmp/merge pup_412.sfs

  • Mount your SquashFS file:

mount -o loop -t squashfs pup_412.sfs /mnt/pup

  • Upload a file to your webspace:

wput MYFILE ftp://username:password@web.host.com

  • Convert a MIDI file to a .WAV file:

timidity -Ow -oruby.wav ruby.mid

  • Replace spaces in a filename with hyphens:

find . -name "* *mp3" -exec rename 's/\ /-/g' {} \;

  • Print the current month in Julian dates:

cal -j

LUSH:

streamripper http://streamer-ntc-aa06.somafm.com:80/stream/1073

GROOVE SALAD:

streamripper http://streamer-ntc-aa08.somafm.com:80/stream/1018

181.FM CHILLED

streamripper http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275050

CHILLOUT LOUNGE

http://yp.shoutcast.com/sbin/tunein-station.pls?id=1268725

  • Cleanposts: 75.147.177.4
  • mencoder manoro.avi -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 -o manoro.mpg -oac lavc -lavcopts acodec=mp2:abitrate=224 -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2:aspect=4/3
  • Factorial function implemented by recursion.

define fact(n)

{

if (n <= 1) return (n);

return (n * fact(n-1));

}

Personal tools