Skip links

Main navigation

Geequie: Cull Photos on Linux

I recently decided to take advantage of Google’s automatic photo and video backup. Previously, I was using Sweet Home to synchronize them to my computer. I’m happier to have them in the cloud so I don’t have to worry about offsite backups, etc.

I took this opportunity to do a quick culling of my photos. I started off simply using the Nautilus file browser to view thumbnails and delete the cruft. I got annoyed with the nested directory structure of my photos, so I wrote a perl script to flatten it. After that, I found the thumbnails in Nautilus too small, so I started looking for other tools.

That’s when I discovered Geeqie. I fired it up in my photo directory, and I quickly figured out how to efficiently cull my photos. The key was using Geeqie’s marking capability, where you can “mark” photos with numbers 1–5. I simply used the up and down arrows to navigate through the photos, and marked photos I wanted deleted with mark 1 (by pressing the 1 key). To make the marks visible, I enabled the “Show Marks” option in the Select menu. After going through all the photos, I selected all photos with mark 1 (Ctrl + 1), deleted them (Ctrl + d), done!

Geequie made culling photos on my Linux machine a breeze!

Sync PDFs with Android using Dropsync

I recently got a Nexus 7, using it mainly to read academic papers. Often, I find an interesting article on my laptop, and want to stash it to my Android device to read later. I need this to be fully automatic–I am horrible at regularly doing manual synchronizations. Here I will describe the tools and workflow I use to synchronize PDFs from my laptop to my Android device.

I thought Dropbox would be all I needed. I already use it for synchronizing other files between computers. I thought I could just stick files in my Dropbox folder on my laptop, and have it automatically synchronized to my tablet. However, the Dropbox Android app does not automatically store files to the tablet; it just provides access to them when online. So, I searched for a tool to fill this hole.

Luckily, I found Dropsync, a full two-way sync Android client for Dropbox. It was very easy to set up (pick an SD card directory, pick a Dropbox directory, and it keeps them synchronized). I haven’t noticed any impact on battery life or performance of my tablet. Dropsync fits my needs perfectly.

Not related to synchronization, but the best Android PDF reader/annotator I’ve found is ezPDF Reader. In my opinion, its killer feature is its ability to zoom in just right. In a two-column paper, it zooms to fit one column perfectly in the width of the screen. When you get to the bottom of a column, a page flip gesture brings you to the next column. It fixes the zoom level for figures. In short, it does the Right Thing.

Configure .htaccess. to use FastCGI for PHP


I had a request to use FastCGI for PHP handling on a wordpress site, to fix permissions issues. That is, FastCGI runs the PHP scripts as the owner instead of the apache user. This plays more nicely with e.g. file uploads and script-generated files. Here’s a link for More info on PHP handlers.

The configuration was a little tricky, and I didn’t find a single site that laid it all out easily. Here are the steps:

Ensure mod_fcgid is loaded

Check that this line appears in httpd.conf:

LoadModule fcgid_module /usr/lib/httpd/modules/

Create a wrapper script

I don’t fully grok it, but mod_fcgid must run the CGI scripts using suexec. suexec expects everything it runs to be inside the its document root. This document root can be found by running the command (as root):

/usr/sbin/suexec -V

and looking for the value of AP_DOC_ROOT. Mine is /var/www.

So, we make a wrapper script for the PHP CGI handler underneath the document root. We can set other relevant variables in there. Here’s an example, which I put in /var/www/cgi-bin/php-fastcgi:

export PHPRC # php.ini directory.
export PHP_FCGI_MAX_REQUESTS=5000 # Num requests before restarting process.
exec /usr/bin/php-cgi # Call the regular PHP handler.

Update .htaccess settings

Now, we tell the web server ot run PHP scripts using fcgid:

AddHandler fcgid-script .php
Options +ExecCGI
FcgidWrapper /var/www/cgi-bin/php-fcgi .php

I believe this can also be done in httpd.conf, but this was my solution.


We can see that it worked by looking at the “Server API” line in phpinfo(); it should have changed from e.g. “Apache 2.0 Handler” to “CGI/FastCGI”.

Process Management in Emacs with proced

Leaving emacs frustrates me, especially when it’s for things I would normally do in a command shell. But alas, I would regularly drop into a shell to run the top command, as I did not know of an emacs replacement. I became fed up enough with this to do some googling, and found proced, which is a dired-like mode for managing processes.

I haven’t done much with it yet, just looked at processes and killed an xeyes as a test. It seems to have common keybindings: g to update the buffer, q to bury the buffer, marking like dired, etc. It doesn’t seem to have a home on the internets or an info page, but M-x proced [enter] C-h m provides good documentation. Glad to have this new-to-me tool in my belt.

Linking to MS Office File in Emacs Org Mode

My daily workflow includes emacs org mode files for each project I’m working on. I often link to files, programs, etc. from these org mode files. I tried linking to a MS Excel spreadsheet using my usual


link. However, since the xlsx file is optionrally broker really a zip file, emacs opened a dired buffer revealing the contents, rather than opening it in Excel.

After a bit of googling, I found a message from the org mode mailing list about linking to Excel and Word documents from org mode and discovered the file+sys link type. This, per the org mode External Links manual, will “open via OS, like double-click”, which is exactly what I want. Good reminder for myself: when all else fails, RTFM.

Upgrade to Ubuntu 12.04 Precise Pangolin


I upgraded to Ubuntu 12.04 today. My motivation for upgrade was twofold:

In short, the experience was good, with two small snags.

Snag 1: Wireless

As expected, the upgrade left my patched wireless driver in the dust. This was relatively simple to fix. I just downloaded the Broadcom driver from the above-referenced how-to, ran the b43-fwcutter command (with the vanilla apt-get version–no need to patch or hand-build anything), and voila: wifi.

Snag 2: Xmonad

Xmonad was a little trickier. When I tried to run the “Gnome with Xmonad” session from the login screen, it failed. syslog showed a segfault, in Xorg I believe. Boo.

I removed and re-installed the xmonad and gnome-panel packages. One encouraging bit: the Xsession entries automatically showed up, which I believe I had to do by hand before. Nice. The Xsession stayed open, but the window manager seemed missing.

I tried moving my ~/.xmonad/ directory. That got Xmonad to stay alive, though it seemed confused about the gnome desktop, and keyboard shortcuts weren’t working.

So, I moved my ~/.xmonad/ directory back. The window manager seemed missing again. ps showed the Xmonad process was defunct, and something more insightful: it was running ~/.xmonad/xmonad-x86_64-linux. I whacked this file, logged back in, and all is well. Must’ve been a stale version compiled against old libraries.

I just found this issue in an Xmonad bug report. Hopefully this will be automated in the post-install script soon.


Ubuntu 12.04 Precise Pangolin: so far, so good. I’m glad to have my wireless adapter better integrated into the kernel, and glad to be on an LTS release.

Email Update: Notmuch


In my last email-related post, I discussed Disciplined Email via Gnus. I theorized that reading email like a newsgroup would enforce more disciplined, efficient email use. I stand by that philosophy, but changed my email client to Notmuch.

Why Switch from Gnus to Notmuch

Reasons for switching from Gnus to Notmuch include:

Local copy of email
I had been doing email over IMAP, both work and personal. I was interested in getting a local copy of my email for backup and availability purposes. For this, I use OfflineImap, which synchronizes IMAP email with a local maildir. This integrates nicely with Notmuch, while I found Gnus maildir support slow and clunky.
Fast search
Search lives at the core of Notmuch. As a response to the Sup email client (get it?), Notmuch provides indexing, and searching, while search seems peripheral to Gnus.
Unified email
I like the unified inbox I get with K9 mail on my Android phone. I find separation between email accounts unnatural. Notmuch provides a single “inbox” tag for new messages, regardless of the account; I did not figure out how to do this easily in Gnus.

Nits About this Setup

A couple smaller things bug me about my current setup, though possibly not enough for me to spend time fixing:

OfflineImap occasionally goes to lunch
I excellent exam answers bshs 382 research proposal think this happens when OfflineImap is running when I put my laptop to sleep. When it wakes up again OfflineImap eats a CPU, so I go kill it. I run OfflineImap via cron, so I don’t need to restart anything.
Email forwards sent from default account
When responding to email via the Notmuch emacs mail client (which uses Message Mode) does the right thing–if you have multiple email accounts, it sends the response from the account that received the email. However, email forwards send from the default account, even if a different account received the original email.


I find email with Notmuch + OfflineImap superior to Gnus + IMAP.