- availcols
- A utility for printing the number of free color cells in the root window's colormap.
- byteswap
- A utility for swapping the bytes of all the words in a binary data file.
- GNU enscript
- A utility to convert text files to PostScript with a color syntax-highlighting capability for many programming languages.
- GNU ls
- A replacement for the shell ls command that can color-code directory listings!
- maker2html
- Converts a FrameMaker document into HTML as a complete web page.
- man2html
- Encapsulates a man formatted help topic in HTML.
- NEdit
- A mouse-based text editor that's easy to use and customize with a color syntax-highlighting capability for many programming languages.
- snoop
- A tool for magnifying pixels on the screen.
- TkcxHelp
- An interactive tool for finding appropriate Explorer modules using a keyword search.
- TkFind
- An interactive (GUI) version of the Unix find command.
- xcmap
- A utility for displaying the colormap of the root window.
- xdiskusage
- A utility for displaying a directory's disk usage.
- XFTP
- A GUI tool for simplifying FTP operations.
- zip & unzip
- Tools for manipulating ZIP archive files.
availcols
DESCRIPTION
- availcols is a utility that prints how many color cells are free in the root window's (simply the background of the screen) colormap. On the SGI, the root window uses an 8-bit colormap by default for maximum compatiblity with all X applications even though the machine is able to easily display 24-bit color. Many programs try to share this colormap rather than create their own custom colormaps to also conserve system resources. The 256 colors can eventually run out and when this happens new applications that you try to run will probably have color schemes different than you would expect. In order to avoid these problems, it is best to try and run programs which use lots of colors in 24-bit mode if at all possible.
HOW TO INVOKE
- (Located in /net/hnv/graphics/xwindow/)
To see the number of free color cells:- availcols
- availcols black
HINTS
- The xcmap program (see below) is useful in conjunction with availcols in order to see exactly what the root window's colormap looks like.
byteswap
DESCRIPTION
- byteswap is a utility for swapping the byte values within
all the words of a data file creating a new file. Byteswapping just amounts to
switching the places of the first byte and the last byte, the second byte and
the second-to-last byte, etc. within a word. byteswap assumes a
default word size of 4 bytes, but it could also be 2 or 8.
Byteswapping is a common problem when binary data files are used on a big-endian machine which were created on a little-endian machine and vice versa. Big-endian machines, such as the Crays and RISC-based SGIs and Suns, store words in memory in MSB order meaning that the most significant byte of a word has the first address. Little-endian machines, such as Intel x86-compatibles and DEC Alphas, store words in memory in LSB order meaning that the least significant byte of a word has the first address. Unlike unformatted IEEE, not all data files have to be manually byteswapped between different endian machines. For files such as netCDF, GIF, TIFF, SGI RGB, etc., information in them tells reader programs how to interpret their bytes correctly regardless of the machine on which they originated.
HOW TO INVOKE
- To byteswap a file with the default 4-byte words:
- /home/hnv/pub/{linux:irix}/byteswap infile outfile
- /home/hnv/pub/{linux:irix}/byteswap infile outfile -w 2
- /home/hnv/pub/{linux:irix}/byteswap infile outfile -w 8
HINTS
- For byteswapping to be meaningful, the file size should be a multiple of the word size.
- Within GrADS,
one can specify that input data must be byteswapped by adding this line to the
control file:
- OPTIONS BYTESWAPPED
- Within MATLAB, one can specify whether a file contains big-endian or little-endian data with the 'b' and 'l' options to the "fopen()" function.
- The grads2nc utility is also able to deal with byteswapping (not in combination with the SEQUENTIAL option) when converting GrADS IEEE data files to netCDF.
DOWNLOAD
- byteswap is now available to the public via FTP. Be sure to read the enclosed LICENSE agreement before using it.
GNU enscript
DESCRIPTION
- GNU enscript is a utility that converts text files into PostScript for printing similar to a2ps. However, enscript has many more options, most significant of which is the ability to do color syntax highlighting of program code for many different languages. Printing of highlighted text can already be done directly out of Emacs, so enscript is probably most useful for those using other text editors, particularly NEdit.
PLUSES
- Large number of options for customizing the printing.
- Color syntax highlighting of program code!
MINUSES
- More difficult to customize the color syntax-highlighting language modes than in NEdit.
HOW TO INVOKE
- A good set of options to use with enscript is in this
example:
/home/hnv/pub/irix/enscript --fancy-header=custom2 -H3 -j \ -f Courier8 -E --color=nedit --mark-wrapped-lines=arrow \ input.F > output.ps
- cp /home/hnv/.nedit ~
This may overwrite one's customizations, so it may be a good idea to diff the files first and see what has changed. Another color model is emacs, which should be similar to the highlighting built into the Emacs environment. Finally, the "--mark-wrapped-lines=arrow" option puts small arrows at the ends of long lines which wrap onto subsequent lines. Many other options are described in the man page below, but here are some examples of actual source code (from grads2nc) processed with enscript and available for viewing as the final PostScript:
read_grads2nc.c.ps (/home/hnv/pub/enscript --fancy-header=custom1 -H3 -j -f Courier7 \
-E --color=nedit --mark-wrapped-lines=arrow -u"grads2nc" \
--ul-position="+125-25" -2 -r read_grads2nc.c > read_grads2nc.c.ps)write_grads2nc.F.ps (/home/hnv/pub/enscript --fancy-header=custom2 -H3 -j -f Courier8 \
-E --color=nedit --mark-wrapped-lines=arrow -u"grads2nc" \
--ul-position="+125-25" write_grads2nc.F > write_grads2nc.F.ps)
HINTS
- Put all the desired enscript options into a shell alias for easy recall later.
- Very useful in conjunction with NEdit.
DOCUMENTATION
GNU ls
DESCRIPTION
- GNU ls is a replacement for SGI's command-line ls program. It is basically functionally identical to the old ls except that it also supports color-coded directory listings. Different types of files in a directory can be displayed using different colors rather than the standard foreground color for everything.
PLUSES
- Color-coded directory listings!
HOW TO INVOKE
- Since getting a directory listing is a fairly frequent operation, it is
probably best to have GNU ls available locally. The first step
is to make a copy somewhere on one's local disk:
- cp /home/hnv/pub/irix/gls /net//
Then put an alias statement (to override SGI's ls) and a color definition statement (which maps file types to ANSI color numbers using the LS_COLORS environment variable) at the end of one's "~/.cshrc-sgi-" file:
- alias ls "/net//gls -CF --color=tty"
- setenv LS_COLORS "ex=33:di=31:ln=36:or=36;4:*.o=35:*.a=35:*.so=35:*.gz=32:*.Z=32:*.zip=32"
The "-CF" options on GNU ls are the same as for SGI's ls and the "--color=tty" option turns on color-coding when the output is sent to the terminal. If the output is redirected elsewhere (such as to a file) then it functions the same as SGI's ls to avoid any potential problems with embedded color codes. Note that the "setenv" statement above is very long and it should all be on one line. The man page further below has a DISPLAY COLORIZATION section which explains the format of the "LS_COLORS" string if further customization is desired. The above example sets the mapping from file types to colors as follows:
File Type Color executable yellow directory red symbolic link cyan objects and libraries (".o", ".a", and ".so") purple compressed (".gz", ".Z", and ".zip") green This alias will take effect when a new shell is started and so GNU ls will be transparently called whenever the regular SGI ls is used.
HINTS
- The color-coded directory listings are most effective with a dark (preferably black) background in the command shell.
DOCUMENTATION
maker2html
DESCRIPTION
- maker2html converts a FrameMaker document into
HTML format as a complete web page. Although, FrameMaker has
HTML conversion capabilities already built-in via WebWorks HTML
Lite, there are some significant limitations to it such as not being
able to handle graphics, equations, or tables. In addition, it doesn't provide
direct control over the exact HTML code that maps to each
FrameMaker tag; one can only choose from a list of predefined
HTML sequences which is frequently insufficient for accurate representation.
There is also no way to save a customized set of mappings for a document.
maker2html addresses many of these limitations, but has some
limitations of its own; the most notable of which are that it will generally
only recognize text in the main text frame and only recognize graphics in an
anchored frame.
maker2html does its conversion using a global set of mappings and assuming some default FrameMaker tags. In order to produce the best output web page, it will most likely be necessary to customize the mappings according to the formatting that each paragraph tag represents in a document. (It may also be necessary to know a little bit about HTML; a good introduction is on this WWW Help Page.) These mapping customizations are put in a file called ".maker2html" in the same directory as the document and apply to all documents to be converted in that directory. As an example, the customization file used to convert the FrameMaker documents comprising the GFDL Annual Report to HTML is as follows:
HTMLTAGS: 1Heading_maker2html <P> PARA</P> 2Heading_maker2html <P> PARA</P> Activ+Plans_maker2html <CENTER><H4>PARA</H4></CENTER> BodyAR_maker2html <P> PARA</P> Chapter_maker2html <H3>PARA</H3> GoalsBody_maker2html <P><UL><I>PARA</I></UL></P> HeadGOALS_maker2html <P><CENTER>PARA</CENTER></P> names_maker2html <P><UL><I>PARA</I></UL></P> ############################################################################ GENERICTAGS: 1Heading 1Heading_maker2html 2Heading 2Heading_maker2html Activ+Plans Activ+Plans_maker2html BodyAR BodyAR_maker2html Chapter Chapter_maker2html GoalsBody GoalsBody_maker2html HeadGOALS HeadGOALS_maker2html names names_maker2html
When constructing a ".maker2html" file, it is not absolutely necessary to include an "HTMLTAGS:" section. The definitions in the global mappings file /home/hnv/pub/irix/maker2html_src/global.mappings can certainly be used if they appear suitable, which avoids some potential (although minor) HTML programming. In order to use them, just select the one that best represents each FrameMaker paragraph tag and then put the appropriate name in the right-hand column of the "GENERICTAGS:" section. Of course, it will also be necessary to get a list of all the paragraph tags used in a FrameMaker document and then put them in the left-hand column of the "GENERICTAGS:" section. Fortunately, maker2html will display a list of all the used ones in its processing diagnostic output for easy cut-and-paste.
PLUSES
- Nicely converts graphics, equations, and tables!
MINUSES
- Only graphics that are in an anchored frame will be recognized and only text which is in the main text frame will be recognized.
- There is no easy way to configure character mappings other than editing the maker2html source code. As a result, some character styles may not convert completely.
- A single FrameMaker document is always converted into a single web page. There is no control over splitting it up in any way which may become an issue with large documents.
- The output web page is not always in perfect shape despite the best possible tag mappings (though it can be quite good) and will often require at least minimal tweaking (using perhaps the page editor built into Netscape or by modifying the raw HTML code).
- Figure conversion can be quite slow.
HOW TO INVOKE
- To convert a document with maker2html:
- /home/hnv/pub/irix/maker2html input.fm
The HTML file that is produced will be in the same directory as the input FrameMaker document and will have a ".html" extension. Any generated figures (as GIF files) will be placed in a "figures" subdirectory within the current directory. Figure generation can take quite a while so it is only done once by default; there is a command-line switch for regenerating them if necessary. There will also be some intermediate files left after conversion which can then be safely deleted ("*.commands", "*.mif", "maker2html.log").
maker2html has a library of small GIF images that it can use to represent special characters in the text. If a generated web page uses any of these images then their paths will have to be changed in the HTML code since the default location for them is in a directory ("/home/hnv/pub/irix/maker2html_src/icons_char/") which will not be accessible to an outside user loading the page through the web server. A utility is available called clean_maker2html which will copy all the referenced character images to the "figures" subdirectory within the current directory and update the paths in the HTML file:
- /home/hnv/pub/clean_maker2html input.html output.html
This utility also has an option for removing all the HTML target tags from the output file:
- /home/hnv/pub/clean_maker2html -t input.html output.html
If the file is not referenced from a FrameMaker "table of contents" document (also processed with maker2html) then it is safe to remove all the targets which only clutter the file, especially within an HTML editor like that built into Netscape.
HINTS
- See the FrameMaker Notes page for some general FrameMaker tips and information about document publishing.
DOCUMENTATION
- Complete command-line usage (also viewable by running maker2html without any arguments)
- Official maker2html WWW page no longer supported
man2html
DESCRIPTION
- man formatted help can be quickly encapsulated with HTML for online documentation. Its output is a single HTML file for each man topic piped into it.
HOW TO INVOKE
- man topic | /net2/rsz/linux/man2html/bin/man2html > out.man.html or
-
man ./topic_manfile | /net2/rsz/linux/man2html/bin/man2html > out.man.html
if the topic's man file is in the local directory and not in MANPATH
HINTS
DOCUMENTATION
NEdit
DESCRIPTION
- NEdit is a very polished GUI text editor written at
Fermilab. SGI even thinks highly enough of this program to bundle it with
versions of IRIX starting at 6.3. Its functionality falls somewhere between
the simple Jot and the complex Emacs.
NEdit's best features are probably its intuitive and
well-designed interface (taking advantage of SGI's enhanced Motif widgets),
high level of customizability, and extremely useful color syntax highlighting for many different programming
languages. Sure, Emacs can do color syntax highlighting as well, but
NEdit's implementation actually allows it to be modified
interactively and easily within the program's menus.
Another notable feature is the ability to copy text directly out of the NEdit window and then paste it into Netscape Gold's web-page editor window. This seems to be the only way to bring arbitrary (non-HTML) text into that editor without using the xclipboard program. Directly copying and pasting from the command shell, Jot, or Emacs doesn't seem to work for some reason.
PLUSES
- Slick and intuitive interface (esp. with the SGI-specific widgets and color schemes).
- Color syntax highlighting for C, Java, Fortran, Perl, Tcl, Awk, Csh/Sh/Ksh, Makefile, HTML, LaTeX, X resources, etc.!
- Easy to customize (colors, language modes, recognition patterns, etc.) compared to Emacs!
- Parenthesis/brace/bracket match flashing.
- Supports multiple file windows and splitting the view of a single file within a window.
- Remembers recently opened files.
- Macro capability.
- Supports selecting an arbitrary rectangle of text (keep the control key pressed while drag-selecting with the left-mouse button) rather than only the standard line-by-line selection!
- Allows selected text to be dragged around with the mouse.
- Multi-level undo and redo.
MINUSES
- Keyboard menu shortcuts do not work when either the Num Lock, Caps Lock, or Scroll Lock is on... IRIX 5.3 Motif bug?
HOW TO INVOKE
- To start NEdit:
- /home/hnv/pub/irix/nedit sample.F
HINTS
- Here are two sample configuration styles to make NEdit
appear and function as in the two images above. For the first sample, just add
this line to one's "~/.Xdefaults" file:
#include "/home/hnv/pub/irix/nedit_style1.ad"
then:- cp /home/hnv/pub/dotnedit_style1 ~/.nedit
NEdit's icon can also be changed by putting an SGI RGB image (85x67 pixels) called "nedit.icon" in one's "~/.icons" directory. To install a sample icon:
- cp /home/hnv/.icons/nedit.icon ~/.icons/
DOCUMENTATION
snoop
DESCRIPTION
- snoop is a very fast GL-based pixel magnification tool. It's quite useful for viewing small details which might otherwise be hard to see as a result of the high resolution of the screen. A pop-up menu (accessible with the right mouse button in the snoop window) provides options for changing magnification, single/double buffering, displaying the actual pixel values under the cursor, and snooping with the arrow keys instead of the mouse.
PLUSES
- Very fast since it's based on GL (hardware accelerated).
HOW TO INVOKE
- To start snoop, select it from the "Utilities" menu off the
"Main Menu" on the screen's background (accessible with the right mouse
button), or just enter:
- (IRIX) snoop
HINTS
- Switch to single-buffer mode (24-bit) in order to get a more accurate color representation of the magnified pixels. The default is double-buffer mode (12-bit) which introduces dithering to enhance its limited color resolution. Note: This 12-bit limitation applies to the Indigo2/Indigo XZ as well as the low-end Personal Irises, although higher-end graphics subsystems can double-buffer in 16-bit or 24-bit.
DOCUMENTATION
TkcxHelp
DESCRIPTION
- This program searches for keywords in the help files of
Explorer modules. Any number of words may be searched for by
entering them (separated by spaces) into the "Keywords" text widget at the
bottom of the window. The case of the keywords is ignored by default during
searching. Case can be considered by unchecking "Ignore Key Case" in the
"Options" menu. Pressing the "Find" button will start the search. The found
help files can be viewed by double-clicking on one or by drag-selecting one or
more and then pressing "View".
TkcxHelp searches for module help files in the following directories at GFDL:
- /usr/explorer/modules
- /usr/explorer/opengl/modules
- /usr/explorer/scribe
- /usr/explorer/maps
- /usr/explorer/unsupported/modules
- /home/hnv/explorer/modules
- /home/hnv/explorer/redrock.ncsa.uiuc.edu/General
- /home/hnv/explorer/redrock.ncsa.uiuc.edu/Grid
- /home/hnv/explorer/ftp.epcc.ed.ac.uk
- /home/hnv/explorer/phoenix.ocf.llnl.gov
- /home/hnv/explorer/www.iijnet.or.jp
PLUSES
- Easy way to find an Explorer module that performs a desired action.
MINUSES
- Cannot prematurely abort the keyword search.
HOW TO INVOKE
- TkcxHelp uses the Tcl/Tk libraries that are found through
environment variables. These variables can be set and the program run with a
compact command-line call such as:
(setenv TCL_LIBRARY /home/hnv/pub/tcl/tcllib; \ setenv TK_LIBRARY /home/hnv/pub/tcl/tklib; \ /home/hnv/explorer/tkcxhelp) &
HINTS
- Send e-mail to the author regarding any comments or suggestions for improvement.
DOCUMENTATION
- Built-in help pages
TkFind
DESCRIPTION
- TkFind is basically a GUI version of the Unix
find command. It looks through specified directory paths for all
the files that match a particular search pattern. The search can be modified
with various options such as matching a user, file permissions, size, date,
etc. The actual find command constructed with all these options
is shown as well as the results from the previous find at the
bottom of the main window. Before the search is started, sorting options can
be selected regarding how the matching files should be listed. They can be
sorted by name, time, and size in a verbose or compact format with relative or
absolute path names.
Once a list of matching files have been found, Unix shell commands can be executed on this list. Possible operations include searching the found files for specific strings (the grep command) compressing them, storing them in a cpio or tar archive, etc. Most shell commands (from the "Other" selection in the "Options...Apply Command" sub-menu) should work reasonably well from within TkFind. See the "Options" selection in the help menu for a more detailed explanation as to how the list of matching files is processed.
The cpio and tar commands are particularly noteworthy since they have their own execution window. This window allows these operations (along with the find) to be saved as a script. The script can be run immediately, at a specific time, or can even be submitted to NQS on the T90 as a batch job. Also on the T90, TkFind creates scripts that know how to deal with files in the archive filesystem using the dmget and dmput commands.
The first example image above shows an expanded view of TkFind running on the T90. Its search was for all files in a local directory that end with ".nc" and do not contain the string "test" in their names and are greater than 1,000,000 bytes in size. The other two example images show TkFind running on an Indigo2 and a Personal Iris. Different colors are used in order to make it easy to see on what system TkFind is running. See below for more information on color options.
PLUSES
- Much easier to use than the command-line find.
- Operations can easily be performed on the found files.
HOW TO INVOKE
- Although TkFind uses the Tcl/Tk libraries, it is no longer
necessary to set environment variables for them. Just run the following simple
wrapper script which takes care of everything on either an SGI or the T90:
~hnv/pub/tcl/tkfind
TkFind has several command-line options for specifying some of its window colors. By default, when TkFind starts up, it makes a minimal check to see on what kind of system it is running and then adjusts the colors accordingly. It uses a green scheme for the Indigo2, a purple scheme for the Indigo and Personal Irises, and a gray scheme for everything else (such as the T90). If the defaults are not satisfactory then they can be changed with the following options:
- -bgc color
Sets the background color. - -fgc color
Sets the foreground color. - -abgc color
Sets the active background color. - -selc color
Sets the selected color. - -menuc color
Sets the menu color. - -green
Uses the green color scheme. - -purple
Uses the purple color scheme. - -gray
Uses the gray color scheme.
HINTS
- Make sure that "Num Lock" and "Scroll Lock" are both off on the keyboard since they will temporarily disable interaction with all the widgets in the TkFind window!
- If a search matches a directory name AND files in that directory then it is best not to use tar on them. When tar is given a directory name to include in an output file, it automatically includes everything in that directory!
- When creating cpio files, it is best to keep the "Directories Last" option on (the default). This avoids potential extraction problems with read-only directories.
- Use caution when applying the rm command to the found files! TkFind will try to set the file permissions to make them writable (chmod u+w *) for successful deletion.
- Send e-mail to the author's address at the bottom of the page regarding any comments or suggestions for improvement.
DOCUMENTATION
- Built-in help pages
- man page
DOWNLOAD
- Due to a few requests, TkFind is now available to the public via FTP. Be sure to read the enclosed README file and LICENSE agreement before trying to use it. Certain program features are quite specific to the GFDL computing environment, so some code modifications will inevitably be necessary when it's used elsewhere...
xcmap
DESCRIPTION
- xcmap brings up a window displaying all the colors in the colormap of the root window of the SGI. The colors are shown as a grid of 16x16 rectangles. You can click on any cell with the left mouse button to see its index number and its RGB values. The RGB values are printed in 16-bit hexadecimal and since the range is normally 8-bit, the two characters for each component are repeated. In the example image above, all the black rectangles (except for the one in the upper left-hand corner) are the unallocated color cells.
HOW TO INVOKE
- xcmap
HINTS
- Use xcmap in conjunction with availcols (see above) for maximum utility.
DOCUMENTATION
xdiskusage
DESCRIPTION
- This provides a more effective view of disk usage as compared with the command du. A distribution of the disk usage for a specific directory is graphically displayed with comprehensive labeling (sub-directory names and usages). Examining at a depth of 11 sub-directories is also possible. Printing and sorting the contents are additional features.
HOW TO INVOKE
- /net2/rsz/linux/xdiskusage/bin/xdiskusage path
MINUSES
- As slow as du when scanning the directories.
DOCUMENTATION
XFTP
DESCRIPTION
- XFTP provides a very easy way of doing file transfers between different machines. It is far more convenient than the command-line ftp plus it has advantages over Netscape's FTP capabilities. These include being able to see both the source and target hosts/directories simultaneously and transferring multiple files in one operation. XFTP even saves a list of the recently visited remote/anonymous hosts.
PLUSES
- Much easier to use than the old command-line ftp!
HOW TO INVOKE
- /home/hnv/pub/irix/xftp
DOCUMENTATION
zip & unzip
DESCRIPTION
- zip and unzip are two programs for manipulating ZIP archive files. These files are compatible with the ".zip" files commonly found on PCs. A ZIP archive is just a collection of smaller files gathered into a larger one with built-in compression. The typical Unix equivalent would be a ".tar" file compressed with gzip. zip creates and modifies the archive files and unzip extracts their contents. These programs are useful when large files or collections of smaller files have to be transported between machines (namely from an SGI to a PC, and vice versa) using floppy disks.
HOW TO INVOKE
- To create a ZIP archive containing all the image files in the
current directory:
- /home/hnv/pub/zip201 test.zip *.rgb
- To extract the entire contents of a ZIP archive into the current
directory:
- /home/hnv/pub/unzip test.zip
- To extract just the file called "image1.rgb" from the ZIP
archive into the current directory:
- /home/hnv/pub/unzip -x test.zip image1.rgb
- To view the contents of a ZIP archive without extracting anything:
- /home/hnv/pub/unzip -v test.zip