Skip to content

Instantly share code, notes, and snippets.

Christopher Campanale ccampanale

Block or report user

Report or block ccampanale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ccampanale on github.
  • I am ccampanale (https://keybase.io/ccampanale) on keybase.
  • I have a public key ASAG-dzI-pKDyZhsbndxS0NKdrtiQ1UsL5QZurVXKTYl_go

To claim this, I am signing this object:

@ccampanale
ccampanale / env2fs.sh
Last active Oct 28, 2016
env2fs is a simple script to facilitate the creation of files from environment variables
View env2fs.sh
#!/bin/bash -e
#
# env2fs is a simple script to facilitate the creation of files from environment variables
# check for help
if [[ $1 =~ ^--help|^-h ]]
then
echo "usage: env2fs.sh"
echo
echo "env2fs is a simple script to facilitate the creation of files from environment variables."
@ccampanale
ccampanale / vaultsealmanager.sh
Created Dec 10, 2015
Bash shell script to check seal status for local vault server and attempt to unseal using keys secured in vault secret store. Supports HA Vault clusters with TLS with unseal keys stored as secrets in vault (see code). Relies on registered service vault.service.consul, in place DNS configuration, and a single unsealed vault instance in your clust…
View vaultsealmanager.sh
#!/bin/bash
export vault=/usr/local/bin/vault
export VAULT_TOKEN=$(cat /root/.vault-token)
vault_cacert='-ca-cert=/path/to/your/ca.pem'
local_vault="-address=https://$(hostname -f):8200"
unsealed_vault="-address=https://$(getent hosts $(dig +short vault.service.consul | tail -n 1) | awk '{ print $2 }'):8200"
leader_vault="-address=https://$($vault status $vault_cacert $unsealed_vault 2> /dev/null | grep Leader | awk '{ print $2 }' | sed 's/^http\(\|s\):\/\///g'):8200"
vault_read="$vault read $vault_cacert $leader_vault"
vault_unseal="$vault unseal $vault_cacert $local_vault"
You can’t perform that action at this time.