Category Archives: Tech

Lisp Breaks My Brain-Meats

I started reading Structure and Interpretation of Computer Programs over the weekend. I’ve only got as far as the first set of examples and already my head hurts.

Write a procedure that takes three arguments and returns the sum of the squares of the larger two numbers. Without iteration because they haven’t shown you how to do loops in Scheme at this point in the text.

I’ts both wonderful and depressing that by the end of page 2 I’ve already hit a gaping chasm in my programming skills. I will prevail.

Incidentally, this is not a request for people to post the solution. Anyone doing so will suffer the wrath of my patented ‘slap-in-the-face-over-XML-RPC’ system.

Wikis, Wikis Everywhere

One of the first things I did when I arrived at my current job was to whack a copy of mediawiki on one of my servers so that I somewhere to write ad-hoc documentation. As time has passed we have built up quite a few docs and had to lock down the wiki as some of the documents are externally viewable.

It has become apparant that we could do with moving to a wiki that is more suited to our current usage.  So my list of wiki requirements is:

  • Be able to re-use apache authentication since we already have working mod_auth_pam setups talking to central LDAP.
  • Different parts of the wiki editable/viewable by different users.
  • Pages can be public or only viewable by logged in users.
  • Able to use multiple different auth mechanisms concurrently: e.g Apache,PAM,wiki-login
  • Themes/stylesheets for different sections of the wiki
  • File upload/attachments. I don’t want people to have to ftp documents and link to them manually.

So far the contenders are Midgard, MoinMoin and TWiki. I’m leaning towards Moin because it’s written in Python. What I’d really like to hear is some comments from people you have similare requirements. What wiki did you go with and what were your experiences?


Open Science

Bioinformatician Pedro Beltrao has posted what is probably the most thought-provoking article I’ve read all year.

His basic tenet is that the the current mechanisms by which scientific research is produced have become counter-productive. Rather than just whingeing about it he proposes an alternative mechanism.

During my ill-fated career as a PhD student the constant feeling of being in competition with everyone else was something I hated. That was probably partly due to my state-of-mind at the time but I always got the impression that talking to other scientists was a bad thing.

In my current job I deal with researchers in several different fields. Many of them are doing really cool research that I would love to talk about but I don’t.

Pedro’s suggestion may turn out to be unworkable but I applaud the sentiment.

Post LugRadio Live

Right I’ve now had a week to recover from LRL and to internalise some of it.

Good Points:

A plethora of informative and entertaining talks. Too damn many in fact. I missed quite a few I wanted to talk to see due to scheduling conflicts.

My talk went quite well, although being scheduled against Bruno and Simon Phipps was a bit of a bugger. I can’t wait for the video of Bruno’s talk to be released.

Talked to a researcher from Coventry who was interested in the whole concept of Grid data repositories so something useful from a work stand-point may come out of it.

Dinner at some wetherspoons pub with a random bunch of (very nice) geeks a bumped into on saturday night.

The very nice beer called Titanic that they were serving in the afore-mentioned pub.

Bad Points

Completely failing to talk to any of the #lugradio regulars.

It was too damn hot.

Spending the whole of saturday in a complete haze due to talk anxiety.


Talked to a researcher from Coventry who was interested in the whole concept of Grid data repositories so something useful from a work stand-point may come out of it.

Met a chap from Southampton who was familiar with the OMII project and of course completely failed to get his email address. In the unlikely event that this is you, could you send me an email please?

After seeing Christian Schaller’s GStreamer talk I’ve spent all day looking at the python gstreamer bindings and have gotten as far as writing a noddy media player that prints out any metadata it finds in the media. Now I just have to work out how to re-write the metadata and I should be able to completely replace the tagging infrastructure in Peapod with a better version using gstreamer.

Here are the slides for my talk.

LugRadio Live: Pre Game

Having just had a look at the LugRadio Schedule (due to excellent work by popey) two things occur to me.

1) Buno Bord is a being of unimaginable evil. He kicks Andrex puppies for fun. And anyway how edifying is a talk about swearing going to be?

2)Do you really want to listen to an hour of Simon Phipps getting heckled about why Sun haven’t open-sourced Java yet?

Obviously your should come and listen to my talk about Grid Computing. I’m not evil, Java isn’t my fault and you’ll
learn something.

<fx=”tumbleweed rolling past”>

Oh Dear.

I’d better get my stuff packed

Annoying Gnome-Blog Bug

So after installing Dapper on my new laptop (more on this in a later post) I decided to give gnome-blog a whirl. I like the idea of in-line spell checking and the panel applet looks quite nice too.

Anyway when pointing it at my blog it insists on trying to connect to http://site.domain/wordpress/xmlrpc.php and there seems to be no way in the configuration GUI to persuade it that my blog lives at http://site.domain/xmlrpc.php

Looking around launchpad and bugzilla.gnome brings up the following bugs.

It seems fairly sensible to me to just change xmlrpc_url in the code so that it doesn’t make any assumptions about the location of xmlrpc.php. But it’s probably not possible to do without breaking at least some peoples currently working gnome-blogs.

Anyway for the moment you can always hack .gconf/apps/gnome-blog/%gconf.xml by hand to make it work.

SWIG and C++ on Solaris

Here at WeSC we have a potentially very useful piece of kit from Cybula which is essentially a set of neural-net based pattern matching algorithms blown into some FPGAs.

Now I have to advise some researchers about how easy it will be to use this kit for a particular project. My ability to advise is limited by the fact that the API for this kit is written in C++. This makes it hard for a mere sysadmin like myself to play with it.

I have been vaguely aware of SWIG for a while as a mechanism for building language-bindings to C and C++ so I decided to give it a whirl.

I installed swig from sunfreeware. After browsing the tutorial for a while I decided to take the simple approach to building an interface file.

%module aura
/* Includes the header in the wrapper code */
#include "aura.h"

/* Parse the header file to generate wrappers */
%include "aura.h"

Then I used swig to generate the python and C++ code.

swig -python -c++ -I/opt/Aura/2.4.2/include aura.i

And built the libraries from that

g++ -shared -I/usr/local/include/python2.4 -I/opt/Aura/2.4.2/include -c aura_wrap.cxx

This left me with and which look like a python module to me.

Python 2.4 (#1, Dec  1 2004, 05:20:08)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>>import aura

Now I just need to work out how to use it. Assuming this module actually works and isn’t just an empty shell I may have to try building Java and Perl modules later.

Edited: 16:27 to include some bug-fixes

After playing around with this some more I realized that I had indeed created a completely empty binding. So I went through aura.h and manually included all the header files that it pulled in.

%module aura
/* Includes the header in the wrapper code */
#include "aura.h"
#include "auraErrorTable.h"
#include "auraTypes.h"
#include "auraStructures.h"
#include "auraException.h"
#include "auraSearchEngine.h"

/* Parse the header file to generate wrappers */
%include "aura.h"
%include "auraErrorTable.h"
%include "auraTypes.h"
%include "auraStructures.h"
%include "auraException.h"
%include "auraSearchEngine.h"

This produced much larger python and c++ files so I guessed I was on the right track. I also realized that the g++ command wasn’t linking in the aura library and that I would have to do it by hand

g++ -shared -c aura_wrap.cxx -o aura.o -I/usr/local/include/python2.4 -I/opt/Aura/library/include

ld -G -o aura.o /opt/Aura/library/lib/SunOS/libaura.a

The path changes were introduced when I realised I was trying to build a 64bit version of libaura into a 32bit version of python.

Python 2.4 (#1, Dec  1 2004, 05:20:08)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import aura
>>> dir(aura)
'ERROR_UNIMPLEMENTED', 'ERROR_UNINITIALISED', 'Exception', 'Exception_swigregister', 'NULL', 'OK',
'Pattern', 'Pattern_swigregister', 'Preferences', 'Preferences_swigregister',
'RetainedInfo', 'RetainedInfo_swigregister', 'SearchCharacteristics', 'SearchCharacteristics_swigregister', 'SearchConstraints',
'SearchConstraints_swigregister', 'SearchControl', 'SearchControl_swigregister', 'SearchEngine', 'SearchEngine_swigregister',
'SerialiseControl', 'SerialiseControl_swigregister', 'Sizes', 'Sizes_swigregister', 'StorageType', 'StorageType_swigregister',
'__builtins__', '__doc__', '__file__', '__name__', '_aura', '_newclass', '_object', '_swig_getattr', '_swig_repr',
'_swig_setattr', '_swig_setattr_nondynamic', 'cvar', 'new', 'new_instancemethod']
>>> x = aura.SearchEngine
>>> dir(x)
['ClearRetained', 'Copy', 'GetColumn', 'GetRetainedIds', 'GetRow', 'GetSizes', 'IncreaseSize', 'Initialise',
'Merge', 'Optimise', 'Remove', 'Search', 'Serialise', 'Store', '__class__', '__del__', '__delattr__', '__dict__',
'__doc__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__swig_destroy__', '__swig_getmethods__',
'__swig_setmethods__', '__weakref__']


Random Updates

After some gentle ribbing from friends about the lack of updates to this blog I’ve realised that it is indeed time to get back in the saddle. I apologise in advance for the disconnected nature of this post.

So work is almost a green-field site in that while they have quite a few systems in production they are all being managed in a piece-meal fashion. I’ve been free to specify a standard linux build (CentOS4) and whatever management systems I want. Now that my new server is in place I can start setting up cfengine.

Given that these systems represent a fresh start I decided to leave SElinux turned on (at $ORK-1 we turned it off because it objected strongly to the way we had things set up). This has lead to a fairly arduous learning process. The upside is that I now mostly understand it but I probably hate it. The fact that the SElinux policy is monolithic makes things hard to manage. I’m not sure how I’ll deal with this as the systems get more complex. I’ll probably end up building a selinux-policy-wesc package and try and ignore the ugliness.

In other security related news I’ve finally gotten around to learning about PAM. It’s strange but mesmerizingly powerful. Together with mod_auth_pam you can get apache logins to do very strange things. Now if only someone would write a PAM module for Shibboleth.

It’s the little things that are annoying me. Like that fact that someone has walked off with the case keys for my two Sun V880 servers.

We have no backups. Nothing to see here, move along.

My shiny iAudio X5 is now running rockbox. It is fantastic. Browse by ID3 tags. List files by date. Revolutionary!

I shall be giving a lightning talk on Grid Computing at LugRadio Live 2006. If you happen to be attending, prepare to be be informed and entertained.

The ramble endeth here..