There’s No Place Like lo0

Posted on December 11th, 2007 in Technology by minter

As Rob posted, I came up with an interesting solution to a problem yesterday, and I hadn’t seen it written up anywhere.

The problem was: You have a user on a Mac OS X system, running Windows on VMWare Fusion. They have application code running on the Mac side, and want to do browser testing via the Windows instance on VMWare.

Now if the Mac is online and has an IP address, you can just use that IP in the browser bar in Windows, and it will work. But what happens if you want a consistent URL between work, home, the coffee shop, and other places where your IP might switch? You could write a script that would inform your VMWare instance of your live IP, but that’s kludgy. What happens if you’re on a plane and don’t have any live networking? Then what.

You want an interface that’s always up, and that can have a static IP. That rules out the ethernet port (cable out, no networking, DHCP issues), or AirPort.

But wait! There IS an interface that’s always online. And it’s lo0, the localhost adapter. Sure, it doesn’t really go anywhere, but for inter-VM networking, you don’t care about that. And while it normally only hosts 127.0.0.1, the loopback address, it’s a “real” interface, so you can take advantage of IP aliasing.

Run as root:

ifconfig lo0 inet **10.0.0.100** netmask **255.255.255.0** alias

That will bind the IP 10.0.0.100 to your localhost adapter. You can adjust the IP address and netmask to taste – just make sure it’s a nonroutable IP, and hopefully one you won’t get assigned by your NAT device. Once that IP is up on the lo0 interface, you will be able to access it from VMWare. And it won’t change with the winds of DHCP, or even a lack of internetworking at all, giving you something consistent that you can refer to.

If you want to have that persist across reboots, edit the file /etc/rc.local as root and add that ifconfig line to it. rc.local is run by the system at the end of the boot process, so that will take care of it.

Hope this is useful!

Snap-Tastic

Posted on May 17th, 2007 in Technology by minter

There’s a new game in town, and it goes by the name of TeamSnap.

TeamSnap is a sports management web application from the amazing minds at Sparkplug out in Portland, OR. I’ve been helping them with their IT stuff for a while, and when they started writing a Rails app, I helped out on the infrastructure side (Mongrel, Apache, etc) as well. As development has been ramping up, I’ve also been doing some Rails programming as well (the image code is mostly my work, as well as the data export and RSS functions).

TeamSnap is designed to help people who manage adult and youth sports teams – it handles rosters, announcements, scheduling, availablility, even refreshments and photos. And it’s now in free public beta. So if you’re involved in sports teams, or your kids are, check it out. Comments are always welcome.

We’re already getting some pretty good reviews out there.

Wii’re Here

Posted on January 25th, 2007 in Technology by minter

After a surprisingly short shipping period, my Nintendo Wii arrived today. Yay! I’ve hooked it up, put it on the wireless, done the basic configuration, and played some Wii Sports. For such simple game, they’re a lot of fun. I also got some Wii Points and bought Super Mario Brothers (NES) and Sonic The Hedgehog (Genesis). They’re very smooth to play with the Wiimote.

Should be a lot of fun. If anyone else out there has one and would like to link up, drop me an email and I’ll send you my Wii number.

Wiiiiiiii

Posted on January 19th, 2007 in Technology by minter

I’ve got an RSS feed going monitoring the in-stock-ness of the Wii at several online retailers. Lately, a very expensive 6-game bundle has been showing up at Wal-Mart.com, but I’ve been passing.

However, I just saw a $400 bundle that was decent, so I went ahead and placed the order. The bad part is, it’s a bundle, so it’s somewhat overpriced. The good part is the bundle is the “Kid’s Bundle”, so the standard $250 Wii system (controller, Wii Sports, etc) comes with the “Happy Feet” game, and Hayley’s on a huge Happy Feet kick, and Super Monkey Ball, plus a 1GB SD card. So it’s not like I’d be throwing the games away, hopefully, in order to get the console.

Plus it saves me from having to go fight the lines on Sunday when Target and Best Buy are supposed to have them in stock.

The system should arrive late next week or early the following week.

SURBL Robble

Posted on January 18th, 2007 in Technology by minter

I’ve been getting quite a bit of spam through the “New Key Request” form on the Rails-based Mr. Voice website, and finally decided to do something about it. I wanted to take the spammy form fields and run them through the SURBL RBL.

I was hoping there was already a module that could take a URI, parse out the base domain from it, and query the RBL, but alas, there was not. So I wrote my own function to do it for me. I’m sure there are better ways to do it (that’s why I’m the sysadmin, not the developer), but I couldn’t find any. So in the hopes that someone else might find this useful, or possibly do it better, here’s the function (which I call like: if in_surbl(spammytext)…)


def in_surbl(text=”“)
require “uri”
require “ipaddr”
require “resolv”

uris = URI.extract(text)
uris.each do |uri|
dns = Resolv::DNS.new

begin
host = URI.parse(uri).host.to_s
rescue URI::InvalidURIError
next
end

begin
ipaddr = IPAddr.new(host)
revip = ipaddr.to_s.split(’.’).reverse.join(’.’).to_s
if (dns.getresources(”#{revip}.multi.surbl.org”, Resolv::DNS::Resource::IN::A)).size > 0
logger.warn “Found SURBL entry for IP #{host}”
return true
end
rescue
# We’re using a hostname
until (host.split(’.’).size <= 1)
if (dns.getresources(”#{host}.multi.surbl.org”, Resolv::DNS::Resource::IN::A)) .size > 0
logger.warn “Found SURBL entry for Host #{host}”
return true
end
array = host.split(’.’)
array.shift
host = array.join(’.’).to_s
end # until
end # begin/rescue

end # uris.each
return false

end # in.surbl?

MacWorld Thoughts

Posted on January 12th, 2007 in Technology by minter

Also due to the blog problems, I didn’t write about MacWorld. I “watched” the keynote on Mac Rumors Live (great setup there) while IM’ing with Mark.

In somewhat of a surprise, the keynote was heavy on detail, light on quantity this year. There seemed to be three major announcements:

1) Paramount movies on iTunes. Not really relevant to me, since I don’t watch many movies, and don’t want to pay near-DVD prices for low-quality films on my computer.

2) AppleTV (nee iTV). It’s almost, almost, almost something I’d care about. Nice interface, onboard storage, iTunes/iPhoto integration. But it has no DVR/TiVO functionality which makes it total crap. $300 for a glorified iTunes repeater? No thanks. If they had DVR, I’d get it tomorrow. Heck, they could probably make channel functionality dependent on .Mac memberships and sell more of those, too.

3) iPhone. The long-awaited (by Ken Ray anyway) convergence of iPod, touchscreen, and cell phone. The positives for it are very postitive – amazing interface, quasi-decent battery life for what it does, well-designed online integration, much-needed features like visual voicemail. All that is drool-worthy.

What’s bad? The price, for one ($499-$599, and a two-year-contract on top of that). That’s up there, and out of my price range. The locked-in carrier (all of my family is on Verizon, so I have tended to stick with them). And, more importantly, apparently the software on the phone will be locked down. So what you see is what you get, which means probably no SSH terminal application, which kid of ruins it as a smart phone for me.

I really like the idea, but will probably re-up my current phone plan for a couple of years and then check back to see if the problems have been addressed.

The introduction of an 802.11n basestation didn’t even make the stage, just showing up on the store. And there was surprisingly no news on iLife (‘07?), iWork, or any, y’know, computers.

So a pretty odd MacWorld. Some very ineresting things, but nothing that’s going to make me go out and buy something anytime soon.

No Wii, Wade

Posted on December 17th, 2006 in Technology by minter

I got up at 5:45am and headed out to the local target this morning. There was already a crowd. One of the guys said “Are you here for the Wii? There are 15 of them inside, and more than 15 of us here already.”

So I went back home and went to bed. Maybe I’ll try again after the holidays.

LISA, LISA, Why You Buggin’?

Posted on November 8th, 2006 in Technology by minter

I just booked my travel to LISA ’06 in DC. I’ll be getting in on Sunday and returning on Thursday (in time for hockey league, natch).

Any of my other peeps going (besides Lance, I know he’s in)?

Prefixing The Mongrel

Posted on September 27th, 2006 in Technology by minter

I’ve got three different blogs on lunenburg.org (mine, Holly’s, and the kids’), all running the Typo Rails-based blog package.

I had traditionally been running them under the Apache FastCGI environment, which I’d had some “random crash” problems with. FastCGI also appears to be running out of favor with the Rails community in favor of Mongrel, a native Ruby web server written specifically for Rails. I’m using Mongrel, with Apache mod_proxy’ing requests back to it, on the Mr. Voice website.

But when I tried to use it on my blogs back in July, I ran into a problem. My blogs are in subdirectories off of the lunenburg.org URL space, but Mongrel was assuming that they were running in a top-level URL space. Throw Apache’s proxying on top of that, and things just flat didn’t work. If I had changed the URL to “wade.lunenburg.org” it would have worked, but “www.lunenburg.org/wade/” didn’t. I asked about it on the Typo list and Scott Laird, one of the lead Typo developers, confirmed that it wouldn’t work, but said that he had sent in a patch to Mongrel to allow a —prefix flag that might solve the problem.

I saw the other day that a new Mongrel had been released, so I installed the gem and checked it out. Lo and behold, there was the —prefix flag. I set up the mod_proxy rules, started Mongrel with —prefix /wade, and it worked! Looks like I can kiss FastCGI goodbye!

For reference, I start Mongrel in my blog directory like this:

mongrel_rails start -e production -d -p 4002 -a localhost --prefix /wade

(that starts Mongrel in production mode, daemon form, port 4002, bound to localhost (so you can’t get to it from teh intarwebs directly), and with a /wade URL prefix.

Then, in Apache, I have these three rules:

  ProxyPass /wade http://localhost:4002/wade
  ProxyPassReverse /wade http://localhost:4002/wade
  ProxyPreserveHost On

And that’s it! Now when you hit this blog, you’re actually going against the Mongrel webserver, instead of FastCGI.

North Carolina, C’Mon And CVSup

Posted on September 8th, 2006 in Technology by minter

Like FreeBSD? Love CVSup? Hate the fact that it’s written in Modula-3, a language that nobody in their right minds would use, and a half-hour compile for one package?

Well, there’s a new port in town. Install the “net/csup” port and get a cvsup client written in C. Same great functionality, .001% of the bloat of net/cvsup. I just ran it on my supfile and it worked fine.

Thanks to Mark for finding it.

Next Page »