2 x iFixit $5 voucher

I’ve just got 2 coupons from iFixit. They’ll give you $5 off on your next purchase. As I plan to get rid off of all my Apple hardware very soon, I don’t need them anymore.

If you want one, please leave a comment below and don’t forget to fill the appropriate field with your email. I’ll then be able to contact you and send you the coupon’s code.

Export Quartz Composer to video

Quartz Composer is a really nice piece of software for visualists. It allows you to create animated and/or interactive compositions mixing sounds, images, effects, user inputs and any other kind of data. In fact, Quartz Composer was the main reason I bought a MacBook Pro 18 months ago.

The first composition I created was this simple kaleidoscopic effect with shifting colors:

The source composition is available under a Creative Commons 3.0 BY-SA license. And here is the screenshot of the main patch:

And this is how I designed the color wheel sub-patch:

If creating a composition is really simple and straightforward, exporting the result to a video file is another story…

I first tried the Export to Movie v1.3b plugin. But it didn’t worked on my Snow Leopard, throwing me this exception every time:

0x8272938b: -[QCContext renderPatch:time:arguments:]
0x8272906d: -[QCGraphicsContext renderPatch:time:arguments:]
0x827281bb: -[QCOpenGLContext renderPatch:time:arguments:]
0x0000d873
0x8276495b: -[QCView render:arguments:]
0x82763f68: -[QCView startRendering:]
0x0000cd80
0x8548584e: _nsnote_callback
0x81ccda90: __CFXNotificationPost
0x81cba008: _CFXNotificationPostNotification
0x8547c7b8: -[NSNotificationCenter postNotificationName:object:userInfo:]
0x86da2f5f: -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
0x86da2bbe: -[NSWindow orderWindow:relativeTo:]
0x86da0544: -[NSWindow makeKeyAndOrderFront:]
0x86fa55c1: -[NSWindowController showWindow:]
0x0000ca7f
0x873461d3: -[NSToolbarButton sendAction:to:]
0x86fb73c1: -[NSToolbarItemViewer mouseDown:]
0x86ea4763: -[NSWindow sendEvent:]
0x86dd9ee2: -[NSApplication sendEvent:]
0x0000a994
0x86d70922: -[NSApplication run]
0x00001d2b

So I tried the old trick of importing compositions in iMovie. If this was possible in the past with iMovie ’06, Apple removed this feature in iMovie ’09.

My last chance was another plugin: Movie Exporter (v0.0.20091011). As the other one, you have to drop your original composition in a Render in Image macro block and export the resulting stream to the Movie Exporter block:

It did the trick but it looked like I messed things up: my goal was to export a 720p clip. But compression artifacts are so present in the final video that I think the exported images are blow-ups of a rendering executed at a much lower resolution. The rendering in the preview panel support this hypothesis:

Another big problem with this video export lies in the framerate: it cannot be set. For this composition the plugin exported a clip at 11fps. Which is far from fluid. I guess it’s because of the plugin grabbing images in real-time instead of taking the necessary time to render them one by one.

At the end, because of the reduced number of options available to export QC’s compositions to movies, and because of the proprietary nature of the platform, I don’t want to invest more time and energy in Quartz Composer.

I did some more experiments with it last year. I plan to share them with you and published them in the coming weeks. Then I’ll be free to sell my Apple machine and switch back to a full Open-Source stack (I’m thinking of Processing, PureData and their derivates here).

Fuse and sshfs on MacOSX Leopard

I’m used to access distant machine’s file systems via ssh. My favorite environment, KDE, makes things easy thanks to the support of sftp:// URLs via a kio_slave. MacOSX is not as friendly and don’t have any built-in mechanism of that kind.

To get similar features in Leopard, we have to rely on MacFuse and sshfs. I’ll explain here how I’ve installed these components on MacOSX 10.5.

MacFUSE_Banner

First, download the latest MacFuse dmg and install it. FYI, the version I’ve got was MacFuse 2.0.3,2.

Then, download the sshfs executable for Leopard, either the gzipped version or the binary from the SVN as explained in the MacFuse wiki.

From a terminal, rename the binary:

sudo mv ./sshfs-static-leopard ./sshfs

Then allow the binary to be executed and place it in the system:

sudo chmod +x sshfs
sudo install sshfs /usr/local/bin

From now you can test sshfs mounting with the following command:

sshfs user@myserver.net:/folder/ /Network/distant-folder -p 22

I personally had a problem here: sshfs complained about a missing library. I fixed this by downloading the required file from the MacFusion project and copying it beside the sshfs binary:

sudo wget http://www.macfusionapp.org/trac/export/86/trunk/SSHFS/sshnodelay.so
sudo mv ./sshnodelay.so /usr/local/bin/
sudo chmod +x /usr/local/bin/sshnodelay.so

If this fail you can also check:

  • that the current user you’re logged with has access to the distant server with the ssh user@myserver.net command;
  • or that the local mount point exists (you can create it with mkdir -p /Network/distant-folder);
  • and finally, you can add the -o debug option to the sshfs command above to get additional clues.

Now we will automate the mounting of sshfs at every start.

At this point I recommend you to register the root user of your MacOSX system to the distant server:

sudo cat ~/.ssh/id_rsa.pub | sudo ssh -p 22 user@myserver.net "cat >> ~/.ssh/authorized_keys"

If doesn’t exists, we have to create the /etc/fstab to edit it:

sudo touch /etc/fstab
sudo vi /etc/fstab

And add the following directives:

dummy:user@myserver.net:/folder/ /Network/distant-folder sshfs allow_other,auto_cache,reconnect,port=22,follow_symlinks,volname="Distant folder" 0 0

As you can see I’ve added lots of options to accommodate my uses. You can get more informations about sshfs options through traditional help pages:

sshfs --help

MacOSX’s automount daemon will look for a script called mount_sshfs at start. Actually it doesn’t exists on your system, but sshfs command line is compatible with what automount expect. So creating a symbolic link will do the trick:

sudo ln -s /usr/local/bin/sshfs /sbin/mount_sshfs

Finally, we can tell automount to acknowledge all our modifications:

sudo automount -vc

Plone 3.2 (and Python 2.4) on Mac OS X Leopard

In this post I’ll show you how I installed Python 2.4 on Mac OS X Leopard and how, starting from a bare Python environnement, we can build a stand-alone Zope 2.10 instance with Plone 3.2 thanks to zc.buildout.

If your goal is to play with or evaluate Plone (or if you don’t know what zc.buildout is), then this article will lead you to some troubles and pain. The Plone community maintain a collection of out-of-the-box and ready-to-use installers for all major platforms. So before going further, I strongly advise you to use the official Plone installer for Mac OS X. This is much simpler and faster than the process described below.

Now that all Plone newcomers are redirected to the right place, I can start to talk about how to install Python 2.4 on Mac OS X. Why the 2.4 release ? That’s simple: Mac OS X 10.5 (Leopard) ships with Python 2.5, but Plone 3 requires Python 2.4.

To get Python 2.4 on your machine, you can install it from its source code. But this is too much work for me. There should be a way to do it easier and faster… And there is.

Browsing the net, I found the repository of the “fat python” project, were you can find a universal binary installer for Panther. I’ve just installed it on my brand new Mac OS X 10.5.7 and it seems to works perfectly:
python-2.4-shell-in-mac-os-x-leopard

Now that the most annoying part (to me) is done, we can install Plone via zc.buildout.

Before going further, you need to have a machine that is able to compile code, which mean Apple’s developer tools must be installed locally. These softwares are available for free on the second DVD that ships with every Mac OS X copy.

First we create our project directory, then we download, from its SVN repository, the bootstrap code of buildout:

$ mkdir -p ~/plone-vanilla
$ cd ~/plone-vanilla
$ curl http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py --output ./bootstrap.py

Then we create our buildout config file and edit it:

$ touch ./buildout.cfg
$ vi ./buildout.cfg

The buildout.cfg file should contain the following directives, which tell buildout to install Plone 3.2.3, Zope 2.10.8 and all their dependencies:

[buildout]
find-links = http://dist.plone.org

http://download.zope.org/ppix

http://download.zope.org/distribution

http://effbot.org/downloads

http://dist.plone.org/release/3.2.3

extends    = http://dist.plone.org/release/3.2.3/versions.cfg
versions   = versions
parts      = zope-server
             zope-instance
eggs       = PIL
             Plone

[zope-server]
recipe               = plone.recipe.zope2install
url                  = http://www.zope.org/Products/Zope/2.10.8/Zope-2.10.8-final.tgz
fake-zope-eggs       = true
additional-fake-eggs = ZConfig
                       pytz

[zope-instance]
recipe           = plone.recipe.zope2instance
zope2-location   = ${zope-server:location}
user             = admin:admin
debug-mode       = on
verbose-security = on
eggs             = ${buildout:eggs}

Now let’s build our Plone and Zope environnement:

$ python2.4 ./bootstrap.py
$ ./bin/buildout

At the end, if your build process didn’t fail, you’ll be able to start your Zope server:

$ ./bin/zope-instance
program: /Users/kevin/plone-vanilla/parts/zope-instance/bin/runzope
daemon manager not running
zopectl> start
. daemon process started, pid=17585
zopectl> logtail
------
2009-07-20T20:42:26 INFO ZServer HTTP server started at Mon Jul 20 20:42:26 2009
	Hostname: 0.0.0.0
	Port: 8080
------
2009-07-20T20:42:35 INFO Marshall libxml2-python not available. Unable to register libxml2 based marshallers.
------
2009-07-20T20:42:59 INFO Zope Ready to handle requests

Then you can fire up Safari, go to http://localhost:8080/manage (default Zope config), and login as the admin user (password: admin):
safari-zope-login

Create a Plone site:
plone-site-creation

Check that your using the right version of Plone in the control panel:
plone-323-control-panel