Tag Archives: linux

Google Drive and Linux

Google Drive is a handy way to share files across multiple computers, or back up files into the cloud. Naturally it integrates seamlessly with Android, and Google provide a client for use on Windows and the Mac, so you can keep you tablet, phone and PC all synced up. Unless you use Linux that is. Because unlike Dropbox, there is no official Linux client for Google Drive. Fortunately, help is at hand in the form of Insync.

Insync is a full featured proprietary Google Drive client. I’m focusing on Linux because it was trying to find a Google Drive client for Linux that led me to Insync, but it is also available for Windows and Mac. Unlike the official client, it supports multiple Google accounts, if you have a need for that sort of thing.

I have it installed on a laptop running Ubuntu 12.04 and it seems to do what it says on the tin. It constantly monitors a configured directory and keeps it in sync with my Google Drive account. It can handle having symlinks in the directory, so for example I’ve symlinked my Shotwell data directory to make sure that is backed up. And it can automatically convert Google format documents to LibreOffice format on the fly. It also supports selective syncing, allowing you to exclude certain folders from syncing. I’ve only had it installed for ten days or so, so it’s a bit early to tell if it functions reliably, but I’ve had few problems so far. The one niggling issue is that sometimes it fails to start at system startup, but support from Insync staff has been responsive so I suspect this will get sorted out soon.

Much Linux software is open source and distributed free of charge, so using proprietary, paid for software may come as a bit of a shock to some Linux users. If you have some deeply held philosophical objection to closed source this is not going to be for you, but otherwise it is definitely worth a look. The cost is far from prohibitive—the consumer version is $10 per Google account. When you consider that beyond the basic free allowance Google Drive is significantly cheaper than Dropbox you could quickly save this if you need more than a few gig of space. Cost over a year with 100GB of storage, including software purchase, would be $69.88 with Google + Insync consumer[1], or $99 with Dropbox[2].

If you want to try it out Insync is available on a 15 day free trial. To be honest, unless you make a lot of use of Google Drive this is not really long enough to evaluate something that just works away in the background. It’s also perhaps one place where the Insync team are missing a trick—it’s certainly not long enough to get you hooked. I suspect if they bumped this to six months they’d find a lot of people install it, forget about it, learn to take it for granted, and then pay for it a soon as they realise they’re about to be without it.

  1. Based on $4.99 per month + $10 for Insync. Google Drive price from https://www.google.com/settings/storage, retrieved 24 Oct 2013 []
  2. based on $99 per year. Price from https://www.dropbox.com/upgrade, retrieved 24 Oct 2013 []

Call popups with Asterisk and Thunderbird

There are several applications around for Windows users that offer popup notification of incoming calls to an Asterisk server, looking up the caller’s name in various Personal Information Managers (PIMs). Since I don’t use Windows, they’re not much use to me, so I wondered if there was anything available for Linux.

A Google a while back threw up this script by Olivier H. Beauchesne which looked promising. It does part of what I wanted—it generates a popup notification of incoming calls, but it makes no attempt to look up the name of the caller.

I considered writing something as a Thunderbird extension, but there seemed to be a couple of downsides to this approach:

  • From recent experience of working with Thunderbird’s address book for a click2dial extension I knew that it doesn’t lend itself well to look ups keyed on phone numbers
  • I wanted something that would always be running, irrespective of whether or not I’d fired up Thunderbird

I decided to have a go at hacking Olivier’s script, quite ambitious considering I’d never written anything in Python before.

It didn’t actually take much to get it to look up incoming numbers in a SQLite database. I then wrote a dirty Perl script to pull all the phone numbers out of my Thunderbird address book and populate the database. The Perl script was way to ugly to share and I always intended to tidy it up, but just never found the time. Until now.

callPopPy in action

callPopPy in action

A prolonged period off work sick has driven me to looking for things to keep my mind occupied, and so I’ve returned to this project. The Perl script has been scrapped. In it’s place I’ve written a Thunderbird extension named Squalit, a much neater solution. Squalit can export a single contact or an entire address book to the database, and can be configured to update the database periodically, ensuring that call popups and Thunderbird are always in sync.

I then turned my attention to the popup script itself. The original relied on libnotify and its Pyhon binding, pynotify. These are only available on Gnome based Linux distributions such as Ubuntu. I thought it would be useful to make everything more portable, so rewrote it to use a library I stumbled across by Daniel Woodhouse, gtkPopupNotify. After a fair few other changes I was left with a distant descendant of Olivier’s original script, which I’ve called callPopPy. callPopPy is portable enough that I’ve had it running on a Windows XP machine, and is doing just what I wanted on Ubuntu. The advantage of the two stage approach is that other utilities could be written to integrate callPopPy with other PIMs.

The combination of TBDialOut for click2dial with Squalit and callPopPy for call popup notification provides me with great integration between Thunderbird and my Asterisk server—I guess this is what is meant by CTI.

Links

Pifimon: NetStumbler for Linux?

Well no, not really. But Pifimon does do a little of what NetStumbler does.

Pifimon is a small programme to monitor wireless networks under Linux. It is written in Perl and works by presenting the output of iwlist in a more friendly, and constantly updating, way.

The initial screen presents a list of visible access point with a summary of information about them in table format. The list is updated as fast as iwlist can rescan. You can select one access point to monitor and display that access point’s signal strength as a constantly updating histogram. Here are some screenshots:

List of access points

Initial screen: list of visible access points

Signal strength histogram

Monitoring the signal strength of one access point

Pifimon supports several wireless card drivers, and provides a way to extend support to other drivers. You can download the latest version (pifimon-0.4rc2.tar.gz) or get Pifimon from Github.

Why did I write it?

For various reasons I’ve become interested in building antennae to boost wifi coverage. I needed some way to get a constantly updating representation of signal strength to help test and align antennae. The thing most people seem to use is NetStumbler, but NetStumbler only runs on Windows. Most of my machines, and in particular the netbook I plan to use for testing, run Ubuntu.

After a bit of Googling I came across scanmeter, a bash script that processes the output of the Linux `iwlist scan` command to produce a histogram. Just what I needed! Well nearly, but the great thing about open source is that if it’s not quite right, you can change it.

I started playing about with scanmeter. I didn’t want to have to enter a whole MAC ID to select the cell I wanted to monitor. I thought it would be nice to colour code with a third colour for ‘moderate’. I put colours in the signal strength column of the cell list. Then I thought it would be nice if the cell list updated regularly…

By now I was really stretching the limits of my bash scripting. So I decided to rewrite it in Perl. A bit more googling threw up this blog on using Perl to neaten up iwlist’s output which provided some great ideas on parsing iwlist output with Perl. I rewrote that script as a Perl package, largely to allow for easy extending to cope with different wireless drivers producing different iwlist output. A few hours later I had my first stab at Pifimon…

Downloads

Links