Index of /~jc/demo
JC's Demos
JC's Demos
This is John Chambers'
directory of interesting demos. What is here will change from
time to time, as I change my mind about which demos I want to
make public. Here are the current demos:
Documentation
-
Unix manuals online
-
A simple web interface to the standard Unix online manuals.
This uses the m2h CGI script.
WWW demos
-
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.
-
webcat
-
This is a webified version of the Unix cat ("catenate") command.
It reads one or more URLs and writes their contents to standard output.
This program originally required the libwww module,
but performance problems (especially the problem of hung connect calls)
encouraged replacing it with some special-purpose high-performance modules.
So if you are curious about 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.
-
wthr
-
This is a package that uses weather'com's XML data service to provide
weather information in a fast, compact form. This is a simple example
of the power of the Web to leverage data from one or more separate
sites, and provide a useful user service on another site.
-
ABCbot
-
The keyword-based search sites are useful, but have obvious problems,
so people have started working on specialized search tools that have
an understanding of their topic.
This is a Web "spider", tailored to look for the
ABC music notation and build index files for the contents.
This is the basis of my tune finder.
It starts from a list of URLS, and follows links to a depth of N,
reading each page and extracting ABC header information.
This program is only the search portion of the task; see the
bot/ directory for the full story.
Character Set demos
-
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 demos
-
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.
JavaScript demos
-
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.
-
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
-
verbose-mode init routine.
- Programs
-
Many of the following programs use the above modules:
-
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.
-
Kill.bsd,
Kill.sys5,
Kill.linux
-
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.
-
NSlookup
-
Calls nslookup and strips off all its verbiage,
so that its output can easily be used in scripts.
-
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.
This script also demonstrates how to correctly do non-blocking I/O
with a subprocess that writes partial lines to stdout.
(This is very tricky in tcl.)
-
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.
-
-
-
-
Active button
Name Last modified Size Description
Parent Directory 12-Nov-2009 12:09 -
ABCbot 31-Dec-1969 19:00 -
keyboard.txt 15-Oct-1999 16:15 1k
URLdata.pm 03-Dec-1999 14:08 2k
Source.tcl 03-Dec-1999 14:21 2k
proto.pm 03-Dec-1999 14:21 1k
chrset 03-Dec-1999 14:21 7k
Help.w 23-Feb-2000 13:22 13k
FindHdrFiles 02-Mar-2000 10:27 1k
Kill.aix 08-Mar-2000 10:01 1k
Kill.bsd 08-Mar-2000 10:01 1k
Kill.hpux 08-Mar-2000 10:01 1k
Kill.solaris 08-Mar-2000 10:01 1k
Kill.sunos 08-Mar-2000 10:01 1k
Kill.sys5 08-Mar-2000 10:01 1k
kill.freebsd 08-Mar-2000 10:01 1k
mailto.html 08-Mar-2000 10:01 1k
tcpproxy 08-Mar-2000 10:01 64k
Man.html.orig 20-Mar-2000 13:04 1k
Man.html 20-Mar-2000 13:57 1k
m2h.pl 20-Mar-2000 13:59 5k
but_on.gif 03-Apr-2000 15:20 1k
but_off.gif 03-Apr-2000 15:20 1k
JSorbit.html 21-Nov-2000 17:11 5k
proto.cgi 14-Dec-2000 09:56 1k
hummingbird.html 15-Mar-2001 19:50 1k
Elastic.html 29-Mar-2001 17:30 1k
JSelastic1.html 29-Mar-2001 18:16 1k
redirect2.html 30-Apr-2001 15:10 1k
redirected.html 30-Apr-2001 15:14 1k
Kill.linux 07-Jul-2001 12:51 1k
SmartTagsOff.html 11-Aug-2001 09:38 1k
BrowserID1.html 28-Aug-2001 23:08 1k
HelpText.html 28-Aug-2001 23:08 2k
ImgPreload.html 28-Aug-2001 23:08 1k
JSarrow.html 28-Aug-2001 23:08 2k
JSelastic.html 28-Aug-2001 23:08 8k
JShummer.html 28-Aug-2001 23:08 2k
JStetris.html 28-Aug-2001 23:08 16k
JStrailMsg.html 28-Aug-2001 23:08 2k
redirect1.html 28-Aug-2001 23:08 1k
ImgPreload1.html 10-Dec-2001 14:27 5k
proto.b 26-Apr-2002 11:17 1k
proto.d 01-May-2002 09:06 1k
Verbose.w 25-Sep-2002 17:08 2k
NSlookup 01-Oct-2002 09:20 1k
FindDiffFiles 01-Oct-2002 09:20 3k
FindWaste 01-Oct-2002 09:20 2k
proto 01-Oct-2002 09:20 1k
proto_pl.sh 01-Oct-2002 09:20 1k
rename 01-Oct-2002 09:21 1k
supplant 01-Oct-2002 09:21 3k
w3ld 01-Oct-2002 09:21 21k
URLtrim.pm 01-Apr-2003 10:43 1k
Pings 17-Apr-2003 18:51 34k
img/ 09-May-2003 16:52 -
crash/ 29-May-2003 12:08 -
elastic.js 12-Jun-2003 17:37 6k
proto.w 05-Nov-2003 11:39 3k
PCkbd.txt 21-Nov-2003 09:24 1k
pl/ 21-Jan-2004 14:23 -
read.sh 10-Feb-2004 15:21 1k
ISO8859-1.txt 19-Feb-2004 21:00 8k
IF 18-May-2004 16:03 9k
m2h 13-Oct-2004 21:39 5k
proto.pl 21-Apr-2005 11:55 1k
URLopen.pm 27-Apr-2005 09:22 6k
CGI_Lite.pm 27-Apr-2005 17:19 26k
Backup.pm 30-Apr-2005 23:21 2k
HelpWin.html 14-Aug-2005 00:26 3k
HTTPcon.pm 05-Oct-2005 20:08 5k
w3cat 05-Oct-2005 20:09 12k
PShdr 14-Oct-2005 13:51 2k
HTMLdir.pm 01-Dec-2005 19:30 2k
msgbad/ 03-Jan-2006 15:25 -
proto.html 24-Feb-2006 20:37 1k
marqee.html 15-Apr-2006 23:46 2k
img.html 15-Apr-2006 23:51 1k
23-May-2006 18:36 1k
ps/ 07-Jun-2006 14:07 -
URLhref.pm 26-Jul-2006 15:02 1k
test/ 12-Sep-2006 16:38 -
webcat 13-Sep-2006 12:36 46k
ae.cgi 30-Jun-2007 21:25 2k
pm/ 25-Feb-2008 20:04 -
PSftr 18-Sep-2008 15:21 3k
Vopt.pm 12-Jun-2009 22:15 2k
DT.pm 20-Jun-2009 20:58 1k
Apache/1.3.41 Server at trillian.mit.edu Port 80