Feb 9, 2010 - Why sending e-cards is rather rude

Valentine's day is upon us, and like many other special days throughout the year a pesky aspect of the internet rears it's head again: e-cards.

For one thing, spammers jump on the opportunity and send around intriguing e-card announcements of the form "somebody sent you an e-card" or "n people want to meet you on network x". It's a good idea to never click on those links in emails, as most likely they'll just link to a scam.

So that is one reason not to send e-cards: it endangers the recipient, because he is getting used to clicking on e-card links, which might be hazardous. The better e-card sites are capable of including the senders name in the email ("xyz sent you an e-card"), but even that is no guarantee that the e-card is legitimate. It is easy to harvest the names of a person's friends from various social networks (Facebook and others) and simply pretend to send e-cards in their name.

One way to at least send a reasonably safe e-card would be to use a very well known and trustworthy company, like Yahoo, Google or Amazon (and that list is probably the complete list, I can't think of any other well known sites). But even then it is still rude: by sending somebody an e-card, you are giving away that person's private information, namely their email-address. Chances are high that in addition to your lovingly selected e-card, that person will also receive a never ending amount of spam mails for the rest of their lives.

If you absolutely want to send a greeting card by mail, just attach a regular JPEG image to an email you sent from your normal email program. Otherwise, why not invest in a real postcard? I know there are a lot of funny flash movies available for special occasions, but really JPEG is preferred. The chances for security holes in JPEG viewers are very small (although not impossible), and the same can not be said for most other formats like flash or Power Point.

That said, I admit that the occasional e-card from a friend has given me a warm fuzzy feeling. I don't really expect most people to understand the issues with e-cards, or with giving my email address to a 3rd party. But I'd prefer it if they did, hence this article.

Feb 4, 2010 - Exchanging a hard drive with Ubuntu LiveCD and gparted, disk image created with dd

The S.M.A.R.T. monitor has been warning about imminent failure of the hard drive in my mother's laptop, so it was time to exchange it. Since it is running Ubuntu Linux (version 9.10, Karmic Koala), I was looking for ways to create an image of the old hard disk and transfer it to the new hard disk.

My initial googling didn't immediately yield definite results, even though I found some comments mentioning "dd". Therefore I wanted to quickly summarize the steps I have taken in case anybody else looks for something similar.

While I found forum threads recommending a variety of tools, they were usually several years old. Therefore I wasn't sure if the recommended tools are still state of the art. Also I preferred a disk image over using the recovery mechanisms of the backup software (sbackup or rsync), as I wasn't 100% sure if permissions and everything would work out OK on a fresh install of Ubuntu (probably, but a disk image just seemed cleaner).

Then I found this blog article about copying a disk with dd and decided to stick with it. Other than in that article, since I didn't have a way to connect the new hd without installing it in the notebook, I first copied the image to another external hd. Then I exchanged the internal disk and copied the image back onto the new internal disk.

To do the copying, first boot the notebook from the Ubuntu CD ("Ubuntu LiveCD"), to run Ubuntu from the CD and not from the internal hd. That way, the conents of the hd don't change during the copy process. Booted into Ubuntu LiveCD, I quickly changed the keyboard layout in the settings -> keyboard menu (it defaults to US layout, but I have German). Then I mounted the external USB disk by selecting it in "Places" (or clicking on it in Nautilus, the Ubuntu file explorer).

Then open a shell, and create an image of the internal hd by executing

sudo dd if=/dev/sda of=/media/name_of_external_disk/image_name

The sudo might be optional, in my case I needed it because the external hd was only writable for root. If the external hd doesn't have a name yet, you can assign one with GParted or Disk Utility (I forgot which).

This might take a while, depending on the size of the internal hd. The resulting image will be as big as the capacity of the internal hd. dd will copy the whole hd, no matter how much of it is used or not. Also dd does not give any progress reports, so just be patient.

As the article I linked to mentioned, it might be a good idea to check with
sudo fdisk -l /dev/sda that /dev/sda is the right hd (I recognized it because of the size).

Now, power down and exchange the internal hd, then boot up with the Ubuntu LiveCD again. Again, change the keyboard layout (if necessary) and mount the external hd. (I actually rebooted once because at the first time there was a hickup mounting the external hd. After the reboot it worked).

Then write the disk image back using

sudo dd if=/media/name_of_external_disk/image_name of=/dev/sda

(again, checking that sda is the right target with fdisk might be good).

If the new disk is the same size as the old one, that's it. Otherwise, the partitions on the hd can be resized with GParted to make them use the whole disk. GParted can be started from the Ubuntu Administration Menu.

I had only one problem: the hd had a "normal" partition containting the main file system, followed by an extended partition that contained the swap partition. Somehow I couldn't move the extended partition or the swap partition, and therefore I could not resize the main partition either. Eventually I figured that I should first resize the extended partition to fill all the remaining space. Then I could move the swap partition (which is inside the extended partition) to the end of the available space. That done I resized the external partition again to only be as big as the swap partition. After that I could finally resize the main partition to use all the remaining space (OK, except for 8MB that were left over because of alignment with the hd's "Cylinders", not sure if that was necessary or not). Before resizing/moving the swap partition it might be necessary to select "swapoff" for that partition on gparted, if the Ubuntu Live system has decided to use that swap space.

That's it - again a scarily long text to describe a simple procedure.

A downside might be that it copies the whole disk, not just the used parts. Also there has to be enough space left on the external disk. Not sure if copying less could be achieved with some dd magic. I am pretty sure one could just copy individual partitions with dd, but not sure how to copy the disks partition table, master boot record and what not then.

Feb 4, 2010 - APT, the app store for geeks

Whether they loved it or hated it, all reviewers of the iPad agreed that usability of "normal" PCs for average users is atrocious. And I have to agree: whenever I take a look at the PC of a friend or relative who is not a "computer freak", they are always riddled with spyware and malware or at least ladden with useless software that draws away time and energy of the user (examples are "Toolbars" like the Google Toolbar or the Yahoo Toolbar). This is not only because they might have downloaded or installed bad software from questionable sources, but because even vendors or seemingly trustworthy businesses have no qualms to sell their customers. Usually a new PC is already messed up by the software the vendor has preinstalled. If not that, then the new gadget (camera, navigation system, whatever) might come with crappy software.

But I don't want to rant about the various ways today's PC software and hardware vendors mess up the PC experience. The point is, by many reviewers the iPad has been hailed as the savior from this hell of malware and overly complicated software. What I want to mention is that the "geeks" (computer savvy people) have actually been aware of this problem for a long time, and they have invented a solution long before Apple's App Store. It is called APT.

APT is a front end to the package managers of some Linux distributions, most notably Debian and it's derivative Ubuntu. By using it you can install software from a trusted repository of open source applications (trusted because it is open to peer review). It is not the only way to install software on these Linux systems, but usually if you opt to install software from another source, you end up feeling slightly icky and dirty, as you should.

To avoid icky spyware, malware and so on, just stick to the official repositories of your Linux distribution. It is as simple as that - no debilitating iPad required.

Now I have to go ahead and admit that I am not even that well versed with Linux and apt. I know how to find, install and remove programs, and some other internals that are not really important. But isn't that kind of the point: you can use Linux and apt even if you are NOT a "computer freak". There are simple front ends that enable you to use it without using the command line. The main difference to Apple's App Store is that it is still open - using apt is entirely optional, but recommended.

Of course, things on Linux don't always run as smoothly as with a Mac (although I have whole lot of things to complain about with Macs, too). Not all the software in the repositories is very polished or even bug free. But neither is software in the app store.

As for stability, it helps to look at the hardware Apple has on offer: presumably they only actually sell three or four different kinds of computers (a laptop, which includes the iMac and the Mac Mini which are also based on laptop internals, the Mac Pro, and the iPhone/iPad). Most Linux distributions try to support a far wider range of hardware and therefore are less optimized for any specific piece of hardware. But it would be possible even today to launch computers with a Linux distribution optimized just for these computers. They should have no troubles achieving adequate stability.

Anyway, maybe you get the idea, maybe you don't, all I want to say is this: the App store model is NOT our only salvation.