Skip to content

Instantly share code, notes, and snippets.

View phumpal's full-sized avatar
🌮

Patrick Humpal phumpal

🌮
  • Northern California
View GitHub Profile
@phumpal
phumpal / bashfix.sh
Created September 26, 2014 22:22
Patches bash exploit on Debian / Ubuntu servers via cli and inventory file
ansible all -i production/inventory -m apt -a 'update_cache=yes name=bash state=latest' -s -k
@phumpal
phumpal / get_cloud_ips.rb
Last active August 29, 2015 14:08
Gather public cloud server IPs in a region and permits traffic to statsd/graphite
#!/usr/bin/env ruby
require 'fog'
connection = Fog::Compute.new({
:provider => 'rackspace',
:rackspace_username => ENV['RACKSPACE_API_USERNAME'],
:rackspace_api_key => ENV['RACKSPACE_API_KEY'],
:version => :v2,
:rackspace_region => :ord
@phumpal
phumpal / check-resque-queue-size.rb
Last active August 29, 2015 14:09
Checks the specified resque queue size
#!/usr/bin/env ruby
#
# Check the size of a resque queue
# ===
#
# Copyright 2014 Patrick Humpal <patrick@netvilla.net>
#
# Released under the same terms as Sensu (the MIT license); see LICENSE
# for details.
@phumpal
phumpal / redis.logstash.filter.rb
Created September 24, 2015 06:30
Redis Logstash Filter
input {
file {
path => "/var/log/redis/redis-server.log"
start_position => "beginning"
type => "redis"
add_field => { "role" => "redis" }
}
}
filter {
if [type] == "redis" {
@phumpal
phumpal / sensu-client.conf
Last active October 21, 2015 20:34
This is a simple upstart config for sensu-client
description "sensu-client"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
respawn
chdir /opt/sensu
pre-start script
@phumpal
phumpal / README.md
Last active January 27, 2020 15:09
Install CoreOS on Hetzner w/hardware RAID1

CoreOS on Hetzner w/hardware RADI1

The existing docs when attempting to install CoreOS on Hetzner are a bit incomplete. This caused a bit of frustration for me so I am putting this doc together in hopes that it will help someone else.

Pre-requisites

After ordering your server you will need to log into the Hetzner server console

Add a public key

@phumpal
phumpal / remove_ruby.sh
Created February 3, 2016 23:11
A shit script to remove Ruby installed from source
#!/bin/bash
gem list | grep -v "test-unit|rdoc|psych|io-console|minitest|rake|bigdecimal|json" | cut -d" " -f1 | xargs gem uninstall -aIx
rm -rf /usr/local/lib/ruby
rm -rf /usr/local/share/doc/ruby
rm -rf /usr/local/share/ri
rm -rf /usr/local/include/ruby-*
rm -rf /usr/local/bin/ruby

Keybase proof

I hereby claim:

  • I am phumpal on github.
  • I am phumpal (https://keybase.io/phumpal) on keybase.
  • I have a public key whose fingerprint is F949 FD0F EB0A EAFE D01B 3349 233C 59EA 6342 D3F9

To claim this, I am signing this object:

@phumpal
phumpal / s3_wale_policy.json
Created July 21, 2017 19:25
wal-e encrypted PostgreSQL backups s3 policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S3PostgreSQLWALeBackups",
"Action": [
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:GetObject",
@phumpal
phumpal / README.md
Last active February 21, 2020 20:05
A simple Sinatra app to proxy Airbrake webhooks to Cisco Spark Rooms

Setup

brew install jq # or apt-get install jq (only needed for testing)          
rvm install ruby-2.4.1
rvm gemset create spark
rvm gemset use spark
gem install cisco_spark --no-document
gem install sinatra --no-document