Linux Stuff
This is a grab-bag of scripts, configuration files,
installation notes, and other miscellany for Linux,
plus occasional items for Cygwin and DJGPP to facilitate running
the scripts under Windows.
With regard to the scripts,
please note that minor modifications will be needed depending
on your installation, but this will
generally amount to no more than changing a few path variables
near the start of the script.
Stuff for Netscape 7.0.1 on Slackware 8.1.01. Here are a few scripts
that I use with my latest Netscape installation; you will no doubt need to
modify the specific path variables to match your installation.
- cache-log.sh
lists the files in Netscape's cache directory along with the size, date,
and content type of each. This script was really just a development step for
'cache-view' (see below), but since Netscape 7 uses really
non-descriptive
file names as well as selective gzip compression in cache, I still use the
cache-log listing from time to time top see what is going on.
- cache-view
picks out the 'N' largest graphics files in cache, creates a temporary
directory of symbolic links to them, and starts up 'gqview' to browse
them. Edit the script to use a different graphics viewer.
- ns
is a short script to simplify using Netscape to browse arbitrary local files
or directories from the command line; it uses
this little 'C' program to convert from
relative to the required absolute pathnames.
Newer Compaq Armada 7730MT configuration information:
7730-repartition.txt (14.3KB)
contains notes and copies of important configuration files from my
February 2004 re-install of Slackware 8.1.01, DOS 6.22, and the Compaq
diagnostics on my Armada 7730MT laptop. This time I completely
rebuilt ALL the partitions, whereas previously (see below) I had retained
the factory-installed partition table and diagnostics partition.
Older Compaq Armada 7730MT configuration information. The 7730 is an
aging 133MHz pentium laptop that I acquired in mid 2002 and set up to
run Linux instead of its native Windows 95. I installed RedHat6.1 first,
since that's what I had on my desktop box at the time, but I soon switched
to Slackware 8.1.01 on both the desktop and the 7730.
- 7730-partitions.txt
(1.3KB) is the captured 'fdisk' and 'sfdisk' output describing the hard drive
partitions I'm using. The original Windows95 installation used three
partitions: a 11MB Compaq diagnostics partition at the beginning of the disk;
a 2027MB primary Windows partition following, and a 23MB extended partition
containing Windows setup stuff at the end of the disk. When I installed
Linux, I deleted the big Windows partition and a reallocated its space as
a slightly smaller Linux partition and an approximately 128MB Linux swap
partition.
N.B.: Booting the diagnostic partition is the only way I have found
so far to get into the BIOS setup, so be careful not to wipe out the Compaq
diagnostics partition. Once you've booted the diagnostics via 'lilo' (see
below), you can easily use the diagnostics themselves to make backup BIOS
setup and diagnostics diskettes; and from what I've read, you could probably
do this before wiping out Windows by hitting F10
during the boot process to start up diagnostics.
- 7730-lilo61
(0.2KB) is the /etc/lilo.conf file that I used for RedHat6.1. The 'compaq'
boot choice loads up Compaq diagnostics as mentioned above, but the 'dos' boot
choice doesn't work because there are currently no "system files" on the
little FAT16 partition.
- 7730-lilo8101
(0.3KB) is the /etc/lilo.conf file that I use for Slackware 8.1.01; it took
a bit of experimenting to get this one right, I think mainly because I
initially told the installation script to install lilo on the Root superblock
instead of on the MBR.
- 7730-xfc335
(4.1KB) is the 7730's /etc/X11/XF86Config file for XFree86 3.3.5 on RedHat6.1.
800x600 is set as the default resolution, and it works fine to switch back
and forth between 800x600 and 640x480 using Fn-Ctl-Alt-KP+/-. The LCD display
does not seem to be capable of higher than 800x600 resolution.
- 7730-xfc420
(3.2KB) is the 7730's /etc/X11/XF86Config file for XFree86 4.2.0 on
Slackware 8.1.01.
- 7730-snd61
(0.1KB) is the /etc/conf.modules file used to set up the 7730's sound
card on RedHat6.1. It was produced by running 'sndconfig' and
supplying the parameters "SoundBlaster", IRQ 5, I/O Port 0x220, and DMA 1.
- 7730-snd8101
(0.1KB) is the /etc/modules.conf file (note the difference in names!) used
to set up the 7730's sound card on Slackware 8.1.01. After much
experimentation - including the discovery that
the /etc/rc.d/rc.modules file installed by default required no
changes to get the sound system working - it was produced manually
with a text editor
Directory listing scripts, mainly just wrappers for 'ls', updated
in November 2003 to handle filenames with embedded spaces and apostrophe
characters (especially useful on Cygwin/XP and for Windows partitions
mounted under Linux). On my newer systems I install them in /usr/local/bin so that
'root' can use them too.
- mydir
(0.8KB) is my basic directory list command, which I normally use via a soft
link called simply 'dir'. Its main features are that it a) does not
exclude items whose names begin with a period; b) pages through 'less' only
if there are more than 23 items in the list; c) appends indicator characters
(*/=@|) to classify entries; and d) lists the names of directories instead
of their contents unless exactly one or zero arguments is given.
- mylsal
(0.8KB) works like 'mydir' but with the long form output (permissions,
owners, sizes, dates ...). I use a soft link called 'l' (lower case L).
- lt
(0.8KB) is the same as 'mylsal' but the list is sorted by modification time
(newest first).
- lt2
(0.9KB) produces a time sorted list like 'lt', but the list is limited to 10
items and a pager is never used. If items are skipped because of the 10
line limit, a count of skipped items displayed at the bottom of the list.
- ddir
(0.5KB) lists just the names of the subdirectories in the current directory
or in a specified directory; it had no built-in paging capability.
- lsa3
(0.9KB) produces a list of file counts for a given directory, displaying
an individual count for each file extension found and an overall total.
- lss
(3.7KB) produces a size-sorted directory listing giving size, an abbreviated
timestamp, and filename fields for each file, plus a summary line giving the
total of the individual file sizes. I use 'lss' when working with long
filenames, especially those with embedded space characters.
Word play: Here are odds-and-ends including some scripts to look up
words in a big word list, as when solving crossword puzzles or jumbled word
type puzzles. I use a word list called YAWL (Yet Another Word List) which
was packaged by Mendel L. Cooper and is available in
this
collection.
- wlu
(5.7KB) is an interactive script to look up words in a word list, given
a pattern of letters and/or wildcards. Revised 14Sep2004 to add
repeated-letter pattern matching capability.
- wlu-dj.sh
(5.8KB) is an version of 'wlu' that I run from an XP desktop shortcut
under DJGPP. The command line in the shortcut properties is
"c:\djgpp\bin\bash.exe -c c:/utils/wlu-dj.sh", and the working directory
in the shortcut properties is set to "c:\djgpp\bin".
- alu
(1.7KB) is an interactive script to look up SINGLE WORD anagrams of a given
string of letters.
- alu-dj.sh
(1.7KB) is 'alu' modified for DJGPP and Windows; see wlu-dj.sh above.
- plu
(4.9KB) is an interactive script that finds all possible solutions for
a single word of a simple substitution cryptogram by finding
dictionary words of the same number of letters and the same pattern
of repeating letters. This can be quite useful when applied to long words
with multiple repeating letters ...
- plu-dj.sh
(4.9KB) is 'plu' modified for DJGPP and Windows; see wlu-dj.sh above.
- xword.png
(214 bytes) is a 33x33 icon for 'wlu', 'alu', and 'plu' when they are run
from a Linux decktop shortcut. Remember that 'wlu' and 'alu' are
just shell scripts so you will need to specify "run in console mode" or
suchlike when setting up the shortcuts.
- xword2.ico
(2.2KB) is a 32x32 version for a Windows desktop.
More word-play:
- permu
(12.6KB) is an interactive script that displays all the permutations of the
letters in its user-supplied argument; the idea is just to save the
pencil and paper work when solving an anagram "the hard way".
- permu-dj.sh
(12.6KB) is 'permu' with its filename and a single 'define' changed for use
with DJGPP and Windows; see wlu-dj.sh et al. above.
Spelling:
If you have 'aspell' or 'ispell' installed on your system, 'speller.sh'
provides a convenient way to interactively check/discover the spelling of
SINGLE words. I find that 'aspell' is much more imaginative
(entertaining ?) in suggesting correct spellings, but 'ispell' is
less like to judge questionable spellings to be 'correct'.
- speller.sh (5.2KB) is can be used directly
from a desktop shortcut under Linux; as supplied it uses 'aspell' but it
should work fine to just change "aspell -a" to "ispell -a" if you want to use
'ispell' instead.
- spell-one.sh (247 bytes) can be used to execute
'speller.sh' from a XP desktop shortcut on Cygwin/XP; it just starts a
temporary Cygwin session in order to straightened out the Cygwin
paths and provides as 'rxvt' console that will disappear cleanly when the user
is finished.
Sudoku: Here is some exploratory stuff prompted by my discovery of
sudoku puzzles in the local news papers around the start of 2006. Suggestions
and comments will be greatly appreciated.
- sudoku00.c (17Jan06)
(21958 bytes) is a quick and dirty program to (attempt to) solve sudoku
puzzles; it reads a puzzle from the disk file specified on the command line,
and gives a one line rational for the actions it takes at each stage of the
solution.
- sudoku00 (17Jan06)
(19442 bytes) is the Linux executable compiled on my Slackware 10.1 machine.
- sudoku00.exe (17Jan06)
(35638 bytes) is a DOS/Windows executable compiled under DJGPP. It runs
fine on our XP machine as well as under 'dosemu' on the Slackware box.
- sample00.sud
(462 bytes) is a sample sudoku puzzle in a format understood by 'sudoku00'.
- sample00.txt
(746 bytes) is the sample sudoku puzzle in another the format understood by
'sudoku00'.
Miscellaneous simple programs, in 'C' source.
- getdate00-0.1.tgz
(8.1KB) is a little program to interactively set the Linux system clock
at startup time, in the manner of a BIOS setup routine. Its
README explains how it might be useful.
Exploratory code, part of my learning experience for various projects.
- pango-starter.zip
(5.0KB) is a set of three little C programs exploring Pango font processing
and metrics in Gtk+-2.2.2 / Pango-1.2.3, the first of which I found posted
to a newsgroup. These programs were used in the conversion of my CPT4
package from Gtk+-1.2.8 (June 2000) to Gtk+-2.2.2 (September 2003).
- gtk-static-notes.tgz
(3.6KB) contains some notes, scripts, and a sample makefile resulting from
my recent adventures in creating a statically linked distribution of my CPT4
package. The installation was for glib-2.2.3, pango-1.2.5, atk-1.2.4, and
gtk+-2.2.4, but the notes are probably be applicable to other versions as
well.