some of Lowell's useful system configuration

I run FreeBSD, use the bash shell, and currently run the X.Org version of the X Window System. I've broken these files up into categories: [X-based user utilities and configuration] [general file handling] [System scripts] ["Other"]

X-based user utilities and configuration

Should be useable under most Unix-ish systems, should be easily adaptable to most Bourne-like shells (and in the simpler cases, should run trivially on any shell).

xalarm
pops up an xmessage (with a message) at a specified time (using at(1)) or after a specified delay (using sleep(1)).
getup
pops up an xmessage periodically (using sleep(1)) to remind me to get out of my chair.
mc
biff-like script for checking mail on another system, using finger. Doesn't actually require X, but I tend to use xmessage(1) for output.
make-picture-webpage
Nifty little script that uses ImageMagick to make thumbnail images of a set of image files, and builds an HTML page of thumbnails linking to the full-size images.
.xsession
My .xsession starts twm under ssh-agent, to make ssh authentication pretty painless. Most of the interactive applications (and the whole window manager are passed to a shell running under the ssh-agent along with twm. Just be careful about where you configure agent forwarding to go: this is a potential security hole.
A couple of interesting features are using DPMS (to turn off the screen instead of a screensaver) and displaying a fortune(1) cookie in its own window at login.
.twmrc
I use the boring old twm window manager. I've tried others and found them prettier but no more functional (for me). Some of my customizations to twm are the reason for this: I put useful functions on function keys and most of the applications I use frequently on the middle-mouse-button menu.

System scripts

I assume these are fairly FreeBSD specific. See the FreeBSD handbook (particularly the section on making the world) before trying to do these things. Really. Don't build a system from source unless you know what you're doing; it's not that hard, but it's easy to destroy your system if you screw up. Such as having a different arrangement of disk partitions than I do, or hitting an error condition I never did.

Of course, you want to do these as root.

buildworld
runs make buildworld, dumping the output to /var/tmp
update-etc
builds a new version of the /etc files in /var/tmp [This isn't as useful as it was before mergemaster(8) came along, but it's still convenient at times.]
allupdate
runs cvsup, then does the buildworld/buildkernel (or makes port index, depending on how you set some flags). Can usefully be run off-hours from crontab. You need to set a flag to get the buildworld, and if you do that, you need to set a different flag to get the ports index rebuilt (I don't download the ports index; I build my own to be sure it's in synch and doesn't include the ports I don't cvsup).
mount-and-installworld
for doing the installworld in single-user mode. Partition names are hard-coded in; mounts everything async and noatime for speed.
system backup
based on Gnu tar and its listed-incremental backup capability. Handles multiple levels of backups. I've also developed a new version based on dump(8). I also have a little script based on split(1) which I use to break a backup into pieces and burn them to CDs, along with checksums to verify them.
autofs-to-amd
is a shell script that I use to trigger an awk script. This takes a autofs map (which in my production environment I get from NIS) and converts it into an amd(8) configuration, then restarts amd if necessary.

general file handling

dcase
renames a file to the same name but with all lowercase letters in the file name.
upcase
renames a file to the same name but with all uppercase letters in the file name.
renlower
renames a series of files to the same name but with all lowercase letters in the file name. There's no reason to use this if you remember how to build a shell loop.

Change filenames to change spaces to underscores: something like:
for a in * ; do b=`echo $a |sed "s/ /_/g"`;mv "$a" "$b" ; done

Other

burnMixCD
picks a random set of MP3 files out of a directory and builds a regular audio CD with those songs (normalizing the volume). Depends on cdrecord, normalize, and mpg123, all of which are in ports.
copyMP3s
version the above which copies MP3s into my USB (umass) MP3 player. Depends on mtools.
My essay on different goals for backup strategies.

Useful pointers

System Rescue CD
is a useful tool after some kinds of disasters. Primarily for Linux and to some extent Windows. FreeBSD has a fixit disk that works with the normal install disks, and also FreeSBIE, a LiveCD.
"FreeBSD: An Open Source Operating System for Your Personal Computer"
by Annelise Anderson, for new users
The Complete FreeBSD,
by Greg Lehey, for (in my estimate) people in between new users and experts.

last modified: 10:57am, Saturday, 20 May 2006 by Lowell Gilbert.