Some cute hacks in Linux.

Adding aliases permanently:open the .bashrc file in ur favorite editor and add the aliases there have them permanently.

man pages formatted as text :

Take for example : man apropos . It looks great on console but sucks when u list it out to a text file.Try this out:

man apropos | col -bx > myfile.txt

The preceding command writes the man page to myfile.txt, without backspaces (the -b) and with spaces substituted for tabs (-x).

This one is from Mihai Patrascu’s site: http://web.mit.edu/~mip/www/probs.html.

Compressing a file system

Suppose you want to back up a partition of your hard drive, and you want to compress it to save space. So, you take your favorite compression utiliy, and have it compress /dev/hd??. But the compressed file turns out to be much larger than the amount of data on that partition. Why, and how do you fix it?

This is because the compressor doesn’t know that the free blocks on disk are actually free. These blocks typically contain junk left over from deleted files, and the compressor treats them as data. An easy and cute fix is: mount /dev/hd?? /mnt ; cat /dev/zero > /mnt/fill ; rm /mnt/fill ; umount /mnt. This will zero out all free blocks, and the compressor will only work hard to compress the actual data.

Advertisements

Pengufest , Pragyan ’08

Pengufest is all about Linux and Open Source Software. It initially started out as a mass linux installation fest.This year we had along with the usual installations fest, a few lectures from NRCFOSS contributors and a number of small workshops conducted by second years. It was really amazing to see the amount of code our seniors contributed to OSS . The work and effort they put in is tremendous. As a first step towards contributing to this community, Akhil Sanket and I conducted a workshop on Basic Networking in Linux. It was fun preparing all the pamphlets and the presentations. U learn a lot when u do it by urself tweaking things to make them work correctly. Thanks to Suren , he organised it brilliantly.

Bye, C u @ Pengufest , Pragyan 09.