Skip to content

Instantly share code, notes, and snippets.

View brodygov's full-sized avatar

Andy Brody brodygov

View GitHub Profile
@brodygov
brodygov / github-copy-issues.rb
Created May 30, 2017 18:46
Copy issues from one github repository to another
#!/usr/bin/env ruby
# Copy a list of issues from one repository to another.
#
# This whole script is a poorly documented mess. Sorry.
require 'date'
require 'yaml'
require 'pp'
@brodygov
brodygov / get-piv-ssh-pubkey
Created April 27, 2017 19:03
Get the first PIV public key in SSH format in the same way that PuTTY-CAC does on Windows
#!/bin/bash
set -eu
# This script prints the first PIV certificate found from a smart card in SSH
# format in the same way that putty-cac does on windows. (yeah.)
# LICENSE
#
# As a work of the United States Government, this project is in the public
# domain within the United States.
#!/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 <andrew.brody@gsa.gov>
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
#!/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>
#!/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