Chris Webb

Free software

Twitter Twitter GitHub Facebook

Chris Webb’s home page

The following free software can be downloaded directly from this page, and is also available from my GitHub and Bitbucket accounts. Please email any bug reports or feedback to

Like many other free software developers, I’m not keen on the web-based pull requests GitHub and Bitbucket encourage. If you’d like to propose a patch, please send it by email. I can’t fully disable pull requests but do use a webhook to automatically close them. See Linus Torvalds’ take on GitHub pull requests for a colourful but fair critique.

af — a Bayesian mail filter

af is a Bayesian mail filtering system based on the highly accurate OSBF-Lua text classifier library: an alternative design to the spamfilter.lua distributed with OSBF-Lua.

In the intended configuration, af runs server-side but is trained by end users, who move messages into training folders with a normal IMAP client.

The main af and af-deliver scripts depend on Lua >= 5.1 and OSBF-Lua >= 2.0.4, and the supplementary af-list and af-spamfilter scripts also require a reasonably recent Perl with CDB_File, Mail::Address and Mail::Header. There is no documentation at present.

containers — lightweight containers using Linux namespaces

This package is a simple implementation of containers for Linux, making secure containers as easy to create and use as a traditional chroot. It comprises three utilities, contain, inject and pseudo, which use the kernel support for user namespaces merged in Linux 3.8.

gist — a command-line interface to GitHub gists

gist is a simple gist manipulation tool which can list, create, clone, redescribe and delete both public and private Github gists. Set github.user and github.pass in git-config before running it. It creates gists with just a README containing the gist description, so you should use git commit –amend and git push –force to fill in the content of each new gist.

init — a lightweight BSD-style init, syslog and udev implementation

This is the lightweight BSD-style init and syslog system used in Arachsys Linux. It includes a number of small utilities including a minimal init, a wrapper for turning simple commands into well-behaved background daemons, a simple but flexible syslog implementation, and an elegant replacement for the increasingly bloated udev daemon.

The design aim for this suite is to provide a toolkit of small components that can be joined together with standard shell script to produce a complete system, rather than the large, monolithic, inflexible daemons that are typical elsewhere.

MailFlow — improved plain text email in Apple Mail

I sometimes work on an Apple machine running OS X, and it’s convenient to use the built-in IMAP mail client. It isn’t bad for reading mail, with cross-mailbox threading and good platform integration, and can be configured to send plain text messages. Whilst it once sported an excellent RFC2646 format=flowed implementation, recent releases have taken to sending each paragraph as a single long line, mangling outbound messages with an ugly and embarrassing quoted-printable transfer encoding.

A handful of long-standing bugs have also remained unfixed despite being reported several years ago. For example, Apple Mail incorrectly quotes the reply attribution string with ‘> ‘ to the same level as the quoted text, and drops the first leading space from indented lines when displaying plain text messages. The latter bug corrupts inline patches during copy-and-paste, but fixing it is apparently less important than introducing the ability to draw ludicrous speech bubbles on image attachments.

MailFlow is a plugin which fixes Apple Mail to emit nice format=flowed plain text messages and tames its enthusiasm for quoted-printable transfer encoding. Various problems with quoting and attribution when replying are addressed, and the long-standing bug with leading whitespace when displaying plain text messages is fixed.

My previous plugin to help make Apple Mail less antisocial is also available:

Both of these plugins use an unsupported mechanism to hook into Apple Mail, replacing or wrapping private selectors at runtime. Recent internal code churn means the latest releases will only run on Mail 10.x and macOS 10.12. However, older versions of MailFlow are compatible with Mail 9.x (OS X 10.11) and 8.x (OS X 10.10), and older versions of MailWrap support Mail from 7.x (OS X 10.9) onward.

skd — attach scripts to unix, IPv4 or IPv6 listening sockets

skd is a small daemon which binds to a udp, tcp or unix-domain socket, waits for connections and runs a specified program to handle them. It is ideal as a secure, efficient replacement for traditional inetd as well as being an easy-to-use tool for non-privileged users wanting to run their own network services.

Datagram and stream sockets are available in both the internet and unix namespaces, each with the expected inetd behaviour. In the internet domain, IPv6 is supported in addition to IPv4.

skd also supports connection limits, verbose logging of connections, dropping of privileges, forking into the background with a pidfile and redirecting stderr to syslog or a file. Some of these facilities (such as forking into the background, privilege dropping and logging) are also useful for standalone, non-network services and can be used without binding any socket.

djbdns getpeername patch

I use skd to run Dan Bernstein’s djbdns without daemontools or ucspi-tcp. dnscache and tinydns do their own networking and work fine using env to set the environment and skd -BL to daemonise and handle logging. However, axfrdns expects to be run under tcpserver and reads the environment variables TCPREMOTEIP and TCPREMOTEPORT to identify the remote host. Neither the original inetd nor older skd (before version 1.1) set these. The following patch against djbdns-1.05 changes axfrdns to use getpeername on the socket instead, which should work correctly on all inetd variants.

Paragliding odds and ends

Modern hang-gliding and paragliding GPS-vario instruments read airspace data in a standard text format, displaying it on their moving map displays and providing warnings when pilots stray too close to restricted airspace. Complete UK airspace files can be downloaded from The Worldwide Soaring Turnpoint Exchange including excellent UK coverage. However, much of the content of these files is concerned with airspace far above any height relevant to paragliding, and these entries are distracting when displayed on a small map screen. The following small Perl script filters OpenAir-format data files to remove the unwanted airspace information above a specified flight level:

It is apparently compulsory for every pilot to roll their own IGC to KML converter for plotting their flight tracks on Google Maps. Here is mine:

The Regional Atmospheric Soaring Prediction system provides useful weather forecasts for glider pilots. These are my scripts which periodically pull data for our local flying sites to integrate into our club site guide:

Yamaha Motif odds and ends

The Yamaha Motif XF synthesizer has an undocumented network audio record and playback interface. Here is some sample C code demonstrating how to use it:

Some information gleaned from reverse-engineering the native file format of the Motif XF and XS is here, together with example file manipulation code:

Miscellaneous local patches

I try to contribute all my local fixes and improvements back upstream, but here are a few cases where I have failed to do so: