[ Home page ]
Well, here it is, for what it's worth: (you might want to look at a note on licensing, or at a more concise listing)
Well, OK, it's not really automatic. It's a perl script which regenerates your .sig every n seconds, by default 1, from a list of quotes. It's so obvious that it's a wonder people who ask me for it don't just write their own (``How is it that the quote at the bottom of your email is different every time you email me?...''), but if you can't be bothered to, then get sigs.tar.gz.
You'll need to edit sigflip, the perl script (on Windows, rename it to sigflip.pl, remove the reference to fork(2) and run it from your `Startup' `Start Menu' folder) to put in the other .sig text you want, and edit quotes to include your own selection of quotation lines. And by the time you've done all that, you might as well have written your own.
If all you want is the quotes, well, here they are (but see also Am I Sig Or Not?). Don't expect anything startlingly original....
This is also utterly trivial:
$ new foo.h guessed type h $ cat foo.h /* * foo.h: * * Copyright (c) 1999 Chris Lightfoot. All rights reserved. * * $Id:$ * */ #ifndef __FOO_H_ /* include guard */ #define __FOO_H_ #endif /* __FOO_H_ */
It knows about C, C++, C/C++ headers, perl, perl modules, shell scripts and HTML files at present. It puts in appropriate top-level elements and RCS tags, and figures out your name from /etc/passwd. This is new.gz.
``[A member of the intelligentsia is] someone who won't own a television because the programmes are so terrible, but will listen to any old crap on Radio 4.''
The BBC's web site is excellent (i.e., it has actual content and only crashes Netscape about 20% of the time), but their listings pages are hopeless. getr4listing is a quick hack to extract the useful information from the Radio 4 listings and email it to you -- intended to be run every morning from cron.
A little while ago, the BBC buggered up the design of their news site. It used to be that there was a `low graphics' versions, which had the text and images which were actually relevant (well, roughly), such as photographs, maps and so forth, and a `high graphics' version which had tiny fonts, stupid spacing GIF files, and sundry other web designer droppings. The new version has a completely graphics free version -- complete with references to maps which aren't there, as in this story (about one third of the way down the page) -- and the same old `high graphics' version. unbbc is a perl CGI/FastCGI script which strips the graphic design out of the `high graphics' version, leaving just the content and the pictures. You can see an example.
A little script to render `xface' 48x48 bitmaps on a terminal: (apologies for physical formatting, it just looks better in white-on-black...)
',||||'' | |'|',|'| |' | ,',' ,', ', ,,' ,' | ' ,'|,||,||'','|,|',',',',' | ,',', ', | ,',' | ' ,||||,',|'|',', ,', | |',',',',',' ' ,' ,', | ' |||'|| ,|',| , | ',' | |,',',',',',',' ', ,' ,' ||'',|'|,',,' ' | ,'| | |',',',',', | ', | ', ' |,||'|,',', ',' ,' |,||||,|,,,,| ',' ,' ',',' ' ||,||,'| , ', | |,||||||||||||'||, | , ' ,' ,' ,'|'| ||', ' , ,''|||||||||||'|||'||',,' ' ,' ,' ||',| |',' , ,',|||||||||||'||,|||',' ,' ' ' |'|',| |'| ,','||||||||||||||||,|'| | , ' ' ' ' ||||,'|,||,| |||||||'|'|'|,||,||||',', ' ' ' , '|,'|,',||,,|'||,||,'',' ' | || | | |,' ', ' ||,|',',|||||||||||||||,',|,||,, ' ' ',' , ', |,|'|'|,'|||||||||||||||||||||, , ', ', ', ' |'||',|'| |',|||,||||'||'|||||,, |,, | , ' ' |||',| |',|,||||||||||'||''',|, '|,', ', ' ' ' ' ||'|,','| |||,|||'||'||||||| , ' ', ,' ' |'||'|| |'|,',|','||,||'|||','''|',|,,' ', ', '',' | |,| ||',|,'| |'||,|'|,||'||',| , ' , ' ,' | |',|,| |'|,| | ',|||,|',||'|||', ' ' ' , , ','| |,',| |||,' , ||||'|,| |||||'|,| ' ' ' ' '|',|'|,| '' , ' ,||||||,|,' |''', ,' ' ' |',|',|, ' ' '|||||||'|,| ' , ' ' ' ' |||||||'|',,' ' ' , , |
Get unface. I've also written a perl module to do this stuff (unface doesn't use it...); this will hopefully be in CPAN at some point, but anyway, Image-XFace-0.1.tar.gz.
Don't know how to make an X-Face image? Let the web take the strain.
The Unix philosophy is, of course, that programs should not tell you anything at all which is not directly relevant to their execution. This is fair enough. However, from time to time, it is useful to be able to obtain some indication of the progress of a copy operation; cwp addresses this requirement: it replicates the functionality of cat(1), but giving a progress indication to standard error. Use it as follows:
$ cwp very-large-file | rsh another-host "cat > /dev/hda2" very-large-file: written 47.6 Mb/ 383.9 Mb 12.4% 10.1 Mb/s
Linux users out there will be familiar with the extremely useful program killall(1), and will be grateful for its existence... right until the moment that they absently use it when logged into a Solaris machine as root:
Maintenance Commands killall(1M) NAME killall - kill all active processes SYNOPSIS /usr/sbin/killall [ signal ] DESCRIPTION killall is used by shutdown(1M) to kill all active processes not directly related to the shutdown procedure. [...]
nkill is a killall-alike which works on Linux, Solaris, and pretty much any other system with ps(1). It is carefully designed to not have the same name as killall(1).
Proxy a service from one machine to another, with hostname-based authentication and primitive bandwidth limiting. Possibly useful if you're stuck behind some dumb firewall or are getting nostalgic for that telnet-over-2400bps-modems feeling. This is proxy.
tlsproxyd is a daemon which proxies TLS/SSL connections onto daemons which don't support TLS themselves. Unlike stunnel, it allows you to use certificates which are protected by pass phrases, and it doesn't have a history of security holes (partly because it is new...).
Paul Warren's iftop displays an indication of bandwidth usage by hosts on a network; I contributed some code and documentation along with customary suggestions of debatable usefulness....
sp splits files into sections delimited by lines matching a given pattern, passing each chunk to a named program or writing it to a separate file. Saves you writing a little shell script whenever you want to do this. (Actually, csplit(1) does much the same thing, except that it can only split files into smaller files, not automatically feed each bit to a program.)
xdata is a set of shell utilities and a perl module for manipulating arbitrary key/value data in GDBM databases; the data can be synchronised among cooperating hosts via rsh or ssh. This is intended for storing information such as contact information, to-do lists, and appointments diaries (for my not-yet-quite-written scheduling application). Your reaction to xdata will probably be `but that's what files are for'.
Only in the movies, alas. popexpire will, however, automatically clean messages older than a certain margin out of a POP3 mailbox, ideal if you want recent mail to be available to you when you're away from home using a slow connection to the network.
fwdmail sends email with a blank (`<>') return-path, so that such an email cannot bounce (at least, not unless it happens to pass through a really incompetent MTA). Handy for convoluted procmail scripts.
umtp is an implementation of the `unreliable mail transfer protocol', which sends short email messages as compressed data in UDP packets. If you understand what this means, then I probably don't need to explain its limitations to you, and if you try to use this as your only means for delivering important mail and then come whinging to me, I will only laugh.
Everyone and their dog is implementing Bayesian spam filters these days. I'm no exception. bfilter's main claim to superiority over Dog Brand(TM) filters is that it knows something about decoding base64-encoded emails. You can also read the README file from the package.
Note: the current version, 0.3, uses Andrew Tridgell's TDB as a back end, rather than GNU GDBM. I made this change because TDB supports multiple writers on a single database, which helps when mail is being received quickly. Unfortunately, this means that 0.3 is not compatible with 0.2's database. You can either rebuild from your spam/non-spam corpora, or use the migrate-0.2-to-0.3 script included in the distribution. Alternatively, download the previous version, bfilter, version 0.2.
evencolumns is a filter which reformats a file of text so that the columns (presumably of data items or something) line up.
gh is like grep(1), but it hilights matching patterns
in the results (probably some versions of grep do this anyway). Only works on
VT100-alikes where ^[[7m
switches on inverse-video. (Usage idea:
tail -f /var/log/messages | gh -p something
.)
htmlise formats plain text as HTML.
ipcountry is a small utility which performs lookups against the Directi.com IP-to-country database. Download the tarball and type make; it will grab copies of the data you need from the web. Type make again when Directi.com update their database or ISO find any new countries. This now includes libipcountry, a simple library which you can call from your own programs to perform these lookups.
Every UNIX user is familiar with the problem of automatic processes generating scads of uninteresting diagnostics each time they are run. This is particularly bad with cron scripts which dribble uninteresting verbiage into your mailbox every morning. It's tempting to just ignore all this stuff, but if you do that you stand a good chance of missing something important if the program ever goes wrong and so reports something important. matilda is a tiny utility you can use to wrap such logorrheic programs; it will swallow all of their output until every invocation of the program has failed for more than a user-specified period, so you can say, in effect, ``only mail me the output of this command if it's failed every time it's been run for a week or more'' or whatever. More examples in the man page: matilda(1). (The name, obviously, is a reference to this.)
You can get a tarball of several of these utilities, complete with Makefile and a couple of extra goodies: useful.tar.gz.
This is a fairly fast implementation of a `dissociate' algorithm as described in, for example, A K Dewdney's The Magic Machine. It's occasionally amusing; for example, from my email spool, it dragged up
In a spy-vs-spy-style retaliation, various Internet denizens sent half a million e-mail bombs to pop up all over -- because no one's Unix-like...
No integrated word processor, and none of those new to the topic, it is not reliable enough to fluctuations in exchange rates and to charges made by your mail folder, and is not a real message.
Therefore large holes are apparent in the trick is to use the earth as a waveguide and see me in O7, Memorial Court at 5:45 pm on the town.
I'd be happy to look after a cat has just had kittens and he would like to know whether Netscape makes persistent connections?
This is a very good point. Of course, the problem goes away if you require users to be crap for the duration of our tenancy?
``Service provider'' is broadly defined and likely includes many colleges and an infant.
(While trying to find examples to put on here, I tried running it on the sendmail documentation, but oddly it didn't seem to make much difference to the sense.) This is dissociate.tar.gz.
Some C code for messing around with landscape generators. In its present form,
it generates island-like forms (see picture; these images were rendered in
POV-Ray). The algorithm is based on noise
generated from an FFT, and is moderately computationally intensive. Some
brief experiments were done with simulating erosion; a naive strategy based on
simulating trajectories of `water particles' showed some promise; see other
picture. I never got around to adding this to the islands, and the erosion code
isn't really in a fit state to give out.
Email me if you're interested. The
other landscape code is islands.tar.gz.
I've rewritten the original ng-analyse to do more interesting things and to work on mailing list messages as well as newsgroups. Example output. Get ngmlstat-0.1.tar.gz -- you'll need various perl modules, including the MIME stuff and Text::Iconv, to make it work. It's also much faster than the old version, since it uses XOVER/XHDR. You can also read the README file for ngmlstat.
A quick perl hack to analyse the traffic in a newsgroup. Enough to make you stop reading USENET (it almost stopped me reading USENET...). Analysis is broken down by author and subject-line. See some example output. You'll need a local NNTP server with read access (d'oh!) to use this. Get ng-analyse.gz. There is also a `web gateway' for this (i.e., a version made into a CGI script). For reasons which should be obvious to the CGI-savvy, this is nph-usenet.gz.
Produces a CD box cover as a PostScript program from a text file like the following:
title = How To Make Friends And Influence People artist = TerrorVision track = Alice What's The Matter track = Oblivion ...
I never got around to integrating this with CDDB, largely because everything in CDDB is inaccurate or misspelled, and one would spend as long correcting the output as just typing it in. Get mkcdcover.gz.
Another project in which I had an involvement: a Windows NT driver designed to subvert music anti-piracy schemes embedded in, for example, MP3/4 streams. Essentially it emulates a sound card, but saves the stream to disk instead of playing it. So far as we can see, it's not possible to get around this sort of thing until sound card manufacturers put decryption technology in their DSPs, and even then it seems to be the case that one analogue stage (DAC/ADC) is acceptable in quality terms on good hardware. Geocities canned our site-- aren't they owned by the Yahoo Empire now?-- but for now it's legal for us to host this ourselves: go to the Wave To Disk home page.
Timeshift is a dynamic shared object which allows you to run a program with an altered view of system time. See also its README file.
This was written back when a 386/20MHz was a fast machine, and had to be updated to take advantage of the exciting new features in Windows 3.1 when it first came out. The corollary of this is that (a) it won't run on Windows NT (some dumb programming error on my part, or Microsoft's, I can't decide which); (b) it almost runs on WINE (which is not, of course, an emulator). The binary distribution is podgame.zip; you can get the source code for it if you want (email me), but you probably won't be able to compile it unless you have Borland ObjectWindows 1.0 (needless to say, an obsolete product; ObjectWindows 2.0, the replacement was, as I recall, so bad that I gave up on programming Windows in C++ entirely -- nice message loop, anyone?).
These use James McKenzie's Samsung Digimax driver software, but if you can use vi, you can edit them to do what you want. photoscripts.tar.gz has code for retrieving, indexing and making web pages out of your photos. It includes cleverness for splitting archives of photos into (overlapping) sets, defined by characteristic phrases, in a fairly Mickey Mouse way.
Pausing only to question the appearance of these under the heading `play', here are: the Makefile for the top-level directory; Makefile.generic, which contains generic rules used for all subdirectories; and that for a subdirectory: tpop3d/Makefile.
Driftnet watches local network traffic, and tries to reconstruct and display images from what it finds. Amusing to run on a host which sees lots of web traffic.
This is a patch implementing the ``I'm Feeling Lucky'' pseudo-URL syntax in links-0.96. Examples: (the links won't work unless you have the patch, of course...)
If you are familiar with Google, you can guess what these do....
Mark has implemented the same thing for Microsoft Windows, so that you can use it whatever your platform and browser prejudices. James has implemented this as a Mozilla plugin XPI thingy using the Protozilla URL scheme extension tool.
RSS, one of the web's first examples of sending XML to do plain text's job, has now become extremely popular, and, occasionally, slightly useful. Sadly, RSS `aggregators' haven't followed this trend, and instead are useless pieces of top-heavy GUI tat. So I wrote my own: headlines-0.1.tar.gz.
.------------. .---------. | Keyboard | | Mouse | `-----+------' `----+----' | | `----------+---------' | V .--------------------. | UNIX-like kernel | `----------+---------' | V .-----------------------------. | Terminal driver and other | | POSIX-style abstractions | `--------------+--------------' | V .- - - - - - - - - - - - - - - -. | Large mass of HORRID C CODE | `- - - - - - - - - - - - - - - -'
A tiny program for drawing ASCII-art line-and-box pictures such as the above. I wrote this because it seemed like a good idea, but it turns out that my ability to design text-mode user interfaces is much more limited than my ability to actually draw lines-and-boxes diagrams using just vi. Anyway, if you want the code -- it represents the stuff in the dotted box in the diagram, as if that weren't obvious -- it's here: boxes.c.
I can't really take credit for this thing, though I did write bits of it. It's an implementation of RPL (also called RIPL for `Remote Initial Program Load'; `Initial Program Load' is IBM for `boot'), an IBM network boot protocol based on link-level communications over ethernet. Go to the RPLD home page for more information. Presently this only runs on Linux, but it does have a nice config file parser.
This code exploits the Linux (2.0.*) kernel bug which makes it possible to detect hosts with network interfaces in promiscuous mode by sending specially-constructed ethernet packets. Now mainly of historical interest, since Linux 2.2.* doesn't have this problem. `L0pht Heavy Industries' also have code to do this, and a bunch of other heuristic checks (but theirs runs on Windows). Get findpromisc.tar.gz.
This is a very hacky print formatter for FORTRAN-90, outputting to HTML or TeX; one would normally call such a thing a `pretty-printer', but I felt that it should produce output which was faithful to the ugliness of the language; hence, the output of this program is deliberately rather unpleasant (though consistent). You can see an example. Also note that this program is heuristic, rather than correct. The two versions (TeX and HTML) are f90format and f90format-html: f90format.tar.gz.
Graphs of load average, memory in use, and swap in use made available through a CGI script. See example output. Presently works only on Linux. A friend of mine did make this work with the Netscape push-protocol extension for HTTP (which, of course, Internet Explorer doesn't implement), so that it doesn't need a <meta http-equiv="refresh"...> tag, but I don't have the code to hand; email me if you want it, or implement it yourself (how hard can it be?). This thing consists of a few programs and scripts, and requires GD, which I believe was discontinued recently because Unisys were getting shirty over their bogus LZW patent (I am not sure whether this comedy piece of legal posturing has any force on the civilised side of the Atlantic). Nevertheless, you ought to be able to dig out a copy via a web search -- you might consider looking for gd1.3.tar.gz. The distribution, with minimal documentation, is status-page.tar.gz.
Another marginally useful pair of status monitoring/display scripts, this time to tell you how much bandwidth is being consumed across a network interface:
The programs to produce this are in traffic.tar.gz.
If you use a commercial dial-in connection to access the internet, you'll be painfully aware of the difficulty of finding your host's IP address if you're not logged on to it at the time. DHS.org offers a standards-compliant solution to this problem -- `dynamic' (low TTL) DNS records for your host, which you may update at any time.
Unfortunately, you have to use an HTML form and an HTTP transaction to do this. This is a nuisance. Before you run off and write a perl script to do it for you, however, you can try this one: dyn.dhs.org-1.0.tar.gz.
This is a virtual domains setup which draws its configuration from a relational database, making it easy to reconfigure from, for example a web page. Includes a (now obsolete) patch to gnu-pop3d to support the configuration, a configuration description for the Exim MTA, and a set of administration scripts.
Yet-another-POP3-server, but this one already contains vmail-sql support, and has other Good Features.
Consolidate is a console server. If you don't know what one of those is, you don't want one. (Arguably you don't want one even if you do know what one is.)
Countless other programs out there do this, but eq has the pleasing properties of (a) not requiring a complete LaTeX file to start from; (b) producing transparent PNG files; (c) producing nice anti-aliased output:
That image was produced with the command
$ eq 'u(\omega, T) {\rm d}\omega = \frac{{\hbar \omega^3} {\rm d}\omega}{\pi^2 c^3 (\exp(\beta \hbar \omega) - 1)}' > planck.png
pstojpeg is a ghastly PNMTools hack, but it seems to work OK.
OpenSSH is clearly superior to commercial SSH, especially in the matter of not giving away a free root shell to every passing script kiddie. Here are patches to alter the allocation of `reserved' (< 1023) ports, to add client keepalives, and to introduce bandwidth accounting.
vpn-udp is a small set of utilities for setting up host-to-host virtual private networks (`tunnels') between machines running Linux using SLIP to transfer packets between the kernel and the tunnel, and UDP to transmit the packets across the link. This offers better performance than the typical PPP-over-SSH tunnels in wide use.
smscemulator is probably the minimum implementation of an SMSC which speaks UCP. Unlike a real SMSC, this program doesn't charge you 12p before consigning your message to the void.
I spent a while searching for something like this for testing a UCP client without finding anything, before finally sitting down and spending the half-hour required to write it. Hopefully the magic of Google will mean that others don't have to spend that half hour....
Oh, and a sort-of-apposite quote:
Al Grant: No, the level 3 service is a complete journey between any pair of end points on the network, but with no guarantee of reliability.
Mark Ayliffe: Which differs from a train journey on our national network in what way?
John Sullivan: Datagram delivery is ``best effort''?
-- always take advantage of any opportunity to take the piss out of the OSI layer-cake model....
vscvs is a tool which allows multiple
independent CVS repositories to be used on a single machine via the
:pserver:
access mechanism, with each repository being owned by
an individual non-root user, and with the CVS software running in a chroot'd
environment. An additional tool offers simple access-control-list based
configuration of which users are permitted to commit changes to which
projects. See the README file for vscvs.
(NB: this is version 0.2 of the code; 0.1 had a
signed/unsigned bug which could cause serious problems because of interactions
with a Linux 2.2 bug in the implementation of pipes.)
dyndns is an implementation of a simple
dynamic DNS service for UNIX. Host records are updated when users
execute a program, dyndns
, on the server; it is recommended that
they do this using SSH, per
this
description. See also the README file for
dyndns.
If you run NT on a dual-processor machine, you'll be familiar with certain programs crashing randomly because their authors were too dopey to make the multithreading actually work in any meaningful fashion. affinity.zip is source and binary for a program which sets its affinity mask (NT for `which CPUs this program may run on') to have only one bit set.
(There is another known SMP issue to do with a memory manager optimisation called DisableHeapLookaside, which you should be able to locate in the `Knowledge Base'. This will only affect you if you are running a recently Service-Packed version of NT. You can tell if your NT box is up-to-date by connecting it to the internet and seeing if four thousand script kiddies crash it by exploiting some piss-poor Microsoft IP stack problem. If not, you must be running SP4 or above.)
This fixes the irritating Windows-ism where you can't edit a file in a text editor unless the type of the file (meaning the last three characters of the filename) has been registered with the system. Put the following in a .reg file, and add it to your registry:
REGEDIT4 [HKEY_CLASSES_ROOT\*] [HKEY_CLASSES_ROOT\*\shell] [HKEY_CLASSES_ROOT\*\shell\editastext] @="Edit as &Text" [HKEY_CLASSES_ROOT\*\shell\editastext\command] @="d:\\utils\\vim-5.1b\\gvim \"%1\""
Obviously, you'll want to replace the bit reading "d:\\utils\\vim-5.1b\\gvim \"%1\"" with something else if you don't have VIM; Microsoft never did really figure out this command-lines thing (despite their attempts at a GUI staggeringly managing to suck more than X-Windows and the Macintosh combined), so you have to put quotes around the %1 if you ever want to edit a file whose name contains spaces.
Most PC owners eventually become aware that the system clock in their computers is about as trustworthy as an MP confronted with a brown envelope full of used fivers. Unfortunately, setting the time on your computer from Windows is difficult, because Microsoft has left the hapless user without an implementation of any of the several standards for synchronising time across the network. Here is a simple (command-line) rdate client, with source code: rdate_win32.zip; unlike other similar code you may find floating around the Web, it (a) is not written in Delphi; (b) is not 800k in size; (c) does not have a tacky and pointless graphical interface. You should also note that this is not NTP, so if you are obsessed with getting the clock in your computer synchronised with another clock to within fractions of a second, you should look elsewhere.
(If you want to be slightly more accurate about time synchronisation, you could try fugit (as in `tempus', not `Fayed'), which will achieve roughly millisecond accuracy with respect to a known good remote clock. This isn't NTP either, by the way; nor, in fact, is it a Win32 program. A port is left as an exercise for the reader.)
If a program you download from this site doesn't come with an explicit license, you should probably assume that I believe it too trivial to assign an actual license to; you may indulge me by thinking `GPL in intent, public domain in reality': i.e., if you find the program useful, and give it to your friends, they ought to get the source code too -- and, if you improve it, I'd like a copy of what you've done. I am not going to pretend that this is enforceable or claim that it should be enforced even if it could be.
Larger pieces of software -- tpop3d and so forth -- are licensed under the GNU GPL.
I'm not going to bore you with a rant about the Freshmeat my-first-shell-script syndrome which leads morons -- especially USENET morons -- to claim that their half-baked scripts and four line code examples ought to be subject to the restrictions of a full license, but instead I suggest, as a more subversive take on all this, reading Dan Bernstein's opinions on software licensing.
Copyright (c) 2001-2 Chris Lightfoot. All rights reserved.