Skip to content

Instantly share code, notes, and snippets.

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

Jeremy Pruitt jeremypruitt

:octocat:
@ Waabi.ai
View GitHub Profile
#!/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 / 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 / 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.
#
@jeremypruitt
jeremypruitt / sns-publish
Last active August 19, 2022 18:09
AWS Lambda function to publish to SNS topic
console.log('Loading function');
var AWS = require('aws-sdk');
AWS.config.region = 'us-west-2';
exports.handler = function(event, context) {
console.log("\n\nLoading handler\n\n");
var sns = new AWS.SNS();
sns.publish({
@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);
@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) }
}

Vault Admin

The Vault Admin is responsible for ensuring the vault service and its backend are available. They also manage the bringup process in the event of an outage, including coordination of the shamir secret holders during the process of unsealing the vault.

Requires:

  • Much more consideration for production :)
  • Vault binary

For PoC purposes, just use the in-memory vault dev mode: