Skip to content

Instantly share code, notes, and snippets.

Avatar
🚙
Working on Tristan Cole's Pro Driver! Wishlist on Steam: elocnat.com/TCPD

Tristan Cole elocnatsirt

🚙
Working on Tristan Cole's Pro Driver! Wishlist on Steam: elocnat.com/TCPD
View GitHub Profile
@elocnatsirt
elocnatsirt / install_hashicorp_app.sh
Last active Sep 2, 2019
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.
View install_hashicorp_app.sh
#!/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 / ami_locator.sh
Last active Feb 9, 2017
Simple bash AMI locator
View ami_locator.sh
#!/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)
@elocnatsirt
elocnatsirt / handler-hipchat.erb
Last active Feb 9, 2017
Modification of the sensu-plugins-hipchat handler that sends the Uchiwa URL and silences notifications -- written as an ERB template for Puppet
View handler-hipchat.erb
#!/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 / aws-info.sh
Last active Feb 9, 2017
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.
View aws-info.sh
#!/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 / sensu-flume-metrics.rb
Last active Feb 9, 2017
Reads metrics that Flume exposes on a port and converts them into Graphite format.
View sensu-flume-metrics.rb
#!/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 / sensu_finagle_metrics.rb
Last active Feb 9, 2017
Reads metrics that Finagle exposes on a port and converts them into Graphite format.
View sensu_finagle_metrics.rb
#!/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 / check-elastic-beanstalk-health.sh
Last active Feb 9, 2017
Checks the health of an AWS Elastic Beanstalk environment and reports based on color.
View check-elastic-beanstalk-health.sh
#!/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