Quotes

Jul 19, 2011
Quotes I liked. Source: Internet & people in and around planet earth.

  • If you expect the world to be fair with you because you are fair with them, it is like expecting a lion not to eat you because you don't eat lion. - Internet
  • PhD: Permanent head Damage - Anonymous graduate student
  • If you succeed in cheating someone, don't think he/she is a fool. Rather realise that he/she trusted you more than you deserved - Anonymous
  • The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts. - Bertrand Russell
  • A relationship that falls beyond the domain of definition is 'Friendship'. - Anonymous Girl
  • The financial markets have turned so bad that women are now actually marrying for Love !! - Anonymous
  • A Good Girlfriend is one who forgives her Boyfriend when SHE is wrong. - Anonymous Girl
Read more ...

CVS cheatsheet

Jul 15, 2011
Tested on: CentOS release 5.6 (Final)

There are many other CVS cheatsheets & books on the web. This is my version, which is intended to grow with time but will be less verbose (might not be good for beginners).
  • Update current working directory with prune & build directories cvs update -P -d
  • Difference between current version & latest repository version: cvs diff -cw <fileName>
  • Rename a file: mv <OldFileName> <NewFileName> cvs remove <OldFileName> cvs add <NewFileName> cvs commit -m "Renamed <OldFileName> to <NewFileName>" <OldFileName> <NewFileName>
Read more ...

Infrequent Linux commands

Jul 15, 2011
Tested with mainly Ubuntu-based distributions. List of Linux commands which are useful but not frequently used. See online or local man pages for details.

System Information

uname -a # Details of kernel, processor, machine, OS cat /proc/version # Detailed kernel version. More details about /proc. cat /etc/*-release # See details of distribution lsb_release -a # See details of distribution service --status-all # status of init services; [+] Running, [-] Not running, [?] Unknown sudo initctl list # List & status of upstart jobs. More at UbuntuBootupHowto.

Hardware Information

cat /proc/cpuinfo # Shows CPU details free -mt # Shows details of memory usage sudo dmidecode -t memory # Shows details of RAM slots df -hT # Report disk type, space usage, mount points sudo fdisk -l # Lists partition table of all disks blkid # Lists UUID and type of all disks ls -l /dev/disk/by-uuid # Lists drives by UUID

Users and Groups

groups <username> # Lists group memberships of the user id -u <username> # Prints user-id of user id -g <username> # Prints group-id of user id <username> # Print user and group information of user sudo passwd <username> # Change user password sudo usermod -d /new/home/dir <username> # Change user home directory
  • Disk usage (size) of directories: du -ach du -sch du -ch /home/user
  • List USB Devices lsusb -t
  • apt installed packages:less /var/log/apt/history.log zless /var/log/apt/history.log.1.gz dpkg --get-selections | sed -n 's/\t\+install$//p' Automatically installed packages </var/lib/apt/extended_states awk -v RS= '/\nAuto-Installed: *1/{print$2}'
  • Image to pdf:convert *.png out.pdf convert -compress jpeg *.png out.pdf

Last edited: June 11, 2014

Read more ...

Font & old emacs

Jul 11, 2011
Tested on: CentOS release 5.6 (Final)

The newer version of emacs (23.x) has a nice option in menu to change the default font. But the older emacs (21.4.1) does not have these options. The older (& stable) versions of emacs are generally shipped with centos. Here are steps for changing the default fonts in emacs 21.4.1

Option 1 (for current sessions only)
  1. Open emacs.
  2. Left-click on mouse while holding 'Shift' key on keyboard. A Font-menu will pop-up.
  3. Play around with the menu & set required font.

Option 2 (for all future sessions)
We have to find the available system fonts and apply them to ~/.emacs file.
  1. Open terminal & execute following command: xfontsel
  2. Left-click on 'fmly' & others to select a value. You will be able to see how the font looks like in the same window. When you are satisfied with the font selected press 'Select' button. It will copy the font name with details to clipboard. Following are some of the examples of the fonts: -*-courier-medium-r-*-*-17-*-*-*-*-*-iso8859-* -*-lucidatypewriter-medium-*-*-*-14-*-*-*-*-90-iso8859-* -*-luxi mono-medium-r-*-*-17-*-*-*-*-*-ascii-*
  3. Open ~/.emacs file in any text editor and add following at the end of the file: (set-default-font "-*-*-*-*-*-*-*-*-*-*-*-*-*-*") Replace -*-*-*-*-*-*-*-*-*-*-*-*-*-* by your selected font name (like one of the examples shown above) Save ~/.emacs & re-launch emacs. You should be able to see the difference.
  4. There might be some delay before text is displayed in emacs. Add following to top of the ~/.emacs file for a workaround: (modify-frame-parameters nil '((wait-for-wm . nil)))
Read more ...