Advertisement
Guest User

Untitled

a guest
May 24th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #~/bin/env python
  2.  
  3. import hmac
  4. from hashlib import sha1
  5. from time import time
  6. import subprocess
  7.  
  8. method = 'GET'
  9. expires = int(time() + 360)
  10. path = '/v1/demo/cont_s3/uploaded_from_s3.txt'
  11. key = '<unsure>'
  12. hmac_body = '%s\\n%s\\n%s' % (method, expires, path)
  13. sig = hmac.new(key, hmac_body, sha1).hexdigest()
  14.  
  15. subprocess.Popen(["curl", "http://10.10.10.200:8080%s?temp_url_sig=%s&temp_url_expires=%d" % (path, sig, expires)])
  16. print
  17. #print "\"http://10.10.10.200:8080/%s?temp_url_sig=%s&temp_url_expires=%d\"" % (path, sig, expires)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement