Add the following to your bash profile:
function terraform-use {
vsn=$1
pkg="terraform_${vsn}_darwin_amd64.zip"
url="https://releases.hashicorp.com/terraform/$vsn/$pkg"
tf="$( which terraform || echo /usr/local/bin/terraform )"
{ | |
"Comment": "Input Routing Example", | |
"StartAt": "Route Input", | |
"States": { | |
"Route Input": { | |
"Type": "Choice", | |
"Default": "Step 1", | |
"OutputPath": "$.Input", | |
"Choices": [ | |
{ |
#!/bin/sh | |
function dotenv() { | |
dotfile="${1:-.env}" | |
# Error if file does not exist | |
if ! [ -f $dotfile ] ; then | |
echo "$dotfile: No such file or directory" >&2 | |
return 1 | |
fi |
A mistake plus keleven gets you home by seven.
class Keleven(float):
def __str__(self):
return 'Keleven'
def __repr__(self):
return str(self)
AWS SecretsManager is a service that allows you to store encrypted secrets in the cloud as raw strings or JSON docs.
Storing secrets as JSON allows you to store ENV settings, similar to a .env
file.
Using the aws-sdk
library for NodeJS, we can update our application's process.env
with the encrypted environment.
I hereby claim:
To claim this, I am signing this object:
def block_helper begin_msg, ensure_msg | |
start = Time.now | |
puts begin_msg.call(start) | |
begin | |
yield | |
rescue Exception => err | |
abort err.to_s | |
ensure | |
puts ensure_msg.call(start) | |
end |
def print_docker_stream(stream): | |
""" Emulate docker pull/push output on stderr. """ | |
# Initialize list of layers | |
layers = [] | |
# Interate through stream | |
for line in stream: | |
# Print normal layer progress | |
try: | |
# Get layer ID |
from datetime import datetime | |
from time import sleep | |
class Timer(object): | |
""" ActiveRecord Migration-style timer using context management. """ | |
def __init__(self, name): | |
self.name = name | |
self.start = datetime.utcnow() |