Skip to content

Instantly share code, notes, and snippets.

@agassner
agassner / s3.py
Last active April 25, 2022 11:48
S3 upload and copy with encryption
#!/usr/bin/env python
import boto3
from boto3.s3.transfer import S3Transfer
filename = 'file.txt'
bucket_name = 'ravenskill'
s3 = boto3.resource('s3')
@astrofrog
astrofrog / qsub.py
Created May 2, 2013 11:39
Submitting jobs via qsub in Python
import os
import random
import string
import tempfile
import subprocess
def random_id(length=8):
return ''.join(random.sample(string.ascii_letters + string.digits, length))
TEMPLATE_SERIAL = """