Tuesday, December 28, 2010

Playing with CHDK

I've spent the morning playing with my Canon PowerShot SD870 IS, loading the Canon Hacker Development Kit on it. I ran through this quick introduction.  So now I should be able to write a script to do some hi-fi kite aerial photography!  It'll complement my arduino-controlled cheap-o camera nicely, I think.

Monday, December 20, 2010

LED Flex Strip Test

My boss understands me -- so he got me a meter of LED Flex Strip from adafruit.  Here's the first test of having Arduino control it.  It's autonomous, actually, and the USB connection is only for power.  That means I could, say, pin it to my bag with a battery pack and have it tell me the current temperature.  Or something.

Sunday, December 19, 2010

Learning Python (Fourth Edition)

Well, I'm only two chapters in to Learning Python, but I'm finding it very interesting. (Happily, Mac OS X has version 2.6, these days.) I picked python partially because Google uses it so extensively -- but it also seems to be handy in general.  I just keep seeing it everywhere.

When I started learning perl, ages ago, it really opened up a lot of new intellectual opportunities for me.  With perl, if I had a text stream, I could parse and extract from it -- and everything was text then!  I'm hoping Python will be an "enabling" kind of thing like that too, but up to date for the now.  Here goes....

Tuesday, December 7, 2010

Linux, Swap and Render Farms

The debate occurred again last night, with a Cinematics group, about how best to configure their linux render nodes.  We're running a bare metal hypervisor, with two guests running RHEL 5, on a pair of xeon 5520 processors, with  12 Gb RAM and a slow-mo SATA disk.  How should we allocate RAM to the guests, and do we want swap?

Sven immediately offered this article on how mysql behaves on a NUMA CPU architecture, which suggests to me that I might as well turn swap off.  The counterpoint (and traditional view) is that a linux machine must have swap, as a part of its normal modus operandi.  So far, the render nodes show no difference with/without swap (so I turned it off) and two virtual guests outperform one OS running on bare metal.  I suspect the virtualization layer is sticking one guest on each of the processors, so their RAM is staying local to the CPU they're on.

I don't know the answer, but it's gonna be interesting.  If you're in the same boat, you'll appreciate this handy secret-decoder-ring for vmstat.  And here's a primer on "swappiness."  Also, here's the middle road solution, enable swap, but just a pittance of it.

 Finally, if you're running a render/compute farm, you'll find these bits handy ... there's a lovely o'reilly article on how the linux out-of-memory killer works.  You'll also be interested in this article on how linux memory overcommit works.  And finally, if you're trying with and without swap, here's a quick bit on how to use a normal file as swap, so you donut have to repartition anything to test the on/off configs.

Hopefully this helps someone!

Sunday, December 5, 2010

What Domains did ICE Shut Down?

I was curious; which actual sites did the Attorney General shut down?  Well each seized domain has had its name servers' IPs replaced with and  So the closest I could get, was to use a tool to find the A records that aim at a particular IP and see all the names those IPs are going by.  (Looking up the PTR doesn't work, so you gotta be a little sneaky.)

If you do this on NS1, you get a list of ns1.somedomain.tld entries in the resulting web page, and if you copy and paste the list into a text file you can clean it up like this

  ` cat textfile | awk {'print $1'} | grep -i ns1 `

Which currently (Sunday, December 5, 2010, 23:30 GMT) results in only thirty seized domains' name servers and ns1.seizedservers.com itself:


I am definitely doing something wrong -- that's significantly less than the 82 being reported by most bloggers.  Naturally, the government has no comments on what domains they've seized.  (I'm not sure I like the sekrit-p0lice implications of that.)  Also interesting to note, they're running both google analytics and piwik on their take-down notice page.

Wednesday, December 1, 2010

Barcode scanning on iFone

I was chatting with Sven the other day about how nice it'd be to have a simple barcode reader that talks to a desktop machine. Basically, he just wants a "keyboard" that takes barcodes as input and "types" them as output over USB/bluetoof/whatever.

I looked at a bunch of apps and about half of them only read QR codes, or if they do read "1-D" codes, they only recognize valid UPC codes, not the barcodes on tapes.  Also, it seems like the best way to scan is to make a "scanning stage" where your phone is stationary and you just put tapes in front of it. Autofocus seems to try to lock-on to the background, missing a tape that you're holding in your hand.

I found these:

ZBar : Open source! Captures barcodes very quickly. Unfortunately no "batch" scan mode, you have to click the Camera icon after each scan to return it to scanning mode. You can capture a whole bunch of codes, that it stores in RAM, and then email the whole list to yourself. Very nice, and could be haX0red into a custom application if we had a C++ dev.

iCody: Eight bucks, but well worth it! Lets you crop your camera input down to just a section, so no auto-focus garbage, nor problems when multiple codes are in the view. Captures a whole batch into RAM, and then lets you send those in email. Also, I didn't try it, but it's got a desktop applet that you can run, and if iFone and Mac are on the same wifi, it'll send codes directly to your Mac -- if it works, that's a winner. :)

And the ones I tried that donut work for scanning our backup tapes:
RedLaser: Won't recognize tapes, only takes 1-D barcodes that are UPCs. (It's a shame, since they have a nice SDK.)
ScanLite: only does QR codes. (It's a shame, as they have a web API that lets you write your own webapps that use the iFone app as input.)
codeREADr: only does QR.
i-nigma 4: only does QR, despite suggesting otherwise in the description...
BeeTagg : only does QR

So there you have it, that's what I gleaned in a couple hours over the weekend.  Share and enjoy!

Android on my iPhone 3G

Well, here it is, my old iPhone 3G is running droid. I tried the "simple" bootlace method, but ended up diving in deeper than expected. I had to go with the dev team pwnage tool on my Mac to get jailbroken in the first place, then connected to a linux machine to do the actual boot loader install, and then bootlace got the iDroid bits installed so the boot loader could see 'em. But it works!