Skip to content

Instantly share code, notes, and snippets.

View GoGstickGo's full-sized avatar
🐍
Falling into k8s hole

GoGstickGo

🐍
Falling into k8s hole
View GitHub Profile
@mdwhatcott
mdwhatcott / s3_presign.py
Last active April 19, 2021 14:02
Generate a pre-signed S3 URL (valid for 20 years) with nothing but the standard library.
#!/usr/bin/env python
"""
Generates a pre-signed S3 URL using a valid key pair that lasts for 20 years.
Reference: http://forrst.com/posts/Python_method_for_creating_authenticated_s3_URLs-uUM
"""
import base64, hmac, os, sha, sys, time, urllib