Skip to content

Installing MySQL + MySQLdb in OS 10.5 (Leopard)

Anyone that is a python developer and that uses mysql will tell you getting MySQLdb can sometimes be a bit of a pain, and every time I reinstall my system I have to dig around to find the instructions to build it properly.So this time I thought I would document what I did on my blog, mostly so I can reference it myself.

  1. Get the mysql packages from darwinsource, this is by far the easiest way to get mysql on your box. http://www.opensource.apple.com/darwinsource/Current/
  2. There you will find a binary package (I guess you could comiple from source also, but I’m doing the quickest route) MySQL-43.binaries.tar.gz, download it.
  3. $tar zxvf MySQL-43.binaries.tar.gz and you are left with a folder, in that folder it has a readme with the command you need to run $sudo tar -xzvf MySQL-43.root.tar.gz -C /
  4. Now you need to edit the download MySQLdb sources file _mysql.c (as per this ) and remove the following lines near the top of the file
    #ifndef uint
    #define uint unsigned int
    #endif
  5. Now with that file patched, you can run $python setup.py build followed by $sudo python setup.py install. I didn’t have to create a symlink to any .so or .o files as mentioned in some other posts, I think it may be because I used darwinsource package rather than the packages from dev.mysql.com

libpurple XMPP transport Google SoC idea

When I wrote the post Why Transports Matter back in September I openly wondered if it was possible to write XMPP transports using libpurple. Sure enough, looking at pidgin’s Soc ideas page they have the same idea right there.

I’m not saying I had anything to do with it, I have never spoken with the devs or submitted the idea, I just think it’s neat that someone else out there was thinking on the same wave length as myself :-)

A little time waster…

So I was at Chuck E. Cheese the other day with my son, putting the tickets he won into the counting machine (called “the ticket muncher”) and when it spit out the card saying how many tickets where counted with a bar code on it, it got me wondering just what was in the barcode…

So I used three of my sons tickets (he wouldn’t mind ;-) )  to get one count cart with one ticket counted and one paper with two tickets counted from the same machine, one right after the other.  Here is what’s on the barcode. Above the barcode is the number of tickets displayed like ” *2* “.  One would think the barcode would decode into the number two, as the asterisks are stop-end characters for many barcode formats, but instead the two ticket paper returned 1479043805200025, and the one ticket card 1479043805300015.

The string breaks down like this…

  •  Positions 1-4 (1479) is the physical machine serial number
  •  Positions 5-11 (0438052) is a machine independent incrementing serial number
  •  Positions 12-15 (0002) is the number of tickets counted
  •  Position 16 (5) is what I believe to be a per-store machine serial number, but I have to go back to verify on other machines

So there you have it, five minuets of my time that I really should have been doing something else rather than looking at ticket cards for a children’s arcade ;-)

Thanks Apple, you gave me IPv6 and I didn’t even notice.

So, I was reading The Night the IETF Shut Off IPv4 last night and came across something weird; I could access all of the IPv6 sites mentioned in the comments…waaahhhtt?? :-/

Ah, so 6to4 is the imporant part and so is the 2002:xxxx, that means I have been setup with a 6to4 subnet and didn’t even know it :-)

UPDATE: WOW! am I behind on the times, this has been know for a while - in fact I even remember reading the story (admititly I didn’t have an AirPort at that time, so I paid little attention) back in Feb 2007

Spanish for IT folks.

Estoy aprendiendo español :-)

In my day to day systems admin job I rarely have to deal with the customers of the company I work for, but when I do it’s often through an interpreter (read: the sales dept) and that does not always go as smooth trying to convey technical terms through a non-technical person. So I have taken to learning spanish myself.

One thing you will find real quick is that none of the spanish-to-english dictionaries you will find have the term for server as the noun it will be used in our field (people WILL look at you funny when you refer to your server room as a room of waiters and waitresses) . That is why I have found this site, Comparative CyberLexicon to be a great jumping off point.

The ultimate web development environment.

Just to let all eight of you that read my blog, the second installment of “The ultimate web development environment” will be coming in the next few days. So don’t go thinking that it is a dead post.

Ad blocking with safari

I often wondered if the custom style sheet support in safari could be used to do rudimentary ad blocking, turns out it can :-)

Check out http://www.floppymoose.com
I kind of like this idea because it doesn’t add any more cruft onto safari that has the potential to crash plus I’m not super adverse to seeing ad’s when it doesn’t catch everything.

bacula-fd 2.0.3 back-ported for ubuntu 6.06

bacula is an awesome GPL’ed backup and restore suite and version 2 has added some very nice features, unfortunately ubuntu 6.06 (dapper) is at version 1.36. While 1.36 is a nice release, I wanted version 2 which has landed in gutsy’s repo. So I fired up prevu the handy one-shot back-porter to get myself some packages, turns out I couldn’t just do a quick back-port and had to make some changes to the dpkg control file, the rules script, and the dcs file.

I’m not all that good at building packages so through trial and error most of today I was finally able to get the packages to compile and built into a deb file. The only two packages I cared about where the file daemon and the bacula-common package (as my director which runs feisty back-ported everything else just fine), for my servers so those are all I built. Anyways I am offering them up here so someone else doesn’t have to go through the frustration of trying to do the same task…

Built for Ubuntu 6.06 i386
bacula-common
bacula-fd

Here are the files I hacked up to get what I needed…
control
rules
bacula_2.0.3-4ubuntu2.dsc

In closing…these work for me, your mileage may very, always do test backups and restores.

Why Transports Matter

Sander Devrieze of the conccinella project explains his opinion as to why mutli-protocol clients (such as my beloved Adium) are hindering the adoption of Jabber/XMPP into the mainstream. I would have to agree with him on most of his points he makes but I am kind of at a loss to use anything else, to my knowledge there is not any well rounded Mac -native- jabber clients. However the same mulit-protocol Adium project that he says is hindering adoption just finished a GSoC project to make jabber a first class citizen, even supporting transports.

Also all the times I have used transports though they have been largely unreliable even for basic messaging and that is something Sander calls to fix. I openly wonder if something like libpurple could be used by a transport component as the pidgen guys are pretty good at staying on top of protocol changes then the transport author would only need to maintain an interface between libpurple and the XMPP server.

read more | digg story

svcs

A little side project I had at work has just become open source, my first one!

The project is for giving full subversion control to a Servoy solution.

You can check it out here http://code.google.com/p/svcs