Miscellaneous Development


All of the projects here don't really fit into any of my other categories of programming so I heaped them all into a cleverly named "Miscellaneous" section. Browse through and send me an email if there's something you like, you don't like, or something simply doesn't work.

Emacs User I Am
I've been asked how I was even hired at my current employers being an emacs user. Well I simply didn't tell them I was an emacs user during my interview. I'm not religious about emacs either, nor am I biased against vi, it's just that I was shown emacs before vi so that's what I learned and that's what I know. And I try to know it as well as I can. Below you can download or view my .emacs file as well as other contributions I've made to the emacs community. This will probably (read: hopefully) be a growing list.

My Emacs Config File:  .emacs
I've seen many more complicated and lengthy .emacs files so I wouldn't say my .emacs file is anything special but it has some functionality that I find very useful and hopefully so do you. In addition to the basic customized coloring, tabbing, and so on I also wrote a few Lisp functions of my own to do things such as insert date- and time-stamps, reindent an entire buffer, and bring up the man- and info-pages for the current word in a different window (splits the current window). I have also done some custom syntax highlighting for the C, C++, and SQL programming modes and have added php-mode and my own jil-mode support and file associations to my .emacs file.

AutoSys JIL Programming Mode:   jil-mode.el
AutoSys is an advanced job scheduling system similar to cron but much more advanced. Instead of crontabs they have JIL scripts (JIL is short for Job Instruction Language) that allow you to organize jobs and execute them conditionally and non-linearly instead of having a bunch of commands that always run at the same time. This tool is used where I work so to help me out I decided to write a JIL programming mode for emacs that does custom syntax highlighting and auto-indenting. It's not quite complete but it does support all of the basic features including C-style comments and I've even added some extensions that are specific to the company where I work. Check out my .emacs file if you want to know how to associate .jil files with this programming mode. To install, just place the .el file in with your emacs/site-lisp folder. If you have questions or comments, email me

Linksys DSL Router IP Grabber
This is a short and simple Perl script I wrote to get the IP address of a Linksys Etherfast Cable/DSL Router Model BEFSR41. The reason I wrote this script was because I didn't want to cough up the extra dough to get a static IP address through my DSL provider but I wanted to host a webpage. Simple enough: just sign up for a dynamic IP service. Unfortunately I noticed it was somewhat common for you to provide your IP to the service (guess it's too difficult for them to figure it out on their own). So I was on a mission.

I read through the manuals of the router I had and there was no way to connect except through port 80 via HTTP. After debating whether I wanted to learn the HTTP protocol I found a very cool Perl module named LWP which was exactly what I needed, plus with the power of regular expressions I could easily grab the IP by faking a session with the router administration pages. Plus I got to learn Perl along the way. The cool part about my script is that it grabs the IP without leaving your internal network. The only other ways I know of to get your external IP are to go outside your network and do some kind of lookup on the network from which you are coming from which is pretty slow and would be much more difficult to mimic through scripts (well, maybe). Anyway, here's the stuff you really came here for:

Download:   routerip.zip

Installation
Like I mentioned previously, this script requires the LWP (libwww) Perl module to run. If you want to do a manual install you can find the module on CPAN. An easier way is to run the following command from a shell:

perl -MCPAN -e 'install Bundle::LWP'

Execution
Once you've installed the LWP module, you're ready to run the script. If you're in Windows or some other non Unixy environment 'perl routerip.pl ' should work. Otherwise, you can just set the executable flag for the script and run it as any other executable file. There are some command line arguments. Here's a quick explanation:

Usage: routerip.pl [ password [ internal_ip ] ]

'password' is the password you normally use to login to your router. The default is 'admin'. The internal IP address of your router can also vary so 'internal_ip' refers to the router's internal IP address. The default for the internal IP is 192.168.1.1. The router doesn't seem to care about the username so I just use 'admin'. I should probably mention that I have the most recent firmware version of the router so I don't provide any guarantee that this script will work on firmware versions other than those listed below. Of course, I don't know if this script will work with any other Linksys routers but the model I have so shoot me an email if you try it out and find that it works so I can maintain a list of compatible routers.

Firmware Versions
My routerip.pl script is known to work on the following firmware versions for the Linksys Etherfast Cable/DSL Router Model BEFSR41:


Quest for Dragon Eye


This is a game I developed for the TI-85 graphing calculator over the summer of 1997. It's a dungeon crawler written in Basic that has graphical and text components, something you don't see in many games written in Basic for the TI calcs since Basic runs pretty slow on the calcs. I did a lot of work making the tile renderer not only as fast as possible but also reusable. If you download the game, you get not just the game, but also a map editor for designing your own maps, and a map viewer for seeing what the existing maps look like.


I've thrown together as much information as I could collect about this game. You can download the same game from TI-Calc.org but I've got some extra goodies here you might like taking a peek at. In addition to a handful of screen shots I've also got the intro story (above), the key mappings in the various game modes, and all of the monster stats.


There are a couple of things you should be aware of too. The game is by no means complete. I had finished writing the game but I lost the source code for the final version and I don't intend on taking the time to rewrite the ending and fixes a handful of bugs and unfinished features. But it's definitely playable and kinda fun. Also, if you've got good natural vision then you may want to reconsider playing this game. Due to the small screen size and slow Basic interpreter I made the main character a single pixel. This allowed me to use 9x9 tiles but it makes the hero difficult to find if you are continuing a quest or you lose track of where he is on the map.


Now for the download. The following zip file contains the binary that can be sent to the TI-85 via a link cable or it can be used in an emulator. You might need a version 10.0 ROM for your TI-85 emulator for the package to work correctly. I use TI-Graph 2.0 and it works pretty good for my needs. You do need a version 10.0 ROM to use it though and even though I have one and would like to provide it to you, I can't for legal reasons. If you hunt long enough though you can probably find it. ;) The zip file also contains a text file that shows some version info and how the size of the program has changed over time. Oh and in case you didn't know, the binary also contains the source for everything.

Download Quest for Dragon Eye Here


Random Word Generator
randword is a program that generates random words by first generating strings of random letters and then comparing them to a set of dictionary files. It was first written in 1997 by me and Keith Batten in Keith's parents' car on a drive back from Case Western Reserve University. We were curious what we would see when the computer spit out random text and only words we could understand were filtered out. I suppose it's similar to the monkeys writing Shakespeare if they had enough time. Here are the links to the source code, binaries for Linux and DOS, and a separate archive for the dictionary files. See the readme.txt in one of the archives to see how to use randword. In particular, pay attention to where the dictionary files have to go in relation to the executable.

Downloads:

What's New:

Version 1.1
  • By default all needed dictionaries are preloaded into memory. This makes randword a LOT faster (14x faster on my computer).
  • New option: -d. Use old (slow) method of searching through the dictionary files on the disk. Requires a lot less memory this way.
  • Outputs CR/LF pairs in Windows, LF characters in any other OS.
Version 1.0
  • Initial release

Command Line Options:

Usage : randword [options] filename

Displays a list of randomly generated words.


I don't mean to go into a rant but...
there have been "practical" uses for randword since it was first written. I used it myself while I was a junior in high school when I wrote a paper about cryptography. I had a portion of the paper devoted to entropy within language and how when one encodes and transmits a message the message can be decoded with enough knowledge about the language the plain text was written in. For example, in the English language the letter 'E' occurs on average more than any other letter. There's a good probability that if you replace the most common character in a substitution-encoded message with 'E' then you've taken a step in the right direction to decode the message. Based on the idea of letter frequency, the concept can be extended using randword to determine which words in the English language are most common based on letter frequency within the word and perhaps even the length of the word itself.

What got me to dig out the source code for this program however was something more fun. My friend Ashish wrote an IRC bot and was working on implementing a hangman game. One day while chatting he said he needed a program that can generate random words. What a coincidence, I had just what he needed! At the time there was no Linux port but that was easy enough. He also took out the overhead of generating random strings and instead picked words straight from the dictionary files. Heck, for all I know he wrote his own program and just used the dictionary files I gave him. This was enough to spark my interest in the program again though so I decided to start my own porting effort that would encapsulate all of the original functionality of the program and more. So technically you're not downloading the first versions of randword but these are the first releases to the public so that's why the versions are labeled the way they are.