Skip to content

Instantly share code, notes, and snippets.

@burdara
burdara / bash-function_aws-mfa.sh
Last active August 29, 2019 23:01
Bash helper function for getting AWS session token using MFA.
#!/usr/bin/env bash
#
# AWS MFA helper function.
# Add this file to your dotfiles of source directly.
# AWS MFA wrapper
# Globals:
#
# Arguments:
# 1: mfa token
@burdara
burdara / check_zone_certs.sh
Last active March 13, 2018 18:06
Iterate over Route53 DNS to check certificates.
#!/usr/bin/env bash
my_path="$(cd $(dirname $0); pwd)"
expire_check_secs=2592000
output_dir="$my_path/output"
attention_file="$output_dir/ATTENTION.md"
unknown_file="$output_dir/UNKNOWN.md"
which gtimeout &>/dev/null && timeout_cmd="gtimeout 3"
formatDate() {
date -jf '%b %d %H:%M:%S %Y %Z' "$1" +'%Y-%m-%d %H:%M:%S'
@burdara
burdara / check_zone_certs.sh
Created March 8, 2017 16:38
Iterate over Route53 DNS to check certificates.
#!/usr/bin/env bash
expire_check_secs=2592000
formatDate() {
date -jf '%b %d %H:%M:%S %Y %Z' "$1" +'%Y-%m-%d %H:%M:%S'
}
create_md_file() {
local r53_zone_id="$1"
local r53_zone_nm="$2"
@burdara
burdara / bootstrap_aws_mon.sh
Last active November 15, 2016 17:58
Installs AWS monitor scripts for reporting memory and disk space.
#!/usr/bin/env bash
#TODO(robbie): this should be handled via IAM role (newer instances).
aws_access_key=""
aws_secret_key=""
install_aws_mon() {
apt-get update
apt-get install -y unzip libwww-perl libdatetime-perl
local aws_mon_file="CloudWatchMonitoringScripts-${1:-1.2.1}.zip"
local script="/opt/aws-scripts-mon/mon-put-instance-data.pl"
@burdara
burdara / ubuntu_ixgbevf_upgrade.sh
Created November 2, 2016 17:07
AWS enhanced networking - Ubuntu ixgbevf driver upgrade.
#/usr/bin/env bash
set -x
name="ixgbevf"
version="2.16.4"
file_name="$name-$version"
archive_name="$file_name.tar.gz"
tmp_path="/tmp"
src_path="/usr/src"
wget_src="sourceforge.net/projects/e1000/files/$name stable/$version/$archive_name"