Michael Rutter's Random Programs Page

This page collects together the more respectable of the various bits of code I have written.

There is no warranty or statement of fitness for purpose associated with any of the code on this page. If you wish to use them, it is up to you to determine whether they are fit for the purpose you have in mind. Most of them are unmaintained. No guarantees of support are offered either.

The larger bits of code on this page are offered under the GPL, and clearly state this. The smaller pieces are so small as to be, in my opinion, unworthy of any restrictive licence. If the GPL is unsuitable for the use you wish, note that the author retains full rights to the code, so it may be possible to negotiate different terms with him.

Major Projects


Converts from pnm/bmp/gif/jpeg/png to eps/ps/pdf. Major features are that jpegs are converted without decompressing and recompressing, that stdin is accepted for input for all file types, and that some effort is made to make the resulting eps as small as possible. Originally designed for use with LaTeX, it has many other applications. Has its own download page. Part of its code was reused in the excellent PyXPlot.


This is a converter for CASTEP's check files, and can extract charge and spin density, wavefuctions, or simply atomic positions. It can also build supercells. For more information see the c2x website.

Linpack in Various Languages

A page dedicated to the Linpack benchmark in various languages: Java, Matlab, Octave, Numpy, Fortran, C, C++/eigen.

OpenMP parallelisation of the Linear Congruential RNG

It is unclear why one would wish to parallelise the Linear Congruential pseudorandom number generator, but the theory is interesting. Examples in C and Fortran, with OpenMP, given.


An example of using the hardware event counters on Intel processors to report the average mflops achieved by a program. As described, the code is part way between a utility and an example. Recently (2018) revised to work with Skylake, Kaby Lake and Xeon Scalable CPUs, also works with Core 2, Nehalem, Sandy Bridge and Ivy Bridge. AMD CPUs, and Intel's Haswell, are not supported.


A script to interface between OProfile's perf and KCachegrind which retains both cost counts and the call tree. Usage examples are also provided on op2kcg's web pages.


Major in the sense of being quite a few lines of code, but not of any finished quality. This demonstration code converts directly from XFig's .fig file format to PDF, without going via PostScript and gs. In its current form, of niche use.

Thunar NFS quota patch

A patch to add NFS quota support to Thunar, XFCE's GUI filemanager.

Educational / Recreational Fun on a Raspberry Pi

The Mandelbrot Set, the Logistic Map, the Boltzmann Gas, Conway's Life, IFS ferns and more, all in python. Or, if one seeks art, not science, a Mandelbrot gallery.

Small Graphics Utilities

(If downloading these, do choose "download target" rather than attempting to copy and paste from your browser window. The latter is very likely to upset things.)

Reading Exchange ical attachments with pine/alpine

Trying to decode Microsoft Exchange calendar invitations on older email clients can be painful. I use a line in /etc/mailcap of

text/calendar; vcal %s; copiousoutput;

And vcal is a python 3 script (download) which uses the widely-available icalendar module to decode the attachment.

This code has not been written to be robust in the face of all possible input: no warranty and use at your own risk!

Small Miscellaneous Things

(If downloading these, do choose "download target" rather than attempting to copy and paste from your browser window. The latter is pretty certain to upset things.)

Miscellaneous Notes