These are some handy Perl and Expect scripts that I have made
recently. They are for use on Linux, but should be flexible
enough to easily be ported elsewhere. I have found them useful.
Here are my scripts! Download. (very
Here are 3 scripts that each operate on a given directory. They
process all the files and directories beneath that directory,
extsize.pl File Extension Size
This will find all files in the given directory and group them
It will then tell you how many total files and total bytes are
taken by each extension.
Handy for finding what is taking up so much disk space!
dupedetect.pl File Duplicate Detector
This will find all duplicate files in the given directory, and
also find files that have a length of zero (mostly useless files
that can be safely deleted).
All files are properly compared using a byte-for-byte
comparison, so it will catch duplicates even if they have
mp3wav2ogg.pl MP3-and-WAV to OGG Converter
This will find all MP3 and WAV sound files in the given
directory, and convert them into
the increasingly popular OGG sound format.
Not only will this save disk space, it will also save money!
All MP3 and WAV files will be backed up, so you can go back if
you do not like the conversion.
MP3 files are converted to WAV as a temporary step, before
finally converting to OGG.
And here are 3 more scripts that form a "suite":
makeipwebpage.pl Make IP Web Page
This creates a HTML page containing details of
your current Internet connection.
This is useful if you have a dynamic IP address that often
changes (such as dialup, DHCP, or PPPoE).
The other 2 scripts here can be used to upload that HTML page
to a webhosting provider, so you can access it from a remote
location and learn where your machine is.
scpupload.exp Upload File to SSH Server
This is an Expect script that executes the scp command
and automatically enters your password when asked. It also
answers "yes" to the "Are you sure you want to connect" warning
that sometimes appears. This makes it much easier to automate
the use of scp.
This script uploads a file to a host and username that are
preset in the script. That way, they do not need to be
repeatedly entered on the command line.
uploadip.pl Upload IP
This uses the above 2 scripts to make a webpage containing your
machine's current IP address and upload it to your website!
This script can be set up to run automatically when your PPP
connection is established. That way, you will always be able
to find your machine online!
Extensive documentation is provided with each script. Please
read the comments at the beginning of each script.
These scripts are free to use for personal use, and to redistribute
under the GPL. Please do not redistribute them
in any other way without first asking me.
If you have any questions please let me know!