Hardware doesn’t like me

I’m a software kind of guy. Here’s proof.

Today I went to visit my grandparents, and it turned out their computer wouldn’t boot. BIOS would load up fine, and I could browse the menus fine – but once it tried to go on from there, it would simply blink what looked like half a cursor (that is, half of a “_”-style cursor). I figured it might be the HDD – so I took it home, and decided to connect it to my own box. Upon disconnecting my DVD drive, I destroyed the SATA cord – it had an annoying little metal tab which had to be pushed in before it would release, and it just wouldn’t give, and the connector just broke, exposing and bending the wires.

Checking if the computer still boots, the BIOS took much longer to display hard drive status, and while Ubuntu would start booting, it would fail in the process and tell me that my root hard drive (by UUID) isn’t available. Looking at dmesg, the ata2 module was indeed reporting that the hard drive was too slow – but a few seconds later it would finally access the drive, and mount properly. This problem, however, disappeared once I connected my grandparents’ drive! (Mounting it would fail, telling me that I either have a hardware error or need to connect it to a Windows machine, which I don’t have, and run some diagnostic commands). Sure enough, when the HDD is connected by itself, it gets quite flaky, but once I connect a second drive (back to the DVD, eventually), everything works properly. This probably has to do with the fact that both drives are connected on continuations of the same power cord – but I’ve never experienced such a problem, where you must connect devices to both connectors on the power cord. A hardware guy I know says he’s never heard of such a problem either.

Naturally, these things never happen when I mess with hardware at work, where there are plenty of spare parts…

Thursday, February 26th, 2009 Asides 1 Comment

Whatever happened to black & white LCDs?

I had a Game Boy once. I could play it just about anywhere, and battery life – for the time – was great. I lost it at one point, and replaced it with a Game Gear, which sucked the life out of 6 AA batteries rather quickly. The Game Boy Color was actually decent on battery life, but since it didn’t have a backlight, you had to play it at very specific angles.

For gaming, I can appreciate the need for a color screen. My point has to do with cellphones. True, most cellphones today come with cameras, are able to play video, and are rather capable mobile gaming platforms (when compared to the Game Boy, that is). All this does, in fact, require a color screen. However, I believe that there is a market for cellphones which do not support these features, but do support neat things like 3G internet connectivity (GMail and RSS on the phone is a major Win, in my opinion), and have a comfortable SMS interface. These features actually suffer from having a color screen: Battery life (for the powerful backlight), viewing angle, and screen resolution take a hit. While it’s true that color LCDs have come a long way since the Game Gear, so have black & white display technologies (E-Paper, anyone?).

Of course, my wish for a modern B&W-screen cellphone will likely never come true. The simple reason is that they would be totally unmarketable. Even business-types like color screens nowadays. So I’ll just keep holding out for a folding E-Paper mobile browser.

Saturday, November 22nd, 2008 Asides No Comments

Another SSH trick

Ever have a machine you can only ssh into through another machine? It’s a very common situation in the Technion. Here’s one way to get around it: Assume you can directly ssh into alpha, and from alpha you can ssh into beta. Have the following code in your ~/.ssh/config:

Host beta
	Hostname 1.2.3.4  # IP Address of beta
	ProxyCommand ssh alpha nc -w 1 %h %p

This requires you to have nc (netcat) installed on alpha. Once you do that, you can run ssh beta directly from your own box.

Monday, November 10th, 2008 Asides 2 Comments

Automatically starting rtorrent within screen

These days I don’t stay at home often, but I do have an RSS/BitTorrent combo fetching me all kinds of neat stuff for me, so I can have it ready for me on the weekend. I love rtorrent, especially due to the fact that I can run it in screen, ssh home and see how things are doing (or add more torrent to the download). However, sometimes my net connection breaks down, computers gets shut off, or things like that. This week my router broke down, so I can’t even ssh home to manually start up rtorrent. My solution: A small script, which checks whether rtorrent is already running, and if not – runs it in a detached screen session. Run this with your favorite cron software.

#!/bin/bash
# A simple script to make sure I am running rtorrent in a screen

if ! ps -o uname -C rtorrent | grep -q `whoami`; then
	screen -d -m rtorrent
fi
Tuesday, November 4th, 2008 Asides 2 Comments

Quick time tracking hack

Gnome 2.24 adds a new Time Tracking feature, which I would have found useful. I don’t have Gnome 2.24 at work, but I do have a Unix-based operating system… Here’s my new ~/bin/track:

#!/bin/bash
date >> ~/time_tracking
vim ~/time_tracking +

Now, if I could only get vim to automatically hit “A” and space for me afterwards… (I’m betting there’s a way to do it, but AFAIK vim can only receive ex-mode commands as parameters).

Edit: …and, of course it’s possible. Here’s the new version:

#!/bin/bash
echo "`date` " >> ~/time_tracking
vim ~/time_tracking + -c 'startinsert!'
Sunday, October 26th, 2008 Asides 2 Comments