This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if executable('asdf') | |
let g:asdf_go_path = trim(system('asdf where golang')) | |
let g:go_bin_path = g:asdf_go_path . "/go/bin" | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo "secret" > secret.txt | |
$ key_material=$(aws kms generate-data-key --key-id <CMK_key_id> --key-spec AES_256) | |
$ echo ${key_material} | jq ".CiphertextBlob" | sed 's/"//g' | base64 -d > key.enc | |
$ export key=$(echo ${key_material} | jq ".Plaintext" | sed 's/"//g' | base64 -d) | |
$ openssl enc -aes-256-cbc -pass env:key -in secret.txt -out secret.txt.enc | |
$ rm secret.txt | |
$ ls | |
key.enc secret.txt.enc | |
$ key=$(aws-fd-full kms decrypt --ciphertext-blob fileb://key.enc --output text --query Plaintext | base64 -d) | |
$ openssl enc -d -aes-256-cbc -pass env:key -in secret.txt.enc -out secret.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
es_get_endpoint() { | |
local domain_name | |
local endpoint | |
domain_name="${1}" | |
endpoint="$(aws es describe-elasticsearch-domain --domain-name ${domain_name} --query 'DomainStatus.Endpoints.vpc' | tr -d '"')" | |
if [ "${endpoint}" = "null" ]; then | |
endpoint="$(aws es describe-elasticsearch-domain --domain-name ${domain_name} --query 'DomainStatus.Endpoint' | tr -d '"')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export VAULT_ADDR="http://${VAULT_IP}:${VAULT_PORT}" | |
vaultwalk() { | |
local prefix | |
local secret_keys | |
prefix="${1}" | |
if [ -z "${prefix}" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZSH=$(which zsh) | |
BASH=$(which bash) | |
shellcheck <(sed "s|#\!${ZSH}|#\!${BASH}|g" < .zshrc.d/functions.zshrc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
project = "tfternarywtf" | |
chosen_sg = "${var.security_groups}" | |
} | |
data "aws_ami" "ubuntu" { | |
most_recent = true | |
filter { | |
name = "name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove(emails, infile): | |
try | |
if emails and infile: | |
raise ValueError('Specify one or more emails, or a file path, but not both') | |
pass | |
except ValueError as e: | |
print(e) | |
sys.exit(1) | |
if emails: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filter_list(*args): | |
filters = list(args) | |
stuff = #some Boto3 call with a list of dictionaries | |
filtered = (s for s in stuff['Foo'] | |
if all([f(s) for f in filters])) | |
return filtered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max at maxmanders-laptop in ~/dev/dotfiles (master) | |
$ cat test.sh | |
#!/bin/bash | |
set -e | |
set -o pipefail | |
ZSH=$(which zsh) | |
BASH=$(which bash) | |
ERRORS=() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
ip_address = "192.168.56.1" | |
config.vm.box = "ubuntu-12.04.2-server-amd64" | |
config.vm.hostname = "chef-server.local" | |
config.ssh.timeout = 30 | |
config.vm.provider :virtualbox do |vbox| | |
vbox.customize [ "modifyvm", :id, "--memory", 1024 ] |
NewerOlder