Wednesday, February 29, 2012

Encrypting Files on OSX with openSSL

You can use FUSE with encfs to locally encrypt eg for uploading to DropBox or Google Docs.

But what if you want to send the encrypted file to someone else? Well OSX Snow Leopard and Lion can create encrypted zip files, and decrypt and expand them. Thing is that zip encryption isn't very strong.

How about using openSSL with AES-256 encryption instead?

To encrypt from the command line

    openssl des3 -salt -in regular.txt -out encrypted.txt

And to decrypt

    openssl des3 -d -salt -in encrypted.txt -out regular.txt

So I have a file called "all_tags.txt" then you would do

    openssl des3 -salt -in all_tags.txt -out all_tags.encrypted.txt
    enter des-ede3-cbc encryption password:

    Verifying - enter des-ede3-cbc encryption password:

You'll see you are asked for the passphrase twice. Don't lose it!

This is what the file looks like:

    Salted__3fi˛Œ—Æ+È£Pùˇ§S`p~±Õ˘Ãº_ç*oõÏ ◊◊È°8Aˆ3"∞ »„â@‡yÑ€g≠.¡ìÁ| 2Ë4~)‚R)ÚR¶®™1Íê=o–ï€à∑!¡›fiπ∑Öˇ#[P˙Ô|éÈsÙ¢ì‚z^◊ú˛ÀBœ2íùJÂh©åQ&±û—†nÇIÊQˆµxá( ∆8Íg¬a˛Î.V˚tuKV[CHø€c√“®˙√5Öïæh˘zt„ŸÂïCe"d,è€ Höπ$Âú8ê”<Ȭ˚ù'•?[4◊uÓé÷0—aeõnö˘CÖÁ€r˝—®À»?›<…åìŸ Ê#Æú¢v´Ø{'›ÆÙ∞)<◊[õì

Then to decrypt

    openssl des3 -d -salt -in all_tags.encrypted.txt -out all_tags.clear.txt
    enter des-ede3-cbc decryption password:

and you get the first file.

Works with ANY file!

You can zip the encrypted version if you like to save space.

Monday, February 27, 2012

Howto change the OSX Application that open when you plug in a camera

Howto change the OSX Application that opens when you plug in a camera.

After installing the FinePix software for my Fuji W3D, everytime I plugged in a camera or compact flash or SD, it would open. How annoying. Of course the reason I thought it would be useful is to crop and edit the stereoscopic images, but the FinePix software that comes with the Fuji Film Real 3d W3 doesn't do that.

Before deleting it, I wanted to change its behaviour. I wasn't able to find a way to stop FinePix opening at all, other than deleting it, but I was able to stop it opening for some events.

You can use Image Capture.

When  the device is connected, select it and then in the drop down bottom left change the option.

If you don't see those options, you may need to press the button to show them

Saturday, February 25, 2012

Renaming Photographs with EXIF data using Amok EXIF Sorter

Over the course of the year I take a lot of photographs, thousands it turns out.

For "big photography" I have three cameras and they have distinct file naming schemes:

    Nikon D300: DSC_xxxx.JPG and DSC_xxxx.NEF
    Panasonic GF1: Pxxxxxxx.JPG
    Fuji Film Real 3d W3: 

For the cameras such as the Fuji W3D this works well. For my mobile phones, well Androids really, it presents a problem.

It seems every release of Android uses a new scheme, sometimes sequential, sometimes one date format. And then I also take photos with my iPhone.

So I was looking for a way to firstly standardise the naming scheme and secondly to put the camera model into the filename. All the data I need is in the EXIF data.

After a bit of looking I found Amok Exifsorter. It has a graphical interface and the GUI does all I need. I did try using EXIFTool, but found it less easy to use.

I created a new profile called "include camera model" which uses the tags

    %model% IMG-%year%-%month%-%day% %hour%-%minute%-%second_digitized%

and that gives me filenames like

    HTC Magic IMG-2009-10-08 11-20-39.jpg
I can then sort and sift based on camera or phone model.

For bonus points you can use EXIFviewer to find out all the tags in the photo, and then use other tags in the file name such as GPS data or image size.

I'm always grateful to authors who write software and then give or sell their works, so the following is not criticism:

 - the website is flagged by OpenDNS as hosting Internet Explorer exploits and other malware. Google's compromised web site feature doesn't flag. I found that OpenDNS flags them while writing this article in an Apple store, waiting for my MacBookPro to be repaired. Who knew Apple use OpenDNS?

 - the Exifsorter app is a bit crashy. On OSX Lion you think it'll take drag and drop, but then crashes.

Wednesday, February 22, 2012

Remove a Drop Shadow in Inkscape

I've been using Inkscape recently, and its starting to grow on me. For example I really like that it creates and edits in .svg format. I can even forgive that on OSX it runs under XQuartz or X11, though I reckon if I find myself using it alot I'd bring up an Ubuntu box instead.

One thing I had trouble with was that I'd applied a drop shadow to an object by accident and it wasn't obvious how to remove and delete it.

Turns out that you just need to select the object and then 'remove filter'.

Minor rant... why does Blogger not support upload if .svg files?

Saturday, February 18, 2012

Blogger posts and special characters

Blogger posts and special characters

In a few of my posts I include instructions, such as

Menu 1 > menu 2 > menu 3 / button


If Blogger doesn't handle these well for you, reverting to the html character codes, eg

Menu 1 &gt; menu 2 &gt; menu 3 / button

its likely because you need to change a setting.

On the right hand side click options and then select "Show HTML literally". This is a per-blog setting, so its sticky between posts.

Tuesday, February 14, 2012

Chrome: increasing browsing security

Chrome has quite a few features that increase your browsing security in the background.

Here are three that you can implement yourself.

1.   Multi-user support. Create a new user profile, and run things like your internet banking from the new tab. All processes are sandboxed, so if you get an exploit from your general web browsing account/window it will not be able to grab content from your banking window. Just make sure you are using different Chrome accounts!

Goto Settings > Personal Stuff > Add New User 

Then go back in and edit the name and icon

When running multiple users you get a new icon top right. Click on it to switch

If you sign in to your Google account, consumer or Apps account, it remembers your bookmarks, plugins, browser extensions etc. Like you'd expect really with all that data being stored in Google's Cloud

2.   chrome://flags is a (relatively) unadvertised way of controlling lots of behind the scenes features. One in particular you should consider

Click to play
Enables a "click to play" option in the plug-in content settings.

When a web site has content that calls a plugin of browser extension, you will be required to click first. Like Flashblock on steroids.

3.   chrome://plugins/ gives you a list of all the plugins on your entire system you have installed. And likely its a scary long list. If you see something on there you aren't expecting, then disable it. As an example, Chrome shows Safari plugins

Glims Version: 1.0

Glims Plug-in for Safari

Sunday, February 12, 2012

Offline mapping Android Apps - part 3

Previously I've been testing some Android offline mapping Apps.

You might ask why I didn't try NavFree and its USA counterpart. Well, I didn't know about them, because when you search for offline maps you don't find it. Then, for some reason to get maps / routing for the US you need a different version.

Its billed as

Unlike many other "free" satnavs we offer you fully featured, non-time limited turn-by-turn navigation. No hidden payments: after map download you can use it forever for free and update it from time to time, also for free."

At first glance its pretty good. For the non-USA version you can download maps after pressing on 'upgrades'. Not 100% intuitive, does the job.

For v1.x of this app, it needs a data connection to look up addresses, so this is not 100% solution to data-less offline navigation. Seems that v2 will not have this problem. You can work around this by finding where you are going using hotel or airport wifi. You can also look up a few addresses in advance, and they will be kept in the 'recent destinations' list. You don't need a data connection to route to already found destinations

In actual use, its quite nice. By default you get 3D view, and you can choose which voice you want, in a variety of languages as well.

This is what the route looks like

And you can also see start to finish

So far, so good. Over the coming weeks I will test against a variety of addresses and routes.

One great thing is that since it uses Open Maps if there is something broken, you can go in and fix it.

Tuesday, February 7, 2012

OSX Lion: Returning Preview to Snow Leopard functionality

OSX Lion: Returning Preview to Snow Leopard functionality.

If like me you use Preview all the time to view photos, and occasionally do some minor editing eg cropping, then OSX Lion's lack of 'save as' is really annoying.

Fortunately you can copy over Snow Leopard's version. Copy these two items from Snow Leopard


Then rename Preview to something else eg SL_Preview and copy it into the Applications folder on the Lion install. The framework folder goes into the same location.

Then, find some files you would want to open in the old Preview, and do right-click or ctrl-click "open with" "other" and select the old Preview, and tick 'always open with'.

If, on the occasion you still use the new Lion flavoured version of Preview, you can also add a keyboard shortcut to Export:

Lion version

Snow Leopard version

Goto to System Preferences, Keyboard, Keyboard Shortcuts, and then select Application Shortcuts. You can then press the '+' button and add a new one. The text must be IDENTICAL for it to work ie 'Export...'

Sunday, February 5, 2012

Offline mapping with Android - App Reviews - part 2

This is part two of my review of some Android Apps that have offline maps. Part 1.

Testing in the field or on the road sorts out what works and what doesn't. After the first pass I had three Android Apps to try:

    Google Maps

I gave all three a fair test, and versus the incumbent, the Nokia N73 plus Bluetooth GPS receiver.

First up, MapDroyd. Did the lack of detail control count it out? Well, it does not get off to a good start. Surely there are _some_ roads in the USA, Canada or Mexico?

and maybe one road that goes from LA to Las Vegas?

Zooming in, its the same problem. Here's an example where I've tried to get the amount of the city showing to be the same - you need to allow for different aspect ratios of course, so I've tried to fit the width.

and that, in a nutshell is MapDroyd's problem. If it had no competition, then you could use it, because its not a bad App in itself.

Second up, Google Maps. First the good news. When you are in a cached area, it works just like you are used to.

Detail is nice. The bad news is the caching. I was unable to tell when I was in a cached area, and when the cache would run out.

Third up, OSMand, and it really is a case of the best for last. Detail is good, and after trying all three for a day, it became the only App I used for the rest of the trip. I can't get the zoom quite the same for a fair visual / zoom comparison, but I don't need to - its just plain better.

A handy feature is that it records to GPSx track all the while its running which is useful if you want to geocode your photos for example. I'm not sure its a replacement for MyTracks - will need to test further.

It does have the idiosyncracy of the whole map disappearing at zoom level 6 with an error message that I was not able to use to fix.

And it doesn't really do routing either, just gives you a pointer for the direction you need to go. If you are flying, or trekking cross-country it might be all you need.

So the final scores:

Google Maps: 4
MapDroyd: 7
OSMand: 8.5

Sorry Google, the whole offline caching thing is just not working well. And its not a competition solely against other offline maps, its against the N73, and the N73 just works.

MapDroyd. If that was the only option, it would be useable, just not as good as the N73. I cannot see why it works this way, when on the new Android devices there is so much more screen area to play with.

OSMand: the clear winner, though some eccentricities keep it from scoring higher.

Wednesday, February 1, 2012

OSX: share from WiFi to Ethernet

For reasons far too tedious to go into, I needed to share an internet connection from WiFi to ethernet, and of course I'm using OSX 10.7 Lion. This also applies to Snow Leopard 10.6, and likely Leopard 10.5.

In theory, its easy: go into the sharing control panel select the correct options, and off you go.

However, this didn't work.

It was very curious. Client devices on the ethernet were getting DHCP addresses, so the built in DHCP daemon was working OK, but the Macs ethernet port wasn't being assigned the correct IP address.

Anyway, giving the ethernet connection a manual address of made it all work fine.