bzr-svn and svn revisions

I was updating an svn branch today using bzr, thanks to bzr-svn, and I wanted to know what svn revision I was at.

You can easily see the bzr revision by running

johnf@zoot:~/trunk$ bzr revno
34

But it gives no indication of where you are in SVN land. After a bit of rummaging around I discovered the following

johnf@zoot:~/trunk$ bzr version-info
revision-id: svn-v3-trunk0:90e61fa5-4541-0410-a685-e5b9dba3c764:trunk:74
date: 2008-05-29 19:24:44 +0000
build-date: 2008-06-14 19:10:59 +1000
revno: 34
branch-nick: trunk

The revision-id field seems to be the key and seems to indicate I’m using SVN revision 74. Checking the branch via the web confirmed that.

Hardy, exim4, SMTP-AUTH and LDAP… (or debian openssl causes pain)

As most people will know yesterday caused a lot of people a lot of pain as they ran around replacing SSH keys and SSL certificates.

While running around fixing up all our servers, most of them in one felll swoop thanks to puppet, I realised two of our servers were still running Edgy. I figured it was high time I moved them to Hardy.

Everything went fairly smoothly with some minor hicups, except for SMTP-AUTH for exim. We use an ldap backed SMTP-AUTH and this just wouldn’t work after the upgrade. The following error was appearing in the logs.

ldap_search failed: -7, Bad search filter	

This lead to hours upon hours of google searches, staring at debug messages and even at one stage resorting to using GDB. Eventually after staring at debug messages harder it twigged when I saw the following.

perform_ldap_search: ldapdn URL = "ldap:///ou=people,o=vquence?dn?sub?(uid=moo) "

Notice the space just before the closing double quote. It seems that the new openldap libraries don’t like errant spaces in your search filter.

Now to remember what I was doing yesterday morning before this whole derailment began.

Note: Before anyone comments I will completely deny that during these upgrades I did anything as silly as rm -rf `dpkg -L random-font-package`, no matter what twitter says.

Hardy and password locking

passwd -l root

In gutsy the above would simply lock the account by placing an ! in front of the passwd in your /etc/shadow file.

In hardy it now also sets the account as expired. Meaning you can’t ssh to it even if you have SSH keys in place.

Time to go and rebuild my EC2 AMI. 🙁

Update: To get the old behavour back you can do the following

passwd -l root
usermod -e "" root

Sorting in Mutt

A couple of days ago I discovered the following mutt config option.

set sort = threads
set sort_aux = last-date-received

This means you get the usual threading but that a thread is sorted by the date the last message in the thread was received. This keeps a thread which receives new mail at the bottom of your mailbox rather than up at the top.

Another idea I found useful is to sort my spam mailbox by subject. Since a lot of SPAM has exactly the same subject it makes it really easily to quickly scan the mailbox for HAM.

You can easily do this with the following additions to your muttrc

folder-hook . set sort=threads
folder-hook spam set sort=subject

You need to set the default as mutt will change the sort order when you change to the spam folder but won’t change it back when you jump out of it.

Firefox 3 and howtoforge.com

There is currently a bug in firefox 3 which causes it to crash with an XError BadAloc when you go to any page hosted on howtoforge.

This seems to be related to the image at http://howtoforge.com/themes/htf_glass/images/bg_header_bottom_left15.png. I suggest you don’t click on that link 🙂

Apparently this image is 10,000 pixels wide. It looks like this is probably a GTK issue since the same problem happended when I opened the image with evince!

I tried writing a greasemonkey script to get around this problem but it loads too late to avert the crash. So iptables to the rescue.

iptables -I OUTPUT -d howtoforge.com -m string –algo bm –to 70 –string “GET /themes/htf_glass/images/bg_header_bottom_left15.png” -j DROP

iptables  
    -I OUTPUT  # Match packets levaing my laptop
    -d howtoforge.com   # Only packets going to howtoforge
    -m string  # Invoke the string matcher
    --algo bm  # Pick a matching algorithm
    --to 70  # Only check the first 70 bytes of each packet
    --string "GET /themes/htf_glass/images/bg_header_bottom_left15.png"  
    -j DROP # Drop the sucker