M i c h a e l  @  a c t r i x . g e n . n z   ---   G i f t s ftp

Java CD Audio Player Application

SGI IRIX now supported.

View jcd in full size. Jcd was an experiment to see if Java could be used for something more than simple applets. I chose to write a CD player because it required: interfacing to C, controlling hardware, threads, file IO, sockets, text parsing, image manipulation, data entry, graphical user interfaces. A great project for trying out a new language.

I'm not pushing it so much as a CD player, but as a sample Java application illustrating how some of the above can be tackled. I'm don't have a detailed reference on AWT, so some aspects of the GUI aren't the best. I'd welcome pointers as to what I've done right/wrong.

This is an application, not an applet, ie it accesses files and devices and can't be run under Netscape. You must use something that runs a Java application: eg Sun's JDK. If you've managed to get the AWT to run, you shouldn't have any trouble installing and running jcd.

Features:

It's a memory hog. When better Java tools are available the amount of memory required should come down. I haven't had the chance to try it on anything with less than 32MB.

Jcd is available from ftp://sunsite.unc.edu/pub/Linux/apps/sound/cdrom

ftp

VH-Man2html V1.5

I wanted users to be able to browse local man pages from a web browser under Caldera Linux 1.0. What does the resulting HTML look like? Here's a sample page for telnet(1)

The March 1997 Linux Journal includes my article on vh-man2html. If you're interested in more details of how it came about, and a summary of how it works, please see the article.

Update: I uploaded new tar.gz's and rpms for vh-man2html-1.5 on 9 March 1997 to fix a looping bug when a man directory contains no man pages. You can also just apply this small patch by doing as follows:

  mkdir fix-vh
  cp /home/httpd/cgi-bin/manwhatis /home/httpd/cgi-bin/mansec fix-vh
  (cd fix-vh; patch < ../vh.patch)
  cp fix-vh/manwhatis fix-vh/mansec /home/httpd/cgi-bin
Thanks to Mike Richardson (mike@quaking.demon.co.uk) for pointing out the cause of this problem.

Update: Redhat 4.1 has changed the location of grep/egrep to /bin. A quick fix is for Redhat 4.1 is to manually edit the /home/httpd/cgi-bin/manwhatis script changing the relevant references.

Several man to html convertors exist. I've looked at two:

I've enhanced Richard's man2html so that it can also handle BSD mandoc-style man pages. I've also written some scripts to front-end man2html. They are designed to work with the man related commands and makewhatis info from Caldera/Redhat Linux. They generate indexes and perform searchs. The Indexes are generated on demand and update themselves when necessary. The indexes are ordered alphabetically with an A,B,C,... quick-link header and divided into man sections with section cross-links.

I've called my enhanced version of man2html, vh-man2html to distinguish it from both Richard's orginal and the many other scripts and programs of the same name. The V standing for Verhoeven's man2html, and the H for Hamilton's enhancements and packaging.

VH-Man2html privides the following functionality:

Features:

The latest vh-man2html (v1.5) and an optional glimpse Redhat rpm are available at ftp://ftp.redhat.com in the Incoming or in the contrib directory. It is also available at ftp.caldera.com.

Christoph Lameter (clameter@waterf.org) has put a version of vh-man2html into Debian Linux. His version is modified to work with man 2.3.

While working on man2html, I made some improvements to makewhatis that reduces its run time from 30 minutes to about 1.5 minutes on my 486DX2/66. It is now available as part of man-1.4g.tar.gz: at

ftp://sunsite.unc.edu/pub/Linux/apps/doctools/man
ftp

Linux/SGI Gr_Monitor

View gr_monitor in full size

Linux 2.0 version available!

Gr_Monitor displays information about processes resisdent on a UNIX system. For each process it displays a bar graph of CPU, Memory, Resident Set Size, and Elapsed Time. The processes are grouped by username. Each username group sits on its own little plinth.

There are controls for translating, rotating, scaling, lighting and fog effects.

Gr_Monitor consists of two components. The first gathers data from the Linux/IRIX process file system. This info is piped to the second display process which displays the data. By using rsh its possible to run the gather program on one machine and the display program on another. The display program input format is quite flexible, and could be used to display other kinds of data without any modification.

Gr_Monitor is something I hacked together to learn more about OpenGL, SGI's open standard for 2D/3D graphics. The whole thing was developed under Linux using the Mesa, OpenGL look-a-like, library.

I now have SGI process file-system version of process info gatherer. I haven't found an SGI home for it. So if you're interested email me. Gr_Monitor is very slow on a typical 486 with a non-accelerated graphics card (I don't know if an accelerated card would help). But it is fun to watch, especially on a machine where processes or users are coming and going. It is very useful for spotting hogs and uninhibited growth.

I have a larger 32k gif preview of what a gr_monitor display looks like.

Gr_monitor version 0.53 is available for anonymous ftp from sunsite.unc.edu where it normally resides in /pub/Linux/system/status. The tar includes both Linux and SGI source code.

ftp

Getdate - Safely sync your system date

Getdate is a utility that queries an RFC 868 time server and adjusts or sets the local date and time. It's useful for querying and copying the date/time from other Internet hosts. It will work correctly across time zones.

Get uses the UNIX adjtime() call so that it can be safely set up as a cron job. It can be set to reject hosts that respond slowly, or that vary too greatly from the local time. It should work on most of the modern UNIX variants.

The getdate man page is available for perusal.

The latest getdate-1.1 has been dropped off at ftp.redhat.com where it should move from /pub/Incoming to /pub/contrib. Getdate 1.0 is available from sunsite.unc.edu in /pub/Linux/system/network/misc/getdate-1.0.tar.gz.

View source

Fm.py - Some example Python/Tkinter code

View fm in full size.

Python is my favorite programming language. Here is a short example of how to program the new Python 1.3 with Tkinter. The code demonstrates how to do things like:

The code illustrates how to tie related Tk items together, how you might deal with accessing Tkvars, and how lambdas can be used to pass parameters to Tk "command" routines that aren't expecting any, how you can get at the insertion cursor in entry widgets, ...

You can view the source code to the forms module fm.py and the small test program testfm.py. My code isn't the best python (I'm still learning). It's just over 900 lines of python including comments.

I originally had something similar written in Tcl/Tk, which I used in TkCD (see next heading). It's nice to see that python can be used far more cleanly without resorting to global variables and evals.

ftp

TkCD Audio CD Player

View TkCD in full size.

TkCD is a GUI CD player interface I developed for the Linux operating system. TkCD 1.0 is actually a Tk/Tcl front end for CDplayer 2.0 by Mark Buckaway (mark @datasoft.com). Currently CDplayer 2.0 works on Linux and Coherent, but should be portable to any system supporting Sun CDROM ioctl. TkCD was developed using Tk/Tcl (an embeddable scripting language and GUItoolset). The entire application is available via anonymous ftp from sunsite.unc.edu where it resides in /pub/Linux/apps/sound/cdrom as part of the CDplayer-2.0 distribution.

TkCD needs a small patch to work with tcl 7.4. Just apply it to your installed tkcd script:

	cd  to-where-tkcd-lives
	patch < patch-file-name
	

If you are thinking of obtaining TkCD you might like to preview the TkCD interface before you consider ftp'ing it.(13373 byte gif).


Back to Michael's Home Page
Actrix Home Page

Last modified: Wed Jul 16 22:59:56 NZST