Skip to content

Instantly share code, notes, and snippets.

View bubba-h57's full-sized avatar

Bubba bubba-h57

View GitHub Profile
@bubba-h57
bubba-h57 / manage-ephemeral.conf
Created March 7, 2014 16:10
Upstart Job to Manage EC2 Ephemeral Devices
# manage-ephemeral - manages our ephemeral devices, if present
#
# Installation:
# /usr/bin/sudo /bin/cp /path/to/manage-ephemeral.conf /etc/init/manage-ephemeral.conf
# /usr/bin/sudo /bin/chmod 644 /etc/init/manage-ephemeral.conf
# /usr/bin/sudo /bin/ln /lib/init/upstart-job /etc/init.d/manage-ephemeral
description "Manage Ephemeral Devices"
author "Bubba Hines <rob@stechstudio.com>"
@bubba-h57
bubba-h57 / keybase.md
Created April 23, 2014 13:51
Keybase.io ownership claim.

Keybase proof

I hereby claim:

  • I am bubba-h57 on github.
  • I am bubba (https://keybase.io/bubba) on keybase.
  • I have a public key whose fingerprint is 1691 BA56 FFB2 145F 23C6 C35E B87C 621E 8E0D 93B1

To claim this, I am signing this object:

@bubba-h57
bubba-h57 / ELBAccessToSplunk.php
Last active August 29, 2015 14:00
Script to get AWS Elastic Load Balancer (ELB) Access Logs into Splunk Storm. Keep in mind that ELB ships logs to S3 every five minutes, so if you schedule this to run every five minutes, and it runs as fast as possible, your Splunk will still lag real time by at least five minutes.
#!/usr/bin/php
<?php
/**
* ELBAccessToSplunk.php
*
* Take ELB Access logs that have been shipped to AWS S3
* and transforms them into Splunks generic_single_line
* in a new composite logfile on the system, monitored
* by Splunk Storm.
*
@bubba-h57
bubba-h57 / SplunkLogger.php
Created August 12, 2014 22:16
Simple class for logging directly to Splunk via API
<?php
use Guzzle\Http\Client;
/**
* Simple class for logging events directly to splunk, via their API
* in the generic_single_line format.
* @author Bubba
*
*/
class SplunkLogger {
@bubba-h57
bubba-h57 / Preferences.sublime-settings
Created October 30, 2014 13:37
Bubba's Preferences for Sublime Text
{
"auto_indent": true,
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"default_line_ending": "LF",
"detect_indentation": true,
"font_face": "Consolas",
"font_size": 18.0,
"open_files_in_new_window" : false,
"ignored_packages":
[
@bubba-h57
bubba-h57 / vagrant-apache.conf
Created November 25, 2014 13:35
There are a number of scenarios wherein apache will fail to start on vagrant up because it relies on filesystems that are not yet mounted when it attempts to start. This upstart script solves the challenge by waiting for the vagrant-mounted event, and then starting up the service.
# vagrant-apache - manages our apache service, and starts it once vagrant is ready
#
# Ubuntu Installation:
# /usr/bin/sudo /bin/cp ./vagrant-apache.conf /etc/init/vagrant-apache.conf
# /usr/bin/sudo /bin/chmod 644 /etc/init/vagrant-apache.conf
# /usr/bin/sudo /bin/ln /lib/init/upstart-job /etc/init.d/vagrant-apache
description "Manage Apache in Vagrant"
author "Bubba Hines <rob@stechstudio.com>"
@bubba-h57
bubba-h57 / timestamp.yml
Created September 14, 2015 15:16
Sometimes I need a timestamp string in Ansible. Specifically, I need the same timestamp string available across all my hosts. This seems like the most elegant way to achieve that.
---
- name: "Get Timestamp on Local Host"
hosts: localhost
gather_facts: False
tasks:
- name: "Setting Time Stamp"
set_fact:
time_stamp: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"
- name: "Now we can go to work."
@bubba-h57
bubba-h57 / SecureToken.php
Created March 13, 2012 22:41
A simple method for communicating key->data sets accross requests/machines along with some meta-data regarding lifetime of the data as well as owner.
<?php
/*
* A simple method for communicating key->data sets accross
* requests/machines along with some meta-data regarding
* lifetime of the data as well as owner.
*
* For example, assume a token is emailed to individuals that
* allow them to access some particular data/functionality
* for a specific period of time. By providing a URL for them
* to click that has the token embedded, you can verify the data
@bubba-h57
bubba-h57 / decrypt.pl
Created July 22, 2012 04:52
PHP Compatible PERL mcrypt function
$encryptedString = '7DjnpOXG+FrUaOuc8x6vyrkk3atSiAf425ly5KpG7lOYgwouw2UATw==';
$iv = '12345678';
$passphrase = '8chrsLng';
$string = &decryptPhpEncrypted $encryptedString, $passphrase, $iv;
# Expect: Some Secret thing I want to encrypt
sub decryptPhpEncrypted() {
my ($encryptedString, $passphrase, $iv) = @_;
my $keysize = length($passphrase);
@bubba-h57
bubba-h57 / ctfLevel7.py
Created August 24, 2012 17:02
Stripe CTF Level 7 Helper File
#!/usr/bin/env python
#
# sha1 padding/length extension attack
# by rd@vnsecurity.net
# modified by ... rob@hines57.com
#
import sys
import hashlib
import sha