DIY DDNS

For those of us on cable or DSL who are slightly too cheap to pay for a static IP, dynamic DNS services are really useful. My DD-WRT based router knows how to talk to dynamic DNS providers, so setting it up is really easy. I’ve tried both DynDNS and No-IP, and while they work quite […]

Installing Ruby Gems in your home directory

I’ve been playing with Ruby in my cheap shared hosting provider. They don’t include everything I need so I had to install Ruby Gems in my home directory. The instructions don’t work. So here’s what I did…

First set up environment variables to tell Ruby and Gems where to find stuff:
export GEM_HOME=$HOME/lib/ruby/gems/1.8
export RUBYLIB=$HOME/lib/ruby:/home/ian/lib/site_ruby/1.8

Download and unpack the Gems source (this is the version I downloaded, you should grab the latest:
wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz
tar xzvf rubygems-0.9.4.tgz
cd rubygems-0.9.4

Run the setup.rb script with the right arguments to install into your home directory:
ruby setup.rb all --prefix=$HOME --siterubyver=$HOME/lib/site_ruby/1.8

This will install the gem command (and a couple of others) into $HOME/bin and the Gems source into $HOME/lib/site_ruby. Gems will be installed into $HOME/lib/ruby/gems/1.8. You should add $HOME/bin to your path. If you want to install it somewhere else replace $HOME with the prefix you’d like to use.

OpenID for the mathematically challenged

The other day I got the OpenID bee in my bonnet and grabbed James Walker‘s module and installed it on my server. Actually I grabbed it from CVS, and then discovered that the CVS version is half-ported to some new Drupal 6 form API, so I ended up using the DRUPAL-5 tag.

Anyway, I use Dreamhost which I love for many many reasons (primarilly it’s really cheap and seems to work really well). Unfortunately they don’t build their PHP with BCMath or even GMP, which means my PHP can’t do the hard math that’s required for crypto. Luckily there’s a mode of OpenID that doesn’t require any work on the relaying party side. So I made a small change that allows James’ module to work in this “dumb” mode.