Skip to content

Instantly share code, notes, and snippets.

@limed
limed / assumeawsrole
Created October 15, 2015 23:51 — forked from sneak/assumeawsrole
shell script to ease MFA use with aws role assumption
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "usage: $0 <rolename> (e.g. \`$0 EngineerProd\`)" > /dev/stderr
exit 127
fi
if ! which jq 2>&1 > /dev/null ; then
echo "$0 error: Please install 'jq'." > /dev/stderr
exit 127
@limed
limed / ensure-cloudtrail.py
Created October 1, 2015 21:09 — forked from vrivellino/ensure-cloudtrail.py
Ensure CloudTrail is activated in all regions
#!/usr/bin/env python
# tested with boto 2.38.0
import boto
import boto.cloudtrail
import json
import logging
import re
# Find the IAM username belonging to the TARGET_ACCESS_KEY
# Useful for finding IAM user corresponding to a compromised AWS credential
# Requirements:
#
# Environmental variables:
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# python:
# boto
@limed
limed / onidpw.py
Created October 12, 2011 17:56 — forked from russellhaering/onidpw.py
Oregonstate ONID Password Cycler
#!/usr/bin/env python
#
# reset-onid.py - A script to allow you to keep your ONID password at Oregon
# State University. This script is (literally) untested and should not be used
# under any circumstances
#
# Dependencies:
# - httplib2
# - The 'pwgen' utility
#