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 ruby | |
MAX_DIFF_SIZE_MB = 4 # MB | |
def bytes_to_mb(bytes) | |
bytes.to_f / (1024*1024) | |
end | |
total_diff_bytes = 0 |
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
#!/bin/sh | |
# concurrency is hard, let's have a beer | |
MAX_PROCS=4 | |
parallel_provision() { | |
while read box; do | |
echo "Provisioning '$box'. Output will be in: $box.out.txt" 1>&2 | |
echo $box |
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
#!/bin/bash | |
set -eou pipefail | |
dump_images() { | |
for i in $(docker images -q | uniq); do | |
local tarball="$i.tar.gz" | |
if [[ -e "$tarball" ]]; then | |
echo "$tarball exists, skipping $i" | |
continue |
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
# | |
# Bash helper function for connecting to a remote JVM via jconsole using an SSH | |
# tunnel. | |
# | |
# Supports multiple concurrent jconsole sessions to different hosts. | |
# | |
# Tested on mac osx, but should work on linux too. | |
# | |
# Install | |
# ------- |
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 ruby | |
# | |
# Usage: | |
# | |
# vault write pki/issue/role common_name=foo ttl=1h | ruby vault-cert-parse.rb | |
# | |
# Creates the file tls.pem containing private-key, cert, and issuing-ca | |
# | |
# Can also be used with curl for living on the edge: | |
# |
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
$ vault server -dev -dev-root-token-id=root & | |
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv put secret/foo bar=baz quux=blah | |
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv put secret/foo/subkey blah=blah | |
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv list secret/ | |
Keys | |
---- | |
foo | |
foo/ |
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
#!/bin/bash | |
# | |
# uber simple wrapper to leverage bash/zsh shell globbing support with terragrunt's `--terragrunt-include-dir=` flag. | |
set -eou pipefail | |
[[ -n "${DEBUG:-}" ]] && set -x | |
if [[ "$#" -lt 2 ]]; then | |
echo "Usage: $0 [init|plan|apply] GLOB" |
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
#!/bin/bash | |
# | |
# Start the server in dev mode: | |
# | |
# bash setup-pki-vault-server.sh | |
# | |
# In another window, generate a cert: | |
# | |
# VAULT_ADDR=http://127.0.0.1:8200 VAULT_TOKEN=root vault write pki/issue/any common_name=foo | |
# |
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/ruby | |
# CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 CPU8 CPU9 CPU10 CPU11 CPU12 CPU13 CPU14 | |
# HI: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | |
# TIMER: 2344143 2305156 2295889 2278479 2274008 2260063 2237324 2245718 0 0 0 0 0 0 0 | |
# NET_TX: 11309569 76523 76961 77020 77086 76261 78908 76016 0 0 0 0 0 0 0 | |
# NET_RX: 11442620 47843 49607 48089 48989 45698 49201 41453 0 0 0 0 0 0 0 | |
# BLOCK: 0 0 0 0 0 0 0 0 |
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
type VaultDriver struct { | |
vaultClient *vaultapi.Client | |
project string | |
} | |
func (d VaultDriver) TokenRenewer(ctx context.Context) error { | |
renewer, err := d.vaultClient.NewRenewer(&vaultapi.RenewerInput{ | |
Secret: &vaultapi.Secret{ | |
Auth: &vaultapi.SecretAuth{ | |
ClientToken: d.vaultClient.Token(), |