Skip to content

Instantly share code, notes, and snippets.

Created March 8, 2013 18:20
Show Gist options
  • Save anonymous/5118604 to your computer and use it in GitHub Desktop.
Save anonymous/5118604 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import cgitb
cgitb.enable()
import sys
import datetime
body = sys.stdin.read()
date = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
fh = file('log/%s.log' % date, 'w')
fh.write(body + '\n')
fh.close()
print "Content-type: text/plain"
print
print "ok"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment