I hereby claim:
- I am bitdivine on github.
- I am captainamerica (https://keybase.io/captainamerica) on keybase.
- I have a public key ASATCWjQjA7rZNUyQTQBVRYqRuxGv0qsBdOFNwRIi3VUawo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # Add this to your ~/.bashrc | |
| alias aws_session_token_generate='export AWS_SESSION_TOKEN=$(aws sts get-session-token --serial-number "$(aws sts get-caller-identity --query Arn --output text | sed 's/user/mfa/g')" --token-code "$(read line ; echo $line)" --query Credentials.SessionToken --output text)' |
| #!/usr/bin/env node | |
| const RECIPE = process.argv[2] || process.env.RECIPE || '/dev/stdin' | |
| const doubleslash=/^(("([^"\\]|\\.)*"|([^\/]|\/[^\/]))*).*/gm | |
| const multiline=/(("([^"\\]|\\.)*"|[^\/"]|\/[^*])*)\/[*]([^*]|[*][^\/])*[*]\//g | |
| var x,y; | |
| for ([x,y]=[require("fs").readFileSync(RECIPE,{encoding:"utf8"}).replace(doubleslash,"$1"), ""]; x.length != y.length; [x,y]=[x.replace(multiline,"$1"),x] ); |
| # Prompt: Exit code red/green && runtime | |
| PROMPT_COMMAND=__prompt_command # Func to gen PS1 after CMDs | |
| __prompt_command() { | |
| local EXIT="$?" # This needs to be first | |
| timer_stop | |
| PS1="" | |
| local RCol='\[\e[0m\]' | |
| local Red='\[\e[0;31m\]' | |
| local Gre='\[\e[0;32m\]' | |
| local BYel='\[\e[1;33m\]' |
| #!/bin/sh | |
| set -eux | |
| set -o pipefail | |
| INSTALL_DIR="${INSTALL_DIR:-/opt/terraform/bin}" | |
| # Get the version to install, degrading gracefully depending on which tools are installed: | |
| test -n "${VERSION:-}" \ | |
| || VERSION="$(curl https://releases.hashicorp.com/index.json | jmespath "terraform.versions.*.version" --output text | sort --version-sort | tail -n1)" \ | |
| || VERSION="$(curl https://releases.hashicorp.com/terraform/ | grep terraform_ | sed 's/.*href.*>terraform_//g;s/<.*//g' | sort --version-sort | tail -n1)" |
| #!/usr/bin/env python3 | |
| import sys | |
| import json | |
| import jmespath | |
| import argparse | |
| parser = argparse.ArgumentParser(description='Apply a jmespath filter to stdin') | |
| parser.add_argument('jmespath', metavar='JMESPATH', type=str, nargs=1, | |
| help='jmespath expression') |
| echo If the region is given in the environment: | |
| echo $AWS_DEFAULT_REGION | |
| echo If aws has been configured: | |
| aws configure get region | |
| echo If running on an aws instance, the availability zone is in the metadata and hence we have the region: | |
| ec2metadata --availability-zone | sed -r 's/.$//g' | |
| echo Equivalently: | |
| curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -r 's/.$//g' |
Note: You will almost certainly want to add some storage options: Note: This is correct as of July 2017. The official Docker docs give the wrong port number but are otherwise correct. https://docs.docker.com/registry/deploying/
Create a cert with whatever tools you normally use:
(.ve) maxim@space:~/pumpernikel-pristine/tools/ansible$ ./bin/ssl-client-gencert docker.pumpernikel.com
Run: