Skip to content

Instantly share code, notes, and snippets.

@aaronlevy
aaronlevy / s3download.py
Last active August 29, 2015 13:57
Simple S3 download (for when boto is more than you need)
import base64
import hmac
import sha
import time
import urllib2
def download(access_key, secret_key, bucket, key, destination=None, timeout=None):
url = 'http://%s.s3.amazonaws.com/%s' % (bucket, key)
headers = _auth_header('GET', bucket, key, access_key, secret_key)
data = urllib2.urlopen(
@aaronlevy
aaronlevy / test_pem.py
Created February 20, 2014 21:19
Test APNS PEM file
import os
import socket
import ssl
import tempfile
from M2Crypto import RSA
from M2Crypto import X509
from M2Crypto.util import no_passphrase_callback
SANDBOX_GATEWAY = 'gateway.sandbox.push.apple.com'

Keybase proof

I hereby claim:

  • I am aaronlevy on github.
  • I am aaron (https://keybase.io/aaron) on keybase.
  • I have the public key with fingerprint E719 74E3 7057 2007 5F44  3B4E A98B 9D05 88C8 6DE2

To claim this, I am signing this object: