Skip to content

Instantly share code, notes, and snippets.

View pacohope's full-sized avatar

Paco Hope pacohope

View GitHub Profile
@pacohope
pacohope / ec2-ami-region-map.py
Last active September 23, 2019 15:33
Given a starting public AWS AMI, generate a YAML list of AMI IDs for that AMI in all AWS regions.
#
# Given the ID of an Amazon public AMI in one region, figure out what the
# equivalent AMI IDs are for that same AMI in all other regions known.
# If that AMI isn't defined in a region, it prints the region's name, but
# comments it out.
#
from __future__ import print_function
import boto3
@pacohope
pacohope / glacier-notify.sh
Created July 6, 2017 09:55
Set SNS notifications for all Glacier vaults
#!/bin/bash
#
# Set notifications for all my vaults on the same SNS topic.
# Set Variables up top. The rest flows through.
# See Also: http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications-console.html
# Set these four
REGION="eu-west-1"
PROFILE="MYPROFILE"
@pacohope
pacohope / import-keypairs-all.sh
Last active June 28, 2017 11:01
Import a ssh keypair into EC2 in all AWS regions
#!/bin/bash
# I use an "Admin" profile that has all EC2 permissions
AWSPROFILE="Admin"
KEYNAME="my-aws-key"
KEYFILE="file:///Users/paco/.ssh/foo.pem"
# Create foo.pem via:
# sshkeygen -f /Users/paco/.ssh/foo.pub -e > /Users/paco/.ssh/foo.pem
# use ec2 describe-regions to get the official, up-to-the-minute region list.
REGIONS=$(aws ec2 describe-regions | jq -r '.Regions[].RegionName')
# -*- coding: utf-8 -*-
import click
import os
import pandas as pd
def file_split(file):
s = file.split('.')
name = '.'.join(s[:-1]) # get directory name
@pacohope
pacohope / keybase.md
Created January 13, 2015 10:55
My Keybase Verification

Keybase proof

I hereby claim:

  • I am pacohope on github.
  • I am pacohope (https://keybase.io/pacohope) on keybase.
  • I have a public key whose fingerprint is 97BE DA24 3F14 E0FA 0D43 07AB 695A 1FCB A0B6 2312

To claim this, I am signing this object: