My failed attempt at using autofs to automount TrueCrypt volumes on OS X

I was trying to make it as easy as possible to access our YNAB file which lives in an encrypted TrueCrypt volume. The idea was to have OS X autofs automount the TrueCrypt volume so that when YNAB starts and attempts to load our document, TrueCrypt launches and asks for the password and then the volume mounts. I never got it working smoothly. I also tried sticking the password in the script, which is less than ideal, but that didn’t work either.

The following almost works, but not quite. If you can get it working, please let me know.

First, /etc/auto_master:

marc@hyperion:~
09:30:48 $ cat /etc/auto_master
#
# Automounter master map
#
+auto_master		# Use directory service
/net			-hosts		-nobrowse,hidefromfinder,nosuid
/home			auto_home	-nobrowse,hidefromfinder
/Network/Servers	-fstab
/-			-static
/auto			auto_truecrypt

Then /etc/auto_truecrypt (which is executable):

marc@hyperion:~
09:30:53 $ cat /etc/auto_truecrypt 
#!/bin/sh

TRUECRYPT_VOLUME="/Users/marc/Dropbox/TrueCryptVolume.truecrypt"

key="$1"

if [ "$1" == "Truecrypt" ]; then
    echo "-fstype=truecrypt    :${TRUECRYPT_VOLUME}"
fi

And /sbin/mount_truecrypt:

marc@hyperion:~
09:30:58 $ cat /sbin/mount_truecrypt 
#!/bin/sh

echo "$0: Called with $@" >> /dev/ttys000
# echo open -W /Applications/TrueCrypt.app --args "$7" "$8" >> /dev/ttys000
# open -W /Applications/TrueCrypt.app --args "$7" "$8"
echo /Applications/TrueCrypt.app/Contents/MacOS/TrueCrypt --text --non-interactive --password=(password) "$7" "$8" >> /dev/ttys000
/Applications/TrueCrypt.app/Contents/MacOS/TrueCrypt --text --non-interactive --password=(password) "$7" "$8"

As is, when I have the script calling /Applications/TrueCrypt.app/Contents/MacOS/TrueCrypt with a password, I get:

$ cd /auto/Truecrypt
(Mac locks up with spinning beach ball)

The script actually locks up my MacBook Pro with OS X 10.6.8. The script is probably called in a kernel context or with some big lock and trying to launch a complex userland process from there creates some kind of deadlock. Well, that’s my guess anyway. So be careful — don’t try this if you’re not ready to reboot.

How to build MacVim with Python 2.7

The first few times I tried building MacVim, it kept linking with the system Python. I wanted it to use my Python 2.7 install. I finally found the right incantation:

./configure --enable-rubyinterp=yes --enable-pythoninterp=dynamic --with-python-config-dir=/usr/local/lib/python2.7/config

The --enable-pythoninterp=dynamic was the magic that I needed to make it work.

Quicksilver crash

I wasn’t even using Quicksilver when this crash report popped up.

Quicksilver crash report

Here’s the text of the crash dump.

This computer has been having a lot of kernel panics and crashing processes lately. I fear that it could be on the way out.

Can anyone recommend a program for checking the RAM (and possibly other components of a Mac)? On Windows, a number of years ago, I used Sandra – is there something comparable for the Mac?

Canon MP560 scanner software possibly causing OS X 10.6.6 crashes for me

A follow-up of sorts to my earlier post on Canon MP560 and Snow Leopard troubles.

I’ve actually seen a fair number of kernel panics lately on my MacBook Pro running OS X 10.6.6

This last one occurred last night while we were sleeping and this time, I actually looked at the stack trace in the morning. Note this part:

BSD process name corresponding to current thread: CIJScannerRegist

CIJScannerRegist almost undoubtedly refers to /Library/Image Capture/Support/LegacyDeviceDiscoveryHelpers/CIJScannerRegister.app which is almost undoubtedly something that was installed on the system by one of the numerous Canon software packages that I’ve installed for scanning support.

I am going to check to see if I have the latest stuff that Canon has available on their support site. Maybe this crash and the other problems I’ve had are fixed by a software update which I don’t have yet.

If not, then I fear that Canon has some problems in their drivers. I sent them this crash report too. I figure that if I am using the old version of their drivers, they will probably be able to tell and they will tell me to upgrade my software. If I’m using the latest software, then hopefully they will enter this as a bug into their system and hopefully can get something useful out of the crash report for fixing it.

The Canon MP560 printer/scanner and Snow Leopard: not a match made in heaven

I don’t know if it’s the hardware or the software or both, but this printer/scanner has been fairly irritating with Snow Leopard.

I’m quite disappointed, because I’ve had a lot of Canon printers and they have always been great. This one is great in many respects, but the networking works really badly for us.

Problems we have:

  • Sometimes when we try to print it works fine and sometimes OS X reports a “communication error”. Sometimes pausing and resuming the printer seems to get things working. Sometimes it doesn’t. Sometimes rebooting the printer and/or the computer does the trick. Even when this “communication error” occurs, I can still ping the printer, which tends to refute my earlier theory that the problem was the wireless network. This leads me to think the wireless network is working fine and something wonky is happening with the printer and/or the drivers.
  • Sometimes when I’m having problem like the above, I press the button to turn the printer off and it churns away doing its “power off dance of lights” for several minutes until I lose patience and pull the power cord. This really seems like a fairly serious hardware problem.
  • Sometimes when attempting to scan from the panel of the printer, it shows the computer as a destination; sometimes it does not. Rebooting the printer and/or the router sometimes seems to help.
  • Sometimes when attempting to scan from the panel of the printer and it actually shows the computer as a destination, it just doesn’t work. I select the computer as the destination, the printer thinks for a while, and then it asks again for a destination.
  • The MP Navigator EX software is fairly annoying and un-Mac-like.
  • As far as I can tell when you scan from the panel of the printer and send it to a computer, the filename always defaults to “IMG.jpg” or “IMG.pdf”. Renaming the file is pretty easy, but it’s somewhat tedious to look at the document to see what it is, because when you double-click it, rather than opening up in Preview.app, it opens a small MP Navigator EX window and it’s tedious to navigate in.
  • It seems that if you use Finder to manually rename files that are in the MP Navigator EX directories, MP Navigator EX gets very confused, so you have to do the renaming in MP Navigator EX.
  • When you look at the Canon support site to download drivers, it is incredibly confusing, because you pick OS X as the platform but not a particular version of OS X and you don’t pick your language. So you look at a long list of a lot of different confusing software packages for various versions of OS X and with English and Spanish mixed together. For some reason, there seems to be an almost ridiculous number of software packages and I’m still not really clear on which ones are needed for what — e.g.: the scanner driver, the ICA driver, the CUPS driver, the MP driver, Solution Menu, IJ Network Tool, Wireless Setup Assistant, IJ Setup Repair Tool, MP Navigator EX, and MP Navigator EX Opener.
  • A few minutes ago I tried to print something and the printer queue window has been stuck saying “Copying print data…” for several minutes now.

Is it just me or does this printer not work particularly reliably with Snow Leopard?

Accessing OmniFocus data as a sqlite database

While playing with some OmniFocus AppleScripts last night, I realized that OmniFocus on the Mac uses a sqlite database (in addition to the zipped .xml files that it uses for synching). This is pretty interesting, because it could be a very convenient way to write tools that interact with OmniFocus (and use something like Python instead of AppleScript).

$ sqlite3 ~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2
SQLite version 3.7.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .mode column                                                                                                                         
sqlite> .headers on
sqlite> SELECT task.name AS task, context.name AS context
   ...> FROM task JOIN context ON task.context = context.persistentIdentifier
   ...> WHERE context.name LIKE '%email%' AND task.dateCompleted IS NULL;
task                                           context   
---------------------------------------------  ----------
Send Amanda new color photo via Cloud website  Email

Pretty cool. With a little Python and SQLAlchemy, I could probably create a nice little Python module for dealing with OmniFocus data.

Top 5 OmniFocus Applescripts

I rely on OmniFocus (both the Mac and iPhone versions) to maintain some semblance of order in my life.

I occasionally think of ideas for scripts to make OmniFocus for Mac fit better with my workflow, but I seldom have the time to actually sit down and write them, especially since I’m not particularly strong with AppleScript. I have a few OmniFocus AppleScripts installed (the main one I use is “Complete and Await Reply”), but I often think that I’m just scratching the surface of what’s possible.

So I was very glad tonight to stumble upon Sven Fechner’s excellent post, Top 5 OmniFocus Applescripts, which covers 5 particularly helpful AppleScripts. The only one that I’ve tried so far is the one that Sven calls “Quickly find a project” (the script itself is called FindProject07.scpt if you download it), but that alone was an awesome find for me as navigating quickly to a project with the keyboard is so much faster than mousing and scrolling for me.

He mentions several other scripts which look really useful and I hope to take a look at those soon. I have of course added a project to OmniFocus for that 🙂