New Band & New Demo – Universal Thee

I’ve got a new(~ish) band with James and Robin. Here is a demo we recorded over an 8 hour session in my spare room.

Download – Narcotics by Universal Thee

Posted in Music | Tagged , , | Leave a comment

Testing with Python 2.4 on Ubuntu 10.10

Recently I needed to test a Django app under Python 2.4. I’m using Ubuntu 10.10 and the lowest packaged version of Python in the repositories is 2.6. I decided to compile Python 2.4 myself and use it in a virtualenv environment to test the app. There were a couple of little gotchas that caught me when I was doing this, so I thought I’d write-up the process.

Step 1: Install the Build Dependencies

Python 2.6 is close enough to 2.4 that the dependencies haven’t changed much (if at all).
sudo apt-get build-dep python2.6

Step 2: Download Python 2.4 Final

wget http://www.python.org/ftp/python/2.4/Python-2.4.tgz
tar -zxvf Python-2.4.tgz

Step 3: Configure and Install Python 2.4

My first attempt at building Python 2.4 failed with a buffer overflow. I found a Japanese forum post that had solved the issue by setting BASECFLAGS=-U_FORTIFY_SOURCE during the configure stage.
./configure BASECFLAGS=-U_FORTIFY_SOURCE
make
sudo make install

Step 4: Fix the Default Python Version

The make install step sets Python 2.4 as the default version of Python. I wanted to keep that at 2.6. So…
sudo rm /usr/local/bin/python
sudo ln -s /usr/bin/python2.6 /usr/local/bin/python

Step 5: Install into Virtualenv

I wanted to set up a virtualenv environment to test the app. Here I specify which version of python I want to use for the interpreter and activate it.
virtualenv env -p python2.4 --no-site-packages
source env/bin/activate

Posted in Django, Programming, Python, Web | Tagged , , , | Leave a comment

Using Django FormWizard in a view

I recently needed to use a Django form wizard from a view. I needed it in a view as I had some permissions that I needed to check and also wanted to supply some initial data as the form would now be editing information that was previously supplied.

I had found some code on Django Snippets but it was also messing around with the way that form wizards were defined. I didn’t want to change the way that form wizards behaved so I stripped out the changes and was left with a minimal way to use a form wizard in a view.

The main thing to notice is that first you have to create an instance of the FormWizard. Then as the object to return from the view you must call the instance passing through the context and the request.

Example:


@login_required
def edit_form_wizard(request, slug):
    # Do some permission checking
    ..... snip .....

    # Set up the dictionary of initial data for the form
    # In this case, we are pre-filling some data from the first form only
    initial = {0: {'first_name': request.user.first_name,
                   'last_name': request.user.last_name,
                   'email': request.user.email,
                  },
              }

    # Create the form wizard
    form = EditFormWizard([ContactForm, SecondForm, ThirdForm], initial=initial)

    # Call the form wizard passing through the context and the request
    return form(context=RequestContext(request), request=request)
Posted in Django, Programming, Web | Tagged , , | 1 Comment

Moving from Slicehost to Linode

Spent the weekend moving HairCrazy from Slicehost to Linode.

A few times over the past year and a bit, we’ve had issues with high steal times on Slicehost, with the only cure being to move to another host server (and about an hour of downtime). The disk latency also had got worse, and we kept bumping up against the memory limits.

After a while discussing it, we finally decided to move to Linode for the following reasons:

  • London based data center. Which is handy, as most of our customers are this side of the Atlantic. And we like giving our customers a snappy response
  • Twice the memory for the same price.
  • So far, the steal time has been at 0% and iowait time has been low too.
  • The admin console is a bit more comprehensive too, but that wasn’t a reason for picking Linode

So far, things seems fine but I’ll keep an eye on it and report back if I have any issues.

Posted in sys-admin, Web | Leave a comment

New Laser printer

Jude’s old laser printer started chewing up paper, and she needed a new one. We looked around and found a colour networked laser printer for under £150! After reading as many reviews as we could, we went for the Xerox Phaser 6125.

The hardest bit about setting it up was getting it out of the box! It weighs 17.2kg and is the size of a small fridge.

Setting it up is easy. After removing a bunch of tabs, just plug-in the network cable and set the IP addresses that are allowed to print. It works fine from OSX, Ubuntu and XP.

Posted in Office | Leave a comment

Netbooks

I’ve been thinking about buying a laptop or a netbook recently. I like the idea of a netbook but was a bit worried that it would be too small, crappy and underpowered.

Today I got to play with David’s Samsung N130 running Ubuntu 10.10.

It’s nice. It’s no slower for doing the day to day things I need to do than the laptop I use at work (although that’s not saying much).

I think my mind is made up now… I’ll see if I can find a nice refurbished netbook.

Posted in Ubuntu | Tagged , | Leave a comment

100 hair dye colours available at Hair Crazy

I’ve just noticed that Jude has 100 different hair dyes by 4 different brands available at Hair Crazy. Congrats!

Posted in Hair Crazy | Leave a comment

Of Fonts and Typography

Recently, I wanted to use some nice @font-face on a website. When I was looking around I stumbled on Font Squirrel’s generator that packages up the fonts for you nicely, and auto-generates the proper CSS for their use. Nice.

I also came across The Elements of Typographic Style Applied to the Web (via Aza Raskin’s blog). It has enough depth and detail while remaining clear and providing decent sample implementations. I like things like this.

Posted in Typography, Web | Tagged , , | Leave a comment

Tattooed skulls

My friend Sheltand has some sketches of numberswiki.com

tattooed skulls and skeletons. I like it.
Reminds me that I need to update the theme of this blog…

Posted in Sketches | Tagged , | Leave a comment

Panorama of Kyoto

Jude took some hand held shots from the top of the Westin Miyako in Kyoto.

Panorama of Kyoto taken from the top of the Westin Miyako

Panorama of Kyoto taken from the top of the Westin Miyako

See how she did it on her new blog.

I now have a new desktop wallpaper :D

Posted in japan, Photography | Tagged , , | Leave a comment