Skip to content

{ Category Archives } Tips

Installing Spotify on Fedora 13

I’ve recently taken possession of a flashy new workstation running Fedora, and with joy in my heart went to install Spotify on it, only to discover… Noooo… They only offer .deb packages for Debian and Ubuntu.
Thankfully, the solution was easier than I thought. Do all the following as root…
1. Install dpkg, the Debian package management [...]

Tagged , , ,

Tunnelling a connection through 2 servers via ssh

This took a bit of head-scratching, so for future reference, or anyone else looking:
Say I am working outside the office firewall, on a machine called home, and I need to get into a MySQL server inside it. (Doesn’t have to be MySQL, but just for argument’s sake.)
There’s a machine called gateway I can ssh to [...]

Tagged ,

Best new feature in Eclipse 3.6 Helios

… is hidden away on the last tab of the Java Formatting Profile editor (Preferences -> Java -> Code Style -> Formatter -> Edit).
They’ve finally (after nearly six years) added the ability to temporarily turn the code formatter off for a tricksy block that needs its own custom formatting. e.g.:

// @formatter:off
xml
.append( "<node id=’" )
.append( protein [...]

Tagged , ,

Back up all MySQL databases to separate files

Note to self — so I don’t have to think about it again next time.

#!/bin/bash
export MYSQL_PWD=myrootpassword
BACKUP_DIR=/mnt/backups/mysql_backups
DATE=`date -I`
for dbname in `mysql -uroot –batch –skip-column-names -e "show databases;" | grep -v information_schema`; do
/usr/local/bin/mysqldump -u root $dbname | gzip -9 > $BACKUP_DIR/$dbname-$DATE.sql.gz
done
 
# Clear backups older than 7 days
/usr/local/bin/find $BACKUP_DIR/*.sql.gz -mtime +7 -delete

Edited to include compression. Remember to include [...]

Tagged ,

Google Chrome (actually Chromium) on Centos

Joy at last!
Chris Staite from the University of Birmingham has built a statically-linked version of Chromium, the open source version of Google’s Chrome browser, for Centos.
You can get it from here.
I was getting so sick of Firefox’s slowness and bloat, and Chromium is so much snappier, and more memory-efficient too.
Although to be fair, I don’t [...]

Tagged ,

Things to try when VirtualBox networking messes up

This is really a note-to-self but it might help other people too.
I have two network interfaces in my Ubuntu guest (on OS X 10.4 host), one NAT, one host-only.
Sometimes one of them doesn’t get an IP address — in ifconfig it has an inet6 address but not an inet address.
Today I tried
sudo dhclient eth1
and it [...]

Tagged , ,

NoSuchMethodError when running JUnit tests in Eclipse

This is worth a quick post as I couldn’t find a solution on Google and it took me an hour or two of fiddling.
I have a Maven project, call it frontend-war, which contains the main service code for FuncNet. A unit test kept failing in Eclipse with NoSuchMethodError, one of my least favourite screw-ups to [...]

Tagged , , ,

How to make sure your media disk is mounted before starting iTunes

This is an Apple Annoyance that’s been bugging me for a while — if your iTunes library is on an external HD, and you start iTunes without it mounted, the bloody thing can seriously mangle its own library index (under Tiger at least).
So I’ve replaced my iTunes Dock icon with a little AppleScript that checks [...]

Tagged

MacBook keyboard hacks for # (hash/pound/numbersign)

One of the few annoying things about my oldish MacBook Pro is its keyboard, for example a few unresponsive keys, but particularly the lack of a # key. It’s a UK keyboard, and has £ for shift-3, and # is hidden in alt-3 (not labelled).
This is fine in native desktop apps, but less fine in [...]

Tagged , , , ,

Penhayl Cottage website — design notes

The website is now live for Penhayl Cottage, a self-catering holiday cottage in Cornwall, run by my family. I’m not much of a web designer, but thankfully there’s a lot of free tools around these days that make it easy for an amateur to do a decent-looking job.
The layout was based on a free stylesheet [...]

Tagged ,