Skip to content

Instantly share code, notes, and snippets.

View elocnatsirt's full-sized avatar
🚙
Working on a crazy stunt driving game! Wishlist on Steam: elocnat.com/TCPD

Tristan Cole elocnatsirt

🚙
Working on a crazy stunt driving game! Wishlist on Steam: elocnat.com/TCPD
View GitHub Profile
@elocnatsirt
elocnatsirt / install_hashicorp_app.sh
Last active September 2, 2019 19:28
A script to download and install any valid Hashicorp application (terraform, packer, vagrant, etc.). Has options for version, install directory, extending path, and system architecture.
#!/usr/bin/env bash
# Written by: https://github.com/elocnatsirt
# This will download any valid Hashicorp product you specify if it exists.
# This script has been tested on OSX.
NORM=`tput sgr0`
BOLD=`tput bold`
function show_help {
@elocnatsirt
elocnatsirt / check-elastic-beanstalk-health.sh
Last active February 9, 2017 17:24
Checks the health of an AWS Elastic Beanstalk environment and reports based on color.
#!/bin/bash
# Written By: https://github.com/elocnatsirt
# Options:
# -r = Region of the beanstalk environment
# -n = Name of the beanstalk environment
# extract options and their arguments into variables.
while getopts 'r:n:' OPT; do
@elocnatsirt
elocnatsirt / sensu_finagle_metrics.rb
Last active February 9, 2017 17:24
Reads metrics that Finagle exposes on a port and converts them into Graphite format.
#!/usr/bin/env ruby
#
# This script gets Finagle metrics from various applications
# Written By: https://github.com/elocnatsirt
# Options:
# -h = host that you want to query - defaults to localhost
# -p = port of the nimbus node you want to query - defaults to 9990
require 'socket'
@elocnatsirt
elocnatsirt / sensu-flume-metrics.rb
Last active February 9, 2017 17:23
Reads metrics that Flume exposes on a port and converts them into Graphite format.
#!/usr/bin/env ruby
#
# This script queries flume to get metrics and pipes them into graphite format
# Written By: https://github.com/elocnatsirt
# Options:
# -h = host that you want to query - defaults to localhost
# -p = port of the flume node you want to query - defaults to 41414
require 'socket'
@elocnatsirt
elocnatsirt / aws-info.sh
Last active February 9, 2017 17:23
Retrieves information about an AWS instance and outputs it via stdout. Written to use as a Sensu check to get basic information about a client.
#!/bin/bash
# Written By: https://github.com/elocnatsirt
# This script will curl the instance metadata and output useful values
# If the system isn't in AWS it will succeed with a relevant message
instance_id=`curl --silent http://169.254.169.254/latest/meta-data/instance-id`
instance_type=`curl --silent http://169.254.169.254/latest/meta-data/instance-type`
@elocnatsirt
elocnatsirt / handler-hipchat.erb
Last active February 9, 2017 17:23
Modification of the sensu-plugins-hipchat handler that sends the Uchiwa URL and silences notifications -- written as an ERB template for Puppet
#!/opt/sensu/embedded/bin/ruby
#
# Original: https://github.com/sensu-plugins/sensu-plugins-hipchat/blob/master/bin/handler-hipchat.rb
# Modified by: https://github.com/elocnatsirt
# Sensu Handler: hipchat
#
# This handler script is used to send notifications to Hipchat rooms.
#
# Input:
# @event - Event attributes.
@elocnatsirt
elocnatsirt / ami_locator.sh
Last active February 9, 2017 17:23
Simple bash AMI locator
#!/bin/bash
# AMI Locator that grabs the latest image with options you have specified.
#
# Written By: https://github.com/elocnatsirt
# Options:
# -a = AWS_PROFILE to search for images with
# -r = Operating system release (IE 7 for CentOS 7)
# -v = Operating system version (IE CentOS or Ubuntu)