Skip to content

Instantly share code, notes, and snippets.

@jrossi
Created August 4, 2010 18:21
Show Gist options
  • Select an option

  • Save jrossi/508555 to your computer and use it in GitHub Desktop.

Select an option

Save jrossi/508555 to your computer and use it in GitHub Desktop.
>>> import cdb
>>> f = open("rfc1918-privateaddresses.cdb", "r")
>>> db = cdb.init(f.fileno())
>>> db.keys()
['192.179.', '10.', '172.16.', '172.17.', '172.18.', '172.19.', '172.20.', '172.21.', '172.22.', '172.23.', '172.24.', '172.25.', '172.26.', '172.27.', '172.28.', '172.29.', '172.30.', '172.31.', '172.32.']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment