Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hrzbrg on github.
  • I am hrzbrg (https://keybase.io/hrzbrg) on keybase.
  • I have a public key whose fingerprint is 7157 7F28 A4F8 ADA0 4B5C 7030 80CF 736D 5F76 0D04

To claim this, I am signing this object:

#!/bin/bash -ue
#
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe.
# It should be run once to setup the RAID, and automatically mount on reboot without further intervention.
#
# Beware, This script is NOT fully idempotent.
#
mount_point=${1:-"/mnt/storage"}
METADATA_URL_BASE="http://169.254.169.254/latest"
@hrzbrg
hrzbrg / elasticsearch.py
Created August 25, 2015 17:38
A Zabbix script that will monitor Elasticsearch on a node. Updated and originally from here: http://blog.sepa.spb.ru/2014/12/elasticsearch-internals-monitoring-by.html
#!/usr/bin/env python
import requests
import json
import sys
import os
import time
# Run without parameters to debug zabbix_sender
# Run with param jvm.uptime_in_millis to trigger trap sending and
@hrzbrg
hrzbrg / spotpricing.conf
Last active November 7, 2016 15:01
Logstash Config to parse SpotInstance Datafeed
# Create a custom pattern in the patterns_dir: INSTANCEID \i-\w{8,17}
input {
s3 {
bucket => "com.example.bucketname"
region => "eu-west-1"
access_key_id => "A*******************"
secret_access_key => "*********************************"
type => "spotpricing"
codec => line
#!/bin/bash -ue
# this script will attempt to detect any ephemeral drives on an EC2 node
mount_point=${1:-"/mnt/storage"}
METADATA_URL_BASE="http://169.254.169.254/latest"
INSTANCEID=$(wget -q -O - ${METADATA_URL_BASE}/meta-data/instance-id)
# Configure Raid - take into account xvdb or sdb
root_drive=$(df -h | grep -P '^.*/$' | awk 'NF==6{print $1}')