Posts filed under 'Howto'

Using AMQP to do cron-like scheduling

Barry Pederson’s excellent py-amqplib Python AMQP client comes with a very cute little demo, demonstrating how easy it is to do sophisticated cron-like things with AMQP and RabbitMQ.

As Barry writes in the example, the trick is to “[fire] off simple messages at one-minute intervals to a topic exchange named ‘clock’, with the topic of the message being the local time as ‘year.month.date.dow.hour.minute‘, for example: ‘2007.11.26.1.12.33′, where the dow (day of week) is 0 for Sunday, 1 for Monday, and so on (similar to Unix crontab). A consumer could then bind a queue to the routing key ‘#.0′ for example to get a message at the beginning of each hour.”

Lovely!

1 comment February 8th, 2008 tonyg

How to run RabbitMQ’s experimental STOMP adapter

The code for the experimental STOMP adapter for RabbitMQ is distributed separately from the main server, at the moment. This post walks through the steps needed to try the adapter out, running it against a recent snapshot release of RabbitMQ. The perl Net::Stomp STOMP client is used to demonstrate the adapter in action, subscribing to a queue and sending a couple of messages to it.

Continue Reading 6 comments February 2nd, 2008 tonyg

GNU Smalltalk 2.95h on Mac OS X 10.3.9

GNU Smalltalk version 2.95h (the latest release candidate) didn’t compile out-of-the-box on Mac OS X 10.3.9 for me. The two changes that were required were:

  • change the header file includes in socketx.h to the older way of getting the prototypes for select(2)
  • change part of a .section declaration in darwin_closure.S to remove mention of the live_support section attribute.

After these changes, gst compiles and runs well for me on my OS X 10.3.9 box.

The patch against gst 2.95h is here.

Add comment January 1st, 2008 tonyg

Emacs in MacOS X 10.5 Leopard

If you’ve upgraded to Leopard, and you’re an Emacs user, you may have found that typing emacs in a term no longer works — you get “Fatal malloc_jumpstart() error”. This will be the case if you’re using something like Fink or Darwin Ports, but it may also be the case if the upgrade didn’t quite work out.

The builds in Fink and Darwin Ports are currently broken; but otherwise, you have a few options to get Emacs back:

Use the Emacs that comes with Leopard. All this solution involves is making sure that any custom binary isn’t on the path — remove or move /sw/bin/emacs or /opt/local/bin/emacs (or possibly even /usr/local/bin/emacs) and make sure /usr/bin/emacs is the one installed with Leopard — /usr/bin/emacs –version should tell you the version is “22.1.1″.

The problem with the Emacs shipped with Leopard is that it’s built with no X support (or Carbon, for that matter)(although it does have Carbon support — see below).

Use Aquamacs. Aquamacs has precompiled binaries which work with Leopard. But, beware, it is quite different from Emacs in some ways — if you used Emacs before you used MacOS X, you probably won’t like it.

Compile your own Emacs. This is what I did. The stock 22.1 source distribution won’t build in Leopard; it gives up the ghost with a message “Assertion failed: (filesize <= ranges->size)”. However there is an unofficial patch, which worked for me. I’m going to keep my custom emacs until fink or ports catches up.

In summary (adapted slightly from here):

curl -O http://ftp.gnu.org/pub/gnu/emacs/emacs-22.1.tar.gz
tar xvzf emacs-22.1.tar.gz
cd emacs-22.1
curl -O http://ephemera.continuation.org/patches/emacs-leopard-unexec.patch
patch -p0 < emacs-leopard-unexec.patch
./configure --without-carbon --with-x --prefix=/usr/local
make
sudo make install

I put the result in /usr/local and made sure /usr/local/bin was on my path before any of the other possibilities, while I wait for Fink or Ports to catch up.

UPDATE: Thanks to masklinn’s comment below, I can present another option which I’d overlooked:

Use carbonised Emacs. If you want to run Emacs in its own window, but don’t want X11, there is a ready-made .app wrapper in the source distribution. The disk image, which masklinn suggests, has patches and some very useful bundled Elisp packages, like nxml-mode.

You can also use the emacs distributed with Leopard with the .app wrapper, as jfb points out (see the second comment below); or, compile your own carbonised Emacs, similar to what I did above: change the configure invocation

./configure --with-carbon --without-x
make
cp -R mac/Emacs.app ./
cp src/emacs Emacs.app/Contents/MacOS/
sudo mv Emacs.app /Applications/

Either way gives you an Emacs that behaves like a MacOSX app and doesn’t need X11 to run.

10 comments November 27th, 2007 mikeb

Calendar

May 2008
M T W T F S S
« Apr    
 1234
567891011
12131415161718
19202122232425
262728293031  

Posts by Month

Posts by Category