May 19

My home network is a bit odd. The DSL runs to the refrigerator, and the wireless base station on top of it. Almost everything else plugs into a wireless bridge on my desk. This means most in-house networking is wired, but internet traffic goes through a wireless hop.

I spent a long time trying to get that wireless hop to work well. Eventually, I bought a pair of Linksys WRT54GL base stations and loaded the open source firmware Tomato. This got things to work in the way that I wanted, including functional encryption for the link. The firmware added a lot of assorted perks (like nice bandwidth usage graphs).

However, one of my old stability problems was still happening. Every once in a while, something in my neighborhood starts spewing radio noise. This is enough to kill all network connnections on that frequency. Sadly, this noise’s frequency moves around from time to time.

The pattern was that every two weeks or so, I’d have to carry the laptop into the kitchen, plug into the wireless base station and pick a new frequency. Then things would work fine…. until next time. It would, of course, usually break just during the intense part of some online game.

After a while, I realized that this process could be automated, AND I’m running this nice open source software that I can modify myself without permission from a big company that doesn’t care how often I have to get up to go fix my network.

This led to some investigation, and two small scripts. Once per minute, my base station tries to ping the wireless bridge. If it can’t reach it, it rotates the frequency by one. The base station was already smart enough to auto-reconnect on a different frequency if the base station changed. Since then, my network has been wonderfully stable! Online gaming bliss, broken only by an actual DSL failure that knocked me offline for a week.

init.sh (to create the cron job to run the real job):

/bin/sleep 60
/usr/sbin/cru a ChannelRotate "* * * * * /jffs/channel.sh"

channel.sh (the real job):

# If the other side of the bridge can be reached... we're happy!
ping -c 3 desk > /dev/null && exit

OLD_CHAN=`nvram get wl_channel`
NEW_CHAN=$(( ($OLD_CHAN % 14) + 1 ))

nvram set wl_channel=$NEW_CHAN
nvram commit
kill -sighup 1

This is exactly how things are supposed to work for geeks! We run across something broken, and invent a custom solution, implement, and move on.

Tagged with:
Feb 16

I had a hard drive in my laptop fail. I went out and bought a replacement and got it inserted, then went to try restoring from my Time Machine backup. I was feeling a little nervous, as I always do when trying out a new backup mechanism after a failure.

However, things went pretty smoothly. It took about 4 hours to restore 120G of data, but afterwards I booted the laptop and everything was just normal. I did have a few glitches.

1) The first sync with .Mac took a LONG time. It seems that all sync data was lost, and I had to be smart enough to say “Replace all data on computer” as the way to resolve the merges. This did get me back a few notes I would have lost otherwise.

2) My iTunes account was “unauthorized”. I had do “deauthorize” then “reauthorize” the laptop to get that resolved attempts to simply “authorize” reported me as already authorized.

3) All podcasts that were on my hard drive were lost. It seems that Time Machine doesn’t really back them up. That was the most hassle, and I had to unsubscribe/resubscribe to every podcast to get back the missing episodes.

However, over all I was pleased. It was less hassle than I usually go through to rebuild a machine, well, until I started updating all of the software and had issues with a VM Ware update, but that’s another story. ;>

Tagged with: