Archive for the ‘Ubuntu’ Category

Remove all binaries from a directory tree

June 4, 2008

Here is a one liner that packs some serious bash punch:

rm `find . -type f -exec file ‘{}’ \; | grep -i linux | awk -F: ‘{print $1}’`

Restarting Sound Server in Kubuntu

May 29, 2008

If occasionally your sound stops working, you can try to restart the sound server:

sudo /etc/init.d/alsa-utils restart

If this doesn’t work, try to kill the processes that block it:

1) Identify them:

lsof | grep pcm

example output: esd 5080 name 70u CHR 116,6 13639 /dev/snd/pcmC0D0p

2) kill ’em:

kill -9 5080

3) restart alsa:

sudo /etc/init.d/alsa-utils restart

That should do the trick. Thanks to the person who posted it here.

C compiler cannot create executables

January 29, 2008

Every time I install a new ubuntu distro and I try to compile the first application I have this:

configure:error: C compiler cannot create executables

and this is the solution:

sudo apt-get install g++

So, I hope not to forget this next time 🙂

[EDIT: Manish, whose Linux expertise is much better than mine ;), correctly suggests:

sudo apt-get install build-essential

which is in fact less dirty than my solution]

Ubuntu cd request on apt-get install

January 29, 2008

If you are asked to insert your ubuntu cdrom when installing something with apt-get, and you don’t want to, just do:

  1. gksudo gedit /etc/apt/sources.list
  2. insert a ‘#’ in front of the first entry to comment it out (the one with the cdrom)
  3. sudo apt-get update

EDIT: Kevin Guertin suggested a graphical way of doing it (for the less geeky of us 🙂 ):

Go to System > Administration > Software Sources and uncheck the “Cdrom with Ubuntu 7.10 Gutsy Gibbon” checkbox on the “Ubuntu Software” tab.