Skip to content

Instantly share code, notes, and snippets.

@bradland
Created November 18, 2011 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradland/1376728 to your computer and use it in GitHub Desktop.
Save bradland/1376728 to your computer and use it in GitHub Desktop.
Print POW config
#!/usr/bin/env python
#############################################################################
# Print POW config with nice formatting #####################################
#
# Works as is with Python 2.6. For Python 2.7, 'import simplejson as json'
# instead. Save this file to a location in your PATH and make sure it is
# executable. Then you can call 'powconfig' from anywhere and see the active
# POW configuration.
#############################################################################
import sys
import json as json
import httplib as http
conn = http.HTTPConnection("localhost")
conn.request("GET", "/config.json", '', {"Host":"pow"})
resp = conn.getresponse()
data = resp.read()
print json.dumps(json.loads(data), indent=4)
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment