Thu, 12 Dec 2002
Looking for yummy vegan special-occasion recipies

If anyone has any yummy vegan recipies that they've made for special occasions please send them to me. This is our first vegan/vegetarian Christmas and it's also the first year we're hosting family for the occasion!

Suckers eh :)

Thanks to amk, we have a head start - but our other problem is that December in Australia isn't cold - so those yummy, warming dinners aren't really appropriate.

Email to richard at mechanicalcat dot net please ...

path: /stuff | permanent link |
I see no problem here...

Rachel can't decide which movie to see for her birthday. Let's just declare it a birthday week! Let's see all of them.

path: /stuff | permanent link |
On a completely unrelated note...

A Roundup user has just installed a Roundup tracker via FTP. Neat.

path: /python | permanent link |
Socket timeouts, the conclusion...

Can't reasonably back-port the socket module code from the python CVS. Plan B is invoked: a second daemon that detects that the sms gateway is locked up, and kills it. euwwww

path: /python | permanent link |
Lost...
> look

You are in a twisty maze of python build dependencies, all covered with
inscrutable error messages.  There are exits to: N, S, E, W.
What do you do?

> python setup.py build

A compiler goblin rushes out of one of the passages, scribbles on a wall
and runs gibbering down another passage.

> help

There is no help for you.

> n

You are in a twisty maze of python build dependencies, all covered with
inscrutable error messages.  There are exits to: N, S, E, W.
What do you do?

> get coffee
path: /python | permanent link |
More timeout socket fun

So it turns out that the ssl code in Python requires a real builtin socket object to work on in send and recv calls. This is probably what Skip was referring to. Faked-up socket wrappers are pretty much out, in the current code anyway. The CVS code which has this fixed... well, I guess I'll be looking into that after all, and my sysadmin will just have to deal with it :)

path: /python | permanent link |
Socket timeouts

We've got an SMS gateway in our service that effectively runs as a queued transfer agent, pushing the messages out to actual SMS providers. So far so good.

One of our providers - our preferred provider for price and completeness of service - is a little dodgy in consistency. Sometimes their server breaks and refuses connections. No problem, we have a couple of backups and automatically fail over to them. Unfortunately, sometimes this provider accepts our connection and doesn't let go. That means that we've had a couple of instances where the messages are queued for up to 10 hours.

So the solution is simple, yeah? Use timeoutsocket. It's transparent and has a trivial interface:

import timeoutsocket
timeoutsocket.setDefaultSocketTimeout(20)

The import patches the socket module so that all future socket objects are passed through the timeoutsocket code. Another situation where Python rocks.

...

Except there's a catch. We use SSL to connect to our SMS providers as a way of protecting our account information and user messages. We connect with urllib2 module. This in turn uses the httplib module. The httplib module handles SSL (HTTPS) transparently. Well, except for this little gotcha at the core of the HTTPS connection handler:

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((self.host, self.port))
realsock = sock
if hasattr(sock, "_sock"):
    realsock = sock._sock
ssl = socket.ssl(realsock, self.key_file, self.cert_file)
self.sock = FakeSocket(sock, ssl)

Note the realsock stuff to do with _sock. That code is specificaly circumventing the code that timeoutsocket inserts in the socket module to implement the timeout.

...

No, I have no idea why that code is there - I'm sure there's a good reason. Really.

...

So I asked python-list whether anyone had ported timeoutsocket to be used with HTTPS. The sole response I got indicated that the problem may have been solved in the current CVS version of the socket module. My system administrator would have a fit if I suggested that we use that socket module.

...

The search continues...

path: /python | permanent link |