Welcome to my Junkcode!
What the hell is this?
Andrew "Tridge" Tridgell came up with the idea of having a junkcode directory. Basically it's a place to store all the snippets of code you write that aren't particularly useful by themselves but that you find useful as part of another task. He actually gave a lecture on the subject and his slides are
here [PDF]. So, below are some snippets that I find useful to re-use or just look at for reference. More than likely it won't help
YOU very much but.....you never know!
CAUTION: Some of this code could damage or destroy your data if used in its current form. Do NOT run it if you don't know what it is going to do. I am not liable for the destruction of data or downtime experienced by using anything on this page.
- .kshrc My Korn Shell profile. Includes a few little functions
- check_nic This one isn't mine, I stole it from here. It is really handy for finding out speed/duplex settings on Solaris (because it's a right pain otherwise).
- check_switch_v1.tcl This is an expect script I wrote that goes and collects the running config from a cisco switch via a Cyclades. It's a bit dodgy and I didn't know about the terminal length 0 command at the time. Nonetheless, it works.
- ds A tool to determine how many files are in a directory and how big they all are.
- get_label.ksh A script to fetch the label off a tape in a tape drive on solaris
- ipdadmin.ksh A mega-basic front-end for the Tivoli Access Manager pdadmin utility (the i is for interactive)
- lookat A script to print the definition of an object in memory on an F5 BigIP
- make_pages.ksh The script used to generate this site. All the HTML is stored in .body files and there is a skeleton.html that gets wrapped around them. Easy way of looking after the menu.
- mp3ify A script I wrote to convert my Ogg files into MP3s when I bought an MP3 player (the Ogg player was too expensive).
- namechange A script I wrote to replace $1 with $2 in all files in /etc. I was changing hostnames at the time. I would NOT recommend running this.
- netstats.ksh A script to run netstat and report on how many packets came through since it started
- nice_vmstat.ksh Takes vmstat input and formats it nicely
- qnd.ksh qnd (quick 'n dirty) runs a runqmsc (IBM MQ Series) command through grep
- scan_library.ksh A script I wrote at a site where we ran Amanda. I don't know if it was just ornery or if it had been set up wrong, either way, if you tried to scan the library and it found an unlabelled tape it would fill up its log file (and /var) with scsi errors. This script got around that.
- watch_machine.ksh This script does a tcpdump on an interface and runs vmstat whilst polling the mailq and checking how many sendmail processes are running.
- update_sig.pl A tiny perl program to fetch virus signature updates.