Wordpress code highlighting

I finally found a code highlighting plugin for Wordpress that I like; CodeColorer.

This works on the server side, so there is no need for JavaScript support on the client browser.

The side effect of this is that I’ve had to re-visit all my previous posts to remove all the formatting I had manually applied.

Iñtërnâtiônàlizætiøn

Iñtërnâtiônàlizætiøn – This is string I found some time back which is very useful for testing internationalization issues. I can’t remember the original source of this. Please let me know if you know!

Reading HTTP POST data using BASH

I recently needed to read the HTTP POST data using a BASH cgi script.

When using BASH this way most of the HTTP variables are set as environment variables, and can be accessed simply. The exception is the HTTP POST data, this goes to the stdin stream.

There were some examples of reading stdin like:

POST_DATA=$(</dev/stdin)

and

POST_DATA=`cat /dev/stdin`

However I found that these intermittently failed. I believe this is because at the point of execution you can not guarantee that all the data has been sent.

The solution to this is to use the CONTENT_LENGTH environment variable to read the correct number of bytes:

#!/bin/bash
if [ "$REQUEST_METHOD" = "POST" ]; then
    if [ "$CONTENT_LENGTH" -gt 0 ]; then
        read -n $CONTENT_LENGTH POST_DATA <&0
    fi
fi

Outlook / Google Calendar synchronization

I’ve been using Google Calendar Sync for several weeks now and it has removed the headaches of having calendars in two places.

Google Calendar Sync can be configured to do a 2-way synchronization, or a 1-way synchronization (in either direction). It is very quick to setup, and has very few options that need configuring.
Google Calendar Sync
The only improvement I would like is support for multiple calendars. I would like 2-way synchronization for my work calendar, and 1-way synchronization from my other Google Calendars to my Outlook Calendar.

WordTwit WordPress Plugin Installed

I have just installed the WordTwit WordPress Plugin. This post is primarily a test to check that it is all working.

The domain switch

After much procrastination I have finally made the domain switch over to paulturner.me.

All requests to the original domain paulturner.net are automatically redirected to the correct page on the new domain with a “301 Moved Permanently” HTTP header.

This means that all search engine traffic should be preserved, and the links updated over time.

This was achieved simply with mod_rewrite and a single index.php page:

<?php
header('Location: http://paulturner.me'.$_SERVER['REQUEST_URI'],TRUE,301);
?>

Please update your links.

paulturner.me

A while ago I registered the domain paulturner.me for
a few reasons:

  1. I don’t really like the hyphen in paul-turner.net.
  2. It’s a little more personal.
  3. I currently don’t own paul-turner.net.  (It’s owned by my web hosting company, although I have the option to purchase it)

Currently http://paulturner.me/ redirects back to http://paul-turner.net/ although I have been considering a swap over for some time now.

If I do this my thoughts are to use mod_rewrite with a single PHP program that accepts all the requests from http://paul-turner.net/ and responds with a permanent redirect to the same page on http://paulturner.me/.

Are there any implications in doing this?  I would think that this approach would update all the search engines over time.

What do you think?  Leave me a comment.

Time-lapse tilt-shift photography

Time-lapse photography is a technique where each frame is captured at a much slower rate than it is played back.  When it is replayed everything appears to be moving faster.

Tilt-shift photography is a technique of distorting the plane of focus of an image by tilting the camera lens and distorting the perspective by shifting the lens.  This leads to images which appear to be of miniture worlds.

Combining these two techiniques creates some interesting videos, such as the one below by Keith loutit.


Beached from Keith Loutit on Vimeo.

I found this video here at Web Urbanist.  They have a couple more examples by Keith Loutit, along with several examples of tilt-shit photography.

7 Day Shop

7 Day Shop have always provided good value photographic products, computer & digital accessories (and more as well).

I have used them several times in the past and they have always been reliable and efficient. They have recently announced that they are no longer charging for postage in the UK.

This is great news!

Connect to a Windows remote desktop using Linux

Whilst browsing I found this article of 10 tips when making the switch to Ubuntu Linux.  One of the tips is Remote desktop to a Windows desktop/server.

There is a program called rdesktop that allows you to connect to a windows remote desktop sesson on an IP address (over RDP):

rdesktop [server]:[port]

The remote desktop I tried this on was using a VPN tunnel using this command:

rdesktop localhost:52893

The article also linked to the Wikipedia rDesktop article which linked to information for other RDP clients.

The only downside I found so far is that the screen resolution was restricted to 800*600 with 16 colours. Not a big problem for occasional use, but I may investigate some of the other solutions.

Does anyone else know of a better alternative?