Skip to content

Instantly share code, notes, and snippets.

View bmacauley's full-sized avatar

Brian Macauley bmacauley

View GitHub Profile
@bmacauley
bmacauley / infra-secret-management-overview.md
Created March 26, 2017 10:01 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@bmacauley
bmacauley / convert_IAM_to_SES.py
Created March 19, 2017 12:08
an attempt to convert AWS IAM credentials to the SES sort as per the instructions found here: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#Obtaining Amazon SES SMTP Credentials by Converting AWS Credentials
def hash_IAM(user_password):
#http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html
if DEBUG: debug_message("Hashing for IAM to SES values")
AWS_SECRET_ACCESS_KEY = user_password
AWS_MESSAGE = "SendRawEmail"
#in Python 2, str are bytes
signature = hmac.new(
key=AWS_SECRET_ACCESS_KEY,
@bmacauley
bmacauley / convert_IAM_to_SES.py
Created March 19, 2017 12:08
an attempt to convert AWS IAM credentials to the SES sort as per the instructions found here: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#Obtaining Amazon SES SMTP Credentials by Converting AWS Credentials
def hash_IAM(user_password):
#http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html
if DEBUG: debug_message("Hashing for IAM to SES values")
AWS_SECRET_ACCESS_KEY = user_password
AWS_MESSAGE = "SendRawEmail"
#in Python 2, str are bytes
signature = hmac.new(
key=AWS_SECRET_ACCESS_KEY,
@bmacauley
bmacauley / README.md
Created July 31, 2016 19:21 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@bmacauley
bmacauley / playbook-govready-macbook.yml
Created January 25, 2016 20:05 — forked from gregelin/playbook-govready-macbook.yml
Battleschool Ansible playbook for setting up a Macbook Pro.
---
- hosts: workstation
tasks:
- name: print from playbook
debug: msg="in playbooks/playbook.yml"
- name: easy install pip
easy_install: name=pip
sudo: yes
# coding: utf-8
def to_base(q, alphabet):
if q < 0: raise ValueError, "must supply a positive integer"
l = len(alphabet)
converted = []
while q!= 0:
q, r = divmod(q, l)
converted.insert(0, alphabet[r])
return "".join(converted) or '0'
import logging
logger = logging.getLogger('myapp')
hdlr = logging.FileHandler('/var/tmp/myapp.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.WARNING)
@bmacauley
bmacauley / logging.py
Created March 28, 2013 13:37
logging
#set up logging
logger = logging.getLogger('main')
logger.setLevel(logging.DEBUG)
# Use file output for production logging:
filename, fileextension = os.path.splitext(sys.argv[0])
# log file name <script name>.log
log_file = '{0}.log'.format(filename)
filelog = logging.FileHandler(log_file, 'a')
filelog.setLevel(logging.INFO)
@bmacauley
bmacauley / skel_setup.py
Created March 28, 2013 13:25
setup.py skeleton
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'My Project',
'author': 'My Name',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
#!/usr/bin/env python
"""
SYNOPSIS
TODO helloworld [-h,--help] [-v,--verbose] [--version]
DESCRIPTION
TODO This describes how to use this script. This docstring
will be printed by the script if there is an error or