Selected source code

Things I'd like to share which might be useful to you, but which don't quite merit their own page.
Most of these things should have man pages but don't (yet).

Date, time, and calendar related utilities

Like the + arguments in the unix date command, but as a stand-alone program. This implements most of the POSIX set, except for locales (EO) and the year-by-weeks stuff (gGUVW), with several extentions from other systems and a couple local ones. Use like "datefmt %Y-%M-%d".
Available in both C and Limbo versions:
Like datefmt, but for the Mayan calendar. Implements the Tzolk'in (260-day count), Haab' (365-day count), and the Long Count.
I am not 100% certain about all these conversions; don't use this for academic work without verifying them first.
Copy input lines to output, prepending a timestamp. Be default, the timestamp is fractional seconds since timestamp started; -i instead gives the time since the last line, and -f format prints the current date using datefmt, above.
This is modified from work by sqweek on IRC.

Graphics programs

The programs in this section all run on Plan 9 and under plan9port; they detect unix by looking for $service being empty or set to "unix".
Download the source and documentation for this section.
wordwrap.c, wordwrap.h — man (source, html)
Implements word wrapping under draw(3). Given a string, font, insertion point, and margin, it'll try to fit each word into screen, which must be a defined global (as is set up by initdraw(2)).
litclock and marquee, below, depend on this.
litclock.c — man (source, html)
Modeled after Johannes Enevoldsen's Literature Clock, it will display a quote reflecting the current time. You'll need a quote database at $home/lib/litclock.csv; I use Johannes' but since his runs in a browser, his database has a few <br>-style breaks in there. Fix it by running the database through "sed 's/\<br ?.?\>/\\n/g'". Doesn't handle missing runes in the source text nicely.
marquee.c — man (source, html)
Read input and display it in a large font, wrapping text to the window. Use like 'fortune | marquee'.
This was mostly written to get the word wrapping right for use in litclock, which has now been turned into the library above, but this is fun, too.
Doesn't handle missing runes in the source text nicely.
magicclock.c — man (source, html) — screenshot (Plan 9, — plan9port)
Display a "magic clock": a letter grid that "highlights" words corresponding to the current time. Option -c will cause it to center the clock in its window.

Network programs

A version of aux/trampoline which creates a "Vernam tunnel" — a giant One Time Pad for all the network traffic. It's sort of logistically difficult to set up securely, but offers theoretically unbreakable security for your traffic.
Inspired by Vernam Tunnel.
Send a message to Prowl, to get arbitrary notifications to iOS devices. I use this in my pipemail file to get notifications about email from folks I don't want to miss, to send URLs to my iPad, and for system notifications like resource exhaustion.
A re-implementation of ncp, but without the broadcast bits. Often the simplest way to get a file from point A to point B.

Wiki utilities

A read-only command line wiki client. 'wiki -l' lists the pages, 'wiki foo' prints article foo, 'wiki foo bar' looks for an article called "foo_bar", then "foo-bar", then separate "foo" and "bar" articles. See my post on 9fans for more detail.
I have a version for both Plan 9 and plan9port:
wiki for Plan 9 — wiki-p9p for plan9port
Mail interested parties when the wiki has new edits.
Update the "What's New" wiki page with what's new on the wiki. Best to only do this on a wiki you manage, to avoid thrashing. Change your name in here if you use this.
[This one needs to be updated before it'll work again.] Update the wiki's "Contrib Index" page with an index of the "contrib" package system. Best to only do this on a wiki you manage, to avoid thrashing. Change your name in here if you use this.
This was based on work by uriel.

Other utilities and toys

Report how long it takes to stat a file, in microseconds. Use -f filename to specify the file; it defaults to ".". This was intended for getting a quick-and-dirty benchmark on some remote file systems, but doing sping -f '#/' turned up some interesting performance differences between VPS providers. If specified, -i interval will cause it loop for interval seconds; interval may be fractional.
The dumb name stands for "stat ping".
Run a command in a loop, with a minimum delay. Avoid chewing up the machine on commands with transient failures.
Mostly a port of a twitter joke by thingskatedid. Inconclusive and illimitable.
This copies input to output, inserting a delay between each byte (the code is half there to make the size of the unit copied configurable, but I didn't need it so it's unfinished). I used this to avoid flooding a serial link which lacked flow control.
Conway's Game of Life... played in your mouse cursor. Adapted from games/life; the options are the same.
A trivial test while writing curslife; mostly just an example of the formats for setting your cursor.

See also: