Tool assortment: the good, the bad, and the useless
Those (theoretically) one-off hacks that I still use or just could
never bring myself to delete are available here for your dubious
benefit. There is no documentation or legalese except what you
find in the source code itself. Kind of reminds you of the good
old days, doesn't it? Share and enjoy.
libdstr
Dstr ("Dave's string class") is a C++ class that I use instead of
std::string. It has gotten cloned into so many projects now that
I've made a shared library just to reduce the number of copies.
Jukebox-related
This nontrivial hack has a few extras that go with it.
- jukebox.cc: Play sound files (or
whatever) in random order forever. It will play every song in
the playlist exactly once before repeating any. State is
preserved between runs. Needs libdstr (see above).
- aplay-rt.c: Run aplay with realtime priority. Needs to be suid root.
- jukebox_prep: Script that I use with
jukebox.
- jukebox_play: Script that I use with
jukebox.
LaTeX hacks
These packages work with document class article.
- blockquote.sty: Provides blockquote environment that is like quotation but without indentation.
- draftfoot.sty: Puts *** DRAFT *** in
the footer of every page.
- sssubsection.sty: Turns paragraphs into numbered subsubsubsections.
- timestamp.sty: Provides
\timestamp command to include current date and time in the form YYYY-MM-DD HH:MM.
Everything else
- badgiftoppm.c: giftoppm modified to recover broken gifs.
- bin2c.c: encode a binary file as a C declaration
- binpatch.c: simple non-interactive binary patch utility
- cd.cc: fill a CD with random selections. Uses libdstr (see above).
- cd.sh: use sox and normalize to process a collection of sound files so they will sound better in my truck. Subsumed by cd.cc.
- check_sigs.sh: validate all signatures in a Slackware distribution (good for finding files that didn't download correctly)
- concatheaders.c: process e-mail to un-break header lines.
- cropsong.cc: adaptively crop silence from beginning and end of Wav files, replacing the original files.
- deinstall.c: delete files last touched in a certain range of time.
- DeleteBlankLines.cc: filter out blank lines and trim trailing whitespace. Uses libdstr (see above).
- discard_long_lines.cc: filter out lines longer than 1000 characters.
- doom_barrells.c: produces a PWAD to add random barrels to a DOOM or DOOM 2 level. Can be modified to add random whatever.
- elevate.c:
elevate pid essentially renices a running process to the minimum realtime priority.
- facetopbm.c: convert x-face to PBM.
- filler.c: data source for overwriting a disk. The random source is fast but it repeats on the order of 64 GB.
- filler.cc: Boosted version of filler.c with a long-period random source suitable for large disks. It is slow but still about 3 times faster than /dev/urandom.
- find_big_files.c: name says it all.
- gethostbyname.c: command-line DNS lookup (also does by address).
- idfat.cc: show useful information about a FAT file system.
- ll.cc: print the length of the longest line in
a text file. Uses libdstr (see above).
- lossage_linux.sh: Linux version of script to monitor packet loss.
- lossage_solaris.sh: Solaris version of script to monitor packet loss.
- maketoc.pgcc: Create one or more toc files (as needed) to burn a collection of 44.1 kHz wav files to CD using cdrdao. Track titles are stored in and retrieved from a PostgreSql table. Files are identified by hash. Requires libdstr, libmhash, and PostgreSql.
- mac2unix.c: convert Mac line discipline to Unix.
- maxmem.c: simple benchmark of how much memory a single process can allocate.
- pbmtoface.c: convert PBM to x-face.
- ppmround.c: make a round PPM.
- prboom-patch.txt: patch to PrBoom 2.3.1 to fix one bug and add three new cheat codes.
- qdfilt.c: linear sharpening and smoothing of PPMs.
- qdgamma.c: quick and dirty replacement for pnmgamma, which broke at some point.
- qdnlfilt.c: nonlinear smoothing of PPMs.
- qdsort.cc: replacement for sort that does a better job with Latin-1. Uses libdstr (see above).
- qdvignet.c: correct vignetting / falloff in PPMs.
- rellif.c: validate results of filler.c.
- script-fu-copyright.scm: GIMP Script-Fu to add copyright notice to an image.
- shorten.c: strip trailing spaces and lines and DOS-isms in a text file.
- skim_std_mailbox.c: print From: and Subject: fields of messages in a standard Unix mailbox (mbox).
- split_mangled_mailbox.cc:
modification of split_std_mailbox.cc to undo a certain nontrivial but
systematic mangling of messages. See embedded comments for
details. Uses libdstr (see above).
- split_std_mailbox.cc: turn an mbox into separate files, one per message. Uses libdstr (see above).
- split_unrmailed_RMAIL.c: turn the results of the Emacs command unrmail into individual messages, undoing RMAIL damage to From lines along the way.
- split_VM_INBOX.c: attempt to split a VM mailbox into separate messages.
- unc.c: junk-tolerant uudecoder.
- unix2dos.c: convert to DOS line discipline.
- unvaxify_filenames.c: rename files to remove VMS version numbers.
- wavlength.cc: determine length in minutes:seconds of a collecton of 44.1 kHz wav files.
- whatchar.c: translate keypresses into ASCII values. Function keys with long escape sequences are translated correctly.
- xlabel.sh: change the name of an X window.
Home