Thursday, February 19, 2009

Final Touches On EXP4

Damn I'm good.

My problems with the Map code were all of my own making. I had originally used the sample API code to pull the latitude and longitude out of the GeoIP database. That turned out to be a really bad thing to do.

I used that code because you could give it a text file of IP addresses and it would spit out all the data. The tool they give you, geoiplookup, only does a single IP at a time. But I took a look at the geoiplookup code and realized I could hack it to do the same thing as the sample code.

It was slick and quick.

I hacked it to check to see if the "IP address" on the command line was actually a file. No file, assume it's an address. If it is a file, loop through the lines inside it. Maybe ten lines of code max.

Since I started doing this Chat-O-Matic crud I've always had a heck of a time keeping the code consistent between multiple machines. I either had to copy everything over or edit everything twice. I usually ended up editing everything twice because the original EXP #1 was on Slackware, which has the irritating habit of putting everything that should be in /[s]bin into /usr/local/[s]bin.

Or maybe I did that when I upgraded bash. Could be. It was two years ago. I don't really remember.

All that is fixed and the code now lives on a NFS share on the BOT House server, so all machines run the same exact code, which has been cleaned up considerably.

The ipset code is all finalized as well. I'm still using my hacked version of Debian's ancient (kernel 2.4.x "sarge") iptables init.d script. Why they dropped that script I'll never know. They give you nothing in 2.6.x kernels. I imagine they expect you to use one of firewall packages they ship with the distro (I never liked any of them).

The ipset code is running on BOT House as we speak. That's 132 lines of firewall crud (banned IP addresses) wrapped into one line. There may or may not be a noitceable performance increase, but it feels good just to get that mess cleaned up.

The last piece was the UPS (Uniterruptible Power Supply) configuration, which I simply copied from the EXP/// NetVista box and edited.

This turns out to be the major flaw in my plan. The NetVista's UPS is way underpowered for the new system. It will survive brownouts (the biggest problem around here), but I doubt if there is ten minutes of standby time.

Anyway, it's all there. I will need to do a few edits on the UT game files but that's all minor stuff. Now it's a matter of putting the box in its final resting place.

That will happen Saturday.

Be there.

No comments:

Post a Comment