Installing Chaste on Debian (sorta)

For my research, I program using a collossal C++ software package called "Chaste". CHASTE stands in this case for "Cancer, Heart and Soft Tissue Environment", rather than its usual meaning of the sexual repression of people (especially women) all over the world. Interesting choice of acronym.

Chaste's got lots and lots of bits that I don't use, and it is notoriously difficult to install on things, but it's also incredibly, incredibly useful. Over the last 10 years or so people have added all kinds of modules for biological modelling, especially cardiac stuff. Just a quick look at the class index gives you an idea of how many tools there are to use.

There's an easy Chaste installer for Ubuntu, but I'm a Debian girl myself, and I've had terrible trouble trying to use the generic instructions, because there are a lot of dependencies, and each dependency has different versions in different Linux distributions.

In the end, I decided to side-step the issue entirely. There's a tool called Debootstrap, which creates an entire Ubuntu installation in a single folder, so I can be using my Debian laptop and have Ubuntu open in a terminal without too much bother.

So first we make a Chaste directory and put Ubuntu into it using debootstrap:

mkdir Chaste
sudo debootstrap utopic Chaste

Next, we jump into the Ubuntu installation by changing our root:

sudo chroot Chaste

First off for some reason you need to tell the computer where you are.

locale-gen en_GB en_GB.UTF-8 

Then there are a few useful things that I like to have around; "nano", which is a text editor, "aptitude" which is a front-end for the apt-get installer, and "man" which are the manual pages for command line tools.

apt-get install nano aptitude man

Now you need to add some more repositories so that you have all of the packages available that you need. Open up your sources file:

nano /etc/apt/sources.list

Delete the first line using Ctrl-K, and then copy in the following:

deb utopic main universe multiverse
deb utopic partner
deb utopic-backports main restricted universe multiverse
deb-src utopic universe main multiverse
deb utopic-updates universe multiverse
deb-src utopic-updates universe multiverse
deb utopic/

Then press Ctrl-O to save and Ctrl-X to exit. Next, we add the Chaste license key, and update the package lists.

apt-key adv --recv-keys --keyserver hkp:// 422C4D99
apt-get update

The proc filesystem needs to be mounted before we can continue:

mount -t proc proc /proc

After this point, I am just following the default install guide. This next part took forever, I got quite bored. Here is a collection of margin scribbles from books.

apt-get install --install-recommends chaste-dependencies
apt-get install `dpkg -s chaste-dependencies | egrep "^Suggests" | cut -d "," -f 1-111 --output-delimiter " " | cut -d ":" -f 2`

Then checkout the code! I put it into a folder called "Chaste" in the root directory, but if you want to put it somewhere else (/home/scratch/Chaste/ for example) just create the directory you need first and cd into it.

svn --username anonymous checkout Chaste
cd Chaste

Then all of the tests should start building!


HP Deskjet F380 + Debian Linux

Scanned image

Linux printing is supposed to be difficult, right? This took about 10 minutes total. I almost feel cheated.

These two terminal commands:

$> sudo aptitude install cups cups-client simple-scan hplip system-config-printer
$> hp-setup

Literally all it took. The printer appeared in LibreOffice and worked a treat, and the scanner scanned without so much as a peep.

I have to admit, it took me significantly longer to work out how to put the paper in.


Installing & Tweaking CyanogenMod 7 on a Samsung Galaxy Ace from Debian

Or: How I Broke My Phone And Then Fixed It Again

I will preface this by saying that I did a terrible job backing up my contacts, text messages, apps and phone settings before I tried to re-flash my phone. Don't do that. It's a pain.

I have a shiny phone, called a Samsung Galaxy Ace, and it runs a well-known version of Linux called Android (please stop me if I'm patronising you). I feel very lucky to carry around such a fancy little computer in my pocket all the time. My favourite free apps that I've found are MIUI music player, Dolphin internet browser, and F-droid, which is a repository of free and open source software for Android phones. The only app I have actually paid money for is Cogs, which is a completely amazing steampunk puzzle game.

The version of Android that my phone came installed with was some bizarre combination of what Samsung and Orange thought that I would enjoy, which disabled quite a few of the phone's more interesting features. The nice thing about these phones, however, is that you can install different operating systems on them. I chose CyanogenMod mainly because I had heard of it. Here is a walkthrough of CyanogenMod 7 if you are curious about what it looks like.

I followed the phone-specific instructions on this website for installation. Before following the instructions, please remember to back up anything important using your phone's native features and also in a second way. I used Titanium Backup, which didn't work well at all for me. Pick something else.

In brief, the version of CyanogenMod for the Galaxy Ace is codenamed "cooper". You can read about it on the CyanogenMod wiki, and download it from here. Incidentally, installing it on your phone is terrifying and I really don't recommend doing it while hung over on December 29th.

I, rather cleverly, managed to lose all my contacts thanks to my aforementioned failure to back them up properly. Fortunately, Orange kept a backup for me (if you are with Orange, yours are downloadable from here). It's an odd list of old and new contacts, which you can export in comma separated value (csv) format. I went through and pruned out a couple of ex-boyfriends and all the empty columns. I ended up with a csv file that looked like this:

Other Phone,Mobile Phone,First Name,Last Name
01xxxxxxxxx, 07xxxxxxxxx, Joe, Bloggs

There's probably an easier way to put them back onto your phone via an app, but I decided to try and convert them to VCard format so I could import them directly. I wrote a python program to do this that you can download: If you put the program in the same folder as a csv file (formatted as above) called "Contacts.csv" and run the program, it should output a file called Contacts.vcf which contains all your contacts. The main thing I learned from this is that putting spaces at the end of lines really, really breaks VCards.

So, I had my contacts back. I also tried restoring all my apps from Titanium Backup. Don't do that. I ended up in a situation whereby I had CyanogenMod installed, with several bits broken (including wifi and email), and I needed to re-install to see if I could fix it. I didn't get around to this until 3 months after installation, by which point I had lots of text messages from my loved ones that I wanted to keep hold of.

It turns out all text messages are kept on an SQLite database on the phone. It's in a protected area that isn't mounted when you connect your phone by to your computer via USB. You can find out where it's kept by typing the following commands in a terminal emulator on a rooted phone:

find | grep -i mmssms

When you find mmssms.db, you can copy it over to your computer using the USB android debug bridge (ADB). It's available for various operating systems, but you can download it for Debian as a package from here. After installing ADB, type:

abd pull /path/to/file ./

There are probably all kinds of clever things you can do to restore your text messages, but I just wanted to look at them, so I installed sqlitebrowser from the repositories and open up the file occasionally to remind myself how funny and lovely all my friends are.

The moral of this story is: try not to break things - and if you do, try to fix them afterwards.