When localhost isn’t localhost: Apache and OpenLDAP

Today I was troubleshooting an issue with Apache and LDAP authentication via the OpenLDAP server. I had copied an existing configuration to a new system (Debian Etch to Ubuntu 10.04). Most everything was working (logins via PAM and LDAP, and the like). However, authentication via Apache’s LDAP BasicAuth …

View comments.

more ...


BetweenDict, a Python dict for value ranges

I was doing some programming today (no, really?) and had need of a data structure that would return a value based on the key falling within a given range. Kind of like a dict, but each key in the dict would be two values, between which the querying key would …

View comments.

more ...


Don’t use strptime, use a regex

I am using Python to do some data file processing, converting data from a horrendously verbose, repetitive format to a nice, clean, CSV format. The date and time are in two different fields, and the date is in MM/DD/YYYY format, plus, the MM and DD might be one …

View comments.

more ...

Generating PDF thumbnails

Had the need recently to generate a bunch of thumbnails for some PDFs we had. ImageMagick to the rescue.

for P in `ls *.pdf`
  do echo $P
  outfile="thumbs/`echo $P|cut -d . -f 1`.jpg"
  convert -quality 50 -geometry 64x82 $P[0] $outfile
done

The [0] tells it to …

View comments.

more ...


When marketing gets ahead of engineering

Bob (from marketing): I have this great new idea for our product!

Joe (from engineering): Lay it on me!

Bob: Let’s make our product easier to use! People will love it!

Joe: OK, we’ll need three months to develop and test that feature.

Bob: Great! We’ll start …

View comments.

more ...


Chaining SSH Connections

Today I was trying to figure out how to ssh into one system, and then automatically ssh into another system. The logical way:

ssh user@outside_host "user@inside_host"

wasn’t working. The logs on both inside and outside hosts would show a connection, but I would get no prompt. I …

View comments.

more ...