Linux

General tips

Bash/zsh Command Line

Ultimate Linux Shutdown Process

If all is stuck, and even Ctrl+Alt+backspace does not work, remember this mnemonic: Raising Skinny Elephants Is Utterly Boring:

(SysRq is the same button as print screen on most keyboards)

Less drastically, you can use ALT+SysRq+k to kill all processes on the current virtual console (has the effect of restarting the X server).

SysRq is disabled by default so you will have to edit /etc/sysctl.conf and change the kernel.sysrq value to 1 (and then reboot) to enable these shortcut keys.

Ubuntu

Settings

OpenDNS

Add OpenDNS servers by editing /etc/dhcp3/dhclient.conf and appending the following line to the document:

prepend domain-name-servers 208.67.222.222,208.67.220.220;

Logout Keyboard Shortcut

To re-enable Control+Alt+Backspace shortcut to kill the X server:

  1. Open Keyboard preferences.
  2. Choose Layouts Tab.
  3. Press Options Button.
  4. Find "Key sequence to kill the x server' option on list.
  5. Tick to enable.

Monitor Network Usage

  1. Install vnstat: sudo apt-get install vnstat.
  2. Create database: sudo vnstat -u -i eth0.
  3. Show monthly usage: vnstat -m.

Lost Password

Steps to recover lost password in Ubuntu:

  1. Choose your Recovery Mode from Grub menu.
  2. On the Recovery Menu choose "Drop to root shell prompt".
  3. At the command prompt enter ls /home to list Userids. (optional)
  4. Enter passwd <userid> to change the password of that Userid.
  5. Enter exit.
  6. On the Recovery Menu choose "Resume Normal Boot".