Hello, Dell!

Dell Latitude D620 As i wrote before, given my (mis)adventures with IBM/Lenovo I decided to change my allegiances and switch to another brand. So during the research phase I took some time to go to the Dell Expo and get to know their laptops firsthand.
One of the questions I had was about the keyboard: after so many years of working with Thinkpads I have become addicted to the TrackPoint, and I was sure that I had seen photos of Dell laptops with such device, so whatever laptop I decided for really had to have it.
I quickly found out that the laptops in the business line -the Latitudes- are the only models to sport such contraption under the Dell-esque name of “Track Stick”. As a matter of fact, besides the Thinkpads they are the only notebooks *anywhere* that still have it, so either they were found unusable by a significant amount of people or IBM tried to milk its patents just a bit too much. Personally, I believe the Trackpoint is the invention of the century right next to the Twiddler (and lately, even _on_ the Twiddler2) but then again some people believe I am somewhat eccentric when it comes to input devices.
So there I was with the entire Latitude line before me to consider. The D420 is very nice and would make a killer travel notebook, but its specs are somewhat conservative for my needs. And the D820 has a nice screen but is way too heavy. So I settled for the D620. I received it last week and I am documenting how to make it work with Debian GNU/Linux.
So here is my hands-on review of the Dell Latitude D620:
Pros:

  • Lightweight: About 4kg with the extra battery.
  • Has a TrackPoint (great for mouse navigation) and a Touchpad (great for erratical mouse movement while typing but useful for scrolling) that fortunately can be switched off.
  • Decent battery life even with a 6-cell.
  • Nice full-sized keyboard with fair displacement, good tactile feedback and a satisfactory click. I could almost forgive Dell for the inclusion of a Windows key instead of a realistically-sized space bar.
  • Mostly supported out-of-the box in Kernel 2.6.16; so far, full support for the devices I’ve tried has involved just a bit of recompilation
  • Nice screen with fair brightness and I haven’t detected any dead pixels so far.
  • Gets kind of hot, but not too much.
  • Real dock connector barring the need to resort to a cheesy USB port replicator
  • Somewhat dull gray-and-black color scheme, but it’s not pre ugly (for a business laptop).
  • Built-in smartcard reader (shows up as an USB device).
  • Built-in fingerprint reader with startup protection right after POST.
  • Did I mention that it has a Trackpoint?
  • Built-in WiFi and Bluetooth.
  • Built-in Wireless broadband with US-centered overpriced carriers (No idea if any of the hardware options would work with some Mexican overpriced carrier, but there is an intriguing SIM slot under the battery anyway).
  • Built-in accelerometer that might be readable under Linux. This might end my MacBook-lightsaber envy.
  • Full Type-II PCMCIA slot instead of ExpressCard, so I can wardrive while I work.
  • Four USB ports.
  • Light sensor for automatic brightness adjustment.
  • Windows Vista capable (*Heh!* Like I care…)
  • Up to 4GB of RAM, if you dare sell your firstborn, your kidney, or your firstborn’s kidney to pay for it.
  • A real parallel and -check this out- DB9 serial port.
  • The inclusion of a TrackPoint is a stroke of genius.

Cons:

  • It really could use a keyboard light (Why do manufacturers still refuse to include them by default? That’d be… what? US$0.05 for a white LED and a switch when bought in bulk? But nooooo…).
  • Both the trackpoint and the touchpad have only two buttons (Unix types may note that there’s one button missing).
  • The 9-cell battery protrudes 1.5in from the front of the laptop instead of going on the back like in IBMs, so it kind of gets in the way and looks very much like an aftertought.
  • Those videos of exploding Dells still give me nightmares.
  • Sorry… no built-in webcam, nor multi-format memory card reader, nor JVC or Bose speakers, nor translucent white lid. This is a business laptop, remember?
  • No Firewire. In this era of Firewire-800 external hard disks that is a serious oversight.
  • The system beep is loud and annoying. Scare-the-cat annoying. Wake-your-neighbours annoying. Get-hit-by-your-wife annoying.
  • No built-in SVideo nor DVI, thought there’s both on the port replicator. Not much of a problem for presentations, but you really need the port replicator to use a decent LCD screen.
  • The Dell USB keyboard is kind of awkward. I keep falling off the left edge, and I have trouble finding the ridges in the F & J keys for touch typing.
  • Sparse to non-existent printed documentation. There’s no manual to ignore. You can get them online if you want them badly. The Service Manual looks interesting, tough.

BTW if anyone from Dell is reading this: please update the configurator for LatinAmerica. You cant’ save your cart. You can’t email it. You can’t even *bookmark* stuff for later perusal. The LA site is primitive, counterintuitive and sometimes even downright annoying. Basically, it got stuck in the 90s.
On the other hand, Dell service was good. Thanks and kudos to both Ivan Castillo -who walked me through Dell’s product line during the Expo- and to Jesus Naranjo -who took my order and was very patient with my obsesive-compulsive hardware demands. One week into it I still haven’t had need to deal with their tech support personnel (Fate has carried on like that for a bit longer) and I hope it stays that way. If they are 50% like their sales people then I have nothing to fear, and altough I have heard some horror stories about them I’m willing to give them the benefit of the doubt for the time being.
In short: Dude, I got a Dell!
[tags]Dell, D620, Review, TrackPoint, Customer Service[/tags]

μHOWTO: Install perl libraries in bulk

When you have to install packages that live out of dpkg, don’t you hate to install their dependencies by hand? I do.
Even though this is exactly what CPAN.pm does, there is a Debian way: If you have another machine with the correct dependencies already installed, you can use dpkg to copy those over.
For instance, this one-liner requests installation of the same Perl libraries that live in another machine:

$ ssh original.machine.com 'dpkg --get-selections'|grep '^lib.*perl'|grep 'install$'|dpkg --set-selections
$ sudo aptitude -f install

You may replace the first regexp to whatever your want (e.g. “^libapache-mod” for perl modules, “^lib.*java” for Java libraries and so on).
Gotta love Debian.
[tags]Debian, Perl, linux, apt, sysadmin[/tags]

Goodbye, IBM / Lenovo!

After flickering in-and-out for a few weeks and then getting a misterious red tint, the IBM Thinkpad R50’s display got well for a couple of months before getting all flickery again and dying for good. It was the nicest display you could find in any laptop of its class, even tough it is rather opaque and has its share of glare. I called IBM Tech Support and they told me that I could send it to Guadalajara for service after paying USD$70 for shipping and diagnostics (the backlight’s out, what else is there to diagnose?). I called IBM Guadalajara and was told that I had to pay over USD$100 instead, which I paid up anyway. Then they promptly proceeded to lose my service order for a month, time in which apparently IBM finally managed to kick out Lenovo employees from their Guadalajara offices. After calling their new number repeatedly, I got in touch with them and they finally managed to ship me a prepaid box to send the laptop out.
Well, as it turns out they have to replace the display. Big surprise! Wanna know how much that’s going to cost? Over US$900, thank you very much. You may be aware that the price of the display is more than enough to buy an entirely new laptop of almost any other brand.
Well, let me tell you about brand loyalty: My first brand-new PC was a IBM PS/2 55SX in the early 90’s. I worked like crazy for an entire summer and the next semester to get my hands on a luggable P70. I even sided on microchannel against EISA during the bus wars. Overall, for over 15 years the IBM Thinkpads had been my favorite notebooks. And I advocated them everywere, because even tough they were *very* expensive, their quality was outstanding.
And up to the 600 line they were excellent. But the L series was terrible, the power brick and the laptop itself overheated a lot and overall had awful power subsystem glitches. Anyway -and against my wife’s warnings- I went and bought this R50 anyway just because bdelgado got me a good deal, but it came with a bad hard disk right out of the factory, has a battery that degraded incredibly fast (half the original lifetime in six months of moderate usage, and nowhere near the advertised lifetime to start with), had to have its motherboard replaced barely a month before the warranty expired and it still overheats and has glitches in the power subsystem.
And to think that I was already looking into getting a Thinkpad X41 right before the R50 crapped out.
So decided that I am not going to spend that much money to replace the display in an outdated laptop. Moreover, I’m not willing to keep pumping money into a company whose QA processes seem to have disappeared, and whose service has got so bad that they lose a service order for an entire month.
So, goodbye IBM. Or Lenovo. Or whatever manufacturer they sell out to next. And hello Dell. I just bought a Latitude D620 and I’ve started to document my adventures with it. I will keep all of you posted on that.
In the meantime it’s goodbye forever to IBM/Lenovo computers. Thanks for the memories, but I’m not looking back, and it feels really good.
[tags]IBM, Lenovo, Thinkpad R50, Laptop[/tags]

WPG2 Sidebar Widgets 1.0

Gallery2After playing around with the WordPress Widgets plugin I wrote a couple of widgets for WPG2 borrowing heavily from the sample widgets in the widget plugin distribution and also from Otto’s Google AdSense widget.
WPG2 Random Image and WPG2 Grid Block are released into the public domain, and you can download version 1.0 right here.
Oh! BTW, I just set up a page for these widgets.

[tags]WordPress, WPG2, widgets[/tags]

WordPress 2.0.3 inside

WordPressLast Sunday I upgraded WordPress to 2.0.3, and I have to confess that I am very impressed. After a couple of disastrous dry runs in a spare server, I backed up everything and decided to go for it on the production system — half expecting it to crash somehow. However the upgrade went smoothly, and almost every plugin just kept working exactly as before, with the sole exception of WPG2. Since the website recommends to upgrade to Gallery2 2.1.x and to the new WPG2 2.0 plugin, I did just that and got the embedded gallery working again in no time.
Kudos to both WordPress and Gallery2 teams. You have created nice pieces of software, and are setting a high standard for commercial and Open Source blogging and photo gallery software.

Kudos, and thanks.

[tags]WordPress, blog, Gallery, Gallery2[/tags]

Add swap space to Linux

This is an old sysadmin trick, but a good one all the same.
Suppose that you finished installing a brand-new Debian GNU/Linux server, and for whatever reason you forgot to set aside some space for a swap partition. Or you correctly got some swap space at installation time but now you desperately need some more. Well, despair not. It’s a little known fact that you can have swap space in a file on top of the filesystem instead of using a dedicated block device.
This simple recipe will give you 2Gb of swap space. Here we go:

# mkdir /var/swap
# chown root.root /var/swap
# chmod 700 /var/swap
# dd if=/dev/zero of=/var/swap/01.swp bs=1024 count=2M
# chown root.root /var/swap/01.swp
# chmod 600 /var/swap
# mkswap /var/swap/01.swp

Now add this newly created swap space to your /etc/fstab:

/var/swap/01.swp       none    swap    sw              0 0

Teoretically, you won’t get the same performance as using a dedicated block device, and if the file actually gets fragmented it might drop rigt to the floor, so if you try this at all do it as soon as possible after installation. So if what you’re trying to do is to *increase* your available swap space instead, you may add a priority option to give preference to the block-device swap space:

/dev/hda1              none    swap    sw,pri=1              0 0
/var/swap/01.swp       none    swap    sw,pri=2              0 0

And just this time activate the swapspace with addswap (The initscripts will do it on every boot thereafter):

# swapon -av

That’s all there is to it. I particularily like how newer BOFH generations look at this with some skepticism at first, and with endless amazement later.

[tags]Debian, GNU, Linux, swap, sysadmin[/tags]

reiserfs and dd_rescue for data recovery

Last thursday the hard disk drive on a development machine died big time. First it started to behave erratically and dmesg showed that it has having trouble with some bad blocks. It did not survive a reboot: ReiserFS woud not mount it on boot, and reiserfsck running from an Accelerated Knoppix CD refused to bring it back to life. At first glance, the disk was beyond repair.
Of course, upon closer inspection, it turned out that the warranty expired exactly two months ago. Normally -after swearing my heart off- I would just replace the disk and make myself a nice paperweight or some other modern art piece -I’ve been looking forward to make one of those nice HDD clocks– but in the guts of that particular HDD were some uncomitted changes that I just wasn’t on the mood of rewriting. Besides, even though most of the data was expendable, the configuration hadn’t been backed up in quite a while (Yes, there is a pattern here).
So here’s the recipe I usually apply in these situations using Kurt Garloff’s dd_rescue. First get a brand-new HDD of approximately the same capacity and place both disks in a working Linux box (Depending on your necessities, booting from Knoppix might do). Let’s call the old, dying HDD /dev/hdg, and the spankin’ new disk will be /dev/hde. For the sake of simplicity, let’s assume that /dev/hdg was partitioned in /dev/hdg1 for swap and /dev/hdg2 for data.
First we’ll copy the entire data partition from /dev/hdg2 to /dev/hde2:

# dd_rescue /dev/hdg2 /dev/hde2

This will take a long, long time. dd_rescue starts with a reasonable block size, but whenever it encounters and error it retries a few times with a smaller block size before skipping the defective blocks and moving along. This is useful because it will copy all data in every readable block, instead of giving up at the first error like dd does. In my case, this took more than a day for a 248GB partition.
Once the data is in a new disk you can try to mount it directly, although it is a good idea to run reiserfsck first to make sure that the files you’ll copy are usable.

# reiserfsck /dev/hde2

Now here you might run into a small obstacle. Ideally I would buy the exact same model as the old drive for recovery purposes, because that guarantees that an exact bit-for-bit copy will work in most cases, partition maps and all. However in this case I bought a different brand, which resulted in a slightly smaller drive and a completely different geometry. When this happens, reiserfsck will complain about the different partition size, and suggests that you rebuild the superblock:

# reiserfsck --rebuild-sb /dev/hde2

Now you can do a normal reiserfsck.
When you’re done just mount the new partition and copy your data to a safe place:

# mount /dev/hde2 /mnt/tmp
# rsync -a --progress /mnt/tmp/etc /backup/dir/
# rsync -a --progress /mnt/tmp/home/arturo /another/backup/dir/

After this you can reformat the new drive for normal usage. Mine is being debbootstrapped as I write this.
This little recipe has saved quite some data and a few disks, including most of mcleod’s late Xbox hard disk. As usual your mileage may vary, but with a litle luck you just might get some of your files back.
Now about that crappy Maxtor HDD… I might just go for the wind chimes instead.
[tags]Linux, sysadmin, reiserfs, dd_rescue, data recovery[/tags]

Amplifying ignorance through technological empowerment

There are numerous reports around the Internet about a supposed fraud. People that has never heard about the Drunkard’s Walk is firing up Excel or SPSS to plot variables and doing correlations, and while some of them actually ask for interpretation from someone else (an expert, preferrably), all of them are quick to state that the election is rigged, even when they lack either the knowledge or the experience to realize that they are wrong. Most arguments are critically flawed, the methodology is just wrong or anything resembling actual math is completely absent.
Some people are amazed when they apply a curve-fitting algorithm to some data and then -OMG!- it actually fits (What the fuck where they expecting?). Some other people find linear correlations in time series that represent percentages. A lot of people -a whole lot- are amazed that the lines in the PREP never crossed and believe that it is impossible. A couple of so-called experts were on the radio today discussing “mathematical irregularities” without providing real -scientific- arguments. AMLO himself has spoken about “mathematical impossibilities”. His cynicism -and the irony of the phrase- is mindboggling.
I have seen this same problem before in another context, and you might be familiar with it too: Someone learns to program using Visual Basic by drawing buttons and filling up code. He’s a programmer, right? Now he fires up VB.NET, learns to draw “web forms” and fills out some more code. Now he’s also a web programmer!
The same thing happens in other circles. For instance, we all know that anyone that can fill up a form in Blogger or LiveJournal is a journalist. Now we can prove that this very same phenomena -technological empowerment amplifying ignorance instead of supressing it- seems to work out with statistical programs -even with spreadsheets .
Hypothesis: If you give them SPSS, everyone is a statistician.
[tags]Mexico, IFE, PAN, PRD, PRI, Mexican Elections 2006, Math, Statistics, Ignorance, Education[/tags]

Mexican elections 20060704 @ 1600hrs

The PREP does not determine the actual winner, but a preliminary result within a certain error magin. The “Preliminar” part in “Preliminar Electoral Results Program” is conveniently ignored by many. Since the election numbers are too close to call, and given the error margin (that may account for human error, among other things), the IFE decided to go for a full vote before pronouncing a winner.
The data that the PREP reports is NOT random. The time series does not reflect the measurement of a social variable (e.g. number of births) but a sucessive approximation to a final state (the number of votes for each candidate).
There may be validations in place to detect typing errors (e.g. 129 instead of 124, 272 instead of 212) using the sums in the voting documents but the IFE may not be willing to discard the results of internally inconsistent voting documents (e.g. a bad sum).
The rules are clear, signed by every political party and written somewhere, but the great majority of the people does not know what they are.
As usual, the problem is either education, simple ignorance or disinformation.
[tags]Mexico, IFE, PAN, PRD, PRI, Mexican Elections 2006, Math, Education[/tags]

Mexican elections 20060703 @ 01:00hrs

Yesterday at 11pm IFE asked for prudence and -mostly- for silence. Once again, *both* PAN and PRD ignored the authority and jumped the gun to declare themselves the winner. The PAN cited hard -if somewhat uncertain- numbers. The PRD called to defend the vote, and that they will respect the results if the are real and the process was clean, which to me sounds like a poorly veiled threat. PRI -irrelevant as it may seem- is still in sweet denial and define themselves as “Mexico’s most important force for stability”, setting the table to negotiate with whomever comes out on top.
Myself, I will go to bed without the certainity of either a bright or a bleak future for me, my family, my business and my country, even if these elections demonstrate beyond doubt that those discrete black-or-white realities don’t apply to Mexico anymore. Uncertainity is definitely a lot worse.
I guess Paco Calderón says it best.
Now I just hope the rest of the world behaves with more responsibility than the candidates and that the market doesn’t punish us too much.
Please?
[tags]Mexico, IFE, PAN, PRD, PRI, Mexican Elections 2006[/tags]