Now for some of my cows

/2007/Apr   thoughts, notes and mooo...

<  April 2007  >
SuMoTuWeThFrSa
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
2930     
misc.

Tue, 10 Apr 2007 Two easy_install tricks   >>

Tue, 10 Apr 2007 Two easy_install tricks   >>

Two easy_install tricks I should remember:

1) Package name alias

Whenever the name for a Python package as listed on the cheeseshop is different from the name it will have on the PYTHONPATH (e.g. when it is installed in site-packages or something). easy_install can get confused.

One prominent example is PIL. PIL is installed using easy_install under the name Imaging, not PIL. So, a line in your package's setup.py to require PIL:

setup(
     ...
     install_requires=[
         ...
         'PIL'
         ]
 )

Doesn't work, you have to say this:

setup(
    ...
    install_requires=[
        ...
        'Imaging'
        ]
)

But then easy_install gets confused, because the downloaded egg is called something like PIL-1.1.6-py2.4-linux-i686.egg, not Imaging--1.1.6-py2.4-linux-i686.egg.

My solution for now: make an entry on a custom Python package index page (that I have anyway for internal packages), where the #egg=... fragment identifier is misued, like so:

<a href="http://www.effbot.org/downloads/Imaging-1.1.6.tar.gz#egg=PIL-1.1.6">
  PIL-1.1.6
</a>

(This fragment identifier is normally used by easy_install to point to subversion repositories).

See this thread on distutils-sig list archive for references.

2) HTTP Basic Authentication

Easy_install can deal with a Python package indices that requires Basic Authencticaion. You just use a credentialed URL, something like:

easy_install -f http://username:secret@domain.tld/path/to/index

If downloading the packages that is being refered to on this index page needs authentication too, you have to make sure the URLs to the packages are relative URLs. Only in that case, the easy_install command remembers the credentials provided.

See this thread on the distutils-sig list archive for reference.

Fri, 06 Apr 2007 Dualboot Mac Mini with Mac OS X and Ubuntu   >>

My computer at work is a Mac Mini. Its Intel based, so I figured installing Ubuntu on it should be no big deal. However, downloading the Feisty Fawn beta ISO image took a while, so in the meantime I installed OS X just for the heck of it anyway.

Initially I thought to completely reformat the disk when installing Ubuntu, but since I had setup OS X already it seemed like a waste of time not to try and make it a dualboot machine. You never know when it comes in handy.

Setting it up like that was fairly painless. There were three hiccups, but they proofed not too difficult to solve:

I had the OS X install use the complete disk, so the only option left for installing Ubuntu seemed to be to reformat the disk completely after all. But parted to the rescue! It allowed me to dynamically resize the HFS+ partition back to 20GB, and emtpying up the remaining 60GB for the Ubuntu install. Great!

After having installed Ubuntu on the new partition, the time had come to reboot. That's always exciting after a partition resize and having a second OS installed... And... it just booted OS X. Darn.

A quick Google and I learned about rEFIt which is an opensource bootmenu for EFI based system and thus Intel Macs. After installing rEFIt and a reboot I suddenly had an interactive boot menu including the option to boot from the freshly installed Ubuntu partition. Yeah!

The last hiccup was supporting the very very very nice Apple Cinema HD 23" display. For some reason, the Xorg installation actually detected and configured the display's native resolution of 1920x1200, but X would only start in 1600x1200.

This Mac Mini model has a onboard 945GM/GMS/940GML graphics controller and using 915resolution I could overwrite on of the video BIOS's settings to persuade into actually knowing about this wide screen resolution:

sudo 915resolution 5c 1920x1600

And tadaa! Works!

Its a nice little machine and quite workable as well, especially for a 1.66GHz CPU and "only" a 5400RPM disk. And the wide-screen... Yummy!

some keywords: apple cinema hd 23" 1920x1600 mac mini refit dualboot ubuntu feisty fawn 915resolution parted