Geekup Sheffield

I was very pleased to hear that Sheffield is getting its own Geekup event, and that it starts next week on 7th May and will run on the first Wednesday of every month. I was even more pleased to be asked to speak at it – I’ll be giving a 20:20 format (20 slides, 20 seconds per slide = 6 and a half minutes) on “Deploying Web Projects with Subversion”. Come along to The Fat Cat on Alma Street at 6pm for lots of fun, beer, and chatter!

OpenOffice Custom Quotes

I have been driven mad for the last week or so by the silly slanty quote marks that OpenOffice insists on using instead of the normal ones. It is especially annoying when adding code snippets to presentations!

To turn these off go to:
Tools > Autocorrect > Custom Quotes tab
And until the “Replace” boxes.

Hope this saves someone else the annoyances I had.

Installing VMWare Tools

I recently did some work with Debian Etch virtual machines which I downloaded from the good people at thoughtpolice. Here are my notes on getting the VMWare tools added to that machine.

To be able to do anything interesting with a virtual machine, you need to install the VMWare tools onto the virtual machine. With the virtual machine, choose to “Install the VMWare tools” – this does a virtual equivalent of putting the right CD into the machine and you can then mount the CD and run the install program (follow the instructions on the VMWare site, they probably update theirs). I found that under Debian Etch I needed to first use aptitude to install some additional things that the tools needed to get themselves set up. These were:

  • gcc
  • psmisc
  • binutils
  • make
  • the kernel sources for the relevant version – do linux-headers-$(uname -r) to get the right version.

Then run the VMWare tools installation and everything should go through smoothly. If you installed VMWare tools but didn’t get all the setup completed because libraries were missing, you can just re-run the vmware-config-tools.pl script ( in /usr/bin/ for me).

VMWare Virtual Machines on NTFS

I keep having a problem with my virtual machines. I’m running kubuntu but the virtual machines are on an NTFS partition (because I use them from windows occasionally). The error message appears at startup and goes like this:


VMware Player unrecoverable error: (vcpu-0)
Failed to allocate page for guest RAM!
A log file is available in "/path/to/VM/vmware.log". A core file is available in "/path/to/VM/core". Please request support and include the contents of the log file and core file.
To collect data to submit to VMware support, run "vm-support".
We will respond on the basis of your support entitlement.

I looked in the log file and saw that immediately before the “Failed to allocate page” bit it said:


Could not mmap paging file : No such device

Apparently this is a known problem with VMs on an NTFS parition, but luckily the solution is very simple. I found a post which recommended editing the .vmx file and adding the following line:


mainMem.useNamedFile=FALSE

This worked perfectly for me, I hope it helps someone else too. See also my post about installing vmware tools

Geekup Talk

I did mention recently that I had arranged to speak at the local GeekUp group. Well, the event itself was last night and although I did have speaking nerves I think it went OK.

I’ve uploaded the slides I used to Slideshare, so you can find them here. The talk was entirely based on a talk Ivo Jansch gave at the PHP London conference in February.

I’m trying to work on my speaking skills as I’ve been asked to speak at the Dutch PHP Conference this summer, if you were there and have any comments then let me know! Thanks also to everyone who did come and say hi and give me feedback on the night :)

Edit: I see there is photographic evidence – thanks Deb and Nigel!

GeekSpeakr

I saw this article on linuxchix about the new register of women speakers that has been set up by Brenda Wallace of linuxchix. The site is called geekspeakr and although it claims to be “very alpha” they are currently registering female speakers. I don’t have a lot of speaking experience but it looks interesting and I figure it takes all sorts, so I’m registered … are you?

Speaking at GeekUp in Leeds

This week I will be giving a 20:20 talk at the GeekUp event in Leeds, entitled “Enterprise Web Development”. The 20:20 talk format allows talks with 20 slides, with 20 seconds allowed for each slide. Wish me luck :)

If you’re local to Leeds, I’d love to see you there.

Ubuntu/Kubuntu and mod_rewrite

I just spent a couple of days, on and off, fiddling with my apache setup on a kubuntu box. I had a site with some very weird and scary rewrite rules which I needed to do some development work with and I just could not get the site to work!

The solution was very simple and I found the answer in this post about ubuntu and apache. Basically, AllowOverride is set to None for both / and /var/www/ by default on ubuntu, which is nice and secure but it caught me out on this occasion. Change the settings to AllowOverride All and create a symlink in mods-enabled to mods-available/rewrite.conf and restart apache – everything should then start playing nicely.

Geshi and Serendipity for Code Snippets

I write on technical subjects on this site on a fairly regular basis, and nothing annoys me more than blog software which “eats” long lines of code or renders it in a difficult-to-read way. Happily Serendipity (or s9y for short) has a plugin for geshi.

About GeSHi

I thought “geshi” was a word but I just looked it up to link to it and it turns out its actually GeSHi (Generic Syntax Hilighter) which is a very humane way of pronouncing the thing. It is a very popular way to render source code on the web and was originally intended for phpBB. Geshi is great, it has lots of pre-made syntax highlighting rules so the odds are that it can probably already render whatever language you are coding in very nicely, however if it doesn’t then that’s fine too – it is an open standard and you can jump in and write your own.

Using GeSHi

Back to this blog, I added the “Markup: Geshi” plugin from SPARTACUS (the serendipity plugin repository) and added it as an event plugin. I had a lot of problems getting it working – putting it first in the list of event plugins eventually did the trick for me. You use geshi by adding geshi tags around the code you want to show, for example:


phpinfo();
phpinfo();

Styling GeSHi

Another problem I had initially was with the default resulting fonts, however these are easy enough to change and I now have colours I chose myself (illustrated in my posts about a SOAP server and PHP compilation) which is really quite easy to do. The plugin has files with all the language highlight in them and if you scroll down and look at the “color” entries towards the end of these, it is possible to just replace the red/green/blue defaults with colours that fit in with your look and feel (pink in my case, obviously!). For me the syntax files are in serendipity/plugins/serendipity_event_geshi/geshi – this is also a good place to look to see what languages you have that are supported.

I commonly use:

  • php
  • bash
  • xml
  • sql

A useful tip for styling is that the code block is placed into a div with a class named the same as the “lang” attribute – so for example I’ve got some of them resized by adding an entry to my overall css file.

Hope this helps someone, I remember having problems finding much info about using geshi in this way when I first added the plugin. If anyone is having problems feel free to post comments, I have this working on my serendipity installation so I am happy to try to help out.

Adding Markup to Comments in Serendipity

I switched over to serendipity as my blog platform about 6 months ago and although I haven’t been blown away by it, its a better tool for this job than textpattern was. I liked textpattern a lot but serendipity is better for what I need. There were a few things that I really missed when I moved across to serendipity – and the biggest one was textile as a markup. Its available in serendipity as a plugin, and I’d recommend it to everyone, but after I had imported my existing content from textpattern to serendipity I found that turning on the markup plugin did strange things to existing content so I turned it off.

Another thing I’ve been missing is the ability to add markup in comments, such as images. Well, its back! I’ve turned on textile for comments on this site, there is a link under the comments box to a page that shows you the syntax, so feel free to add richer content to this site from now on :)