Installing Valgrind on Shared Hosting

So you want to tinker with the goodness that is Valgrind, but you want to do it on a shared host? No problem.

# grab the latest valgrind
curl -O

#run an md5sum and check it matches the one listed on the downloads page
md5sum valgrind-3.7.0.tar.bz2

#unpack the puppy
tar -xjvf valgrind-3.7.0.tar.bs2

cd valgrind-3.7.0

#configure and pass in a directory you have permission to
./configure --prefix=$HOME/opt

#make valgrind

#install it - will end up in directory specified above
make install

Now you should have a bunch of files under your $HOME/opt directory. If you try to run it now, you’ll probably end up with an error something like

valgrind: failed to start tool 'memcheck' for platform 'blahblah-linux': No such file or directory

No problem – open up your .bash_profile (in your home directory) and add this in somewhere:


Finally, reload your .bash_profile – either log out and in again or simply

source .bash_profile

Everything I know about the command line I learned from from Tron Legacy

Just kidding…..but they did actually use real command line…um commands….and here they are.

btw, <3 you on with the show:

Scene: In the Encom boardroom

Edward Dillenger, the evil wunderkind of Encom, on seeing the chaos of a barking dog video instead of the brand new Encom OS12:

ps -ef | grep -i os12

Thus he lists processes running that have a case insensitve match of the string os12.

Having found the rogue process above, Ed decides to terminate the puppy:

kill -9 17319

Scene: Sam, our hero, in his old man’s underground laire

Finding a computer covered in dust, Sam wipes it (the dust) away and a lovely futuristic looking machine under a glass worktop comes to life:


He types, asking the machine for the effective username. It tells him: “flynn”. Hmmm he thinks and then whips out a quick

uname -a

Oooh, gotta find out some operating system implementation info. The -a switch is a shortcut switch which basically means show all the info about the current OS. But this isn’t enough for our hero. He has to try and log in, doesn’t he:

login -n root

Now, he should have known better, I mean, his old man was the uber-geek genius of his generation. You can’t just login as root without a password (yes I realise there is inconsistency in the story line here with the other terminal windows open etc but still). Next up, Sam tries the “backdoor”


because every system in the world has a “backdoor” so named that will just let us in. On password change days, I kind of wish mine did.

Now, young Sam is curious. What was the old man up to?


Hmm….nothing to see here, cows turn themselves inside out all the time, and dad clearly works on his last_will_and_testament.txt all the time too. Let’s ignore all that and rather type in the ominous sounding LLLSDLaserControl command that was the last thing his dad typed in before disappearing off the face of the planet leaving his ‘puter all powered up and such.

LLLSDLaserControl -ok 1

Well good thing he did too because he gets zapped into the grid and we get a movie out of the deal. Great Success!

How to speed up Ubuntu 11.04 – Swappiness

Or pretty much any Ubuntu version really. This is aimed at desktop installations, not servers.

Ubuntu has a fancy little property called swappiness. Swappiness basically tells Ubuntu how often to move processes out of memory and onto the hard drive. Things that are in memory are faster. Just like remembering something is faster than wondering off to google and looking it up. So in general, on your average Ubuntu desktop, you want to tell the operating system to keep processes in memory for longer. Enter swappinesss.

To find out your swappiness open up a terminal and try this:

cat /proc/sys/vm/swappiness

It will probably report back “60”. Now, for desktops, the recomended value of swappiness is 10. So let’s change the swappiness factor – open up /etc/sysctl.conf in your favourite text editor (you get extra imaginary points if you use vim instead of gedit). Again, at the terminal type:

sudo gedit /etc/sysctl.conf

Search for (or add if it isn’t there) “vm.swappiness” and change it to:


Save, reboot and hey presto off you go. For the curious, read more about swap than you could ever want to know.

I have no idea why Ubuntu doesn’t set this by default on desktop installs really, it’s one of the things that is standing in the way of it really taking off for the average computer user. Not swappiness per se, but just the fact that you have to get your hands a little dirty when you run Ubuntu, when the average person just wants to install and then play Internet, Facebook, Twitter, type a few documents and check their bank balance. Still, now you can do all that. Only faster.