Category Archives: tech
OpenOffice Custom Quotes
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
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
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’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
Speaking at GeekUp in Leeds
If you’re local to Leeds, I’d love to see you there.
Ubuntu/Kubuntu and mod_rewrite
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
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
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 :)