Skip to content

Instantly share code, notes, and snippets.

View jasonforte's full-sized avatar

Jason Forté jasonforte

View GitHub Profile
@jasonforte
jasonforte / update-iam-credentials.sh
Last active November 4, 2018 16:33
Update IAM Credentials Script
#!/usr/bin/env bash
set -e
CREDENTIALS_DIR=$HOME/.aws
region=${1:-us-east-1}
role=$2
command -v aws >/dev/null 2>&1 || { echo -e >&2 "Required: AWS CLI not installed\n\nPossible fix:\n-------------\nsudo -H pip3 install -U awscli\n\nAborting..."; exit 1; }
command -v jq >/dev/null 2>&1 || { echo -e >&2 "Required: jq not installed\n\nPossible fix:\n-------------\nsudo apt update && sudo apt install -y jq\n\nAborting..."; exit 1; }
if ! [ -d $CREDENTIALS_DIR ]
@jasonforte
jasonforte / script.sh
Created October 14, 2018 08:49
Useful bash commands
# Generate a file of a certain size (24Mb)
dd if=/dev/zero of=output.dat bs=1M count=24
@jasonforte
jasonforte / Makefile
Created August 10, 2018 10:49
Self Documenting Makefile
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@jasonforte
jasonforte / statefulset.yaml
Created August 7, 2018 12:40
Sample statefulset with EBS on EKS
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: gp2
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2
reclaimPolicy: Retain
mountOptions:
- debug