Monitoring DSL diagnostics on a ZyXEL P-600 Series modem

January 17th, 2010

The DSL at the house has been really flakey the past 3 days. The line seems to periodically drop and I also noticed that the voice line had a lot of static.

I suspected a line problem so I called Earthlink support last night to try to get it straightened out. Surprisingly, the line tested good up until the point where it came into the house. But the diagnostics on the DSL modem were showing low noise margin (signal-to-noise ratio) and high attenuation (degradation), so there was definitely a problem somewhere. The trouble had to be inside the house: either the DSL modem or some wiring somewhere had gone bad or both.

I tried changing out some cables and tweaking the way the phone and fax (my housemate runs her own business) were all hooked up into the line. That seems to have fixed the problem. The line’s been steady for almost 24 hours now. I’ve been watching the diagnostics and researching what the numbers mean, and they seem to be within acceptable-to-good ranges. So far so good.

It was annoying to have to load the web interface on the ZyXEL P-600 Series modem (it’s a P-660R-ELNK) and continually refresh the page to watch the diagnostics. Plus I had to remember if any of the numbers changed and by how much. So I whipped up a little python script to fetch the data from the web interface and do some logging.

There were some interesting peculiarities in the ZyXEL web interface. After authenticating with a password, only that computer’s IP can use the interface, apparently; requests from other hosts get locked out until a few minutes of inactivity. Also, the way the interface refreshed the diagnostics page was a bit odd: it used a form submission to set some state that would cause another page to update its contents.

The script output looks like this:

Sun Jan 17 19:15:37 2010 noise = 16 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:16:37 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:17:38 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:18:38 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:19:38 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:20:39 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:21:39 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:22:39 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:23:39 2010 noise = 18 (good) outputPower = 11 attenuation = 31 (very good)
Sun Jan 17 19:24:39 2010 noise = 17 (good) outputPower = 11 attenuation = 31 (very good)

A copy of the script is available here. You may need to do some tweaking to get it to work with your setup. It works with python 2.5 and 2.6.


I’m Back

October 9th, 2009

I’m way overdue for an update!

It’s been nearly a year since I wrote about returning to grad school. So what’s happened? Well, I didn’t finish my dissertation. It felt nice to work on my research project again, but after a few months, I fell into the same depressive slump. I don’t want to go into it here, but it should suffice to say that, for me, the various burdens of academic life far outweigh its advantages. Though it would have been wonderful to get the psychological closure of finishing my degree before moving on to other things, that just hasn’t been possible. So “ABD” I will have to be….

There have been a lot of other changes in my life as well. I’ve moved to West Philadelphia, one of the most remarkable places I have ever lived. I am also writing code again to earn a living. It is a full-time position, and so far, it’s pretty great. Life is good, for now, anyway.

Working on software again has been sparking a lot of thoughts I haven’t had the time or energy to blog about, but hopefully that will change.


Upgrading a Hard Drive on a Macbook

June 21st, 2009

A little over a week ago, I ran out of space on my 80 GB hard drive. I didn’t think that would ever be possible. For the first time, “df -h” showed available space in kilobytes!

In an ideal world, I’d replace the drive, put a fresh installation of OS X on it, install all my applications anew, and move my data over from the old drive. But since this is incredibly time-consuming, I decided simply to clone everything from my existing drive to a new one. I’d never done this on a Mac before. All seems to have gone well with my upgrade, so I’m posting some notes on my process. Standard caveat: while they worked for me, they may not work for you!

After some hunting and price comparing, I bought a 250GB Seagate Momentus (ST9250315AS) drive at Office Depot and a generic USB disk enclosure at RE-PC. I would have preferred FireWire, but they seem difficult to find in brick-and-mortar stores and they’re more expensive.

Third-party applications exist to clone entire drives, but it turns out Disk Utility works just fine for this. After connecting the drive to the Macbook via USB, it should show up in the application’s drive list in the left pane. There are three steps to prepping the disk (adapted from this site by one “A Brody”):

1) In Disk Utility, select the drive and click the “Partitions” tab. Select “1 Partition” for the Volume Scheme. Select “Mac OS Extended (Journaled)” for the format. On Intel-based Macbooks, the drive should have a GUID partition map scheme, so click “Options…” for a dialog and make the appropriate selection. Click “Apply” to perform the partition.

2) Click the “Erase” tab and erase the disk.

3) Open a Finder window, ctrl-click on the newly created volume, and select “Get Info.” At the very bottom of the window, there is a checkbox pertaining to ignoring ownership and permissions. Change it so the computer DOESN’T ignore these!

Now the drive is ready for data. This part is a bit counter-intuitive: in Disk Utility, select the “Restore” tab. Drag the old volume from the list into the “Source” field. Drag the newly created empty volume from the list into “Destination.” Click the “Restore” button to start the copy. Copying 73G (the actual size of the drive was smaller than the nominal size) took a little over 2 hours.

After the copying is finished, shut down the computer, and swap out the drive by following Apple’s instructions. I needed to use a Torx T8 size driver for the screws attaching the drive to its mount. Be aware that Macbooks and Macbook Pros might use different size screws.

And that’s it! The machine should boot off the new drive.


FixedGearGallery Index 2.0

May 4th, 2009

I created a new interface for my FixedGearGallery Index. What better way to procrastinate than spending a few hours on code?

The original purpose of the index was to provide an easy way to browse through the relevant pages of a particular make/model on FGG. My first version accomplished that goal, but it’s awfully clunky. After using it a while, I discovered how annoying it was to toggle between windows and keep track of where I was in the list.

The new version places navigation controls in a small area at the top of the page. It loads content from FGG into an iframe, eliminating the need for switching among windows. And the previous/next links allow you to browse sequentially, making it much easier to keep track of what you’ve already seen.

It’s not perfect but it’s definitely an improvement. I have fancier ideas for organizing FGG content but I don’t want to go too far by pirating Dennis’ site. I’m grateful he gave me permission to do the index at all when I emailed him about it a few months ago.


On The Death of Newspapers

March 15th, 2009

The hot topic lately among the local blogs and news media is the death of the Seattle Post-Intelligencer as we know it. It’s looking likely that the organization will keep a small staff and move to a controversial online-only format that will include aggregation.

Back in January, Erica C. Barnett wrote some smart remarks on SLOG about how frustrating it is to repeatedly hear the same alarmist voices about the death of newspapers. That blog posting really struck a chord with me. Barnett makes a moderate prediction on how the whole “real journalists vs amateur bloggers” debate will eventually shake out. She seems to keep the focus, though, on questions of quality and professionalism. But I think what people don’t talk directly enough about are the particular interests that are inevitably at stake in different venues of reportage.

I was reminded of this again recently with this week’s On the Media program on NPR about how ethnic newspapers are thriving. That show really gets it right. It points out how the ethnic composition of society has been rapidly changing while mainstream newspapers have remained stubbornly focused on their target demographic of the suburban white middle-class.

The death of newspapers isn’t about the triumph of new media, no matter what people may say. When people argue that newspapers have been vital to democracy, I can’t help but laugh. When have mainstream newspapers ever been venues for populist voices or organs for the oppressed? In actuality, they’ve tended to be ideological proponents of middle class values and maintainers of the status quo.

No, what this is all about is the growth of new social classes: vital immigrant populations, younger generations who refuse the strict divisions of being either a consumer or producer, previously “fringe” groups eager for publishing/interactive venues to develop their own social and political interests and subcultures. It is these new social classes, and not simply the new publishing opportunities of the web (which, alone, are inert), that threaten the hegemony of traditional journalism. I think a lot more needs to be said about what kinds of stories and information the so-called “new media” as well as the alternative print press are producing in the age of the newspaper’s death. What new interests are we seeing at work in blogs? Who gets to have a voice now, and who is still left out? How is all of this redefining what counts as worthwhile or credible stories or events? These are the real questions of substance—with real implications for democracy—that will determine what the death of newspapers will ultimately mean.


When Your Blackberry Loses Its EDGE

March 12th, 2009

An old entry about my T-Mobile phone gets some search traffic, so I thought posting about this experience might be helpful to other desperate googlers as well.

Two days ago, the Internet access—that is, the EDGE connection—on my Blackberry Curve stopped working at my apartment. Voice calls still worked fine. Occasionally the signal would flicker between GSM and EDGE, which has never happened in the past. If I walked four blocks away, applications like the browser and mail client would work again. EDGE also worked on campus, four miles away. So, for some mysterious reason, this problem was location-specific to just the tower near my apartment. It took two days to even figure all of this out.

Three separate calls to T-Mobile did no good, mostly because I didn’t have easy access to another line so they could troubleshoot my Curve. They did something called a “location reset,” if I remember correctly, but that didn’t help. So I started googling some forums and experimenting.

From what I’ve pieced together, the problem above can occur if Service Book settings get corrupted. The way to fix this is to get a new set of Service Book data sent to your phone from the provider. On the Curve, you do this in the following way:

- Select “Options”
- Select “Advanced Options”
- Select “Host Routing Table”
- Hit the Menu key and select “Register Now”
- The phone will re-register with the provider, who will send new Service Book data to the phone.

Obviously, EDGE has to be operational for the data to be sent, so this fix only works if EDGE is broken in certain locations but you can still make the registration request elsewhere.

Hope this helps someone.


The GoDaddy.com Auto-Renewal Headache

February 1st, 2009

Today I got two emails from GoDaddy.com. One informed me that a few of my domain registrations were about to expire. That was expected; I no longer wanted them. The other was a puzzling order confirmation. My credit card had been charged for renewal of “business registrations” for those same domains.

So while I no longer owned those three domains, I did now have active business registrations for them costing $4.99 each. (I actually can’t even remember what those are or why I had them in the first place.) Great.

It actually took me a few minutes of navigating the insanity that is GoDaddy.com’s website in order to figure out what had happened. Under “Domain Manager,” my settings had auto-renew set to Off for each domain, which was correct. But under the “Business Registration” page, there is no such setting. The interface only allows you to edit profile information. There appears to be NO WAY to turn off the default auto-renewal for business registrations.

To their credit, I was able to call their billing support number, explain my situation, and get a refund. The person I spoke understood immediately what had happened and was extremely helpful.

Beware, GoDaddy customers.


Okay, I lied.

January 6th, 2009

When I needed a break over the holidays from my research, where do I turn? To coding, of course.

I’m a FixedGearGallery addict. The idea of the site is that people send in photos of their fixed-gear bicycles and usually some details about how they built them up. The site is updated every weekday with new entries. Yeah, it’s a little dorky but for bike nuts (like me!), it’s a lot of fun. There are some really creative things people have done with their bikes.

I decided to write a little script to parse the FGG listings and create an index organized by “marque” (make/model). There’s already two search functions on FGG, but my index lets you browse and also provides a count for each marque. It’s just another way to navigate the content.

Here is the link: http://codefork.com/fgg/

Enjoy.


My Perl Hating Days are Over…

November 13th, 2008

… as are my coding days in general. Since September, I’ve returned to grad school.

The decision wasn’t one I made lightly. And with the economic slump, I often wonder if I’ve made a smart choice in taking a 400% pay cut, only to return to teaching and writing my dissertation. In good times, the job prospects for my field were poor; in bad times, they may be practically non-existent.

So why do it? I miss having the kind of intellectual stimulation centered upon social impact. Application programming is challenging and fun, but I no longer find it as fulfilling as I once did or as others do. Increasingly, it is a thankless job where the headaches tend to outweigh personal growth and learning. In the past year, the best gig I had involved smart architecturally-minded people and a strong project lead. And that was pretty nice, though I still felt something missing. The worst gig involved passive aggressive people who mostly feigned their knowledge. It’s interesting that since I left that job, my replacement (a “CTO” who asked for double the salary) did many of the things I recommended, including a complete overhaul of the codebase. Oh well, I guess they needed to hear it from someone other than me.

So this post is a good-bye of sorts. I may still blog occasionally here about technology when the mood strikes. And I have an idea for a project I’d like to do once my time frees up, one that is more about today’s “culture of technology” than about coding.

Thanks to everyone for reading.


Perl Makes You Cry Harder

August 20th, 2008

Slashdot is linking to an ONLamp.com article, Why Corporates Hate Perl. I think it’s interesting that while zealots exist for every language, you rarely encounter the kind of vehement hatred for a language the way you do for perl. Which probably just fuels the antagonism in both directions.

Many Slashdot comments point out that the requirements specific to corporate environments are rather idiosyncratic. Some stress the “right tool for the job” philosophy, which I totally agree with.
And here’s one that makes a wonderful characterization about what perl is and is not:

The problem is, Perl is just a programming language, not a conceptual system. Arguably it is the antithesis of a conceptual system. Many teams then create their own application frameworks atop it (e.g. Mason, POE), and it’s rare for these frameworks to be compatible since Perl offers so many variations in the construction of even standard programming artifacts like classes & objects.

In addition, the level of expression (i.e. TMTOWTDI) means in practice that highly varying programming styles occur throughout large, long-lived bodies of code.

As a result, significant Perl-based business applications tend to become hard-to-maintain hairballs of divergent style and subtly variegated concept.

The root cause: as I started with; the absence of a standard conceptual framework for Perl means that during the early phases of a project, it’s much harder to reason meaningfully about the eventual form of the system than it is with, say, Java or .NET where many of the design patterns are explicitly standardised.

I wouldn’t say that “Corporates Hate Perl”. It’s just the Perl as an application language doesn’t suit the formal design & architecture process we’re seeing increasingly as IT departments start to grow up and realise that they’re not the most important people in the company.

That doesn’t disqualify Perl from being a useful tool, and it’ll always have a place in data transformation, but it does mean that Perl isn’t going to be one of the general-purpose application programming languages of the future.

Bravo. I’d add that what the author identifies as a “problem” is also Perl’s strength. There’s more than one way to do it, so do it as you please. That definitely has allure for many programmers. As a project scales up, though, I think this does in fact become a detriment, and not only for corporate projects.

In response to someone who wrote, “chomp is not ambiguous. RTFM and stop crying,” here’s another awesome comment:

http://perldoc.perl.org/functions/chomp.html [perl.org]
This safer version of “chop” removes any trailing string that corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the English module). It returns the total number of characters removed from all its arguments. It’s often used to remove the newline from the end of an input record when you’re worried that the final record may be missing its newline. When in paragraph mode ($/ = “” ), it removes all trailing newlines from the string. When in slurp mode ($/ = undef ) or fixed-length record mode ($/ is a reference to an integer or the like, see perlvar) chomp() won’t remove anything. If VARIABLE is omitted, it chomps $_ . Example:

If anything I’m crying harder after reading that.

Amen, brother.