thejof.com

hacks


hacks07 Nov 2008 10:40 pm

Found this bash gem on some corporate BIND management scripts at work - ugh:

ZTEST=$1
if [ “x$ZTEST” == “x” ]; then
echo “Usage: …..”

hacks and main18 Dec 2006 02:49 pm

Is ab-so-fucking-lutely awesome. Granted, this link probably has latencies of almost 100-200 ms on just the first hop to my gateway at MAE-West, and my max throughput is only about 90k at best. However, the cool hax element of the whole thing is hard to ignore.

Thanks Boingo!

electronics and hacks and main01 Nov 2006 05:03 am

So the webcam idea worked, but all of the photos pretty much sucked. >95% of them were completely blurry…

I think about 50 people recognized that I was a LEGO minifig, and about 150 thought I was a wheel of cheese. :)
I really think I could do a much better job next time by making the foam discs a little more round. I had envisioned a glossy and perfect lego head and wound up with something that looked more like a sarcastic-lumpy-wheel of cheese or a smirking-drunk-yellow marshmallow.
LEGO Head

Perhaps next year I’ll put in an old point-and-shoot digital camera with a remote trigger and have a usb cable running down to my pack that’ll read off the card.
One thing that would have been nice is some kind of heads-up-display inside the helmet. Just a simple backlit LCD would have been perfect. It would display the timer length remaining until the next snapshot, and some other arbitrary piece of random crap just ’cause it’d be cool.
A shutter trigger button on the side of the headpiece would be pretty useful as well.

electronics and hacks and main31 Oct 2006 07:04 pm

Hopefully you’ll be able to follow along tonight for Halloween in the Castro.

I’m going to try and put a webcam in my Lego head this year and keep a laptop tethered to my phone to upload images in realtime. It seems to work at the moment, but I still haven’t tested it with my phone or made a mounting hole in the head.
Once everything is set, it’ll upload images to http://thejof.com/halloweencam2006

Build photos at:  http://flickr.com/photos/thejof/sets/72157594354884204/

Update: Everything seems to work, so I’ll be testing out 1 min. intervals on my way out to Shannon’s

Update #2: Pictures are a little blurry, but it totally works!

hacks and main23 Oct 2006 07:53 pm

Orace OpenWorld is at Moscone this week.

ESSID: vpn
64-bit WEP and way more than enough traffic ;)

hacks and main21 Oct 2006 03:47 am

Had quite the busy night tonight…
Somewhere in the wee-hours of the morning, in a Red Bull induced fit of system administration, I got fwknop working on one of my main boxes. I must say… it’s quite a nifty little tool.
Essentially, I send only one encrypted packet utilizing an asymmetrical cipher to my machine instructing it to do different stuff like run commands or change some netfilter policies. It’s way faster than port knocking, and it can do much more right out of the tarball.
In all, pretty useful for the tin foil hatters among us.

For friends and acquaintances of mine following along, I don’t really have anything going on this weekend. So, for those of you who would like to meet up for dinner or drinks sometime, let’s make it happen.

hacks and main20 Oct 2006 02:53 am

Ghetto Projector



It totally works, although it’s not very bright. Pretty cool though.

I watched War Games tonight. What a classic.

hacks and main29 Sep 2006 03:34 pm

If perhaps you’d like to export some MySQL data as csv values, here’s a little sed hack I figured out this afternoon:

[jonathan@magnar:~]$ mysql -umysqluser -ppassword dbname -B -e “select * from tablename order by foo;” | sed ’s/\t/,/g;’ > somefile
That sed block might be a little scary to some newbies, but it replaces tabs (\t) with a comma.
That’ll give data in the format of:

foo,bar
baz,gazonk

Sometimes, quotes are more appropriate for some automated csv imports, so use this instead:

[jonathan@magnar:~]$ mysql -umysqluser -ppassword dbname -B -e “select * from tablename order by foo;” | sed ’s/\t/,/g;s/^/”/;s/\n//g’ > somefile

That’ll make data in the form of:

“foo”,”bar”
“baz”,”quux”

hacks and main03 Aug 2006 11:05 pm

While adding value to a BART ticket this evening, the fare chart caught my eye, and I noticed something called the “Excursion Fare”. It’s a cost for exiting from the same station you came in on (to ward off vagrants living on the system all day, I suppose…), or for losing your ticket. At only $4.60, why isn’t it in my favor to claim that I’ve “lost” my ticket on a longer journey (like on my semi-daily SF-Fremont route, valued at a whole $5.00)?

I’ve also become privy to another BART trick. The total fare from Fremont to Dublin/Pleasanton is actually more than the total fare of the Fremont-Bay Fair and Bay Fair to Dublin/Pleasanton journies. Try and explain that one!

electronics and hacks and main27 Jun 2006 02:57 pm

When I first learned of the awesome SpokePOV project put together by MIT engineering wonder Limor Fried, I just had to get some of the boards together to try it out.

I ordered the Triple SpokePOV Kit that came with two neodymium magnets as well as a useful parallel programming dongle. I also decided to splurge a little on the bright blue LEDs and a 4Kb EEPROM for each. With shipping and all, it came out to a smashing $132.05; a pretty good deal for what I was getting. Shipping took a couple days, but came soon enough. I was so giddy to get everything once it came, and was able to put together the first board, program it, and try it out in about an hour.

Programming the actual images proved to be a bit more trouble than I was hoping. The python program that Limor put together was pretty good for a hack, but it leaves some things to be desired. The rendering while drawing pixes is a little slow, and it unfortunately choked with getting pyParallel working on my Linux machine. I had to resort to programming the boards on Windows. Ick.
And it looked awesome. With only one board going, I ended up needing to have the wheel zipping along pretty quick in order to attain a full image. But, once I got three going on one wheel, I got full-image POV without having to race down the street.

In all, it’s a pretty robust little kit with some nice touches. The only thing I might change is the length of the board for bigger wheels on cruisers (maybe a homebrew hack for the future). I’m not sure if it was counting error, but I got an extra LED in two of the kits. Those could come in handy if something happens to any of the running ones. And above it all, the crumpled up Digi-Key catalog pages for padding was an extra nice touch.

For future additions, the platform seems pretty hackable. I’ve already got a couple of ideas brewing to fix it up to be a more robust system. Here’s what I’m thinking so far:

  • The addition of a pad for an external power connector makes it easy to add batteries (balancing the wheel might be hard), or a generating hub to either charge batteries, or run everything directly.
  • Syncing the hall effect sensors on each board so that all the microcontrollers gets the same pulse. I’m thinking that it would make syncing animations that stay on the boards easier. I’d have to fiddle with the offset timing to make it work.
  • Having a tiny external computer like a gumstix machine under the seat barf out SPI data to the latches on the board for longer animations. Longer clips with sound could be stored on an MMC card on a gumstix machine.
    • Getting a SPI stream into a moving wheel might be kind of hard. My initial idea was to use a brush on the wheel’s conductive frame, but I’m guessing it would be too noisy. I might have to opt for something wireless.
    • And if I wanted to make it extra fancy, I could use some wireless networking to the gumstix with either a cell phone or permiscuous 802.11x detection to get images that people could submit over the Internet to be displayed. Kind of like a mobile blinkenlights setup.

SpokePOV: Getting Programmed

Here’s a video of the whole three-board setup on one wheel. It’s currently setup with four images and it cycles through each every 100 hall effect sensor pulses (rotations past the magnet).From the video, images of an alien head, Commodore logo, dragon, and Tux head can all be clearly made out. The camera doesn’t really do it justice though. Viewed with the naked eye, the image blurs together much more nicely. And the bonus is when you stop; the whole setup looks like the “flux capacitor” from Back to The Future.
SpokePOV in Action