Useful Linux Tips

April 30th, 2010

These might be a little Ubuntu specific but I do use Ubuntu!

Bash Aliases

You may have to edit the file ~/.bashrc first to enable the bash_aliases file.  Uncomment the final three lines here.

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

Then you can edit the ~/.bash_aliases file and add in whatever shortcuts you want.  My current one contains:

alias vb='vim ~/.bash_aliases; source ~/.bash_aliases'
alias ins='sudo apt-get install'
alias upd='sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove'
alias rem='sudo apt-get remove'
alias arem='sudo apt-get autoremove'
alias sea='apt-cache search'

So if I want to search for a package I can type in ‘sea’ only instead of ‘apt-cache search’.  Also typing in ‘upd’ will do a sudo apt-get update and then (if successful) an upgrade and then (if successful) autoremove.

The ‘arem’ shortcut is probably a little pointless as that is done with ‘upd’ but it is still in there.

Partitioning

Notes cribbed from Linux Reality #76

  • Swap space can go anywhere. One can be used by many distributions if you have them.
  • Home should go in a separate partition so if you reinstall the OS then you don’t wipe out your home directory.
  • Usr, Var and Temp should probably be in separate partitions as if there is some problem with them (i.e. huge log files in var) it doesn’t kill the rest of the system from lack of space.

Ubuntu Hints

(From Dave Yates )

If you somehow manage to get both KDM and GDM running at the same time, or want to change the login manager you can run:

sudo dpkg-reconfigure gdm

(or KDM) to select it.

Various Links to useful pages

CD Ripping

By default it doesn’t rip MP3s, so add a new profile:

Profile Name: CD Quality, Lossy MP3 Profile Description: MP3s GStreamer Pipeline: audio/x-raw-int,rate=44100, channels=2!lame name=enc File Extension: mp3

You may have to restart Sound Juicer to get it to recognise the new thing.

Also I had trouble with it not ripping the tags correctly, so I use Easy Tag to fix this.

General Tips

  • Swap / Disk access.
    • Check ‘swappiness’ by running cat /proc/sys/vm/swappiness
    • If it’s 50 (default?) when half your memory is used it swaps it to HD.  If you have lots of memory change this
    • sudo vim /etc/sysctl.conf
    • Change / edit line to vm.swappiness = 15
  • To check what is hammering your HD you can run iotop (may have to install).
  • To check what is draining power, use powertop (may have to install)

Bash Tips / Cool Programs

  • mtr – great tcproute program
  • hardinfo – lists details of your computer

Programs I use

I recently did a server install and then on top of that installed other things.  The apps I installed are:

  • gnome-core (to get graphical stuff)
  • thunderbird
  • firefox3-5
  • zim
  • geany
  • exaile
  • xchat
  • conky
  • conkyweather ** TO DO give script location **
  • gizmo – not in repos
  • thunar
  • terminator
  • nvidia drivers
  • htop
  • gqview (quick easy program to look at images)
  • dvd playback ** TO DO **
  • terminus
  • gwibber ** Crashes – remove? **
  • gnome-do
  • digikam
  • virtualbox ** Haven’t installed yet **
  • keepassx
  • ttt-freefont – I like freesans
  • inkscape
  • gimp
  • gdebi
  • gnome-utils (for baobab)
  • vlc
  • pidgin

Other Tips

sudo tasksel will let you set up a LAMP server or similar – it grabs all the packages you need.

Comments are closed.

Switch to our mobile site