| |||||||||||||||||||||||||||||||||||||
Wicked Cool Shell Scripts: The LibraryThere are 101 scripts discussed in this book, but in fact there are closer to 150 scripts available, in total. Here's how you can get them if you'd like. You are welcome to do this if you don't have the book, but it'll make a lot more sense if you do have "Wicked Cool Shell Scripts", of course. Note that you can also download the entire set of scripts as AllFiles.tgz. Just make sure you unpack the scripts into their own directory!
given a one-line-per-entry datafile, this
script will randomly pick one and display it. Best used
as an SSI call within a Web page.
html sample file for script #76, randomquote.
traverse all internal URLs on a Web site, reporting
any errors in the "traverse.errors" file.
traverse all internal URLs on a Web site to build a
list of external references, then check each one to ascertain
which might be dead or otherwise broken.
use the 'aspell' feature + lynx to spell check either a
Web page URL or a file.
html sample footer information for script #80, apm.cgi
Apache Password Manager - allows the administrator to easily
manage the addition, update, or deletion of accounts and passwords
for a subdirectory of a typical Apache configuration (where the
config file is called .htaccess)
Perl script for sites that don't have an htpasswd with a -b flag
Given a target directory on an ftp server, make sure that
all new or modified files are uploaded to the remote system. Uses
a timestamp file ingeniously called .timestamp to keep track.
Given a source directory on a remote FTP server,
download all the files therein into the current directory.
Given a target directory on an sftp server, make sure that
all new or modified files are uploaded to the remote system. Uses
a timestamp file ingeniously called .timestamp to keep track.
If anything's changed, Create a tarball and sync a remote
directory via sftp using sftpsync.
analyze an Apache-format access_log file, extracting
useful and interesting statistics
extract and analyze search engine traffic in the
referrer field of a Common Log Format access log for a
specified domain name.
extract and analyze search engine traffic indicated in the
referrer field of a Common Log Format access log.
scan through an Apache error_log file and report the
most important errors, then list additional entries.
list of files to back up, for script #87, remotebackup
This script takes a list of files and directories,
builds a single archive, compressed, then emails it off to a
remote archive site for safekeeping.
a simple script to ensure that only the four most recent
messages remain in the users mailbox.
given an input stream with a uuencoded archive from
the remotearchive script, this unpacks and installs the archive.
analyze and summarize the FTP transfer log.
every 'n' minutes, grab netstats values (via crontab)
analyze the netstat running performance log, identifying important
results and trends.
renice the job that matches the specified name.
watch for the specified process name, and renice
to the desired value when seen
add a virtual host to an Apache configuration file
list users in the Mac OS X NetInfo database
note that Mac OS X also has an /etc/passwd file, but that's
only used during the initial stages of boot time and for
recovery bootups. Otherwise, all data is in the NetInfo db.
add a new user to the system, including building their
home directory, copying in default config data, etc.
add a new alias to the email alias database on Mac OS X
this presumes that you've enabled sendmail, which can be kind of
tricky. Go to http://www.macdevcenter.com/ and search for 'sendmail'
tell the Mac OS X Terminal application to change its name
to the value specified as an argument to this succinct script.
list your iTunes library in a succinct and attractive
manner, suitable for sharing with others and using (with diff)
to ensure that you have synchronized iTune libraries on different
computers and laptops.
a smart wrapper for the cool Mac OS X 'open' command
to make it even more useful. By default, open launches the
appropriate application for a specified file or directory
based on the Aqua bindings, and has a limited ability to
launch applications if they're in the /Applications dir.
pick a word, scramble it, and ask the user to guess
what the original word (or phrase) was
a rudimentary version of the hangman game. Instead of showing a
gradually embodied hanging man, this simply has a bad guess countdown.
a state capital guessing game.
|
| ||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||