some useful stuff for ubuntu linux

sources.list for ubuntu precise (12.04) 

## Main
deb precise main restricted universe multiverse
# deb-src precise main restricted universe multiverse

## Major bug fix updates
deb precise-updates main restricted universe multiverse
# deb-src precise-updates main restricted universe multiverse

## Security Updates
deb precise-security main restricted universe multiverse
# deb-src precise-security main restricted universe multiverse

## Backports
# deb precise-backports main restricted universe multiverse
# deb-src precise-backports main restricted universe multiverse

## Canonical 'partner' repository
deb precise partner
# deb-src precise partner

## google
deb stable main
deb stable main
deb stable main


Conky is a neat & light weight system monitor for X desktops. It's available as deb package conky in the official ubuntu repositories.

Save this configuration file as ~/.conkyrc & start it with "conky" from a terminal.

much more configuration examples are here 


useful programs for monitoring your system

- baobab (sudo apt-get install baobab): shows you disk usage by folder

-  localepurge (sudo apt-get install localepurge): removes unused locales (saves loads of diskspace)


helpful console commands 

Check Volume Status of the ALSA PCM device

If your audio volume in ubuntu is very low (although all the PulseAudio Volume controls are up) your problem is most likely caused by the PCM mixer's volume being muted/set to 0%. Check it's status via alsamixer:

$ alsamixer -Dhw


Add an apt key (obviously replace with the real URL)

wget -O - | sudo apt-key add -

Mount an iso (run "sudo mkdir /media/iso" first)

sudo mount -t iso9660 -o ro -o loop /home/user/filename.iso /media/iso

List all open ports:

sudo netstat -lpAinet

Get IP's without hostnames: 

sudo netstat -lpnAinet

List what's using eg. TCP port 443: 

sudo fuser -v 443/tcp
Fix "libary not found" issues when compiling custom software under /usr/local/ in ubuntu: 

sudo gedit /etc/ (check that the file contains)
sudo ldconfig
Convert Windows DVB transponder .ini files to Kaffeine style 

sed 's/^\(.*\)=\([0-9]*\),\(.\),\(.*\),\(.\)\(.\)/S \2000 \3 \4000 \5\/\6/g' |
grep ^S > ~/.kde/share/apps/kaffeine/dvb-s/Hotbird-13.0E


Bash Script to build Binary Packages from a local bzr branch 

#!/bin/bash ## This script builds source and binary packages from a local bzr branch ## for multiple ubuntu releases & uploads source packages to a launchpad ppa ### Config Start ### ## Local directory path to the folder containing the directory where the App Sources live workdir=/home/$USER/work ## Local Directory name in $workdir where the App Sources live project="src" ## App Name name="honeypod" ## App Version number taken from debian/changelog ver=$(less $workdir/$project/debian/changelog | awk 'NR>1{exit};1' | sed 's/.*(\(.*\)-.*/\1/' ) ## Launchpad package signing key key="7D43B12D" ## Launchpad ppa to upload ppa="ppa:simbad/honeypod" ## Release nickname currently on the first line of the debian/changelog file release1="quantal" ## build also Source packages for those releases release2="precise" release3="oneiric" ### Config End ### echo "exporting $project-$ver to $workdir/$ver" echo -n "is this ok? (y/n)" read ans case "$ans" in y|Y|yes|YES|Yes) echo "starting bzr export" ;; *) echo bene && exit 0 ;; esac # export bzr cd $workdir/$project bzr export ../$name-$ver.tar.gz cd $workdir tar -xvzf $name-$ver.tar.gz cd $name-$ver # build Source package for $release1 echo "Building $name_$ver Source deb..." debuild -S -sa -k$key && echo "Build done" cd $workdir mkdir -p "$ver" mv *_"$ver"* "$ver/" mv *-"$ver"* "$ver/" # build binary package for $release1 cd $workdir/$ver/$name-$ver echo -n "Build Binary package? (y/n)" read ans case "$ans" in y|Y|yes|YES|Yes) fakeroot debian/rules binary && fakeroot debian/rules clean && echo "Binary Package Build done" ;; *) echo bene ;; esac # build source packages for other releases echo -n "Build Source packages for $release2 and $release3 ? (y/n)" read ans case "$ans" in y|Y|yes|YES|Yes) # build source packages for $release2 cd $workdir/$ver/$name-$ver/debian sed -i "/$ver/s/$release1/$release2/g" changelog cd .. debuild -S -sa -k$key # build source packages for for $release3 cd $workdir/$ver/$name-$ver/debian sed -i "/$ver/s/$release2/$release3/g" changelog cd .. debuild -S -sa -k$key echo "Source Package builds done" ;; *) echo bene ;; esac # install binary package for $release1 cd $workdir/$ver echo -n "Install Deb Package? (y/n)" read ans case "$ans" in y|Y|yes|YES|Yes) sudo dpkg -i "$name"_"$ver"*.deb ;; *) echo bene ;; esac # upload to launchpad cd $workdir/$ver echo -n "Upload Source Packages to Launchpad? (y/n)" read ans case "$ans" in y|Y|yes|YES|Yes) dput "$ppa" "$name"_"$ver"*source.changes ;; *) echo bene ;; esac echo "" echo "All Done!" echo ""