Skip to content

Instantly share code, notes, and snippets.

View grosendorf's full-sized avatar

Gabriel Rosendorf grosendorf

  • Miro
  • Amsterdam, Netherlands
  • 18:06 (UTC -12:00)
View GitHub Profile
@grosendorf
grosendorf / aws_on
Created August 10, 2017 15:11
Validate the export AWS_PROFILE and AWS_REGION env vars
# AWS Credentials
AWS_BASE=~/.aws
AWS_FILES=${AWS_BASE}/aws_files
AWS_REGION=us-east-1
AWS_DEFAULT_REGION=us-east-1
aws_on() {
export AWS_FULL=${1}
export AWS_PROFILE_NAME=$(echo ${1} | awk -F "_" '{print $1}')
export AWS_REGION_NAME=$(echo ${1} | awk -F "_" '{print $2}')
@grosendorf
grosendorf / mfa_auth
Created May 19, 2017 13:01
Get MFA verified, temporary AWS access/secret keys.
#!/bin/bash
set -eo pipefail
usage () {
cat << HEREDOC
Usage:
eval "\$(./authenticate MFA_TOKEN)"
Gets temporary AWS credentials which have been verified using MFA. Requires
the user to configure the aws cli to use their long lived credentials for

Keybase proof

I hereby claim:

  • I am grosendorf on github.
  • I am grosendorf (https://keybase.io/grosendorf) on keybase.
  • I have a public key ASCYbuFNXStjxOM--B0dDTMsFJgzpPiY1diE1VI-IGP0aQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am grosendorf on github.
  • I am grosendorf (https://keybase.io/grosendorf) on keybase.
  • I have a public key whose fingerprint is 7D0E 6E3B 8E3F 57CF C6F1 5088 C607 31A1 B85A 2776

To claim this, I am signing this object:

# In the recipe
seed_fqdns = Array.new
search(:node, "role:cassandra AND chef_environment:some_env").each do |node|
seed_fqdns << node['fqdn']
end
template "cassandra.yaml" do
owner 'your mom'
group 'your dad'
mode '777'