Archive for the ‘Geekery’ Category

HTPC

Saturday, July 26th, 2008

We’ve been talking about ditching Cable TV for a while.  We pay over $700/year for a few hundred channels that we don’t watch.  There’s never anything on, the DVR that comes from the CableCo is crap, and we don’t feel like buying a new TiVO to handle HD content.

The MythTV setup we have is OK, but it’s SD-only, and without the tuner we’re missing out on a bunch of the channels anyhow.

So, what now?  I’ve spent some time looking at VUDU, AppleTV, and other options.  VUDU seems kinda neat, but we already have an xbox 360 and the HD movie rentals on it look just fine.  What I’m interested in is AppleTV’s ability to get real TV programming, legitimately.  Torrents are fun and all, but A. I don’t feel like being on the wrong end of an IP infringement suit, and B. torrents have a low WAF value.

Having decided to hitch my wagon to the Cupertino star, I came pretty close to pulling the trigger on a 160GB AppleTV, when it occurred to me that I might not have done enough research.  After poking around some more, I’ve decided that the best option is a Mac Mini…  It’s a few hundred bucks more, but totally worth it.  There’s no downside…  The Mini comes with FrontRow, same as the AppleTV.  But it also comes with a DVD player, a full OS with web browser and all that good stuff, and it can play formats other than .mp4.  Now it’s a no-brainer.

Let’s look at the math:

Cable TV: $720/year

1.83 GHz/1GB/80GB Mac Mini + mighty mouse + keyboard: $728

HDMI <-> DVI Cable: $20

headphone <-> RCA adapter: already have one in my bins somewhere

For hardware, the first year would be a wash.  But, we need to factor in content costs…

Figure that on average, we watch 1-2 hours of TV every day.  Usually, though, that’s just crap that we can both agree on, or else Law & Order before bed.  Looking through the store, there are a bunch of shows (Weeds, other Showtime/HBO stuff) that are a bargain to get, and we’d both find interesting.

In the end, I’m not sure that we’d save all that much in month-to-month costs.  However, we wouldn’t be paying good money to subsidize the 99% of crap that goes alongside the 1% of interesting stuff we want to watch.  Plus, cable companies suck.

WRT54GS and Tomato

Friday, June 27th, 2008

Just a plug for the Tomato replacement firmware for Linksys WRT-based routers.  What a beautiful bunch of work.  I haven’t really looked at options since the openwrt WhiteRussian 0.9 days, and Tomato blew me away.  I’ve just heard about x-wrt too, but I really can’t find anything lacking in Tomato.

Buggy Bug Bug

Wednesday, June 25th, 2008

I was outside killing a hornets nest when I looked down and saw a lovely specimen of calosoma scrutator.  I’d never seen one before, and was somewhat baffled by it.  My initial guess was that it was some kind of beetle larva, given that it had six legs but no wings.  I wasn’t sure, though.

I brought it inside for L to see…  She was impressed, but more interested in making a house for it than identifying it.  I took it upstairs and tried to take a few macro shots of it, but the bugger moved around so much that getting any good detail was difficult.  I gave up after a while and let the beastie have its freedom (away from the now-dead hornets nest).

After L’s bedtime, I did some wandering through the entomology section of Wikipedia, and while fascinating (did you know that Wood Lice (aka pill bugs, roly-polys, doodlebugs, etc.) are land-adapted crustaceans?), I wasn’t able to identify my critter.  I was able to narrow down my search to beetles, however.  Under Hexapoda, there are only two major classes, and I knew my bug wasn’t in Entognatha (weirdos).  Drilling down into Insecta, I looked at Archeognatha, because they’re wingless.  My bug didn’t have the distinct three-pronged tails that those guys do (think jumping silverfish).  Definitely not Thysanura (non-jumping silverfish).

I started looking at the sub-clades of Neoptera, because the other stuff seemed too weird.  The only thing that seemed to fit was Coleoptera (beetles), but this didn’t feel right because my bug didn’t have wings.  Then I read about how some female beetles retain their larval form into adulthood, and this made me remember what female lighting bugs look like, and my earlier guess.  OK, so I knew it was a beetle larva, but didn’t know what kind of beetle.

After a lot of digging, I came across an entry on whatsthatbug.com, and there it was.  That’s an awesome site.  Excitement abounds.  Anyhow, here’s a picture of one of the gruesome monster’s kin.  Apparently these things are very good for taking out infestations of things like gypsy moth caterpillars.  I’m glad I let it go.

Caterpillar Hunter Larva

I can’t think of a more worthwhile $26.50

Friday, April 11th, 2008

I was chatting with Makia the other night, who told me that he was flying his helicopter around his hotel room.  Well, of course I was curious, so when he told me the make/model, I looked it up on amazon.  Their price is $26.50 (free shipping for Prime), and I’m not sure I’ve ever managed a faster impulse buy.

Fortunately, when it arrived two days later, the Air Hogs Mini Havoc that I ordered lived up to its reputation.  As D commented (while I was buzzing the pets in the TV room), “It’s worth $26 just to watch the cats go bonkers.”

Downsides:

  • 20-30 minutes charge time for ~6 minutes of flight time
  • have to play with the nose weighting to get stable forward flight
  • no cyclical control (just yaw and throttle/collective)

Upsides:

  • $26.50!!!!
  • 9.5g == virtually no inertia, so crashes result in minimal damage
  • chasing a 90lb dog with a dragonfly-sized helicopter

Streamium Owners Unite!

Wednesday, April 9th, 2008

I have a Philips Streamium MC-i200…  And I’m one of like, 5 people, apparently.

So, for those 5 of you out there, I wrote a new backend for this piece of crap.  I got sick of pclinkscan and pclink, so I used Ruby and Rails to create a nice backend server.  The MP3 metadata is stored in a SQLite DB, and I wrote a custom controller to translate the DB data into the crazy PCLink format (a bazillion XML nodes).  Took me a weekend, but now it works, and adding new music to my library isn’t such a PITA.

Bonus: I’m using ActiveScaffold for the models (Artist, Album, Track) to easily browse and edit the metadata.  Sexy AJAX and CSS FTW!  Woo!

Leave a comment if you want a copy of the server.  It’s about 165 lines of ruby, added into the standard skeleton generated by rails.

P.S. The Ruby Spawn plugin is really cool.  When my Mongrel starts, I’ve got an initializer kicking off the UDP broadcast listener.

Update: I’ve uploaded the code to github.  Have at it: http://github.com/mjmac/pcrink/tree/master

Tuning SCSI for flaky USB drives

Wednesday, March 5th, 2008

I bought a Mio Digiwalker c320 the other day. I’ll write a post about that later. For now, I thought the Intartubes might like to know that when you see messages like these:

Mar   5 13:14:57 ganymede kernel: [298160.921155] usb 1-7: reset high speed USB device using ehci_hcd and address 9
Mar  5 13:14:57 ganymede kernel: [298161.053809] sd 5:0:0:0: scsi: Device offlined - not ready after error recovery
Mar  5 13:14:57 ganymede kernel: [298161.053826] sd 5:0:0:0: [sdc] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK,SUGGEST_OK
Mar  5 13:14:57 ganymede kernel: [298161.053830] end_request: I/O error, dev sdc, sector 7880
Mar  5 13:14:57 ganymede kernel: [298161.055176] sd 5:0:0:0: [sdc] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK,SUGGEST_OK
Mar  5 13:14:57 ganymede kernel: [298161.055180] end_request: I/O error, dev sdc, sector 8120
Mar  5 13:14:57 ganymede kernel: [298161.055196] lost page write due to I/O error on sdc5
Mar  5 13:14:57 ganymede kernel: [298161.055207] lost page write due to I/O error on sdc5
Mar  5 13:15:27 ganymede kernel: [298183.709232] usb 1-7: reset high speed USB device using ehci_hcd and address 9

… the problem might be lurking in the block device settings for your USB drive.

In my case, I looked in /sys/block/sdc/queue, and observed the following:

root@ganymede:/sys/block/sdc/queue# cat max_hw_sectors_kb
120
root@ganymede:/sys/block/sdc/queue# cat max_sectors_kb
120
root@ganymede:/sys/block/sdc/queue# cat read_ahead_kb
128

Hmm… Carpet doesn’t match the drapes. On a hunch, I did this:

root@ganymede:/sys/block/sdc/queue# echo 64 > max_sectors_kb

… Which also had the effect of reducing read_ahead_kb to 64.

Now my transfers work fine.

I am relieved, because I was about to take the unit back to Rat Shack, thinking that this one was defective somehow.

… Totally worth it

Wednesday, December 19th, 2007

If Rock Band sucked otherwise (which it doesn’t), the Metallica Pack would make up for everything else.

I don’t think I’ve had a bigger grin on my face as when I hit a bass groove on “…And Justice For All” and held it for 254 notes. Not quite 5-star, but not bad for my first try. It’s almost as if I’ve heard the song a bazillion times, or something. ;)

Also: The opening to “Blackened” still gives me chills. I am so glad they got the master tracks and not Mr. Tries Very Hard.

alias_method_chain weirdness

Monday, October 22nd, 2007

Short story: When you’ve got a module doing this:

module Taglist
  def self.included(base)
    base.class_eval do
      [:save, :save!].each do |method|
        alias_method_chain method, :taglist
      end
    end
  end
...

Ensure that you protect against including it twice, like so:

class BuildJob < ActiveRecord::Base
  include Taglist unless self.include?(Taglist)
...

Why? Because otherwise you'll waste hours trying to understand why your code works fine in development but starts failing with StackLevelTooDeep errors when you run rake tests.

Bleh.

video games == sweat?!?

Sunday, October 21st, 2007

I am reasonably certain that I’ve never before worked up a sweat while playing a video game. Not even in the hairiest parts of DOOM.

Today, I discovered Wii Sports Boxing. I was not prepared for the level of fun inherent in playing this game. Even my daughter got into it… Which isn’t quite so interesting until you know that she was wearing a Di$ney Princess costume while throwing jabs and dodging gloves.

Imagine, if you will, a 4yo girl wearing a Belle (from Beauty & The Beast) costume and throwing a perfect left-left-right-cross combo that knocks her opponent down.

Awesome.

Using mocks in Rails for fun and profit

Wednesday, October 17th, 2007

Well, maybe fun, anyhow. Possibly profit.

One of the reasons I had put off doing any real testing of this Rails project was that I didn’t feel like dealing with figuring out how to avoid messing with the SLURM stuff when doing testing. I really don’t want to kick off fourty real build jobs when I run my tests, but I really should be testing all the goop that leads up to and follows after the interaction with SLURM.

The answer is so simple that I didn’t believe it at first. All I needed was to drop a file in test/mocks/test with the same name as my SLURM library (happens to be slurm.rb). In this file, I simply require the original library, and then stub out the run_slurm_command subroutine. Et voila! I can now safely pretend to interact with the SLURM system without actually doing anything to it.

Incidentally, this works just fine for modules. In other words, it will work regardless of what you are mocking. I make this note because after reading the documentation I had the impression that it would only work for mock objects. My SLURM library is just a collection of subroutines, so I was thinking that I needed to make it a class. In fact, the Mock infrastructure is just Ruby’s built-in metaprogramming — I can open up an existing module or class, monkey around with its innards, and then send it on its way. Sweet!