everything in life is easier when you can automate it with a shell script. here are some of the ones i've written, maybe you'll find them useful. there's no warranty, or guarantee, or anything like that, of course. anything that breaks or goes poorly it's
your fault. <g>
- xen console
attach to a xen domu via its tty using 'cu' instead of 'xm console'
- hobbit monitor
hobbit can't alert you to a downed machine if it's down, so this script watches the watcher and sends an email if hobbitd stops responding
- CSDB generator
generate a CellServDB based on a text file list of cells
- pkgsrc-mini
this tool will, given a netbsd pkgsrc name (like "misc/screen"), go out
and retrieve the pkgsrc files and distfiles needed (and only
those needed) to build the package and rolls them into one tarball.
right now it doesn't handle packages that require X11 yet, i still
don't quite grok how pkgsrc sets all of its dependency variables.
mostly it makes my head hurt. also, yes. this shell script is
recursive.
- rndbits
spits out an arbitrary number of hexadecimal bits. suitable for wep
keys and whatnot.
- arpspoofwatch
because some bastard in my favorite coffee shop was ettercapping the
wireless network (way overkill, i know. his loss, my gain) i wrote
this script that monitors for suspicious looking entries or changes
in the arp table. it uses the
growl
framework to alert the user of changes. i've also rolled it into an
os x application bundle here (
zip)
suitable for running as a login item in os x.
- backupcd
takes a date string (YYYYMMDD) as an argument and creates an ISO
of all .tgz files from that date. it then mounts the iso on a
loopback device and verifies the md5 hashes.
intended as a companion to backupworld.
- backupworld
backs up users' data and configuration files into a series
of .tgz files, in the format `hostname -s`-YYYYMMDD-[contents].tgz
- burncd
creates an audio cd. run it from a directory containing MP3 or
OGG files (or both). converts mp3s and oggs into wav, and burns
them to cd with `cdrecord`. takes device name and burning speed
as the arguments.
- checkconns
parses `netstat -an` to determine what hosts the computer is
currently connected to (or which hosts are currently connected
to the computer)
- dshieldblock
takes in dShield's Recommended Block List and adds it to the pf
table <dshield>. requires the following in /etc/pf.conf:
table <dshield> persist
block in quick from <dshield> to any
also requires DShield's pgp key
0xA32BC885 in root's gpg keyring
this list changes daily, so it would probably be best
implemented with an @daily entry in root's crontab
- getpictures
requires root access via sudo
pulls all pictures off a digital camera with `gphoto2` and saves
them into the directory ~/pictures/YYYY/MM/DD/. changes
ownership of files to the uid that invoked the script.
- patchcheck
checks ftp.openbsd.org for new patches and notifies the
administrator of any changes via email. this script requires
that already-applied patches be kept in /usr/patches/. it also
does not gracefully handle network outages. you may see emails
suggesting that all the patches need to be applied. this is, of
course, generally not the case. you can also strip the `mail`
bits out and include this script in your /etc/security.local to
run it daily and be notified in your daily insecurity output.
- sshdbrute_block
parses the authlog for ips that have had more than 4 failed
user logins and adds them to the pf table <sshdbrute>.
requires the pf.conf entries
table <sshdbrute> persist
block in quick from <sshdbrute> to any
i run this every five minutes out of a crontab entry.