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 / 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 / .env
Last active May 24, 2017 00:42
GULP file for managing AWS LAMBDA node.js functions.
FUNCTION_ROLE="arn:aws:iam::123456789097531:role/lambda_basic_execution"
FUNCTION_TIMEOUT=10
AWS_REGION=us-east-1
@bubba-h57
bubba-h57 / closeConnection.php
Created January 14, 2015 21:39
Easy way to close connections to the browser and continue processing on the server.
<?php
/**
* Close the connection to the browser but continue processing the operation
* @param $body
*/
public function closeConnection($body, $responseCode){
// Cause we are clever and don't want the rest of the script to be bound by a timeout.
// Set to zero so no time limit is imposed from here on out.
set_time_limit(0);
@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 / 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 / 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 / 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 / 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 / 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 / fiddle.css
Last active October 18, 2016 17:08
JFiddle Functional Reactive Program Engineering Challenge
body {
padding:0;
font:15px/1.4 Arial, sans-serif;
background:#e5e5e5;
}
p {
margin:1.4em 0 0;
}
ol {
margin-left: 1em;