Uncompressing Cisco X2000 firmware images

I got a refurbed Cisco X2000 [amzn] ADSL router / wireless access point for cheap from Adorama, hoping to combine 2 networking boxes, and reduce clutter and power a bit.  It comes in at 3-4W, and has an efficiency Level V wall wart, so that part’s all good.


Edit: Everything else is bad!  Don’t get this device.  Really.  It’s the buggiest piece of junk I’ve had the misfortune of trying to run on my network.  I’ll leave the rest of this post here for posterity.


Continue reading

Spinning down a WD20EARS “Green” drive

Ok, this is a pretty utilitarian post.  I did finally get my 18W Server up and running; in fact, it’s serving this post!  But I can’t really get to 18W unless the 2x 2T WD20EARS [amzn] drives I have in it for media storage spin down when not in use.

And I had a heck of a time making that work.  hdparm -y would quickly spin them down, but using hdparm -S to set an idle timeout seemed to have no effect; I had been trying to use hdparm -S 241 to set a 30 minute spindown time, and I had no luck whatsoever.  With the drives spinning, the server used more like 30W.

Mostly through trial and error, I found out that if you set a lower spindown timeout, i.e. hdparm -S 3, the drive will spin down in 10 minutes. Continue reading

Linux Filesystems LOC Update

I did a post last year about how lines of code for some of the primary Linux filesystems were evolving.  It seemed to spark people’s interest, so here’s an update through v3.4-rc4:

(Click to see full size).

I added regression lines this time – btrfs should catch xfs around kernel version 3.8 or so.  :)

Again, I draw no strong conclusions from this – I just think it’s interesting to see how things are moving as these filesystems evolve.

I used CLOC to count lines; the numbers on the graph reflect no blank lines & no comments.  For ext3 & ext4 I included jbd[2] and some of the peripheral files they use; code snippet from the script:

ext3lines=`cloc fs/ext3/*.[ch] include/linux/ext3*.h  fs/jbd/*.[ch] \
           include/linux/jbd.h fs/mbcache.c include/linux/mbcache.h \
           | grep SUM | awk '{print $5}'`;
ext4lines=`cloc fs/ext4/*.[ch] include/linux/ext4*.h  fs/jbd2/*.[ch] \
           include/linux/jbd2.h fs/mbcache.c include/linux/mbcache.h \
           | grep SUM | awk '{print $5}'`;
xfslines=`cloc fs/xfs/*.[ch] fs/xfs/*/*.[ch] include/linux/dqblk_xfs.h \
           | grep SUM | awk '{print $5}'`;
btrfslines=`cloc fs/btrfs/*.[ch] | grep SUM | awk '{print $5}'`;
gfs2lines=`cloc fs/gfs2/*.[ch] include/linux/gfs2* \
           | grep SUM | awk '{print $5}'`;

(Some of the files above no longer exist, but I used the same script to iterate over all the kernel versions.)

Siri meets wifi thermostat

Oh, man, this is just too cool.  And sadly I just upgraded to an iPhone 4, not 4s (I am both a sucker for a deal, and normally filled with buyer’s regret).  But anyway, this guy used the Radio Thermostat API (which I mentioned in my last post) together with a Siri hack to add voice control to his thermostat.  How awesome is that?  (The thermostat he used is the 3M-50 available at Home Depot, a rebranded version of the CT-30 available at Amazon [amzn]).

Looks like his code is here.

Linux Filesystems LOC

The XFS filesystem has taken a beating for being a big, complicated, foreign filesystem since it’s introduction, and there is no doubt that there is a fair bit of code in there.  But an interesting thing happened on the way to the Linux Kernel v3.0.0 - XFS developers have steadily reduced lines of code, while other up and coming filesystems such as Ext4 and BTRFS are steadily growing in LOC and complexity.  And XFS has been under constant improvement at the same time as well.

Some of this is to be expected when comparing a mature product to newer developments, but I still find it interesting.

Notes on the above graph :

  • Comments & whitespace were stripped with CLOC for LOC counts
  • EXT4 LOC includes jbd2 as well.

XFS is actually more heavily commented than EXT4 or BTRFS; XFS is about 39% comments, while EXT4 is about 33% and BTRFS is about 17%.

Another interesting metric is to use Simian to see how much duplicated code there might be:

  • xfs: Found 4806 duplicate lines in 561 blocks in 55 files
  • ext4+jbd2: Found 917 duplicate lines in 116 blocks in 23 files
  • btrfs: Found 2252 duplicate lines in 272 blocks in 31 files

Those high-level numbers aren’t terribly useful, but digging into them sometimes reveals a surprising amount of cut+paste in the course of development.

Other duplicate finders such as duplo and CPD are useful, too – these latter have free licenses.  They all behave a little bit differently…

(edit: Many of the xfs dups are actually a result of the many explicit #include directives in each C file).

JetWay JNC9C-550-LF and PicoPSU-90 problems

+

I got a Jetway JNC9C-550-LF mini-ITX mobile Atom board from Newegg to run sandeen.net, and the plan was to run it off a Pico-PSU 90W [amzn] power supply for maximum efficiency.  But I could not get the darned thing to boot on that power supply.  It worked ok on a 250W ATX ps, though.  I had originally gotten an 80W picoPSU, and that failed to boot, so I RMA’d it.  The folks at mini-box were very nice and helpful, but the 90W behaved exactly the same way.  I was stumped.  As a long shot, I asked Jetway tech support about it, and was rather astounded to get this reply:

Continue reading

New look

I didn’t intentionally change the layout… EPEL sprung a WordPress 3.1 upgrade on me, and it seems the old theme is gone (in addition  to needing a database upgrade before anything would even display, bleah!)  So you’ll have to stare at the lonely guy walking down the country road until I find something I like better.