Saturday, May 30, 2009

Maker Faire 2009

As promised, I set up an ATSC demo station at Maker Faire. I've got a small table with the K6BEN ATV folks. I've got a camera, the German DATV transmitter gear set for 910-916 MHz, the KP-20 antenna for transmitting, a TVC-9S downconverter and my 7" portable digital TV.

I've had lots of folks come up and marvel at how there's a short delay between what they do mugging for the camera and when it actually shows up on the screen. Everybody I've talked to has understood the explanation of how the system works, and a lot of visiting hams have listened to my rationale for why I'm doing this, and everybody - ham or not - has voiced their support for my efforts.

It was a very long day - and I didn't even stay until the bitter end. I'll be back tomorrow morning, though, and this time I will stay until the bitter end at 6 PM. We're in Redwood Hall, near the South door. The League has a booth near the North end of the building across the road from us. Thanks to the League, and in particular our Section Manager, Bill Dale, N2RHV, for providing all of the Ham Makers with neat matching shirts for the occasion.

Thursday, May 28, 2009

Why didn't I think of that?

I don't usually do this, but here's a particularly interesting Slashdot Comment. This fellow actually played with PSK31 acoustically - that is, just sending it as sound through open air.

Why didn't I think of that?

At least over short distances, it ought to be a lot easier to receive than it is over noisy HF channels.

It's an idea that brings up a lot of interesting questions. How far could it go? How much noise immunity would it have (could you successfully use it during a noisy cocktail party)? Would it do well under water?

It's all fairly impractical, but interesting, nonetheless.

Google Gears geolocation considered wanting

Google Gears is an interesting bit of functionality you can add to your browser. One bit of it includes the ability for a site to ask where you are located.

Now, you might wonder how it's possible to turn an IP address into a geographical location. There are databases that try and do this in a fairly inaccurate way by figuring out which ISP you're using and putting a big peg in the middle of their service area. But a much better way is to use DNS LOC records, when they've been provided by the domain owner.

Well, I have provided an accurate LOC record for

The algorithm for turning an IP into a location is a 3 step one with DNS:

1. Get the name of the IP address by doing a reverse lookup on the IP. In the case of the machines here in the house, for IPv6, you'd get the individual machine's name, and for IPv4, you'd get ""

2. Do a LOC lookup for the name. In most cases, this won't get you a match, since the LOC records are generally applied at the domain or subdomain level.

3. Start lopping words off the left side of the name, looking for LOC records at each step until you get to "."

If you do this, you'll get the right answer almost instantly for the machines in the house.

Alas, if you ask Google Gears, the answer you get is "Hayward, CA" and a lon/lat a block east of the Hayward BART station.

Um, no.

D-ATV at Maker Faire

I know it's late notice, but Maker Faire is coming up this weekend, and I'll be there with the ATSC equipment. I'll be transmitting on 900 MHz as a demonstration. Look for me at the K6BEN ATV table. I'll be running about 10 dBm or so from one end of the table to another, but it will be ATSC in the 900 MHz band.

Wednesday, May 27, 2009

uuencode -> base64

If you have a modern version of Unix, you'll have a more recent version of the 'uuencode' command that can generate base64 output with the -m flag.

If you don't, you can convert uuencode output to base64 easily enough. You just have to remove the 'begin' and 'end' lines, strip off the 'count' character off the front of each line, and then convert the characters from the uuencode character set to the base64 one.

This is all relatively easy to do as a shell script pipeline. The hardest part is putting the special characters in the uuencode character set into a variable. But careful escaping can make it happen:

#! /bin/sh

# The uuencode character set
UU=' !"#$%&'"'"'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`'
# The base64 character set - note the extra ` -> A conversion

tail +2 | egrep -v ^end - | tr "$UU" "$B6" | sed -e "s/^.//g"

You will have to remove the line breaks stuck in there by blogger. Sorry.

This script also leaves out one step that makes the output potentially invalid base64 - if the number of characters in the output stream is not an even multiple of 4, then '=' characters are added to represent 0 padding. You can do that experimentally by hand if you absolutely need it, but having to count the number of characters (not including the newlines) as you output them would be rather painful. At that point, it makes more sense to just write base64 yourself in C.

Tuesday, May 26, 2009

Rail 'round the Bay

I take CalTrain to work most days, and it is sort of good enough. If and when they electrify it and replace the rolling stock with EMU cars, that'll make it that much better. My nephew goes to U.C. Berkeley, though, so he lives in BART country. There's been moves afoot for a while to bring BART to the South Bay, but I think I've decided that a much better idea would be to run VTA light rail up to Warm Springs, where the current planned terminus of BART is.

BART is a broad gauge rail system that because of it's third rail electrification must be totally grade separated and fenced in. Light rail, by contrast, is standard gauge rail with overhead electrification and hence has no need to be fully grade separated. In fact, there's no inherent reason that the line couldn't be shared with freight service.

The proposed BART extension to Warm Springs is already on track (see what I did there?) for construction any time now. The proposed location of the Warm Springs station is a mere 6 miles away from the Great Maill VTA station, and there is a railroad right-of-way that actually connects those two locations!

You don't need to tell me twice that the government's involved when the plan is to spend billions of dollars to run BART 15 miles to downtown San Jose (including tunneling under it) and thence to Santa Clara when all they really need to do is go 6 miles further than they're already planning on going and just stop. But even then, just electrifying the 6 miles of track between those two stations and running VTA trains up and down to meet up with BART would probably be cheaper still. If you ask me, it's entirely unreasonable not to connect these two systems together by adding a small extension spur from the Great Mall station to the Warm Springs station, turning it into an intermodal station.

Wednesday, May 13, 2009

Too much javascript

You know you've been doing way too much javascript when you catch yourself doing crap like this:

html += '<a id="linkToFoo">...</a>';




$('#linkToFoo').click(function() {
window.location = '/foo/bar.html';

Hint: If all you want to do is make an 'a' tag clickable and have it take you to another URL, there's a much easier way...

Tuesday, May 12, 2009

Somali honey-pot

You want to fix the pirate problem off the East coast of Africa? It's simple: you do exactly the same thing the Germans did during World War II - you set up a wolf in sheep's clothing. More specifically, the Germans used false flag commerce raiders to destroy enemy merchant shipping. But the Germans had a bigger problem than we do. By the rules of war, they needed to drop the false flag and raise a proper one before they could engage in combat. And combat for them meant destroying and sinking naval vessels while attempting to either destroy or evade heavily armed enemy men-of-war.

The problem that must be solved today off Somalia is much simpler: the pirates are not nearly so well equipped and armed, and if you can apply a couple squads of Marines to the situation, it's pretty easily resolved in our favor. And such a ship flying the American flag, strictly speaking, wouldn't be flying a false flag.

The U.S. government needs to pull a couple liberty ships out of the mothball fleet, put a company of Marines in the hold, and run them along the shipping lanes with a big American flag. For extra points, paint them with the livery of the Maersk lines. When the pirates come, let 'em get real close, and then let the Marines do what they do best. Do that a few times and despite their bravado, I suspect the pirates will think a little harder before going after an American flagged merchant ship.