JC's Tools
JC's Tools

This is John Chambers' directory of useful tools. What is here will change from time to time, as I change my mind about which tools I want to make public. At the end is a complete list of the files here. But first a list of the more interesting tools:


Unix manuals online
A simple web interface to the standard Unix online manuals. This uses the m2h CGI script.

WWW tools

Ever wonder what your browser tells the server? This script sends you a dump of its arguments and environment. You can experiment with adding stuff to the URL, then hit Return and it will show you how the URL is parsed. Here's the source.
This is a Web version of the Unix cat ("catenate") command. It reads one or more URLs and writes their contents to standard output. It has options to show you what's happening, so it is useful for debugging network problems. This program originally used the libwww module, but performance problems and hung connect calls led to replacing it with some special-purpose high-performance modules. If you are curious about how to do such things, you might examine the modules used by this program.

This does a download of a web directory to the current directory. It is recursive to a specifiable depth, so it can produce a mirror of a directory tree. But it only works with directories that look like directories; it can be defeated by an index.html file.

Character Set tools

PC Keyboard mappings
For software that uses the ALT key to shift to the upper 128 characters in the ISO 8859 character set(s), this show what characters you get. Most linux software, some BSD, and assorted other programs do this.
The ISO 8859-1 character set
This is a list of all the 256 characters, one per line, showing the hex, octal, and decimal encodings, plus the actual character (for printables) and its descriptive name (for non-alphanumerics).

The chrset file is a small perl program that outputs the entire annotated character set.

Network Management tools

SNMP Over the Web
SNMP agents can take months to get working, they are difficult to use, and are very slow due to the need to do a series of get-next requests to get a table of information. This is a demo of getting the same information via HTTP. It took me a day to implement, including a couple of "private MIBs". It fetches entire tables with a single request, so it radically outperforms SNMP for table accesses. Why would anyone bother with SNMP any more?

Monitor interfaces
A tcl (wish) script that produces a constantly-updated display of the states of a machine's interfaces.

Ping continuously
A tcl (wish) script that displays a list of remote hosts and the timings for pings repeated at N-second intervals.

JavaScript tools

Popup Help Window
Several ways to get a new window to appear that contains some "help" information from a separate file.
Image preloading
This is a JavaScript demo that shows how to preload images for a second page. It also shows and explains how this may be misused by unscrupulous web sites to embarrass you.

Browser ID
JavaScript demo showing how to identify the user's browser and send different data depending on browser type.


This is a list of shell, perl and tcl tools to do some useful tasks.

Many of the perl and tcl programs here use one or more of the following modules, so I've put them all here for easy downloading:

renames a file by adding '-' to its name. It's recursive, of course.
the stripped-down version of the libwww module. Very useful for all but the most complex and sophisticated web applications.
simple date-time routine.
is a popup-help package for tcl/tk (wish).
produces a simple HTML listing of a directory.
makes HTTP connection to a host, returns open file.
is a wrapper for the tcl source command that searches $PATH.
returns open file for a URL, data only (no HTTP headers).
expand HREF to full URL.
returns open file for a URL, prepared to read HTTP headers.
discards parameters from a URL.
Vopt.pm and Verbose.pm, Verbose.w
Verbose-mode init routines.

Many of the following programs use the above modules:

ABC music programs
abc, abcgui
is an experimental browser helper for ABC music notation.
produces the first two bars of each of a list of ABC tunes.
converts ABC music notation to HTML.
builds a .htaccess file from .abc files showing the titles.
is a netscape helper for ABC music notation, which converts the file to PostScript and starts ghostview to display the results.
is a script that reads ABC music files and outputs numeric codes for the tunes, using the abcCode.pm module.
abcjoin, abcmedley
join ABC music files, and optionally renumber the tunes, in somewhat different ways.
add parallel like to a chunk of ABC music notation.
extracts ABC tunes from a file and writes each to a file whose name is based on the first title.
Converts hostnames to IP addresses and vice-versa. There is no verbiage, so that its output can be used in scripts. See also NSlookup
generates a table of contents from ABC music files.
transposes a fragment of ABC music notation.
A perl wrapper for the nslookup command. It strips away all the "user-friendly" verbage, so you can use it in other scripts.
is a sh script to configure anonymous FTP. Some systems still come without this working, and someone at IBM created a very portable script to do the job.
converts the verbose-ized *.b files to *.c files, selecting and/or suppressing verbose output.
decodes base-64 files.
verbose-izes *.c files, making them compatible with the V.h package.
is a simple backup-in-place script, that (recursively) adds a hyphen to the end of one or more file names. You can restore them with Rs
cpdir, lndir
does a recursive copy of a directory tree, creating all the target directories and either copying or linking all the files. If you want to see how to recurse through directories in perl, you might look at this program.
is a little tcl-coded Desc Calculator. When the fancy one in the system library won't do what I want, I just add a new button to this one and bind it to a proc.
is a mail-delivery program, useful in testing email failures.
lists files with the same name but different contents.
lists all the *.h files in the system.
lists files that are large and aren't being used.
is a generic "helper" program that will start up a program to handle a file. It works with browsers and other programs that need a similar plugin "handle this file" capability. Its config file is a simple, non-proprietary format that you can edit with any editor.
produces a list of users' home directories, with no extraneous text, so you can use it in a script.
converts nslookup output to /etc/hosts lines.
displays the status of a machine's interfaces, updated every N seconds.
Kill.bsd, Kill.sys5, Kill.linux
are scripts that kill processes based on a grep of a ps listing. Different versions are needed due to the variety of ps commands.
searches all the system include directories for patterns. This is useful when porting programs to a new machine and the #include lines produce "no such file" errors or the macros come up as undefined functions.
These are scripts that kill processes based on a grep of a ps list. Different versions are needed due to the variations in the ps command, but one of these should work on most Unix-like systems. We also have Kill.aix, Kill.hpux, Kill.solaris, Kill.sunos and, but these are probably the same as one of the above.
converts a man page to plain text, suitable for editing. This uses the stripman command to remove underscores and other unprintable stuff.
Man.html and m2h
are a web interface to the Unix online manuals. You can look up a man page from your browser, and references to other man pages are converted to hyperlinks.
sorts the names in a Makefile macro definition. This is an example of a tool designed to be called with vi's !cmd mechanism to rewrite a chunk of text.
is the tcl/tk interactive tool "rmt", renamed because "rmt" is a common Unix commant. This is an interactive debugger for tunning wish scripts, and is an excellent example of how to do IPC using tcl's simple, elegant "send" command.
builds a reply header from a block of email headers.
NSlookup or
Calls nslookup and strips off all its verbiage, so that its output can easily be used in scripts. See also Addr
O8, OF, OV
alphabetizes and balances a list of .o files in a Makefile. This is a really obscure example of a special-purpose tool designed to be called with vi's !cmd mechanism to do some specific text massaging. See mfl for another such text tool.
is a wish script that produces a percent-completion bar.
a wish script that produces a window with a running display of a list of machines and how they are responding to pings.
searches through directories for links to one or more files, and deletes all of them. Useful for getting rid of old versions and backups, no matter what they may be called.
is a recursive make, that searches through subdirectories and makes the targets anywhere that they are found.
Rp, Frp, Vrp
is a perl program that does match-and-replace on a list of files. Frp rewrites only function names; Vrp rewwrites only variable names.
restores files backed up via Bp
is the famous RSA encryption in three lines of perl. (There is also a nice t-shirt with this code on it, which is available for sale. If you would like to be an international arms distributor, you can become one for just the price of this t-shirt. Buy one before it becomes legal! ;-)
does perl pattern match and replace on file names. This is an excellent example of something simple and useful which is very easy in perl, and nearly impossible with any other common tools.
is a tcl/tk (wish8.0) script for monitoring a list of hosts. It pops up a window showing a list of hosts. It runs pings on ay or all of the hosts and shows the responses. It can also use traceroute to discover the route to a host, and ping any or all of the hosts along the route.
is a tcl mimic of the MS-Windows Start button.
sums a column of numbers.
searches directories for files with the same name, and makes them links to an "authoritative" version. This helps eliminate the confusion and waste space caused by the "broken link" problem.
produces a window with a list of TCP connections. It is updated every N seconds, and you can specify a (grep) filter to select only certain sets of connections.
is a simple protype of a tcl TCP server process.
is a software-test program. It runs a suite of tests, compares the results with samples of correct output, and reports failures.
is a tcl wrapper for the traceroute command.`
is a tcl program that maintains a central cache of the contents of URLs. Other processes use the source command to ask for URLs and get asynchronous notification when the contents arrive.
Unshar and UnpackKit
unpack a flock of shar kits. They have somewhat diferent extra goodies.
unpacks a (possibly compressed) tar kit.
is a CGI script that copies files to a server's incoming-files directory. It is designed to be invoked via an HTML form or hyperlink.
is "Write to News Group", and sends one of a short list of canned responses to messages that shouldn't have been posted to the newsgroup.
is a perl script that knows how to build the whatis files used by the man command.
displays X resources, and helps you edit them.
lists all the color names known to your X server, and lets you select them as foreground or background colors so you can see what they look like. It can also send the color names to a parent wish process, so it functions as a generic color chooser.
is a tcl wrapper for the xv command. It includes a prototype directory-tree routine.
produces an xterm window with random colors.
wipes out the contents of files.


Here's the full list of everything, in alphabetical order: