Updating the website

I’ve finally got the new website up and running after testing for a while. It has combined the blog and static pages into a single site that hopefully actually works and means I don’t have to worry about compiling a site every time I change something.

The blog software has been changed from [movabletype](http://movabletype.org) to [wordpress](http://wordpress.org) and while the actual migration was straightforward, there was some apache mod_rewrite evilness to update the links.

There is probably broken links somewhere. The site is so old now I’m not sure of all the links and paths myself. I think I also succeeded in changing the blog without spamming [Planet Debian](http://planet.debian.org/) with all my old posts, which is a bonus.

Syntax Highlighting with Mid-Century themes

As a site that discusses a variety of programming languages, I thought it would be good to have syntax highlighting for the code snippets. This blog previously ran [Movable Type][] so it had to fit in with the setup I have already.

So I found the [Syntax Highlighter][] module ok and the initial installation
went fine, it was simply:

1. Download the .zip archive
2. Unzip the archive into a temporary directory
3. Copy the plugins/SyntaxHighlighter directory to my plugins directory
4. Copy the mt-static/plugins/SyntaxHighlighter directory to static/plugins

You then need to edit the “HTML Head” template and add to the bottom of it the following line:


Next, I like to use [Markdown][] as my “markup” language. But you can only have one type text filter. Another plugin called [FormatStack][] solves this.
Create a new stack and put [Syntax Highlighter][] before [Markdown][].
You can then create documents with both sorts of tags and it works quite nicely, well… almost.
Mid Century Problems
——————–
This is probably not a Mid-Century specific problem but the modern templates
or styles may cause a problem. You’ll find you switch styles and suddenly, no more syntax highlighting.
The problem is the onLoad functions get overloaded. Some styles have
an onload property on their body. You’ll see lines similiar to


This onload event stops other onload events, which means Syntax Highlighter cannot do its thing. The fix is rather simple, you just adjust thetemplates so they look like the following:


mtAttachEvent("load", mtEntryOnLoad);

After doing this and publishing it all worked! You may also see this sort of problem with other plugins that use the mtAttachEvent() Javascript call.

Reducing Includes
—————–
By default, the script includes all syntaxes it knows. If you want to only include some, you do this by specifying what brushes you want. For example if you only will highlight perl and python scripts then you can change the line to:


Syntax Themes
————-
The other attribute the Include line will take is theme. There are several themes but default is alternating white on grey with the rest being
variations on light text on a dark background.

[Syntax Highlighter]: http://plugins.movabletype.org/syntaxhighlighter-for-movable/
[Movable Type]: http://www.movabletype.org/
[Markdown]: http://daringfireball.net/projects/markdown/
[FormatStack]: http://plugins.movabletype.org/formatstack/

JFFNMS and IPv6

ipv6-google-rrt.png

One of the many Free Software projects I work on is JFFNMS, which is a network management system written in PHP. In light that the last IPv4 address blocks have now been allocated to APNIC it’s probably timely to look at how to manage network devices in a new IPv6 world.
First you need to get the basics sorted out and for that it is best to use the net-snmp command line utilities to check all is well. Then its onto what to do in JFFNMS itself.
Now fixed with proper markup, I hope.

Read more JFFNMS and IPv6