January 2011 2 posts

Importing and exporting Firefox certificates from the command line

Saturday, January 29, 2011


Firefox is able to manage certificates and keys, for example personal certificates and their corresponding private keys to authenticate to certain sites. The easiest way to import/export these is to use the preferences dialog in Firefox, but there are times when that isn't available or convenient and you want to use the command line. Perhaps Firefox broke, or you're remotely accessing the system and all you have is a terminal.

You will need certutil and pk12util. On Fedora, both of these are in the nss-tools package.

First, determine the path to your Firefox user profile. On Linux systems, it usually looks like ~/.mozilla/firefox/foo.default, where foo is some alphanumeric string. I'll use foo.default for the examples, but remember to replace it with the real path. Now, get a list of certificates:

$ certutil -L -d ~/.mozilla/firefox/foo.default

You should get a pretty big list. Find the name of the one you're interested in and export it:

$ pk12util -d ~/.mozilla/firefox/foo.default \
           -o /path/to/export-file.p12 \
           -n 'Some certificate that I want to export'

Once you're exported it, you can import by using -i instead of -o:

$ pk12util -d ~/.mozilla/firefox/foo.default -i /path/to/export-file.p12

Tags: certificate, cli, firefox | Posted at 18:29 | Comments (0)

Digikam and geotagging

Monday, January 3, 2011


Digikam is probably one of my favorite programs that I use on a regular basis. It's got all the regular digital photo album functionality, as well as some cool extras like lens distortion correction, a pretty cool bulk renamer, and import/export for Picasa, Facebook, and others. I think the coolest is geotagging — recording latitude/longitude coordinates in photos. A few years ago this wasn't very popular with casual photographers, since it requires carrying around a GPS device. But today, many smartphones, and even some non-phone cameras, have built-in GPS receivers that automatically record location information with each photo taken. And even if your camera doesn't have GPS integrated, it's easy to use a free GPS logger app to record where you've been and later use software to correlate the GPS log with your photo timestamps.

Once your photos are geotagged, you can search for all the pictures you've taken in a particular area. It looks like I've taken 212 photos in the city of Wuhan, for example.

geotagged photos in China

Also, you can take a look at a group of pictures (e.g. from a particular day) and see where they were taken. These photos were from riding a horse on a rural mountain trail for a few hours. (The map is blank because it's rural China — no data here.)

a series of pictures taken on the same day

Or do an arbitrary search and see where the photos were taken. Here are all my geotagged photos of Handi:

photos of me and Handi

Modern technology is pretty awesome.

Tags: digikam, geotagging, photography | Posted at 20:15 | Comments (0)