Skip to content

Instantly share code, notes, and snippets.

View scarolan's full-sized avatar
πŸ€Έβ€β™‚οΈ
In whatever position one is in...one must find balance. -BKS Iyengar

Sean Carolan scarolan

πŸ€Έβ€β™‚οΈ
In whatever position one is in...one must find balance. -BKS Iyengar
View GitHub Profile
function vencrypt() {
INPUTFILE=$1
vault write -format=json transit/encrypt/my-key plaintext=@<(base64 -i $INPUTFILE) | jq -r '.data|.ciphertext'
}
function vdecrypt() {
INPUTFILE=$1
vault write -format=json transit/decrypt/my-key ciphertext=$(cat $INPUTFILE ) | jq -r '.data|.plaintext' | base64 -i -d
}
ecommerce_servers = "1"
demoami = "ami-05349ec17a04c40fb"
subdomain = "sean"
key_name = "epsilontraining"
job "java" {
datacenters = ["dc1"]
type = "service"
# This is broken for some reason.
# constraint {
# attribute = "$attr.kernel.name"
# value = "linux"
# }
@scarolan
scarolan / pangrams
Created July 30, 2018 22:53 — forked from huyhong/pangrams
List of Pangrams
Nymphs blitz quick vex dwarf jog. (27 letters)
DJs flock by when MTV ax quiz prog. (27 letters) (2 acronyms and a US spelling)
Big fjords vex quick waltz nymph. (27 letters)
Bawds jog, flick quartz, vex nymph. (27 letters)
Junk MTV quiz graced by fox whelps. (28 letters) (Includes proper noun)
Bawds jog, flick quartz, vex nymphs. (28 letters)
Waltz, bad nymph, for quick jigs vex! (28 letters)
Fox nymphs grab quick-jived waltz. (28 letters)
Brick quiz whangs jumpy veldt fox. (28 letters)
Glib jocks quiz nymph to vex dwarf. (28 letters)
@scarolan
scarolan / easy_vault_transit_demo.sh
Last active October 18, 2018 19:23
Easy Vault Transit Demo
# Log into your vault instance if you haven't already
vault login root
# Enable the transit secret engine
vault secrets enable transit
# Create a key
vault write -f transit/keys/my-key
# Read the key, nothing up my sleeves
vault read transit/keys/my-key
# Write some base64 encrypted data to the transit endpoint
vault write transit/encrypt/my-key plaintext=$(base64 <<< "my secret data")
# First enable the userpass auth engine
#
# vault auth enable userpass
# vault write auth/userpass/users/alice password=alice policies="default,dev"
# vault write auth/userpass/users/bob password=bob policies="default,prod"
# Then create these policies
# dev
path "sys/mounts" {
variable "access_key" {}
variable "secret_key" {}
variable "region" {}
variable ami {}
variable subnet_id {}
variable instance_type {
default = "t2.micro"
}
variable vpc_security_group_id {}
variable identity {}
# My first Terraform
variable "access_key" {}
variable "secret_key" {}
variable "ami" {}
variable "subnet_id" {}
variable "instance_type" {}
variable "vpc_security_group_id" {}
variable "identity" {}
@scarolan
scarolan / rotate.sh
Created April 12, 2018 17:43
Rotate a local Linux password, store the new password in HashiCorp Vault
#!/bin/sh
# Script for rotating passwords on the local machine.
# Make sure and store VAULT_TOKEN as an environment variable before running this.
USERNAME=$1
PASSLENGTH=$2
VAULTURL=$3
NEWPASS=$(openssl rand -base64 $PASSLENGTH)
JSON="{ \"data\": { \"root\": \"$NEWPASS\" } }"
@scarolan
scarolan / emojis.json
Created April 3, 2018 15:37 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw