Best Hack of OSCON Day 1

by chromatic

The best hack I saw in OSCON yesterday was in Jonathan Oxer's Hardware / Software Hacking: Joining the Real and the Virtual.

Jonathan brought a table lamp in a whole box of breadboards and other electronic components from Australia. He connected the table lamp to a remote appliance control. Then he opened the remote control and connected a relay across one fof the buttons. The relay hooked up to an Arduino also connected to his laptop.

He then wrote a small program to run on the Arduino. By sending a single command through the USB port, the Arduino flipped the relay and turned off the light.

That's not the end of it. He ran ser2net to redirect requests from a network socket to the USB port. Then he wrote a very small PHP program which translated CGI parameters and sent the appropriate results to the local network socket.

Within Second Life, you can create an object which invokes a script when touched. This script can make HTTP requests; Jonathan had an off button object.

"Ha!" I thought. "He's running this CGI program on his laptop, in the conference center, and there's no way that Second Life can reach his web server through all of the layers of NAT and connection sharing going on here!"

Then he said, "How many of you have heard of reverse tunneling?" ssh -R opens a port on the remote host that forwards to the local host. With a quick connection to his web server in Australia, he switched back to his SL client, clicked on the off button, and the lamp turned off.

It had been shining in my eyes all morning anyway.


3 Comments

Aristotle Pagaltzis
2007-07-25 02:42:25
Talk about a Rube Goldberg contraption!
Benjamin Kudria
2007-07-25 10:36:43
Wow, there are certainly a lot of layers there. But that is seriously cool.
Dominic Mitchell
2007-07-31 22:33:57
ssh -R is a godsend. You don't need it often, but when you need it, you really need it...