Skip to content

Instantly share code, notes, and snippets.

View jeremypruitt's full-sized avatar
:octocat:
Day 470 @ Waabi.ai

Jeremy Pruitt jeremypruitt

:octocat:
Day 470 @ Waabi.ai
View GitHub Profile
@jeremypruitt
jeremypruitt / gist:d973fabe87c3a57a6d8c
Created September 27, 2014 22:10
Loop over AWS hosts in a jinja2 template with Ansible
{% for host in hosts['tag_Name_' + application.name + '-' + Version %}
IP: {{ hostvars[host] }}
{% endfor %}
# Create a flexible, responsive prompt.
# Based on the Responsive Prompt
# http://jondavidjohn.com/blog/2012/12/how-to-accomplish-a-responsive-bash-prompt
working_directory() {
dir=`pwd`
in_home=0
if [[ `pwd` =~ ^$HOME($|\/) ]]; then
dir="~${dir#$HOME}"
@jeremypruitt
jeremypruitt / lambda-monkey
Created May 14, 2015 08:16
AWS Lambda function to identify ec2 instances without an owner tag
console.log('Loading function');
var AWS = require('aws-sdk');
AWS.config.region = 'us-east-1';
exports.handler = function(event, context) {
console.log("\n\nLoading handler\n\n");
var ec2 = new AWS.EC2();
var with_owner = {};
var without_owner = {};
var req = https.request(options, function(res) {
console.log("statusCode: ", res.statusCode);
//console.log("headers: ", res.headers);
var data = [], data_length = 0;
res.on('data', function(d) {
data.push(d);
data_length += d.length;
}).on('end', function() {
var buf = new Buffer(data_length);
#!/bin/sh
trap "exit 2" 1 2 3 13 15
OPTS="--no-rdoc --no-ri"
if [ -f "/etc/lsb-release" ]; then
### bootstrap with git.
apt-get update -y && apt-get upgrade -y --force-yes && apt-get install -y git-core
#!/bin/sh
trap "exit 2" 1 2 3 13 15
OPTS="--no-rdoc --no-ri"
if [ -f "/etc/lsb-release" ]; then
# Name this host satsang.martinisatnoon.com
hostname satsang
@jeremypruitt
jeremypruitt / render-patch-playbook.go
Created November 11, 2015 09:57
Render Go template to create an Ansible playbook file
package main
import (
"os"
"text/template"
)
func check(e error) {
if e != nil { panic(e) }
}
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20170806"
AAAAB3NzaC1yc2EAAAABJQAAAQEAqP/LmpNx7SNvvhVnDgjtJuP6GRYgpwE/xLgj
mh+nnsHAOY9WH9FeUuKkA7vZrpa+p420CFdOSaPUS3qZHD7lxqBmVy/T04gWSL92
k0dpvqM/M0zZ1IH1PcMPCN6+V/ruQnScSS0iV6CaRhaS+WPJLqtqiAPEAGmgVQxB
WHr/d5af+4TMpe47DA8sK+SiX4a312odcsSVUtKRsI6DJzgHnNMSG4xG3aewbBEe
dnJW6ddAxIvTh19kJU5H4aYLE0VA0mXq9To/FvL3I0i0XWEkLOELfQ/KuGXiKP3w
KAVpJejYY9HwSaIdV2cT7rsuED+0uKhUOu8XTFtoXlJrMsW0wQ==
---- END SSH2 PUBLIC KEY ----
@jeremypruitt
jeremypruitt / README.md
Last active August 8, 2017 23:08
Test Markdown Collapse

Shamir Secret Holder

A Shamir Secret holder is responsible for being available to unseal vault when starting it up.

Requirements

  • Vault Binary
  • GPG Key

Responsibilities

@jeremypruitt
jeremypruitt / gist:ca62a5cdc95f579713b9
Last active April 26, 2018 13:05
Modified ansible windows remoting script
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM/PSRemoting configuration and makes the
# necessary changes to allow Ansible to connect, authenticate and execute
# PowerShell commands.
#
# Set $VerbosePreference = "Continue" before running the script in order to
# see the output messages.
#