Perl-fu ++

I been working third shift at work for the past week until Thursday night/Friday morning. One of the things that needs to be done on 3rd shift is to check up on the backup for all the DNCS’s. Each DNCS has its own backup server with a web interface on it to check the status of the backups. Normally this is a pretty trivial task, but when i have to check roughly forty of these things…yea right. So after a night of hacking around with WWW:Mechanize and HTML::Tableextract, I have a script that will connect to each of the web interfaces, scrape the status of tonight’s backup and dump them to an text file for review. All i need to do now is whip up a fancy progress meter thingie and its all done.

Blog, Perl, hacking | No Comments

Project Gatekeeper

My bot is finally finished!!!

First of all I want to thank the monks over at Perlmonks.org for helping me get the scraping part working correctly, the people that responded to my pleas for help on the Net::OSCAR mailing list on my many questions with the Perl module, and lastly Adam Pash from Lifehacker for giving me the inspiration to work on this bot.

The purpose of the gatekeeper Perl bot is to be able to tell me what the WAN IP address of my Linksys WRT54G router. This is so that if i am at work or away on business, I can still be able to connect to my home network. As of now this bot will only work with a Linksys WRT54G. I have not tried this with any other linksys routers or any other consumer grade router. You will also need to make sure that you have WWW::Mechanize and Net::OSCAR installed in order for this to work. This has been tested using Activestate Perl on Windows XP SP2. This should work in Linux and under Cygwin no problem. I haven’t had a chance to test it yet.

In order to run it, you can just double click on the script in windows, or run it from the command line. Once the bot connects to the AIM network, all you will need to do is message it with the word “ip” and it will spit back to the WAN IP address of the router for you.

I commented the code so that it will be easy to see what it is doing and to make changes where needed. I am releasing this code under the GPL as is and offer no kind of warranty on it.

Download Gatekeeper

Blog, Perl, hacking | 1 Comment

New Perl project almost done

I been kind of working on a new perl script for the past week or so. I am making an AOL Instant Messenger bot that when i send a message to it that it will connect to my Linksys router’s web based management page, pull back what the WAN IP address of the router is and IM it back to me. At the moment i was able to hack together a pretty basic perl bot and code that will scrape the router’s web interface to get the WAN IP. I just need to get them together.

I thought it would be a cool after i read an article on Lifehacker for a Perl based budget bot. I wanted something to let me know what my IP was so that i can connect to my home network from anywhere.

I realize that there are better ways of doing this, but this was more of a exercise for me to continue working on my perl skills. When i get and get everything finalized I’ll be putting together a project page with all the details and code for anyone that is interested.

Blog, Perl, hacking | No Comments

Fun with Perl

In my quest to become the ultimate uber-perl hacker, I thought it would be a cool idea to implement my own own perl based Big Brother pager. The pager we use now is a little app called bbtray that sits in the systray and fires off a popup window every so often giving you the overall color status of the crap you are monitoring (usually its looking at the main bb page).

My biggest beef with this app is that it when it pops up, it takes focus away from anything your working on. I wanted to make something that sits in the systray like bbtray but show status changes through a tooltip popup or something less intrusive and is coded in perl.

After hacking on this for a little bit this is the progress I have made:

  • Connecting to the bb main page
  • pull all the html from the page
  • Parse out all the systems we are monitoring and what their color status is and print it

The second part that i am working is building the GUI using Win32::GUI modules. So far from playing around and reading the documentation

  • I figured out how to minimize the app to the systray
  • setup a timer
  • create a button the fires a web browser page to the bb main page when clicked

After playing around with GUI some more I will have to get everything squished together that is usable. Once i get the full app complete i’ll post the source for all to see and you guys can check out how bad my code is ;)

Blog, Perl, hacking | 1 Comment

Getting Closer

I been thinkering around with getting Catalyst to work under Cygwin this morning. I tried using it under Activestate’s Perl and well that has been nothing short of a disaster. This time around i’d figure i will use cygwin instead with the shadowcat installer, that way i will have all the tools i will need in order to get everything work.

After running the installer, everthing appeared to have been built correctly and i also was able to get sqlite built in cygwin as well. One hurdle I came across was when i issued a make install it is uses a tcl script to install sqlite. Is that it bitches about a variable not being set..

tclsh ./tclinstaller.tcl 3.3
can't read "env(DESTDIR)": no such variable
while executing
"set LIBDIR $env(DESTDIR)[lindex $auto_path 0]"
(file "./tclinstaller.tcl" line 10)
make: *** [tcl_install] Error 1

All i had to do was comment out the line in the makefile that says HAVE_TCL = 1, i found this out after a quick google search which revealed this blog entry .

Now that i have almost everything in place, I am going to try some of the tutorials and see if I can get them working

Perl, hacking | 2 Comments