Skip to content

Instantly share code, notes, and snippets.

View bblincoe's full-sized avatar
👟
Probably running...

Brandon Blincoe bblincoe

👟
Probably running...
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bblincoe on github.
  • I am blincoe (https://keybase.io/blincoe) on keybase.
  • I have a public key ASBVR2By2YpanlCOaK7F0KWCetbL11NMn6xeyWBnG3-DDQo

To claim this, I am signing this object:

@bblincoe
bblincoe / vpn-ipsec-cloudformation.json
Last active July 10, 2016 15:27
OpenSwan acting as VPN IPSec endpoint
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "OpenSwan acting as VPN IPSec endpoint",
"Parameters": {
"KeyName": {
"Description": "Key for SSH access",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "Must be the name of an existing key pair."
},
"VPC": {
@bblincoe
bblincoe / copy_s3_to_hdfs.py
Created June 21, 2016 19:04
Copy timestamped data from AWS S3 to HDFS in Python (boto3)
import boto3
import botocore
def copy_s3_to_hdfs(client, job_flow_id, day):
"""Copy data from AWS S3 to HDFS. Assumes that the file name includes
date followed by a timestamp.
"""
return client_throttle(
client.add_job_flow_steps,
JobFlowId=job_flow_id,
@bblincoe
bblincoe / client_throttle.py
Last active April 28, 2022 14:16
Amazon AWS Client Throttle in Python (boto3)
import boto3
import botocore
from random import randint
from time import sleep
def client_throttle(action, **kwargs):
while True:
try:
return action(**kwargs)
except botocore.exceptions.ClientError as e: