Wednesday, February 10

Linksys WRT310N is a FAIL

I bought this router a couple months ago and, for the most part it seems to do it's job.  It's nothing fancy, but I have had a very strange issue for a while now where I simply end up going to the wrong page.  Facebook ends up on Myspace.  Endless SSL issues where the site I am trying to hit is not the SSL certificate I get.


My first thought was that someone was messing with my router.  It's happened before even though it's locked down to mac addresses, the radio is off, and the router is secured.  After searching through the logs, confident that no one was in there maliciously, I headed to the next likely culprit, my ISP.  Where I live in the country, broadband internet choices are limited.  I chose DSLExtreme... funny name, but their service is good and their support staff not only speaks *good* English, they are actually knowledgeable and they don't just mindlessly follow a flowchart.  However, the fact that they are not a Verizon or AT&T sometimes makes me wonder if there may be wonkiness that the big guys have already worked out.  Still, after talking to the techs there for about a half hour, we found nothing.  They suggested I clear the DNS cache on my router and my computer.  I did that and it seemed to work for a while, but the problem came back not long after.

In retrospect, now that I know what the issue is, it's pretty obvious why it worked immediately after clearing the cache, but the problem cropped up again so quickly that I actually thought it was not fixed.  So I dealt with the issue for a while until this morning, when I actually got so fed up with it that I went searching.  Turns out there's a whole community of people with the same problems as me.  The user forum for the 310n has a thread started sometime last September which points to the issue that also occurs on the 160N

The worst part about it is, Linksys is not fixing the issue.  Multiple people have gotten the "Sorry, we've never heard of this issue before." ... FAIL!  In an interconnected society like we have now with user forums, social networking and so on, you can't tell more than one person that or we all know about how bad you fail.

The workaround works.  I might even venture into the DD-WRT world, which has an experimental version of their firmware that is supposed to work.  Still, this seems like a pretty obvious issue that needs to be fixed and not with a workaround like editing network settings on the computers.

Monday, January 25

Polyphasic sleep... an also-ran story.

Yeah, I'm trying it.  The duties of husband, father, son to aging parents, and geek simply demand more than 16 waking hours.  No, this blog is not about to become an Uberman blog... although I'd probably get more hits that way.

As I sit here at 5 am EST, I am about 5 days into the adjustment period.  It is difficult... not the most difficult thing I have ever done, but it is definitely not easy.  In doing this I have discovered some things about myself, which are always fun.

1. I am not as undisciplined as I thought.  I just really have to want something.  The idea of only having to sleep 2 hours a day and being able to maintain that over long periods of time is extremely enticing.

2. It is friggin cold in my office at 5 am.

3. I like sleeping in.  I like the feeling of knowing I'm supposed to get out of bed and rolling over instead.

4. My hardest nap to get up from is the one from 4am to 4:20am.   I usually need every alarm at my disposal to do it.

5.  In the 5 days I have done this, my time required to fall asleep has greatly decreased.  I am now falling asleep in 1-4 minutes instead of 20 minutes to an hour.

What I can't find are references to ill-effects on health.  I have seen a few testimonials but no hard evidence.  I think it is worth study.

Friday, January 22

The Door to Nowhere

Ever seen something like this:
epic fail pictures
see more Epic Fails

It's one of those things you wonder... what were they thinking when they designed something silly like that?

You see examples of this all the time in code... hey, I'll admit it, I've *done* stuff like this before.  You build an opening for extension to something that can't possibly exist in your application.

This is one of the reasons I believe lean software development is so difficult.  Anyone can walk by this door and notice that it has absolutely no conceivable use besides making it easier for someone to fail at suicide.    However, layer upon layer of abstraction sits in our code today with absolutely no conceivable use except that it's "abstract" and "extensible".  Architects draw pictures of nicely abstracted applications, neatly separated concerns,  and built in abstraction for extensibility.  They then look at the picture, pat themselves on the back, and then hand it off to a peon developer.

Lord Architect: "Here developer, all you need is right here, just code it up.  It shouldn't take you longer than an hour."  
Programmer: "Why do I have to build three classes just to build a calculator that can add and subtract?"  
Lord Architect: "Because around here we use interfaces for everything so it is extensible."
Programmer: "But you have a method in the Calculator interface called, checkSpelling... isn't it a calculator?"
Lord Architect:"We design code for re-usability and extensiblity.  This fits with the long term design concept and it's already been approved.  We can remove it later, but write it like that for now."

Bottom line, building software is not like building a bridge, or as in the example, a mall with doors that make sense.  However, there are striking similarities in the finished product, the difference being that, in software, they are a lot harder to recognize until you get your hands deep into the code.

 While not a silver bullet, there is a way to avoid a pitfall like this and it comes from the book Practices of an Agile Developer.  Architects must write code.  It is a lot easier to see the stupidity of an idea as it is being built than trying to work with it after the fact.

An addition of my own, developers must challenge the architect when something doesn't make sense.  Most developers are just as qualified to be architects as the architects themselves and they can often see waste as they are building it.  I guarantee the construction workers who installed this door said, "This is pretty stupid."  If you are in an environment where architects design applications but don't code, the onus is even greater upon the developer to raise a concern if something doesn't make sense.  Architects, no matter what they think they are, are not gurus or gods of programming.  If the design doesn't make sense, they should be open to the idea that what they designed won't work in practice.  A mature, professional architect should not even want a programmer who is just a robotic extension of themselves. 

In addition, if you are a programmer, you are expected to think, not just type as fast as you can to get the architect's design down on paper.  It is unacceptable for a developer to say, "This is stupid" but then build it anyway.  If they ask a question, maybe there actually is a reason and they can be much more satisfied in their solution.  Working together and fostering an environment of open communication where people give and take constructive criticism is essential to producing applications that do not succumb to problems like the Door to Nowhere.

Reblog this post [with Zemanta]

Monday, January 18

Measuring SSD performance : Follow up

After writing up this post I decided to go out and see what else I could do to speed things up.  I saw a suggestion for tweaking sreadahead, but ureadahead is what we use in Karmic and it already detects and optimizes for SSDs.

I did however see numerous suggestions for the addition of elevator=0 to the grub boot parameters will increase performance even more.

Here are my results:
$ sudo hdparm -t /dev/sda
/dev/sda:
 Timing buffered disk reads:  462 MB in  3.00 seconds = 153.85 MB/sec

$ sudo hdparm -t --direct /dev/sda
/dev/sda:
 Timing O_DIRECT disk reads:  642 MB in  3.00 seconds = 213.91 MB/sec

According to that, the improvement is minimal, but the dd test gives slightly different results:
$ sudo dd if=/dev/sda1 of=/dev/null bs=4k skip=0 count=51200
51200+0 records in
51200+0 records out
209715200 bytes (210 MB) copied, 1.04065 s, 202 MB/s

Wow, 178 to 202.  And it does feel even snappier in my environment. To implement this tweak, go to your /etc/default/grub and make the following change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=0"

Then update the grub configuration:

sudo update-grub

Note, DO NOT make changes to /boot/grub/grub.cfg.  This file is overwritten every time update-grub is run, which happens whenever an update is made that the bootloader needs to know about(new kernel, etc).
Reblog this post [with Zemanta]