Linux, Skype, and web camera

I’ve been using Skype for a few years now, but mainly for chats.  Occasionally, I’d do a call, but that never involved video.  Until recently.  A couple of days ago my dad got online (finally!).  And now there is a good reason to use Skype with a web camera for video calls.

One of the key points in Fedora 12 release notes was about improved support of video cameras.  That I was glad to hear.  I got my hands onto several web cameras and all of them seemed to work just fine in Cheese – a video capture application.  However, none of these cameras worked in Skype.  Either they were not recognized by Skype, or Skype was crashing, or I was getting really weird green-screen output, or something else.

It turned out, that there is something I had to do.  First, check if libv4l package is installed, and if it isn’t – “yum install libv4l“.  That’s a video for Linux library.  Second, start Skype like this: “LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype“.  Once I did that, Skype / Options / Video Devices confirmed that video is working fine.

Skype video

Disable touchpad while typing

I came across this blog post, which, among other things, has this excellent tip for us, laptop and netbook users – how to disable touchpad while typing.  The tip is specific for Gnome desktop and is rather easy to follow.  Navigate to System / Preferences / Mouse menu, switch to Touchpad tab, and check “Disable touchpad while typing” box.  Then close dialogue window and enjoy.  Here is a screenshot to make you life even easier.

Gnome : System / Preferences / Mouse / Touchpad

Fedora 12 and IntelliBook (rtl8187se)

I recently got my hands on an IntelliBook netbook (site in German, but the machine is actually Clevo M810L).  It’s a really small, light, and simple machine, which I got for nothing, and which, I haven’t got it for nothing, would cost me around 400 EUR.  The truth is, if I wouldn’t have bought it for 400 EUR.

intellibook

The good things about it are: small, light, built-in WiFi and a rather large 160 GB hard disk.  The bad things are: non-standard keyboard layout (I touch type, so I don’t mind, but the other people in my home do), non-Linux-supported web camera, and really low battery life (around 2 hours or so).  Also the touchpad always gets in the way, and the whole case has this cheap plastic feel to it.

When I first got the machine, it was running Ubuntu 9.10.  While I have nothing against Ubuntu, I am a Fedora person.  I want a regular desktop, and I want my commands and configurations to be where I am looking for them.  So I replaced Ubuntu 9.10 with a recently released Fedora 12.  The Live USB installation was as simple as it can possible be – boot from USB stick into a desktop, click “Install to hard disk“, and click Next three or four times.

Once the Fedora 12 Gnome desktop booted up, I was slightly disappointed to find out that wireless wasn’t working.  Since it was working just fine in Ubuntu, I was pretty sure that fixing the problem won’t be hard.  And  I was right.

First, I established that the wireless card uses RealTek chipset (rtl8187se).  Secondly, I Googled for rtl8187se and Fedora 12, which led me to this blog post, comments to which suggested that I need to add RPMFusion to my yum repositories and install kmod-staging* packages (there are two of them, one generic, and one with specific kernel version).  Once the packages are installed, loaded up the driver with “modprobe rtl817se“, and restart both network and NetworkManager servers.  Not even a reboot is needed – NeworkManager picks up the wireless network adapter and connects to the network.  A test reboot confirmed that nothing else needs to be done and everything is just fine.

With that, I now have a little computer, which is easy to move around, and can even be given to my kid to play with.  If it wasn’t for the short battery life, it would be perfect for travelling.  So, either I’ll find an extended battery for this thing (which I doubt), or I will get myself another netbook for all the travels that I do.  Carrying around a full fledged laptop becomes heavy and ridiculous.

Fixing Firefox with safe mode

Here is something useful I learned today.  Until recently I’ve been using Firefox 3 beta 5.  It was working fine for me after I found all replacements and upgrades for all the extensions that I need.  One of those extensions was CompactMenu (not giving a link for now).  This extension replaces the whole main menu (File, Edit, View, etc) with a single icon.  You can place this icon anywhere on your toolbars and when you click it, you’ll get a drop down with your main menu items.  Huge space saver.

Yesterday, I upgraded my Firefox to the latest and greatest stable version 3.  The update came as an official package from Fedora updates.  However, once I fired up the new Firefox, it notified me that CompactMenu was not compatible with this version and so it was disabled.  Can you guess where I ended up?

Exactly.  No menu and no way to get to the menu.  I tried uninstalling the extension, intalling another version of it, unintalling it again, cleaning up options in about:config, customizing the toolbars, and so on and so forth.  Nothing worked.  And so I Googled.

It turns out that Firefox has something called a “safe mode“.  All you need to do to get to it is start firefox with “–safe-mode” parameter.  Once it comes up, you’ll see the window as on the screenshot above.  One of the optios is “Reset toolbars and controls“.  It works wonders.  I got all the toolbars to their default state, and with View -> Toolbars -> Customize I could easily get them to the state I want.

BLOB is bad for your (mental) health

If you ever mention that your web application uses database to store files, you risk being flamed into oblivion.  Indeed, in most cases, it is a bad idea, since file system is more effecient when it comes to files.  However, there are cases when it makes sense to have files saved in the database.

Maybe I am doing something wrong, but in the last six month, I had to develop at least three systems that used MySQL for file storage (uploaded files that have to be synchronized across several hosts, etc).  Yesterday, for the third time I stumbled across the same problem, that almost drove me insane.

MySQL has four data types for storing binary data – TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.  Somehow I always forget about these and use BLOB.  BLOB works just fine, but it has a limit on size, which is rather low – 64 KBytes.  The mean thing here is that it will work just fine with most of the test data – text files, short PDFs, and small pictures.  Once the application is tested and put into production, the corrupted files will start coming in.  Re-writing all parts that deal with uploading, moving, cleaning, escaping, and encrypting binary data takes time.  Going through file reading and writing routines is boring too, and it won’t help either.

By the time, the issue is discovered and all fields are changed to LONGBLOB, it is often very late, and you’ve lost your weekend, as well as a lot of large files. This post is an attempt to save my (and your) sanity.

Reminder: use LONGBLOB instead of BLOB for file storage, unless you are absolutely sure about the maximum size of incoming data.