skip main content

Archive for October, 2008

Installing Python’s Twisted on CentOS5 x86_64

posted by Duncan at 10:43 am on October 26th, 2008

I had to do a bit of searching to find the correct way to install Twisted on a 64 bit CentOS 5 machine, like the one I have via virtual hosting with SliceHost. But once I had the answers it was very actually very simple, so this should save you the same headache.

I was having an import problem with Twisted’s subpackages, and was also initially having a problem building the lib from source. The first problem was caused by the fact that 64 bit CentOS installs things in both /usr/lib and /usr/lib64 which confuses Twisted, as it expects things in the same directory. The final problems was due to me trying to compile Twisted without the python-devel lib and the Twisted Zope Interfaces which is a dependancy.

So to install, run these commands:

$ sudo yum install python-devel python-crypto pyOpenSSL zope
$ mkdir src;cd src
$ wget
$ tar jxvf Twisted-8.1.0.tar.bz2
$ cd Twisted-8.1.0
$ sudo python install --install-lib /usr/lib64/python2.4

Bingo, and you should now be able to test with:

$ python
>>> import twisted
>>> import twisted.web

The lines above should give you no output.

Installing MySQL gem on CentOS

posted by Duncan at 10:20 am on October 13th, 2008

Old news, but you’d be surprised how many times the same:

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.

error brings everything to a halt. Well on Centos the way to install the MySQL gem is:

$ sudo yum install mysql mysql-devel gcc
# 32 bit machine
$ sudo gem install mysql -- \
> --with-mysql-include=/usr/bin/mysql \
> --with-mysql-lib=/usr/lib/mysql
# or 64 bit like they are on SliceHost
$ sudo gem install mysql -- \
> --with-mysql-include=/usr/bin/mysql \
> --with-mysql-lib=/usr/lib64/mysq
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

Flash 5/MX games and experiments from early 2000

posted by Duncan at 3:37 pm on October 5th, 2008

Whilst searching through my hard-drive the other day, I found a bunch of games and experiments I did in Flash 5/MX. At that time I was still working in engineering, and reading everything I could about the the web and computer languages. Although the games are not ground breaking and the experiments just fluff, I find looking through them very nostalgic. They came at a the point when I finally realised I could do this web stuff for a living.
Flash 5/mx games and experiments

The source for the games is still missing which is frustrating, but I did find the source for all the experiments.

Repton and BBC Basic, a blast from the past

posted by Duncan at 1:30 pm on October 2nd, 2008

I recently found some old Flash games I had written about 7 years ago, and it got me reminiscing about all the old games I used to play on my Acorn Electron when I was a boy. Here’s a screenshot of one of my favorites, Repton.

Repton screenshot

I also have fond memories of Chucky Egg and of course Elite. Mode 2 graphics *sigh*. I can even remember the first program I ever wrote:

10 VDU 23,0,10;0;0;0;
20 MODE 2
30 GCOL 0, RND(128)
40 MOVE RND(640), RND(512)
50 PLOT 85, RND(640), RND(512)
60 GOTO 30

This used to draw random coloured triangles on the screen. I think the VDU 23 bit used to make the cursor disappear, and meant that you had to press break to stop the program. Oh and this was written from memory .. 25 odd years ago of memory too. Can anyone clarify this actually does anything?

[UPDATE] Just checked it in Electrem and it bloody works!

Setting the timezone on CentOS

posted by Duncan at 12:51 pm on October 1st, 2008

I forget this pretty much all the time, even though it’s a fairly simple operation. There are loads of timezone data files stored in:


So for my CentOS install, to set my machine to London time, I use:

# this is not correct for me
$ date
Wed Oct  1 07:43:58 CDT 2008
# to fix it
$ sudo rm /etc/localtime
$ sudo ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
# now check it's ok
$ date
Wed Oct  1 12:42:33 GMT 2008

I imagine this works on Redhat and Fedora as well, but I can’t be sure on other Linux distros.

back to the top