Skip to content

Instantly share code, notes, and snippets.

View ErikHarmon's full-sized avatar

Erik Harmon ErikHarmon

  • Space
View GitHub Profile
#!/bin/bash
# Easily test mail sending without anything but netcat.
# Instead of processing responses, it just slows down lines
# it sends and assumes it got a valid response.
FROM="$1"
TO="$2"
# Change these as appropriate.
EHLO="mail.example.com"
@ErikHarmon
ErikHarmon / awscreds.sh
Last active September 23, 2015 20:05
Keep encrypted AWS credentials for use in interactive BASH shell
# encrypted AWS credentials
# call this script via source command, such as:
# . awscreds.sh
# to include AWS environment credentials in your interactive shell to
# run AWS tools.
#
# ENCRYPTED_VARS is a base64-encoded, AES-encrypted set of exported
# AWS_ACCESS_KEY and AWS_SECRET_KEY. You can encode them this way:
#
# openssl aes-256-cbc -salt -a <<EOF
@ErikHarmon
ErikHarmon / create_aws_api_group.py
Last active February 5, 2016 15:18
Create AWS security group egress rules for AWS API access, using Ansible
#!/usr/bin/python
import json
import sys
# take json from stdin, from source such as https://ip-ranges.amazonaws.com/ip-ranges.json
# and turn it into an AWS security group using Ansible
region = 'us-east-1'
header_str = """---
- hosts: 127.0.0.1