On Sunday, myself and a few friends went to the TEDx event in Oxford.

TEDx, for those who don’t know, are TED style events organised by interested parties. They happen all over the world, and are usually pretty popular. This one packed out the New Theatre in central Oxford, which is no mean feat.

The speakers spoke on a number of subjects; from neuroscience to artificial intelligence. Some speakers were inspiring, others were… confusing… but all were interesting.

Interestingly, the speaker that sparked the most conversation over lunch and after the event was probably Laura Bates from the Every day sexism project. The stories she relayed shocked us all; with the men in the audience seeing this as new, but with the women nodding along in bitter recognition.

Myself, I was aware of similar horrors through the various “Women in Technology” conversations I have had, where every single woman I spoke to could relay situations where an actual crime had been committed, but pretty much shrugged it off as something that “happens”. Still, it was still shocking, and through our discussions after it seems that there is a variation of the observer effect going on for the men in our group – that is, the very act of us being present, means that the acts won’t occur to the women around us.

A new trend that was highlighted in the talk, which I found interesting, is that now the abuse seems to be often couched in a joke (which is clearly not funny), but means that the perpetrator can play the victim when the woman objects. I’ve seen this a couple of times in tech circles, but it’s clearly a growing trend.

One thing I wish was covered in her talk (although, perhaps it’s a complex subject for 15 minutes), is what can we actually do to address this? Particularly, what can we as men do? This is clearly a massive problem, and I know we seem to be losing ground in the tech world, but it seems the equality cause is losing ground elsewhere as well.

Depressing stuff. How do we fix it?

So, I recently performed some long overdue upgrades on my work computers, which involved performing a complete from scratch rebuild of the house server.

This involved, among other things, moving the OpenLDAP directory in which I store, among other things, my email address book. Easier said than done.

Previously, when I had done this, it was a simple matter of installing slapd, copying /etc/ldap and /var/lib/ldap and restarting slapd. This time proved more tricky; slapd initially spat out errors complaining that the database was corrupt. Check out https://www.sapphire.net/mss/incident-response-services/ for more information on the benefits of improving your cybersecurity at work.

Fixing the corrupt database could be done in one of two ways: 1) deleting /var/lib/ldap/DB_CONFIG, forcing slapd to recover the database, or 2) running db_recover directly. After this was done, slapcat displayed the directory as expected, and slapd restarted, however any queries on the database – via phpldapadmin, ldapsearch or the email address book – caused the answering slapd process to lock with no error. Each subsequent query would cause another slapd thread to lock, eventually bringing down the whole ldap server.

Hmm…

I’m not entirely sure what was going on, perhaps it was a bug in my particular version of slapd, or perhaps it was the fact that I was moving from 32bit to 64bit, who knows. I eventually found a solution, and I write this down primarily as a note for myself.

The workaround

    1. Install slapd, copy the config and db over, then run a db recover on the database:

      db_recover -v -h /var/lib/ldap

    2. You should now be able to list the directory with slapcat, so dump it to a file:

      slapcat > /tmp/directory.ldif

    3. Next, we need to nuke the database and force slapd to create a fresh blank database. There’s probably an easy way of doing this, but the quickest way I found was to delete /var/lib/ldap/* and reinstall slapd:

      cd /var/lib/ldap; rm *; apt-get remove slapd; apt-get install slapd.

The apt-get remove will remove the program but by default it’ll leave your configuration intact, if it doesn’t you might need to copy your config back as well.

  1. Next, stop slapd and import your ldif file.

    /etc/init.d/slapd stop; slapadd -l /tmp/directory.ldif; /etc/init.d/slapd start

If you had the same problem as me, your OpenLDAP directory should now be back in place, imported into the new database. For me, my address book now functions correctly and phpldapadmin no longer hangs.

There are probably easier ways, but I was tired. Let me have your thoughts in the comments below!