I hereby claim:
- I am mmhmxx on github.
- I am mmhmxx (https://keybase.io/mmhmxx) on keybase.
- I have a public key ASBmZu88hkpgyOcQ1-0IdZF4aI9M3grD1ivtIamvK2FBkQo
To claim this, I am signing this object:
| # Requirements: | |
| # * oathtool – install it with brew. | |
| # * AWS-MFA password item in your keychain, under "login" keychains. | |
| # Name: AWS-MFA | |
| # Kind: application password | |
| # Account: your_account (change below) | |
| # Where: AWS-MFA | |
| # Value: taken from the MFA setup on your AWS account, a 64-characters string (capital letters and ciphers) | |
| # | |
| # Usage: |
| ugit() { | |
| local REPOS=($(find . -maxdepth 2 -type d -name '.git' |sed 's+/.git$++g' |sort)) | |
| [[ ${#REPOS} -eq 0 ]] && { | |
| echo "There are no git repositories in $(pwd)" | |
| kill -INT $$ | |
| } | |
| echo -e "Git repositories in current directory: ${#REPOS[@]}.\n" | |
| local NON_MASTERS='' | |
| for r in ${REPOS}; do | |
| cd ${r} |
| # A wrapper around Terraform: runs terraform with given command in an environment taken from current directory. | |
| # | |
| # Workflow: | |
| # cd webops-terraform/$component/$environment | |
| # tf a|apply | |
| # tf g|get | |
| # tf i|init | |
| # tf l|landscape # plan piped through landscape: https://github.com/coinbase/terraform-landscape | |
| # tf o|output | |
| # tf p|plan |
| # Usage: aws_env | |
| # This function will: | |
| # . set your AWS credentials for the current shell. | |
| # or | |
| # . refresh your credentials if the existing ones will expire within 5 minutes. | |
| # The Sandbox environment is hardcoded (but we don't need credentials for any other environment). | |
| aws_env() { | |
| local DATE_NOW=$(date -j -f "%F %T" "$(date +'%F %T')" "+%s") | |
| [[ -n ${AWS_ENV_EXPIRES} ]] && { |
I hereby claim:
To claim this, I am signing this object: