Doing more with your Ubuntu PC

My webcam captures motion and takes time-stamped shots.

FOR more than three years, I’ve been using Ubuntu, a popular distribution of Linux, on my home PC for work and play. As a long-time Windows user, I appreciated the freedom from crashes and system slowdowns that plagued my computing life before I made the switch. The notion that I would have to reinstall my operating system, so common in Windows when something went terribly awry, now seems so foreign to me as a Linux user.

I also enjoyed not having to put up with Microsoft’s intrusive and heavy-handed licensing practices, and not worrying that some malicious piece of code would get past my anti-virus software and wreak havoc on my files.

Like others who made the leap to Linux, I learned to use free alternatives to common Windows applications. For word processing, spreadsheets and presentations, there was OpenOffice in lieu of MS Office. For Photoshop, there was Gimp. To watch videos, I used VLC, a superior alternative to Windows Media Player; to listen to music, I used XMMS (now Audacious), which looked a lot like Winamp. For instant messaging, I used Pidgin instead of Windows Messenger, Yahoo Messenger or Gtalk. To download music, I used Frostwire, and to pull in larger files, I used Deluge, a BitTorrent client comparable to uTorrent. The only thing I didn’t need was an alternative anti-virus program; there just aren’t that many viruses out there that can hurt a Linux system.

This week, just as I felt I had done everything I wanted to do, I found two more ways to use my Ubuntu PC. What follows is a little more technical than I usually get, but it’s really not that hard to follow.

Set up a simple surveillance system using a USB Web camera. To do this, you need a USB webcam and a command-line program called Motion, which you can install from the Synaptic Package Manager (System > Administration).

Next, you’ll need to create a hidden folder called .motion in your home folder. To do this, launch Terminal (Applications > Accessories) and cut and paste this line onto it and hit Enter.

mkdir .motion

Cut and past the next line to copy the configuration file that Motion will use into the hidden folder you’ve just created:

sudo cp /etc/motion/motion.conf ./.motion

Then enter this line to change ownership of the configuration file to you (replace the to your name (the one in your Home folder):

sudo chown ./.motion/motion.conf

You can edit the configuration file to change how Motion behaves, but with any luck, it should work without any alterations. Make sure your webcam is plugged in and type “motion” (without the quotes) into Terminal and hit enter. You’ll see a few messages scroll by in the Terminal window, and you’ll know you’re successful if you see this line: “Started stream webcam server in port 8081.”
At this point, it might look like nothing is happening, but Motion is actually waiting to detect movement through the webcam. To confirm your webcam is working with Motion, go to this address in your browser: http://localhost:8081/
If all goes well, you’ll see a live feed from your webcam. Motion will take time-stamped snapshots every time it detects movement, and save the files into a directory called “/tmp/motion.” Motion also creates a Shockwave Flash that you can play back using VLC. You can change where the program stores these files by using a text editor such as Gedit to edit the motion.conf file in the .motion folder. Find the target_dir setting and change “/tmp/motion” to any folder you like.
On my setup, I changed the target directory to my Ubuntu One folder, which is automatically backed up to a server on the Internet, so I can view them even when I’m not home.
As a footnote to my security camera explorations, I found a much more sophisticated program called Zoneminder that uses a browser interface to control up to four cameras. Unfortunately, despite my best efforts, I couldn’t get it to read my webcam.

Use my Ubuntu PC to control my mobile phone. On the Mac, I use an excellent program called BluePhoneElite ($24.95), which lets me control my Sony Ericsson phone using a Bluetooth connection to my Macbook. SMS messages pop up on the Mac while its connected to the phone, and I can reply to them on my notebook. This beats thumb-typing any day.
The closest I came to this on Linux was Wammu, which was surprisingly easy to set up, once I paired my phone to my PC (System > Preferences > Bluetooth), using a cheap USB Bluetooth dongle from CDR King. Once you’ve added your phone using the phone wizard, you can connect it (Phone > Connect) and retrieve your contacts and messages so that they’ll be available on the PC. Wammu will let you read and send SMS messages, but unlike BluePhoneElite, will not pop up new messages. A workaround would have been to have an option to check messages at user-defined intervals the same way e-mail clients do, but Wammu won’t let you do this either. Still, just being able to type out and send an SMS message on your PC is worth the price of admission, which, in this case is free.

Posted by Chin on January 04, 2010 at 05:59 PM

Next entry: Ubuntu for Windows users

Previous entry: Firing Steve Ballmer

<< Back to main