Miscellaneous utilities
Here are some utilities that I've written out of need. Several of them depend on each other or other common software; dependencies are noted below. Brief descriptions follow; precise documentation, where it exists, is in the programs themselves.
See the individual programs for their licenses; most of them are GPLed, while a couple of trivial ones are placed in the public domain.
The Lua scripts need the stdlib Lua libraries. In general, a full set of POSIX commands is assumed; there are likely to be unwitting dependencies on GNU extensions.
repeat (sh)
Repeat a command a certain number of times.
retcode (sh)
Run a command and print its return code.
rep (Perl)
Perform a regex search and replace on the given files.
prepend (sh)
Prepends standard input to the given files.
softwrap (Lua) and hardwrap (sh)
Soft and hard wrap text. hardwrap just uses fold.
occurs (Lua) and unique (sh)
occurs finds the number of occurrences of each symbol (where "symbol" can be defined flexibly enough to be words, identifiers or HTML tags), and list them sorted lexically or by frequency, with or without the frequency and total number of distinct symbols.
unique calls occurs with the right settings to find all the unique lines in a file like uniq, but actually does output each line in the input only once, rather than just merging adjacent identical lines.
sig (Perl)
A signature-with-random-tagline generator: it appends a random line from ~/.taglines to ~/.signature, formats the result nicely and prints it on standard output.
lpr2 (Perl)
Needs Hulot and psutils (for psselect)
Print files two-sided on a one sided printer by printing the even and then the odd pages. It's set up to work sensibly on my printer (straight paper path, pages come out face down). It works with any file type that cv can convert to Postscript.
hb (bash)
Reports the size of files on the PATH.
findcore (bash)
Find core dumps.
thumbify (Perl)
Needs Image::ExifTool
Add EXIF thumbnails to images. In practice, this seems to mean JPEGs and PNGs.
cvs-difftoprev (Perl)
Show the cvs diff for given files to the previous version. Optionally, a version number can be supplied.
start-alpine (Perl)
Needs URI
Start alpine with a more flexible syntax, allowing either an email address or a mailto URL, including a single attachment in the URL (but not yet multiple attachments).