Noumena Corporation

Whitmore Lake

Clif Flynt wrote Tclsh Spot articles for login: magazine from 1999 to 2005.

Here are quick summaries with links to the articles and the source code.

April 1999:
Intro to Tcl/tk
Tcl/Tk Introduction: A GUI Calculator
The first Tclsh Spot article introduced the basic commands and showed how to create a GUI calculator (with 8 commands and about 30 lines of code.)
June 1999:
File IO, Strings, Text Widget
Catching unowned IRC Robots
This article described a simple script that will confirm that all the tasks running on a system are owned by legitimate, logged in, users. We used this script to track and kill IRC Robots that crackers left on the college network where Clif Flynt was teaching at the time.

August 1999:
Using the HTML viewer
An HTML viewer for MIME mail readers
I like to read mail with a plain old text type mail viewer. But metamail doesn't have built in support for HTML mail. This viewer will handle simple HTML messages (but not most advertising mail).

October 1999:
Extending the HTML viewer
Extending the HTML viewer
This article shows how to extend the Tcl HTML package to read images, and bounce to hyperlinks.

The example code is an improved htmlviewer that will let you look at images or load links at your discretion.

December 1999:
Building HTTP Robots
strings, regular expressions
Introducing the stock robot
This is the first of several articles that show how to build a simple stock quote retrieving robot.

This article creates a simple robot that will return the current price.

April 2000:
Building HTTP Robots
fancy regular expressions
Extending the stock robot
This article explains some of Tcl's new regular expression options, and extends the robot to get all the available data.
June 2000:
File I/O, the BLT Graph widget
Analyzing data - Introducing BLT
Now that we can get the stock data, lets start saving the results, and put together something simple to look for trends.

This article shows how to use the Tcl File commands to save the results, and how to use the BLT extension graph widget to display them later.

August 2000:
Better graphs, sales volumes, Associative arrays
More things to do with the BLT graph widget
This article expands on the previous graphing program and shows how to use bar charts with graphs, use multiple axes, and display custom labels on the tics.

Along with that, it discusses using the associative array to organize the data.

October 2000:
Multiple lines on a chart, menubuttons, more associative array techniques
Comparing multiple data sets with the BLT Graph widget
This article described how to:
  • use BLT with multiple lines of data
  • bind actions to the lines
  • generate postscript images of a graph
  • use a tk menubutton

It expands on the discussion from the previous three articles.

December 2000:
Introduction to TCP/IP Client-Server in Tcl
Client/Server system monitor
Introduces the socket command, and shows how to build a client-server pair that will monitor disk space, and report when the space gets low.
February 2001:
More IP-style Client/Server techniques
Expanded Client/Server system monitor with BLT barchart
This article expanded on the previous article by:
  • Using a single server with multiple ports for different information.
  • Displaying client data with a barchart.
  • Handling exception conditions with catch.
  • Checking for valid clients.

April 2001:
Client/Server System Monitor with History
Client/Server System Monitor with history
Shows how to save the last N hours worth of events, and display them in a scrolling canvas.
June 2001:
Displaying utmp data with the binary command
Examining binary data
Describes using the binary command to dump the information in the utmp file.
July 2001:
Using the binary command to examine telnet configuration messages
Binary data and sockets
Describes using the binary command to display the IAC interaction during the start of a telnet session.
  • binary
  • fconfigure
  • read
  • split
  • regsub
Sep 2001:
A Telnet Client
A simple Telnet Client
Implements a simple telnet client that can interact with a server, maintain its internal state, and respond to various commands the server can send. Demonstrates some features of the Tcl namespace.
December 2001:
Extraction information from tcpdump
Display text from tcpdump output
Describes extracting the text from the hex output of tcpdump.
tcpdump format join
split format string regexp
Feb 2002:
Getting and comparing HTML pages
A simple html interaction tester
An example application that takes reformatted output from tcpdump and turns it into a Tcl script that can be used to replay an interaction.
http vwait
clock format read
April 2002:
Advanced Tk Techniques 1
Resizeable displays
Describes using pack, place and grid to make resizeable GUI applications.
pack place grid
May 2002:
Advanced Tk Techniques 2: Automatic Scrollbars
Scrollable Displays
Describes how to build applications with scrollbars that appear and vanish as required, and how to simulate a scrollable frame.
frame canvas
grid scrollbar
June 2002:
Advanced Tk Techniques 3: popup Help
Popup Help messages
Adding popup help messages to buttons, labels, etc.
bind after toplevel
winfo wm message
Oct 2002:
Firewall Validation 1: Building extensions with SWIG
Firewall Validation 1: Building extensions with SWIG
Describes how to convert an existing library into a Tcl extension using swig. Builds an extension using the dnet library for sending and receiving ethernet packets.
SWIG extensions
Feb 2003:
Firewall Validation 2: Testing the packet generator with AX4000
Firewall Validation 2: Testing the packet generator with AX4000
Describes using the Spirent Ax4000 to measure line usage and confirm that the dnet extension can saturate a 100-B-T line.
ax interface analyzer
Apr 2003:
Firewall Validation 3: Generating packets and validating the code
Firewall Validation 3: Object Style programming in Tcl
Describes object style programming using the namespace command in the context of building broadband packets, and then describes validating the new procedures.
namespace variable tcltest

Read the article
Jun 2003:
Firewall Validation 4: Capturing and Analyzing Packets with an AxTcl
Firewall Validation 4: Capturing and Analyzing Packets with an AxTcl
How to use AxTcl on the Spirent AX-4000 to capture packets and display statistics and packet contents.
ax interface analyzer

Read the article
Aug 2003:
Firewall Validation 5: Monitoring log files with Expect
Firewall Validation 5: Monitoring log files with Expect
Tcl's Expect extension is ideal for automated scanning log files. This article describes watching the log files to confirm that expected events occur.
spawn expect exp_send proc
Oct 2003:
Firewall Validation 6: Client/Server sockets
Firewall Validation 6: Client/Server sockets
Tcl's Socket interface is clean and simple. This makes it an ideal choice for developing client/server applications.
socket (client) socket (server) flush
fconfigure fileevent vwait
Feb 2004:
Firewall Validation 7: Secure Sockets, TLS and creating a simple Certificate Authority
Firewall Validation 7: Secure Sockets, TLS and creating a simple Certificate Authority
For secure applications, you need secure communications. The TLS extension allows Tcl sockets to use SSL for communications. This article describes setting up private certificates for secure private communications.
tls::socket tls::handshake
interp create interpName alias
Apr 2004:
Firewall Validation 8: Mobile Agents in Tcl
Firewall Validation 8: Mobile Agents in Tcl
A client application can send a Tcl script an Agent server for remote evaluation. This article describes creating an Agent based client/server pair, using SSL to ensure that only scripts from trusted agents are evaluated, and evaluating scripts in a Safe sandbox.
safe::interpCreate safe::interpAddToAccessPath
safe::interpDelete info complete
Jun 2004:
Fortran/Tcl 1: Using Tcl with FORTRAN
Digression: Fortran/Tcl 1: Using Tcl with FORTRAN
Adding a Tcl intepreter to a FORTRAN program is an easy way to extend your FORTRAN programs to support graphics, networks, configuration files, etc. This article describes how to link the Tcl interpreter to a FORTRAN application and use a Tk GUI for input and output.
ftcl_start labelframe entry
button label vwait
Aug 2004:
Fortran/Tcl 2: Making a better GUI for FORTRAN Applications
Digression: Fortran/Tcl 2: Making a better GUI for FORTRAN Applications
Demonstrates the flexibility of writing a GUI as script appended to a compiled application. A GUI script is easy to modify and extend without affecting the core application. You can even change a challenge/response application to a real-time application.
labelframe image scale
Oct 2004:
Fortran/Tcl 4: Generating a graphic display with the canvas widget
FORTRAN/Tcl: Data Visualization with a Tk Canvas
FORTRAN applications can generate lots of numbers. The Tk canvas provides a good tool for visualizing that information.
canvas scrollbar canvas bind
canvas xview/yview create line create polygon
Feb 2005:
Fortran/Tcl 3: Wrapping a FORTRAN/Tcl with TOBE
Wrapping applications with TOBE
In order to distribute a FORTRAN/Tcl application, either the client needs to have Tcl installed, or you need to wrap the application into a single executable. D. Richard Hipp's TOBE wrapping solution is best for this application.
Wrapping Applications Editing the TOBE Makefile Tcl_Init
Tcl_EvalFile Tcl_FindExecutable Zip