All posts by linus

Skype works at last

Ever since I installed Skype on my 64-bit Debian laptop, skype has behaved erratically, crashing like hell. I finally found the solution in the Linux Mint Community:

1) Install the 32-bit pulseaudio libraries

sudo apt-get install libasound2-plugins:i386

2) Edit the skype.desktop file to set the latency:

sudo sed -i 's/^Exec=.*/Exec=env PULSE_LATENCY_MSEC=30 skype %U/' /usr/share/applications/skype.desktop

Tada! No more crashes or distorted sound.

Mouse button mapping in Xorg.conf

I purchased a Logitech G400 mouse to temporarily replace my Logitech MX Anywhere mouse, which I forgot at home. I wanted to use the top button for pasting instead of the scroll wheel button, which I feel is too hard to press.

This command solves the problem, by swapping the functions of button 2 (the scrollwheel button) and 10 (the top button):

$ xmodmap -e "pointer = 1 10 3 4 5 6 7 8 9 2"

The trick is that I want it done automatically when I use the G400.

My Debian Wheezy installation didn’t have a xorg.conf file, but there is nowadays an option to put specific conf snippets in /etc/X11/xorg.conf.d/*.conf:

$ mkdir /etc/X11/xorg.conf.d
$ vi /etc/X11/xorg.conf.d/LogitechG400.conf

There are a few directives in the InputClass section that can match device attributes. I used MatchProduct and MatchIsPointer (to be safe). You can just as well use MatchUSBID, I guess. These are the contents of my /etc/X11/xorg.conf-d/LogitechG400.conf file:

Section "InputClass"
Identifier "evdev mouse"
MatchProduct "Logitech Gaming Mouse G400"
MatchIsPointer "true"
Option "ButtonMapping" "1 10 3 4 5 6 7 8 9 2"
EndSection

The ButtonMapping option swaps the function of button 2 (the scrollwheel button) and 10 (the top button).

Now I can paste using the top button with the G400 mouse.

 

What is your privacy worth to you?

The Instagram service recently announced their changed Terms Of Service, causing a minor outrage among their users, since the new terms seem to allow for Instagram to use the user-supplied photos for advertising outside the Instagram site. Since they also added the right to not mark the advertising as such, they would basically be allowed to sell your photos without your explicit consent, or even knowledge. And without compensation, of course.

Since you are using Instagram, you are surely aware that the service is free of charge, and that it’s the advertisers that pay for the party. As the famous quote says, “If you are not paying for something, you are not the customer, you are the product being sold.” That should not come as a surprise for anyone.

This raises an interesting question. What is it worth to you? You like being able to share photos with your friends, and the Instagram service fits your bill exactly. Do you care if your pictures are being used by other companies in order to make money? Do you care if your pictures are being used in a totally different context, like advertising for online dating services? I can imagine most people don’t care that much, but I can also imagine that it hasn’t really occurred to them that it can happen.

I find it kind of amusing sometimes, that people can post all kinds of private information to a web service like Facebook and then say they care about privacy. However, it is still a matter of trust. They trust Facebook and Instagram that their information will not be used in other contexts than the service itself. I can imagine that most people take this for granted, not even reading the Terms Of Service before signing up.

So it all boils down to this: What is it worth to you? If you don’t mind your photos being used without your consent (and control), go ahead and use the service. But at least give it a thought.

Edit: Here [The Verge] is a less pessimistic analysis of the Instagram TOS. Still creepy, but not as doomsday panicky as others.

DVD::rip not ripping your subtitles?

There is a longstanding bug in the DVD::rip package that prevents it from ripping the subtitles if you are ripping from a directory instead of a mounted DVD.

This patch works for me:

+++ Project.pm 2012-02-01 11:59:58.359790393 +0100
@@ -376,6 +376,11 @@
         = $self->get_mount_dir_from_mtab( $dvd_device, "/etc/mtab" )
         || $self->get_mount_dir_from_mtab( $dvd_device, "/etc/fstab" );

+    # If no mount point was found, assume that it is an image dir
+    if(!$dvd_mount_point) {
+        $dvd_mount_point = $dvd_device;
+    }
+
    return $dvd_mount_point;
 }

 

 

convmvfs to the rescue

I had a hard drive with a huge amount of files that was previously connected to my old Linksys NSLU2. For some reason, all the filenames were encoded in the cp437 codepage, and when I mounted the ext3 volume on my Debian Linux box, the filenames were all messed up. I wanted to mirror the drive without changing anything on it, so I mounted it read-only.

How to solve the file name issue? Enter convmvfs. It is a nice filesystem-in-userspace hack that mirrors an entire file system while converting the file names from one system to another.

$ apt-get install fuse-convmvfs
$ mount /dev/sdb1 /mnt/hugedrive -o ro
$ mkdir /home/linus/myfsys
$ convmvfs /home/linus/myfsys -o srcdir=/mnt/hugedrive,icharset=cp437,ocharset=utf8

Tada! Now I could browse the entire converted filesystem in /home/linus/myfsys, and backup all the files with correct file names.

Breathing new life into my HTC Desire

I have an HTC Desire phone. I upgraded from my HTC Hero almost as soon as the Desire became available in Sweden. It has served me well for quite some time, but has one major drawback: it has far too little storage space for applications and data.

HTC Desire owners always have to make a choice, because every time they want to install an new app, they must choose which one to uninstall to make room for it. And every day they curse the app developers for not letting them move the application to the SD card. I have lived in this situation for far too long, and a few days ago Adobe tipped the scale by almost doubling the storage requirements for the Flash Player app.

What were my options? Well, it turns out that there are a few:

Minimize the data usage

Just make the apps use less storage space. Here are a few things you can do.

  1. Move all apps to SD card. It’s easy, just click on “Move to SD card” in the application manager. Unfortunately, the largest applications won’t let you do that, like Flash Player or Facebook. Also, only parts of the application is moved to the SD card, so it still takes up space on the data partition, just not as much.
  2. Decrease the cache size in the Internet app. Can save you a MB or two.
  3. Don’t update unnecessary data. There is basically no need to update both the HTC Facebook app and the official one. The same goes for Twitter/Peep.
  4. Use smaller apps. Soundhound takes less space than Shazam, Moboplayer is smaller than Rockplayer etc.

Unfortunately, this can only help you for so long, since the apps get larger for every update. The data partition will get full sooner or later.

Update the system-installed apps in-place

This is a quite interesting option, which I only discovered just recently. It turns out that Titanium Backup has a neat feature that lets you replace the factory installed apps with their updated ones. Then they won’t take up space on the data partition, since they are installed in the system partition instead.

There are a few drawbacks, of course.

  1. You need to root your phone. This is however quite simple nowadays, with the Revolutionary tool. A more detailed description is here.
  2. You need to purchase the Pro version of Titanium Backup, but I think it’s worth every penny.
  3. You will alter the system partition, which can always be scary.
  4. The system partition on the Desire is already almost full (about 6MB left on my Froyo), so you can only replace a few of the apps before the system partition is completely full.

In fact, when I tried to move the dreaded Flash Player to the system partition, Titanium Backup did not have sufficient checks to make sure that it fit, and got stuck when trying to install Flash Player. I had to force close Titanium Backup, and ended up with 38KB left on the system partition and Flash Player still in the data partition.

Still, I think this might be a good option for those who only need to regain a few extra MB from the data partition.

Install a ROM with A2SD+

This is by far the most definite solution to the problem. A2SD+ is a way to make Android install the entire applications on the SD card instead of the internal memory.

There are a few drawbacks here as well.

  1. You need to root your phone.
  2. You will most probably need to wipe your phone, i.e factory reset. This means losing all your installed applications and their settings. However, if you backup your phone with Titanium Backup before wiping it, you can restore most, if not all, of your apps and settings after the installation of the new ROM.
  3. For some reason, the guys that assemble those different ROM’s just can’t resist packing tons of “features” into the ROM, like overclocking and silly theming. It is virtually impossible to get a ROM with just the stock Desire Gingerbread Sense with the addition of A2SD+. I’m sure A2SD+ requires changing a lot of the inner workings of Android, but it would still be nice to have as few changes as possible.
  4. You need to repartition your SD card, adding an ext3 partition. This might not be all that easy for some people.

I finally installed a new ROM

After trying to minimize the data partition usage as described above, I finally decided to take the leap and install a new ROM. After some investigation, I chose the LeeDroid GB ROM. It has Gingerbread with HTC Sense and A2SD+ (plus tons of other features, of course).

I had already rooted and installed Titanium Backup, so I only needed to repartition the SD card before installing the ROM. I backed up the SD card and repartitioned the card with 1 FAT32 partition followed by a 1GB ext3 partition. I have partitioned hard drives many times before, so this was not much of a challenge.

I then entered the recovery mode and installed the ROM ZIP file. It went well, and then I went to installing the radio image. It failed.

Ouch! The error message told me that the scripting system has changed in newer versions of Android, and the official radio image from HTC uses the older system. What to do? I googled a bit for the error message, and the solution seemed to be to use the “fastboot” tool to install the image via ADB. The problem is that the fastboot tool is not part of the standard Android plattform toolkit. I had to either compile it myself, or download a binary from the net. I ended up downloading a fastboot binary from rapidshare. Scary, I know, but at this point I was desperate.

After extracting the image from the radio ZIP file, I managed to flash it using the fastboot tool. Finally, I could wipe the phone and restart it. It worked! It took some time for it to boot the first time, but I could see that it was working by watching the logging in real time using the “adb logcat” tool.

I spent some time restoring the applications and setting using Titanium Backup, and now it feels like I have a new phone! I can install and update applications much faster now, probably thanks to my Class 6 SD card, and I can install as many applications as I want, since they are installed on the SD card, which has 1GB space for apps and data. Praise the lord!!!

Gingerbread goodness

Now I can also enjoy some Gingerbread goodies. Coming from Froyo, it didn’t feel like much of an improvement, but the user interface is still somewhat nicer. But then again, I didn’t do all this work to get Gingerbread on my Desire. I did it to be able to use my Desire at all. Now I can finally install the applications I want without worrying about taking up too much space. And I can survive for a bit longer until I can get my hands on a Nexus Prime.