Installing git-up on Ubuntu 8.10

Recently I had a bit of trouble getting {{ “github.com/aanand/git-up” | ext_link: “git-up”}} to work on Ubuntu (or anywhere else for that matter), so here’s some of the steps I had to go through. Initially ubuntu seems to have RubyGems 1.01 and 1.2.0 installed : > gem --version 1.2.0 >/usr/bin/gem1.8 --version 1.2.0 >/usr/bin/gem1.9 --version 1.0.1 ...

February 14, 2010 · 2 min · Dave Perrett

Updating RubyGems on Mac OS X 10.5 Leopard

I haven’t used ruby for a while, but recently wanted to try out {{ “github.com/aanand/git-up” | ext_link: “git-up”}} on OSX. According to the {{ “github.com/aanand/git-up/blob/master/README.md” | ext_link: “instructions”}}, a simple gem install git-up should work : > sudo gem install git-up Updating metadata for 1 gems from http://gems.rubyforge.org . complete ERROR: could not find git-up locally or in a repository I assume this is something to do with gem hosting moving to github or something… I haven’t really been following ruby for a year or so so I’m not sure exactly what’s going on. It seems i’m running a pretty old version of RubyGems, so I tried to update : ...

February 14, 2010 · 2 min · Dave Perrett

nginx error - 413 Request Entity Too Large

If you’re getting 413 Request Entity Too Large errors trying to upload with {{ “nginx.net/” | ext_link: “Nginx”}}, you need to increase the size limit in nginx.conf . Add ‘client_max_body_size xxM’ inside the server section, where xx is the size (in megabytes) that you want to allow. http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { client_max_body_size 20M; listen 80; server_name localhost; # Main location location / { proxy_pass http://127....

November 18, 2009 · 1 min · Dave Perrett

Makefile - missing separator. Stop.

If you’re getting missing separator errors in your makefile, similar to the following : Makefile:22: *** missing separator. Stop. … make sure you are using real tabs instead of spaces. A global search and replace for four-spaces should fix things up.

November 12, 2009 · 1 min · Dave Perrett

NoReverseMatch : custom registration templates break django unit tests

I’ve over-ridden several of the built-in django auth and {{ “bitbucket.org/ubernostrum/django-registration/” | ext_link: “django-registration”}} templates so I can have my own custom-styled login and registration pages. This all worked fine until i tried to run the built-in django and django_registration test suites, when everything fell apart : ...

November 10, 2009 · 3 min · Dave Perrett

Sending Django email with Gmail

After spending a few hours struggling to get postfix to work with django on my local dev machine, I gave up and decided to use Gmail . To do it, add the following to your settings.py : ...

October 16, 2009 · 1 min · Dave Perrett

Compiling mysql-python on OS X leopard

I’ve just finished trying to install mysql-python on OSX Leopard, and had quite a few problems. This is the procedure that finally ended up working for me. First, download mysql-python from here. Unzip and try to build it : ...

August 18, 2009 · 2 min · Dave Perrett

'Hello World' with Scala and Lift on OSX

Obviously we’re going to need scala before we can do anything useful; the easiest way to install it is via macports . We’re also going to need maven. > sudo port install scala > sudo port install maven2 Scala seems to have moved their repository to github, and the old google code repository no longer works. Assuming you have git installed (if not, there’s an OS X installer here) : ...

August 17, 2009 · 2 min · Dave Perrett

mysql select random row with join

I have a users table and an assets (basically just images) table, and I want to select and display a random asset for each user. I want to show a list of users, with a random thumbnail for each user from their assets. I could do this easily enough in code with multiple queries, but it seemed like a nice challenge to try and find a pure-sql alternative. ...

August 11, 2009 · 2 min · Dave Perrett

Customize the Nginx server header

Unfortunately the only way to change the server header in nginx is to actually recompile it from source. Luckily this is quite easy. First, download the latest version of nginx (0.7.61 at the time of writing) : > wget http://sysoev.ru/nginx/nginx-0.7.61.tar.gz > tar xvzf nginx-0.7.61.tar.gz > cd nginx-0.7.61 ...

August 10, 2009 · 2 min · Dave Perrett