Skip to content

Instantly share code, notes, and snippets.

View brodygov's full-sized avatar

Andy Brody brodygov

View GitHub Profile
#!/bin/bash
set -euo pipefail
run() {
echo >&2 "+ $*"
"$@"
}
usage() {
cat >&2 <<EOM
2017-09-11 21:56 bash
2017-09-11 21:56 bash-completion
2017-09-11 23:28 htop
2017-09-11 23:48 awscli
2017-09-11 23:48 bmon
2017-09-11 23:48 brew-cask
2017-09-11 23:54 certbot
2017-09-11 23:54 colordiff
2017-09-11 23:54 coreutils
2017-09-11 23:54 corkscrew
commit d9d38c14c11fa7c15eae01c96f839f2278021ada (origin/brody/no-yaml-anchors, brody/no-yaml-anchors)
Author: Andy Brody <[email protected]>
Date: Mon Aug 5 17:31:34 2019 -0400
WIP
diff --git a/cloudlib/lib/cloudlib/lambda.rb b/cloudlib/lib/cloudlib/lambda.rb
index 94b75d46..dcb6e8dd 100644
--- a/cloudlib/lib/cloudlib/lambda.rb
+++ b/cloudlib/lib/cloudlib/lambda.rb
#!/bin/bash
# Common shell functions.
# Having a library like this is a surefire sign that you are using too much
# shell and should switch to something like Ruby. But our scripts currently
# pass around a ton of stuff with shell environment variables, so this will
# have to do for the time being.
run() {
echo >&2 "+ $*"
#!/bin/bash
set -euo pipefail
# shellcheck disable=SC1090
. "$(dirname "$0")/lib/common.sh"
usage() {
cat >&2 <<EOM
usage: $(basename "$0") RSA_PUBKEY_PATH [AWS_USER]
#!/bin/bash
set -eou pipefail
# shellcheck source=/dev/null
. "$(dirname "$0")/lib/common.sh"
nothing_to_do=1
for branch in $(git branch --format='%(refname:short)' --merged | grep -v '^stages/' | grep -vx master); do
nothing_to_do=
#!/bin/bash
set -euo pipefail
# shellcheck source=/dev/null
. "$(dirname "$0")/lib/common.sh"
usage() {
cat >&2 <<EOM
usage: $(basename "$0") ENVIRONMENT
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'csv'
require 'optparse'
# ALB log format:
# https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html
ALB_FIELDS = %w[
type
#!/usr/bin/env bash
set -eu
# shellcheck source=/dev/null
. "$(dirname "$0")/lib/common.sh"
usage() {
cat >&2 <<EOM
Usage: $0 [OPTIONS...] <bucket_name> <state_file_path> <terraform_dir> <region> <dynamodb_table>
#!/usr/bin/env ruby
Dir.chdir(File.dirname(__FILE__)) { require 'bundler/setup' }
require 'aws-sdk'
# Look up RDS free space for the given database, return free space in Bytes, as
# the Maximum over the last hour.
#
# You can do a similar operation using the AWS CLI: