larg's script library

A script archive is a store of scripts. A script is a small program written for a command interpreter or another scripting language. See http://en.wikipedia.org/wiki/Scripting_language. A script archive is also known as a script library.

This archive is hundreds of simple little sysadmin scripts I wrote over the years. I dumped a load in a folder.

my scripts
title description
00-firewall.sh simple firewall for xcl01
audio-6mix.sh record a BBC AOD (Audio On Demand) stream from realplayer to MP3
audio-breezeblock.sh record a BBC AOD (Audio On Demand) stream from realplayer to MP3
css-check-http Cisco CSS script to get a web page using HTTP and check the result
css-check-https Cisco CSS script to get a web page using HTTPS and check the result
date.pl date subroutines
db-multi2csv.pl convert multiline records to comma seperated value records
db-sqlplus.sh set oracle enviroment variables and run sqlplus
db-tnsping.sh contact the oracle database "db01"
dir.pl directory subroutines
dir2html.sh turn a directory into an HTML page of links
dir-check-md5.sh generate a checksum of a directory index
dir-compare-01.pl compare directories on two hosts using Net::Telnet
dir-compare-02.pl compare directories on two hosts using Net::Telnet
dir-copy-scp.sh copy IWS6 directories from one host to another
dir-each-file.pl do something with a series of files in a directory
dir-last-modified-filter.pl find the youngest file in a list supplied from the command line
dir-make-dirs.pl create all missing directories in a path
dir-monitor.sh check the news files and restart the process if nothing new arrived
e-mail-backup-queue.sh take a directory full of messages and back them up
e-mail-dir2uid.sh translate netscape message server directory name to user ID
e-mail-file.pl e-mail a text file using sendmail
e-mail-file-latest.pl e-mail the latest log in a dir
e-mail-file-mime.sh Send file attachments as MIME mail
e-mail-form.pl submit an HTML form, post an e-mail, display the result
e-mail-form-fail.html see e-mail-form.pl
e-mail-form-lib.pl see e-mail-form.pl
e-mail-form-message.txt see e-mail-form.pl
e-mail-form-submit.html see e-mail-form.pl
e-mail-form-success.html see e-mail-form.pl
e-mail-headers.txt e-mail headers
e-mail-inbox-clean.pl delete old e-mails
e-mail-re-mail.pl take a directory full of e-mail messages and send them again
e-mail-send.ksh bulk e-mail to a list of recipients using sendmail
e-mail-sendmail-m4-macros.mc sendmail macro fun
e-mail-sendmail-Makefile.txt sendmail makefile fun
error-generator.pl generate errors using diagnostics
file.pl collection of file subroutines
file-archive-filter.pl archive a load of vignette projects
file-copy-cp.sh copy files in a docroot using cp
file-copy-ftp.ksh backup directory server DB using tar and ftp
file-copy-ftp.pl copy a file from hosts using Net::FTP
file-copy-ftp-put.pl copy a file to many hosts using Net::FTP
file-copy-hosts.bat copy the hosts file from the shared drive to your PC
file-copy-lftp.sh synchronise files using unison and lftp
file-copy-rsync.sh copy my docroot to many web servers using rsync
file-copy-rsync-2.sh run lots of rsync file copies
file-copy-rsync-wrapper.sh copy my docroot to many web servers using rsync
file-copy-scp.sh copy a directory using tar and scp
file-copy-scp-2.sh scp directory contents from a remote host
file-copy-unison.sh sync files on USB store with FAT32 disk and ftp mirror
file-copy-wget.sh copy files using wget which uses ftp
file-delete-old.pl recursively delete old files using using File::Find
file-edit-replace-all.pl Replace one string with another in files in one dir
file-edit-replace-all.sh Replace one string with another in files and subdirs
file-edit-replace-all-2.sh Replace one string with another in files and subdirs
file-edit-replace-all-3.sh Replace one string with another in files and subdirs
file-line-filter.pl rearrange date in each line
file-strip-chars.pl stupid chevron stripping program
file-write-filter.pl write STDIN to a file
fish.htm Simple Flash wrapper page
fish.swf Simple Flash animation of a cartoon fish
ftp-.netrc.txt .netrc example file
ftp-get.pl copy a file from another host using Net::FTP
ftp-get.sh get a file from another host using ftp
ftp-get-2.pl copy a file from another host using Net::FTP
ftp-put.sh copy a file to a remote server using ftp
getVars.html submit a form using post or javascript
host-ascii-map.txt ASCII shapes for mapping hosts in an ASCII art diagram
host-status.sh display the status of the host
include.conf see log-diet-with-report.pl.README
ldap_config.conf LDAP scripts configuration file
ldap-add.htm see ldap-add.php
ldap-add.php add a record to an LDAP directory
ldap-base64-filter.pl read base64 encoded lines from STDIN, write unicode to STDOUT
ldap-client.pl read a record from directory servers using Net::LDAP
ldap-delete.php remove a record from LDAP directory
ldap-index.htm homepage linking to PHP scripts which do LDAP things
ldap-ldapdelete.ksh delete entries in an LDAP database using iplanet ldapdelete utility
ldap-ldapmodify.conf see ldap-ldapmodify.ksh
ldap-ldapmodify.ksh change entries in an LDAP database using iplanet ldapmodify utility
ldap-ldapmodify.ldif see ldap-ldapmodify.ksh
ldap-ldif2delete.pl read LDIF files, make LDIF delete records for all except ones in a list
ldap-ldif2ldif-filter.pl read one type of ldif record from STDIN, write another to STDOUT
ldap-ldif2ldif-hash.pl read a bunch of LDIF files, modify and write to another LDIF file
ldap-ldif-add.conf see ldap-ldif-add.sh
ldap-ldif-add.ldif see ldap-ldif-add.sh
ldap-ldif-add.sh add entries to an LDAP database using the iplanet ldapmodify utility
ldap-ldif-create.pl create thousands of test employee LDIF records
ldap-ldif-person.ldif sample LDIF employee record

ldap-ldif2csv.pl

read an ldif file, select some data and print a CSV file.
ldap-list.php list a bunch of records
ldap-modify.htm see ldap-modify.php
ldap-modify.php change a field in someone's record
ldap-modify-2.ldif sample LDAP modify LDIF records
ldap-ping.pl read a record from LDAP servers
ldap-restart.sh directory server init
ldap-restart-all.sh Directory server rc script
ldap-restore-backup.ksh replace current ldap db with a backup db
ldap-results.php directory search and display test
ldap-search.conf config file used by ldap-search.sh
ldap-search.htm search page for ldap-search.php
ldap-search.php directory search for ldap-search.htm
ldap-search.pl ask LDAP for a test entry
ldap-search.sh ask LDAP for a test entry
ldap-search-2.pl ask LDAP for a test entry
ldap-search-3.pl LDAP search - Graham Barr's example
ldap-search-4.pl return an LDAP record from the LDAP database
log-access-top-visitors.pl report on an iplanet access log
log-batch-summary.pl summarise a bunch of XML records without proper parsing
log-day-to-file.pl chop a day's worth of log entries out of one file and write them to another
log-diet.sh copy non-matching lines from one file into a new file
log-diet-with-report.pl copy non-matching lines from one file into a new file
log-diet-with-report.pl.README see log-diet-with-report.pl
log-firewall.log see log-firewall.pl
log-firewall.pl yet another log report, on the suse firewall log file
log-for-period.pl report using log files covering a specific time range
log-for-period-1.pl make a list of log files that cover a certain time range
log-gunzip-combine.sh unzip a set of log files and combine into one
log-gunzip-combine-2.sh recreate access log from compressed fragments
log-match-report.pl check a list of regexes against a log file
log-monitor.pl monitor a log and report certain errors
log-more-lines.pl has a log had any more lines written in it?
log-multiline.pl summary report on a log file with multiple line entries
log-multiline-2.pl summary report on a multiline log file
log-multiline-sort.pl put paragraph entries in a logfile in alphabetic order
log-parse.pl read a logfile and write a session description for each customer
log-per-minute.awk report how many log entries found for each minute
log-per-minute.pl report how many log entries found for each minute
log-per-minute-today.pl count today's lines per minute in log
log-recent-users.sh Find all accounts in a domain that have been accessed recently
log-rotate.pl rotate logs using Logfile::Rotate
log-rotate.sh rotate a log and signal syslog
log-rotate-2.sh rotate a list of logs
log-rotate-iws.cron see log-rotate-iws-2.sh
log-rotate-iws-1.sh Rotate IWS6 server log files
log-rotate-iws-2.sh rotate and filter IWS6 access and error files
log-top-e-mail-senders.pl list message senders grouped by ISP and the quantities they send
log-top-e-mail-senders-2.pl list message senders grouped by ISP and the quantities they send
log-top-messages.pl read a set of logs and write a report on the most common messages
mq-check.pl make sure a status check responds within a few seconds
net-calc-netaddr.pl calculate network address from IP and netmask
net-ip-list.pl list all IP addresses in a subnet using NetAddr::IP
net-ip-list-2.pl list IP addresses in a block using NetAddr::IP
net-ping-subnet.pl Ping all hosts in subnets using Net::Ping
net-ssh-exec.sh SSH to a group of hosts and run a command
net-ssh-exec.txt see net-ssh-exec.sh
net-ssh-exec-2.sh execute command using a list of servers
net-ssh-front-end.sh display a menu of hosts and ssh to choice
net-ssh-front-end.txt see net-ssh-front-end.sh
net-traceroute.sh traceroute to a couple of hosts
perl-mod-install.sh install several perl modules
ping-hosts.sh ping several hosts
port-tcp-state-count.awk print a summary line on the state of two TCP ports.
port-tcp-state-count.sh how many TCP connections we have in each of a number of different states.
port-tcp-states-linux.sh print a list of TCP connection state counts
port-tcp-states-linux-2.sh print running totals of TCP connection state counts
port-tcp-states-solaris.sh print a list of TCP connection state counts
proc-check.pl check processes are running
proc-check.sh check processes are running
proc-check.txt see proc-check.sh
proc-daemon.sh an attempt to make a daemon
proc-kill.sh Kill certain sessions
proc-list.pl report on processes - types, counts, total, etc.
proc-list-ldap.sh display directory server processes
proc-max-cpu-alert.pl Report any excessive CPU load using MyTrap and e-mail
proc-max-cpu-alert-2.pl Report any excessive CPU load using MyTrap and e-mail
proc-most-cpu.sh display the biggest CPU hog with a datestamp
proc-server-control.ksh the most rediculously comprehensive startup/shutdown script I have seen.
proc-top-10-cpu.sh List the top ten CPU-hungry processes
proc-top-10-mem.sh List the top ten memory-hungry processes.
proc-watch.sh continuously check certain processes are running
proc-zombie.sh make a zombie process
program-command-line-filter.pl a skeleton program for making a command line filter
program-skeleton.pl a skeleton program to add task meat to
program-skeleton.sh a skeleton program to add task meat to
prtdiag.sh a linux version of the solaris command "prtdiag"
ssh-key-distribute.sh manage user keys for ssh on multiple hosts
ssh-key-distribute-hosts.txt see ssh-key-distribute.sh
ssh-key-distribute-users.txt see ssh-key-distribute.sh
tar-todays-files.sh backup today's files
telnet-hosts.pl execute a command on several hosts using telnet
telnet-hosts-2.pl execute a command on several hosts using telnet
telnet-many.pl telnet to several hosts and execute a command
telnet-report.pl gather bits of info from several hosts using telnet
telnet-report-2.pl get a report using telnet and a CLI
unix-profile set up solaris environment for korn shell and bourne shell
usenet-status.sh display a status report of the usenet news host
user-test.sh user test code fragment
web-server-create-apache-vhost.sh Apache VirtualHost management tool
web-server-css.sh print css config rules
web-server-i-c-1-if.sh clone an iplanet webserver, print cisco css config
web-server-i-c-2-ifs.sh clone an iplanet webserver, print cisco css config
web-server-iplanet-clone.sh copy a sunone webserver
web-server-iplanet-clone-1.sh copy a sunone webserver
web-server-iplanet-clone-2.sh copy a sunone webserver
web-server-missing-files.pl list missing docroot files using the webserver error log
web-server-rc-apache.sh rc script for one apache web server
web-server-rc-apache-2.sh another apache init control script
web-server-rc-iplanet.sh rc script for many iplanet web servers
web-server-restart-netscape.sh web server admin utility for operators
web-server-test.pl a test web server which displays client requests
wls-init.sh BEA Weblogic server init script
wls-status.sh BEA Weblogic server status
wls-stop.sh BEA Weblogic server stop
www.css simple cascading style sheet
www-calendar.pl Larg hacking Selena Sol's Calendar Demo
www-cgi-info.pl print env, CGI methods, perl modules in a web page
www-cgi-info.sh print env in a web page
www-client-get.pl time web page fetching from a bunch of different servers.
www-client-post.pl post XML to a bunch of web servers, report how long it took
www-cookie.pl set and receive an HTTP cookie
www-env.pl cgi-bin test script
www-env.sh cgi-bin test script
www-fetch-lynx.sh get a web page using lynx
www-fetch-simple.pl get a web page using LWP::Simple
www-fetch-sockets.pl get a web page using IO::Socket
www-file-html-replace.pl add blocks of text to an HTML document
www-file-shifter.htm HTML test page for www-file-link-shifter.pl
www-file-shifter.pl move pages listed in an HTML TOC file from one dir to another
www-file-title.pl read the file name and title of an HTML document
www-form-e-mail.pl print a web form, e-mail the results
www-form-save.html store a form example
www-form-save.pl store form details in a text file and display an HTML results page
www-form-save-fail.html see www-form-save.pl
www-form-save-success.html see www-form-save.pl
www-form-skeleton.pl print a simple web page with a form
www-hello-world.htm simple HTML test page
www-hello-world.php print a PHP info web page
www-hello-world.pl print a simple web page using perl
www-hello-world.shtml simple shtml test
www-next-serial.php read the current serial number, write the next
www-page-skeleton.pl print a simple web page using the CGI module
www-password-generator.php password generator
www-regex-escape.pl escape a string so it can be used in a regex match
www-server-info.pl HTML report showing what perl modules are installed
www-sitemap-generator.pl Perl site map generator (Unix)
www-skeleton.html empty HTML page
www-test.php execute "ls" and put the results in an HTML page
www-text-to-table.pl turn a text file full of fixed width fields into an HTML table
www-text-to-table.txt see www-text-to-table.pl
www-validate-fields.html field validation using javascript
xml-extract.pl parse the xml from a file and print bits
xml-fetch.pl get a page from a server
xml-in-html-out.pl parse an xml file and print a web page