Scott's Perl Scripts




With all scripts, be sure you set permissions properly, and change the path to your perl executable in the first line if necessary, along with any other path-related things you may find in the source modules.

All of these are completely FREEWARE. Use them all you want, send me stuff only if you want.. an e-mail would be nice. :] ENJOY!

These files are not necessarilly commented well, nor are there major descriptions on configuring them. Some knowledge of perl/programming is *required* to use these.

No warranty is either expressed or implied over these. Use them at your own risk. No support is given for them either. You break it, you figure it out.


Quick index

Gamma - command line interface to DarkAdapted X
Chango - Multidisc Changer MP3 Cache utility.
DIRectory Tool - directory stack tools for any shell
FAQ Builder - Make html FAQ's
JCapture - Webcam effects generator
JIRC - IRC Bot Skeleton
JLJ - Text-Only LiveJournal entry device
Music Review Database
DS: OS X Dock Switcher script
M3S: iTunes volume database file creator
Naridesh: A perl webserver
Open - A simple file opener
URL - dumps the URL for files in your tree



gamma v1.0

a simple command line interface for DarkAdapted X's gamma controls




Chango v1.0

Chango is a system for cacheing MP3 files from multidisc cdrom drives. Since you can't actually mount different discs in the same physical device simultaneously, this software will cache the files you need off to a predetermined cache, so that all of the needed files will be available simultaneously.




DIRectory Tool v1.3

DIRT is a simple directory stack utility, that lets the user use the same directory stack across terminals, and sessions. It also manages multiple stacks of directories.

You must change the absolute path to the "dirt pile", the file that stores the stack. You also must add in the aliases for your shell. Included are the aliases needed for C-SHell and borne shell. You will need to write them up for your own shell.




FAQ Builder v1.0

Generates an html document based on the questions & answers as stored in the data file.

This does not support multiline questions, and will probably barf on bad files, but it works fairly decently.
the sample file is a FAQ for the FAQ Builder. ;)




JCapture v1.0

An automatic Webcam image grabber & image manipulator. Call it from your crontab once a minute, or however often you want to update the image.

A working installation of ImageMagick is required for this to run properly. I also use CQCam v0.90p7 to capture the image. You will need to change the associated lines in the file where necessary to adjust for paths to the proper executables on your machine.

I wrote this one because I saw a bunch of webcams that used ChillCam for Windoze, but nothing like that existed for linux... so, here it is:




JIRC v1.02

This is meant to be a simple bot structure onto which you can put whatever logic you want.

I have some simple code in here now, such that if you /msg it, it will spit out the text msg'd to it out to the channel it is in. If you /describe to it, it will emote what you ask.

This is probably enough to get a simple bot off the ground. Just add code into the *_handler functions.

LIMITATIONS:
  • error codes from the server are NOT CHECKED yet
  • only tested on slashnet and undernet.

FEATURES:
  • reads in configuration from an external file.
  • connects to multiple channels on the server.
  • will cycle through multiple servers 3 times, until it gives up.
  • decodes CTCP messages.
  • automatically PONG's the server.

Yes, it's pronounced "Jerk".




JLJ v2.12 (2006-01-30)

Imitation goat.

JLJ is my
LiveJournal entry system. It is very simple to use. Just setup a .livejournal.rc file in your home directory with your username and password, and run the jlj script.

It prompts you for your Subject and Body text, and sends it off.
If you have either the shell variable "EDITOR" ir "VISUAL"set, it will use that instead of the Old School BBS style editor.

It lets you make, edit and postpone entries on or offline. You can queue up posts to be submitted when you connect up to the net, or leave them in your postponed folder indefinitely.

It only requires the base install of perl and the socket libraries, which should be installed on most unix based systems. This might work on some ports of perl off of unix-based systems, but I highly doubt it will work.






Jerry's Music Review Database v1.0

When I buy new music, i add it into this database, run the perl script, and, whammo; a nice cross-indexed html document.

Just be sure to change in your homepage name and stuff to the .pl source file. You also can change the name of the data file and the generated html file in there as well.




DS: OS X Dock Swicher hack script v1.0

DS (Dock Switcher) saves aside your dock preferences file (.plist) and swaps around these files at your command. You can then switch in different dock configurations for doing different tasks on your Mac. (Tested with OS X 10.2.5)



M3S: iTunes volume database file creator v1.6

Creates a magic file called "ContentsDB.xml" for your removable media so that iTunes thinks that it made the disk itself. (MP3 cds will appear magically within iTunes when this small playlist-like file exists.)

1.6 fixes a few bugs with 1.0, and has better track number and disk ID support.




Open: A simple file opener v1.0

Just checks with the command "file" as well as the extension on the file to "do the right thing" with it. Edit the source to make the appropriate commands for your own use.



URL: dumps the URL for files in your tree v1.0

Prints out the contents of a directory, the directory itself, or the individual files in a directory as links to them, if they are within your html tree. Be sure to set the configuration at the top of the file when you install this. (Single user only!)
It will print out the urls as raw URLs (-r), a href links (-a), image links (-i), for a mud (-m), or for a UBB (-u),(-y)



Naridesh: A Perl Webserver v1.08

This one i made on a dare pretty much. I was explaining how to use sockets in Perl to a friend, and I mentioned in passing, "Hey, I bet I could write a webserver in perl." Within a day, version 1.00 was working. It's since gotten some pretty nice features, and a nice configurable interface.

NOTE: It is single-threaded, and sometime barfs on huge files.

If you have a symbolic link to a url, ie:
      ln -s http://www.freshmeat.net freshmeat.html
It will follow "freshmeat.html" to the url listed. It need not have a .html extension. The server figures it out, and generates an auto forward for you automagically.

All server configurations are set in the main "naridesh.pl" file. Experiment with them in different combonations to see what does what.

All files listed here are required to get it to run. The "naridesh.lib" file was added so you can make the server run server-side programs if you want it to. Do note that this is a potential security problem. You can change the "root path" in the server file to be whatever you want. I'm not sure i finished it though. I couldn't use "chroot", as this is a user process, not a root process.

Incidently "Naridesh" is a mangling of "Sheridan" reversed. Sheridan is the character played by Bruce Boxleitner on the sci-fi TV show, "Babylon 5". There's no real reason for using the name other than I like the way it sounds. :]