This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| --- | |
| driver: | |
| name: vagrant | |
| customize: | |
| memsize: 2048 | |
| numvcpus: 2 | |
| provisioner: | |
| name: chef_zero |
This file contains hidden or 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 bin_files | |
| @cookbook.manifest[:files].collect{|file| file[:path].split("/")[2..-1].join("/") if file[:path] =~ /apps\/#{Regexp.quote(new_resource.name)}\/[^.]/}.compact || [] | |
| end | |
NewerOlder