Jun 18
Ever since I installed Adobe Creative Suite I’ve been annoyed by the fact it installs an Acrobat plugin for Safari that overwrites the default Apple Preview view of PDFs. I hate it! It takes ages to start up, it’s generally slow once it’s started, it looks pretty ugly, it has far too many features for what I want in a browser, the list goes on…
However, I’ve just found where the little bugger lives! Just quit Safari, delete /library/Internet Plug-Ins/AdobePDFViewer.plugin, restart Safari and hey presto, it’s gone, fantastic!
May 13
I’ve been installing the LAMP stack on an Ubuntu based server for a client. They rely on the version of LibGD that’s bundled with PHP5. This version includes certain functions including imagerotate() and others.
It seems that the people who build Ubuntu (and Debian) distribution do not want to compile PHP5 with the version of GD that comes bundled with PHP5. As far as I can tell the guys at Ubuntu (and Debian) consider this to be a fork of the original GD library and think that this could be a security risk. Their stance on it is that if PHP want to use this version then they should contribute the changes that have been made to the original GD library back to the core project. This seems fair enough, but unfortunately I can’t immediately change the direction of an open source project this big – or probably any project, come to think about it!
After a bit of rummaging around on the Internet I found nothing to do with actually compiling in this support, so I tried to work out how to do this… In theory! I found a link on Ubuntu forums about including the GMP library I roughly followed this through.
To install the required packages and download the source code for
PHP5:
# Install build tools, debian helpers and fakeroot
apt-get install build-essential debhelper fakeroot
# source code should reside in /usr/src
cd /usr/src
# Download PHP source
apt-get source php5
# Install all packages required to build PHP5
apt-get build-dep php5
cd php5-5.2.3
How a package is compiled is set within the files contained in the debian directory of a package. Rules for configuring the compile process can be found in debian/rules. In this file there is a line that reads --with-gd=shared,/usr --enable-gd-native-ttf \. This links to the Ubuntu distributed version of LibGD as a shared library. It is part of the autoconf script that customises the compilation of PHP. I replaced this line with --with-gd=shared --enable-gd-native-ttf \. This causes the compilation process to use the bundled version of GD and make a shared library.
Once the package has been reconfigured it can be compiled and installed by:
# build the php5-* packages
dpkg-buildpackage -rfakeroot
cd ..
# Install the new php5-gd package
dpkg -i php5-gd_5.2.3-1ubuntu6.3_i386.deb
A quick /etc/init.d/apache2 restart and hey presto, you should be using the bundled version of LibGD for PHP. Hurrah!
Apr 29
I’ve been working on a project recently that’s needed me to generate human readable (and Google readable) permalinks to pages. As a default these permalinks are generated from the title of the associated object. This was all working until I realised that I had words like ‘café’ in the title. Using my existing algorithm any letters other than A-Z, a-z were removed, thus turning ‘café’ into ‘caf’. Not very human or Google readable.
I found an excellent article on Obie Fernandez’s blog showing how he tackled this problem for a job he was working on and all is now wonderful again!!!
Image credit
Apr 24
I’ve been looking into collision algorithms for a game of Pong I am going to be writing. I found a really good guide to circle to circle collisons.
I was looking for libraries to do vector manipulation and stumbled across GNU GSL - a scientific library, written in C, that includes vector and matrix manipulation classes.
I love the Ruby language as readers of my other blog would know. I found Ruby bindings to GSL. To install this on OS X Leopard with MacPorts installed you download the Ruby GSL bindings then:
% sudo port install gsl plotutils
% tar zxf rb-gsl-1.10.3.tar.gz
% cd rb-gsl-1.10.3
% ruby setup.rb config
% ruby setup.rb setup
% sudo ruby setup.rb install
And your good to go!
Apr 04
A really easy way of beta testing your Ruby on Rails application is to use Basic HTTP Authentication. There are methods built into Rails to do this in your application controller just put
before_filter :http_authenticate
def http_authenticate
authenticate_or_request_with_http_basic do |username, password|
username == 'my_username' && password == 'my_password'
end
end
Every request will put through this filter and users will not be able to use your site without this username and password.
Apr 04
I’m currently working on an app that we’re going to be deploying on Brightbox. However, I ran into a couple of problems when deploying with their gem.
First, my app’s Subversion repository isn’t on the Brightbox server. This was simple, in the config/deploy.rb file, change the address of the repository to the address of the server. Create a SSH key on the Brightbox box (mouthful!) and add the public key to the .ssh/authorized_keys on my Subversion server and away we go!
Second, I don’t have my
config/database.yml in the svn repository. The reasons for this are
# Security – if someone checks out my code they end up knowing my passwords.
# there are several people working on the project so every time a commit/update was performed, it would reset your
config/database.yml file to whatever the last checked in version was, annoying.
In the
config/deploy.rb file I added:
task :after_update_code do
run( "cp $HOME/database.yml #{release_path}/config/")
end
to the config file and put the database.yml file in my home directory. Now, after the code’s been checked out the
database.yml file is copied into the correct place. Hurrah!
The third thing was really my fault. I’d put a - in my database name. The Brightbox gem doesn’t escape the CREATE DATABASE database_name database name (it should really be CREATE DATABASE `database_name`). MySQL was interpreting my - as subtraction, oops. I changed the name of the database to only use underscores and it worked fine.
The final thing was as far as I can tell the
gem is running the
Capistrano setup task. This sets up the
shared directory in your application deployment and will not run without it. I added
task :before_cold_deploy do
setup
end
to
config/deploy.rb to run the
Capistrano setup task.
Then… HURRRAH! It works!!!
Mar 04
I’ve decided that it’s a good idea for me to start from the beginning. I’ve been dabbling with electronics since I was at senior school, but I’m sure I’ve ever completely understood the basics. Over the weekend I decided to start from the beginning again. I’ve got a 1989 book called Electronic Systems which I borrowed when I was at school, but never got around to returning. It certainly seems to give a good introduction into the world of electronics.
Also Dave Checkley and Rich Hubbard have recommended that I get a copy of The Art Of Electronics which I’ve found in the library at the TIC where I work. I’m off to get it, and the student workbook out later.
So, armed with a borrowed oscilloscope and three large textbooks I’m planning on teaching myself up to first year degree level electronics in the next few months.
Should be interesting…
Mar 04

Today whilst trying to pack our "Zope":http://zope.org database I couldn't connect to the server on the port I needed to because of a firewall issue. I went searching to see if I could tunnel into the server using an already open port.
I was unaware that you can forward ports if you have SSH access to the server, for example
ssh -L 3001:server.example.com:3000 -N user@server.example.com
would forward all local requests to port 3001 on the local machine to port 3000 on server.example.com. The traffic bound for the remote machine is encrypted and sent over port 22 like a normal SSH connection... Brilliant!
Mar 03
I’ve just about finished putting together the first incarnation of my personal blog/portfolio site. Here’s a short post about the WordPress plugins I’ve used to further customise the site.
Read more »
Jan 18
Two or three years ago a few friends and I said wouldn’t it be great if we could get together a group of people and put on an event which involved music, dance, performance, poetry, multimedia art, lighting AND make the audience feel like they’d been taken on a journey. After meeting in a pub once a week for a number of weeks we decided to call our group ‘Project X Presents’.
Since then we’ve been meeting at least once a week and have put on two crazy events (you can read all about them on our site). Each time we’ve put on an event it has got more and more adventurous and we’ve concentrated slightly more on a different aspect. The first concentrated on the music, the second performance. This summer we’re planning to throw all this together with a good dollop of interactive art and visuals.
We’ve got lots of ideas and are likely to be using ATMega168 series chips and the wonderful Arduino Open Source electronics prototyping platform to provide the basis for a number of these installations. They will probably be connected together in a grid type system with XBee ZigBee adapters by MaxStream. Some of these devices will be directly outputting to either MIDI or DMX512 to connect audience input to the projected visuals. Custom Processing and/or Max/MSP patches will also be conceptualised, designed and written to tie in with input from these devices.I plan on keeping a log what is happening with these projects via this blog.