OS X clipboard access from the shell

Posted by Patrice Neff Fri, 20 Feb 2009

Chris Siebenmann motivated me to finally do something about the situation of my web site passwords.

So I needed some nice password generation process. I looked at 1password but didn’t find it terribly attractive. Instead I’m using the “OSX keychain”:http://en.wikipedia.org/wiki/Keychain_%28Mac_OS%29. For generating passwords I use the excellent apg. And since today this shell function:

clippass() {
    apg -M SNCL -m 15 -n 1 | pbcopy
    pbpaste
}

This creates a long and safe password, pastes it to the clipboard using pbcopy and then shows it on the command line by pasting it again from the clipboard using pbpaste.

Next step will be to integrate that in Quicksilver, then I won’t even have to leave the browser.

Continuous testing with Python

Posted by Patrice Neff Sat, 07 Feb 2009

Back when I did some Ruby on Rails development I was a big fan of autotest. With it I could stay in my editor while the project test suite got executed with every change.

Setup

Now that I’m working in Python I was looking for something similar and I was successful. You’ll need the following:

Then you can execute tdaemon like this in your project directory:

Usage

tdaemon.py --custom-args='--with-growl'

This will continually execute the test suite and notify you with growl about the status as you can see in this screencast:

Demo

Details

To get this working as shown in the screencast I actually had to make some changes.

First nosegrowl didn’t install well using easy_install as the images were missing. So I went ahead and did it manually:

$ hg clone http://hg.assembla.com/nosegrowl
$ cd nosegrowl/nose-growl/
$ sed -i.bak 's/growl.start/# growl.start/' nosegrowl/growler.py
$ python setup.py install

The 'sed’ command is optional. But I don’t want to be notified when the test suite starts, only when it ends. So I uncomment the growl.start line.

Additionally to make tdaemon less noisy when working with vim I added the swap files to the exclude list. Open the tdaemon.py file and edit the IGNORE_EXTENSIONS line to look like this:

IGNORE_EXTENSIONS = ('pyc', 'pyo', 'swp')

Workarounds for Mail.app and iCal

Posted by Patrice Neff Sat, 28 Apr 2007

I recently had two problems with the Apple suite of applications.
  1. Mail.app regularly marked mails I had read on the IMAP server as unread again
  2. iCal doesn’t allow subscribing to SSL-encrypted calendars. That’s bad because our mail and calendar (Zimbra) runs on HTTPS.

For the first problem the cause was the GPGMail plugin. There is a FAQ entry about the problem. Short answer: deactivate automated decription/verification in the GPGMail settings.

The second one is a big worse. There is a hint on macosxhints.com. The idea is to set up a HTTP server which redirects to the HTTPS URL. iCal actually can handle HTTPS but it doesn’t allow you to enter it. The problem is that the security of this workaround is probably not guaranteed. Or in other words it may be possible that iCal sends out your password clear-text over the wire.