Saturday, September 11, 2010

python crypt authenticate htpasswd/htdigest

A python snippet to authenticate against a htpasswd hash in Python:
from crypt import crypt
pw = '2600'
htpasswd = 'Jywn1PBEdYjkg'
authd = crypt(pw,htpasswd)==htpasswd
assert authd
authd = crypt('wrongpw',htpasswd)==htpasswd
assert authd==False

Friday, September 10, 2010

freenx and GLX

How to get freenx working with GLX & OpenGL?

me@computer:~$ glxgears
Error: couldn't get an RGB, Double-buffered visual

Try this:

Then things should be just peachy!

Monday, September 6, 2010

distutils/setuptools python install -> automatic .deb generation

I used the python-stdeb in the ubuntu 10.04 repo to install itself using the
newest version from the git repo:


1) Add the following to ~/.pydistutils.cfg:

command-packages: stdeb.command

2) If necessary, edit a stdeb.cfg file which contains the options for debian/control.
The stdeb git repo already has a sensible stdeb.cfg file, but for another project,
the following might be appropriate:

Depends: python-numpy
XS-Python-Version: >= 2.6
Provides: python-myproject

3) python bdist_deb

4) dpkg -i deb_dist/python-stdeb_0.6.0+git-1_all.deb

NB: comparing that .deb
with the one in the
apt cache:

Shows similar install paths ... so I think everythings ok

Another possibility would be:
$ sudo checkinstall --install=no python install

But I suppose stdeb is more savvy in its pythonic ways ...