Skip to content

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 tool:

yum install dpkg

2. Download the base package for your architecture, and the gnome support package, from here:

http://repository.spotify.com/pool/non-free/s/spotify/

3. Create a temp directory, and unpack them there (we want to check for clashes):

mkdir spotify
cd spotify
dpkg -x ../spotify-client-qt_0.4.7.132.g9df34c0-1_amd64.deb .
dpkg -x ../spotify-client-gnome-support_0.4.7.132.g9df34c0-1_all.deb .

4. This gives you a directory tree starting at /usr. You can check for clashes like this:

find -not -type d -exec ls -l /'{}' \;

… and make sure there’s no files found.

5. Then re-extract them into your root partition (hence checking for clashes first):

dpkg -x ../spotify-client-qt_0.4.7.132.g9df34c0-1_amd64.deb /
dpkg -x ../spotify-client-gnome-support_0.4.7.132.g9df34c0-1_all.deb /

6. Finally, we need to manually install qt-x11 as this dependency is needed:

yum install qt-x11

7. Then just type spotify and log in!

Seems pretty stable so far, apart from a couple of minor glitches.

N.B. I take no responsibility if this process damages your computer, your music collection, your hearing or your sanity. Try at your own risk :-)

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 and tunnel through, but for security reasons, the database server mysql doesn’t accept connections from gateway directly. But my desktop machine at the office (err… desktop) can connect to mysql.

One way round it is to ssh from home to gateway and forward a port on gateway to the ssh server on desktop:

home $ ssh -L 2222:desktop.example.org:22 -tAY gateway.example.org

And then in another terminal, ssh from home to desktop via this tunnel, forwarding another port on home to the incoming connections port on mysql (3306 in MySQL’s case usually):

home $ ssh -p 2222 -L 23306:mysql.example.org:3306 127.0.0.1

This time, you’re connecting to home port 2222, but because of the first command, this forwards you straight to desktop port 22.

Now both tunnels are in place, you can just connect to port 23306 on home and arrive by magic at mysql. In another terminal (or from your MySQL GUI):

home $ mysql -uUSER -pPASS -h127.0.0.1 -P23306

This example shows a tunnel-within-a-tunnel. There should be a way to make this work using end-to-end tunnelling instead, I tried but didn’t get anywhere. But that might be due to ssh server restrictions on our equivalent of gateway.

If none of this means anything, there’s an intro to ssh port forwarding here.

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 )
			.append( "'><data key='class'>" )
			.append( cls )
			.append( "</data><data key='label'>" )
			.append( protein )
			.append( "</data></node>" );
			// @formatter:on

See the Off/On Tags tab for details.

Nice one guys… Eventually.

Tagged , ,

BioGeeks tech meet, Science HackDay special

This month’s BioGeeks meeting at KCL is on Friday, June 18th, to coincide with the Science HackDay taking place over the weekend.

We have a special guest this month, Cameron Neylon, with an open-science-themed talk entitled “What have the public done for us?” Plus lightning talks on various subjects.

In other news, I’ve moved the blog over to the much cleaner and airier Barthelme theme. Drop a comment if it gives you any problems.

Tagged

London BioGeeks — May Tech Meet is next week

The May tech meet is on Thursday 20th at Imperial College.

This month’s speakers:

Catherine CanevetOndex: Data integration and visualisation

Christopher BarnesABC-SysBio: Approximate Bayesian Computation in Python with GPU support

N. Purswani, L. Tweedy, Z. Patel, C. Suriel-Melchor — DASbrick: A cloud based Rich internet application for Synthetic Biology Parts Registries

Does anyone have a link for DASbrick?

Drinks afterwards at Imperial’s Eastside Bar. See the BioGeeks blog for full details.

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 full paths if you’re running it from a crontab, just in case.

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 have nearly so many extensions installed yet…

It should just work out of the box with no extra dependencies to install. I’m using 64-bit Centos 5.4, and although it’s a 32-bit app, it seems entirely happy so far.

Tagged ,

Take Back Parliament demonstration — Sat 8 May

As someone who works with numbers, I’ve known for ages the electoral system in the UK is a very poor model.

The distribution of votes across the parties correlates very badly with the distribution of seats they get in return.

It’s possible, and not uncommon, for a party’s overall vote share to go down and yet its parliamentary influence to go up, or vice versa.

After years of adversarial flip-flopping, the system’s thrown up a result which nobody seems to be satisfied with, regardless of their party affiliation. (Except maybe the Greens :-) )

There are electoral reform demonstrations happening tomorrow, in London and all across the country:

http://www.takebackparliament.com/

If you can spare a few hours to go along, hopefully we can get a good turnout and make the case for real change while it’s still very topical — not the waffly kind of change that politicians promise every time and never deliver.

I’ll be in Trafalgar Square from 2pm.

Andrew.

Tagged

London BioGeeks — April Tech Meet

This month’s tech meet is at 6pm on 21st April at University College London.

We have talks from…

Alison Cuff, UCL

The CATH database — Structural Diversity and the Question of the Fold Continuum

Andrew Martin, UCL

SAPTF — Sequence Analysis Plugin Tool Framework

John Pinney, Imperial College

GLASS — Gene LAyout by Semantic Similarity

Followed by drinks at 7:30-ish at the College Arms.

Full details, maps, directions etc. are on the BioGeeks blog.

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 worked — all it needed to do was re-query VirtualBox’s built-in DHCP server.

I would have thought this would do that automatically:

sudo /etc/init.d/networking restart

However that didn’t help… But dhclient did.

Another recurring problem is that when I move between different networks, DNS resolution gets screwed up. There’s a description of this with a suggested work around (using VBox’s DNS Proxy) here:

http://forums.virtualbox.org/viewtopic.php?f=1&t=28332

However, while this seemed to help with two of the networks I use frequently, it didn’t with a third, even after rebooting.

So, as suggested on one or two threads, I’ve removed the DNSProxy setting, and set the Ubuntu guest to use Google’s public DNS servers instead of those provided by the DHCP server for the NATted virtual NIC. (Blah blah blah.) Follow example here (more or less):

http://grumpymole.posterous.com/how-to-use-google-public-dns-or-opendns-in-ub

Seems to be working so far… But only tested on one of the offending networks, and without rebooting yet. Updates to come later.

… Nope, after upgrading to Snow Leopard and the latest VirtualBox (it’s now from Oracle — scary), random problems persist.

Sometimes I’ll lose guest-host connectivity in the middle of a session, without any sleep or other interruptions, but will still be able to see the internet from the NAT adaptor.

One possible solution here involving using OS X itself as the NAT router:

http://akutz.wordpress.com/2009/08/20/building-a-better-os-x-firewall-or-how-i-solved-the-nat-problem-for-virtualbox/

… but it’ll take work.

Or maybe a simpler version of the same approach: have a single host-only adaptor, use OS X’s internet sharing to share the AirPort card, and manually tell the vbox to use 192.168.56.1 as the default gateway:

http://forum.virtualbox.org/viewtopic.php?f=1&t=26544

If all else fails, try using a different ethernet hardware emulator.

Tagged , ,