[coll.cgi V=1 RA=18.221.68.196]

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:

Documentation

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

WWW tools

ae
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.
w3cat
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.

w3ld
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).

chrset,
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.


Tools

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

Modules
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:

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

Programs
Many of the following programs use the above modules:

ABC music programs
abc, abcgui
is an experimental browser helper for ABC music notation.
abc2bars
produces the first two bars of each of a list of ABC tunes.
abc2html
converts ABC music notation to HTML.
abcDesc
builds a .htaccess file from .abc files showing the titles.
abc_netscape
is a netscape helper for ABC music notation, which converts the file to PostScript and starts ghostview to display the results.
abccode
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.
abcpar
add parallel like to a chunk of ABC music notation.
abcsplit
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
abctoc
generates a table of contents from ABC music files.
abctr
transposes a fragment of ABC music notation.
Addr
A perl wrapper for the nslookup command. It strips away all the "user-friendly" verbage, so you can use it in other scripts.
anon.ftp
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.
b-c
converts the verbose-ized *.b files to *.c files, selecting and/or suppressing verbose output.
b64d
decodes base-64 files.
bmod
verbose-izes *.c files, making them compatible with the V.h package.
Bp
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.
DC
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.
Deliver
is a mail-delivery program, useful in testing email failures.
FindDiffFiles
lists files with the same name but different contents.
FindHdrFiles
lists all the *.h files in the system.
FindWaste
lists files that are large and aren't being used.
Helper
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.
HomeDir
produces a list of users' home directories, with no extraneous text, so you can use it in a script.
Hosts
converts nslookup output to /etc/hosts lines.
IF
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.
IFind
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.
Man
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.
mfl
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.
Monitor
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.
Mrpl
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.
pctbar
is a wish script that produces a percent-completion bar.
Pings,
a wish script that produces a window with a running display of a list of machines and how they are responding to pings.
PurgeFiles
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.
Rmake
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.
Rs
restores files backed up via Bp
RSA
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! ;-)
rename
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.
Pings
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.
Start
is a tcl mimic of the MS-Windows Start button.
SumCol
sums a column of numbers.
supplant
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.
DC
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.
DC
is a simple protype of a tcl TCP server process.
Test
is a software-test program. It runs a suite of tests, compares the results with samples of correct output, and reports failures.
DC
is a tcl wrapper for the traceroute command.`
DC
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.
DC
unpacks a (possibly compressed) tar kit.
Upload
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.
WNG
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.
DC
is a perl script that knows how to build the whatis files used by the man command.
XR
displays X resources, and helps you edit them.
XRGB
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.
XV
is a tcl wrapper for the xv command. It includes a prototype directory-tree routine.
Xrand
produces an xterm window with random colors.
Zap
wipes out the contents of files.

Everything

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

typegifpngpdfsvgKkeysbarsstaffssizeMOinfoRWfiletitles
1 ----- - - - -820 - - - - -Addr* -
2 ----- - - - -433 - - - - -Bl* -
3 ----- - - - -1411 - - - - -Cookie* -
4 ----- - - - -1411 - - - - -Cookies* -
5 ----- - - - -222 - - - - -CountFiles* -
6 ----- - - - -967 - - - - -Cptree* -
7 ----- - - - -189 - - - - -Cu* -
8 ----- - - - -16119 - - - - -DC* -
9 ----- - - - -1116 - - - - -DateTest* -
10 ----- - - - -35757 - - - - -Deliver* -
11 ----- - - - -1134 - - - - -ExtractFortunes* -
12 ----- - - - -5400 - - - - -F* -
13 ----- - - - -1950 - - - - -FakeMail* -
14 ----- - - - -308 - - - - -Find* -
15 ----- - - - -3391 - - - - -FindDbg* -
16 ----- - - - -2865 - - - - -FindDiffFiles* -
17 ----- - - - -1326 - - - - -FindHdrFiles* -
18 ----- - - - -515 - - - - -FindImageFiles* -
19 ----- - - - -2390 - - - - -FindWaste* -
20 ----- - - - -442 - - - - -Finda* -
21 ----- - - - -810 - - - - -Fln* -
22 ----- - - - -9027 - - - - -Font3* -
23 ----- - - - -5628 - - - - -Fonts* -
24 ----- - - - -5628 - - - - -Fonts1* -
25 ----- - - - -9186 - - - - -Fonts3* -
26 ----- - - - -78 - - - - -FromWhere* -
27 ----- - - - -26502 - - - - -GDB* -
28 ----- - - - -7629 - - - - -Helper* -
29 ----- - - - -301 - - - - -HomeDir* -
30 ----- - - - -849 - - - - -Hosts* -
31 ----- - - - -23979 - - - - -IF* -
32 ----- - - - -126 - - - - -Ifind* -
33 ----- - - - -497 - - - - -Inc* -
34 ----- - - - -11 - - - - -Lds* -
35 ----- - - - -10 - - - - -Lf* -
36 ----- - - - -17 - - - - -Li* -
37 ----- - - - -12 - - - - -Lid* -
38 ----- - - - -1501 - - - - -LinkMy* -
39 ----- - - - -13 - - - - -Litr* -
40 ----- - - - -13 - - - - -Lrt* -
41 ----- - - - -17 - - - - -Ls* -
42 ----- - - - -11 - - - - -Lsd* -
43 ----- - - - -24 - - - - -Lss* -
44 ----- - - - -18 - - - - -Ltr* -
45 ----- - - - -19 - - - - -Lurt* -
46 ----- - - - -715 - - - - -MailShars* -
47 ----- - - - -440 - - - - -Make* -
48 ----- - - - -1193 - - - - -Man* -
49 ----- - - - -360 - - - - -Mkdir* -
50 ----- - - - -5410 - - - - -Monitor* -
51 ----- - - - -10567 - - - - -Mrpl* -
52 ----- - - - -10748 - - - - -MultUser* -
53 ----- - - - -820 - - - - -NSlookup* -
54 ----- - - - -1563 - - - - -OV* -
55 ----- - - - -30 - - - - -P* -
56 ----- - - - -30 - - - - -PP* -
57 ----- - - - -96 - - - - -PSP* -
58 ----- - - - -101 - - - - -PSPP* -
59 ----- - - - -92 - - - - -PSU* -
60 ----- - - - -99 - - - - -PSUP* -
61 ----- - - - -574 - - - - -PSdate* -
62 ----- - - - -2647 - - - - -PSftr* -
63 ----- - - - -2524 - - - - -PShdr* -
64 ----- - - - -30 - - - - -PU* -
65 ----- - - - -39 - - - - -Pc* -
66 ----- - - - -10342 - - - - -People* -
67 ----- - - - -46 - - - - -Pg* -
68 ----- - - - -35093 - - - - -Pings* -
69 ----- - - - -546 - - - - -Post* -
70 ----- - - - -28 - - - - -Pr1* -
71 ----- - - - -333 - - - - -Pr2* -
72 ----- - - - -1963 - - - - -PurgeFiles* -
73 ----- - - - -1359 - - - - -QuoteReply* -
74 ----- - - - -405 - - - - -README* -
75 data---- - - - -293 - - - - -RSA -
76 ----- - - - -3137 - - - - -Relink* -
77 ----- - - - -10540 - - - - -ReplyHeaders* -
78 ----- - - - -711 - - - - -Restore* -
79 ----- - - - -7807 - - - - -Rmail* -
80 ----- - - - -2662 - - - - -Rmake* -
81 ----- - - - -217 - - - - -Rs* -
82 ----- - - - -1562 - - - - -Save* -
83 ----- - - - -35757 - - - - -Send* -
84 ----- - - - -3192 - - - - -SendMail* -
85 ----- - - - -1489 - - - - -SplitSayings* -
86 data---- - - - -218 - - - - -StaffSheet -
87 ----- - - - -4935 - - - - -Start* -
88 ----- - - - -7398 - - - - -TCPlist* -
89 ----- - - - -7572 - - - - -TCPstat* -
90 ----- - - - -10330 - - - - -Test* -
91 ----- - - - -1761 - - - - -Threadize* -
92 ----- - - - -495 - - - - -Top* -
93 ----- - - - -15913 - - - - -TraceRoute* -
94 ----- - - - -7991 - - - - -URLcache* -
95 ----- - - - -345 - - - - -UnpackKit* -
96 ----- - - - -281 - - - - -Unshar* -
97 ----- - - - -240 - - - - -Untar* -
98 ----- - - - -3961 - - - - -Upload* -
99 ----- - - - -9294 - - - - -WNG* -
100 ----- - - - -857 - - - - -Whatis* -
101 ----- - - - -8445 - - - - -XR* -
102 ----- - - - -3025 - - - - -XRGB* -
103 ----- - - - -2428 - - - - -XV* -
104 ----- - - - -1600 - - - - -Xcgi* -
105 data---- - - - -269 - - - - -Xdefaults-gv -
106 data---- - - - -1884 - - - - -Xdefaults-kendy -
107 data---- - - - -405 - - - - -Xdefaults-netscape -
108 data---- - - - -2757 - - - - -Xdefaults-tiel -
109 data---- - - - -650 - - - - -Xdefaults-xterm -
110 ----- - - - -533 - - - - -Xrand* -
111 ----- - - - -31 - - - - -Xsu* -
112 ----- - - - -32 - - - - -Xterm* -
113 ----- - - - -14270 - - - - -abc* -
114 ----- - - - -1286 - - - - -abc+3* -
115 ----- - - - -1288 - - - - -abc-3* -
116 ----- - - - -3520 - - - - -abc2bars* -
117 data---- - - - -3253 - - - - -abc2code -
118 ----- - - - -882 - - - - -abc2html* -
119 ----- - - - -1419 - - - - -abcDesc* -
120 ----- - - - -2768 - - - - -abc_netscape* -
121 ----- - - - -14270 - - - - -abcgui* -
122 ----- - - - -6402 - - - - -abcjoin* -
123 ----- - - - -4309 - - - - -abcmedley* -
124 ----- - - - -2383 - - - - -abcpar* -
125 ----- - - - -1416 - - - - -abcprog* -
126 ----- - - - -7903 - - - - -abcsplit* -
127 ----- - - - -22857 - - - - -abctable* -
128 ----- - - - -8508 - - - - -abctr* -
129 ----- - - - -2040 - - - - -abctri* -
130 ----- - - - -3621 - - - - -abctrn* -
131 ----- - - - -3621 - - - - -abctrs* -
132 data---- - - - -1414 - - - - -ae -
133 ----- - - - -1356 - - - - -b-c* -
134 ----- - - - -168 - - - - -b64d* -
135 data---- - - - -736 - - - - -bashenv -
136 ----- - - - -448 - - - - -bashrc-linux* -
137 ----- - - - -817 - - - - -bmod* -
138 ----- - - - -425 - - - - -bmp2gif* -
139 ----- - - - -6808 - - - - -chrset* -
140 ----- - - - -2876 - - - - -cpdir* -
141 ----- - - - -2169 - - - - -crp* -
142 data---- - - - -736 - - - - -cshenv -
143 ----- - - - -4019 - - - - -cshrc-FreeBSD* -
144 ----- - - - -476 - - - - -dos2unix* -
145 data---- - - - -17 - - - - -exrc-OSX -
146 data---- - - - -258 - - - - -exrc-linux -
147 ----- - - - -3441 - - - - -frMorse* -
148 ----- - - - -1933 - - - - -frp* -
149 ----- - - - -262 - - - - -ge* -
150 ----- - - - -6030 - - - - -gifdemo* -
151 ----- - - - -539 - - - - -giftest* -
152 ----- - - - -578 - - - - -gmtime* -
153 dir---- - - - -64 - - - - -img/img
154 dir---- - - - -96 - - - - -js/js
155 data---- - - - -156 - - - - -kderc-linux -
156 data---- - - - -736 - - - - -kshenv -
157 ----- - - - -2876 - - - - -lndir* -
158 data---- - - - -736 - - - - -loadenv -
159 ----- - - - -486 - - - - -localtime* -
160 ----- - - - -486 - - - - -lt* -
161 ----- - - - -5547 - - - - -m2h* -
162 ----- - - - -484 - - - - -mac2unix* -
163 ----- - - - -2508 - - - - -mfl* -
164 ----- - - - -2348 - - - - -mkdep* -
165 data---- - - - -1478 - - - - -pctbar -
166 ----- - - - -1099 - - - - -rename* -
167 ----- - - - -2169 - - - - -rp* -
168 ----- - - - -30 - - - - -stripman* -
169 ----- - - - -3260 - - - - -subst* -
170 ----- - - - -3260 - - - - -supplant* -
171 ----- - - - -1164 - - - - -tarbkup* -
172 ----- - - - -65704 - - - - -tcpproxy* -
173 data---- - - - -736 - - - - -tcshenv -
174 ----- - - - -4019 - - - - -tcshrc-FreeBSD* -
175 ----- - - - -3440 - - - - -tcshrc-OSX* -
176 data---- - - - -5890 - - - - -tcshrc-SunOS -
177 ----- - - - -6863 - - - - -tcshrc-linux* -
178 data---- - - - -151 - - - - -totitlebar -
179 ----- - - - -1506 - - - - -trim* -
180 ----- - - - -34 - - - - -ts* -
181 ----- - - - -476 - - - - -unix2dos* -
182 ----- - - - -487 - - - - -unix2mac* -
183 ----- - - - -578 - - - - -ut* -
184 ----- - - - -2169 - - - - -vrp* -
185 data---- - - - -12522 - - - - -w3cat -
186 ----- - - - -21895 - - - - -w3ld* -
187 data---- - - - -7247 - - - - -w3post -