Skip to content

Instantly share code, notes, and snippets.

@jiphex
Created September 17, 2009 08:13
Show Gist options
  • Save jiphex/188400 to your computer and use it in GitHub Desktop.
Save jiphex/188400 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# Unpostmap - reverse postmap'ed data
import os,sys,datetime
try:
import bsddb
hashed = bsddb.hashopen(sys.argv[1], 'r')
print "# hashed by unpostmap (%s)"%sys.argv[1]
for key in hashed:
print "%s %s" % (key, hashed[key])
except KeyError:
print "Usage: %s virtual.db" % sys.argv[0]
except ImportError:
print "Couldn't load BDB interface - This won't work on Python >3."
print "If you're running debuntu: aptitude install python-bsddb3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment