Skip to content

Instantly share code, notes, and snippets.

View phil-monroe's full-sized avatar

Phil Monroe phil-monroe

View GitHub Profile
@phil-monroe
phil-monroe / db_lag.rb
Created September 29, 2012 00:21
Calculate the lag in WAL transmission for postgres databases
# math based on http://eulerto.blogspot.com/2011/11/understanding-wal-nomenclature.html
dbname = ""
dbuser = ""
host_master = ""
host_slave = ""
previous_recieved_lags = []
previous_replated_lags = []
@phil-monroe
phil-monroe / clone_vm.rb
Created November 14, 2012 19:51
Clone vm with IP
identity = RbVmomi::VIM.CustomizationLinuxPrep({
hostName: RbVmomi::VIM.CustomizationFixedName(name: "test"),
domain: "test.com"
})
global_ip_settings = RbVmomi::VIM.CustomizationGlobalIPSettings({
dnsServerList: ["172.31.10.37"],
dnsSuffixList: ["identified.com"]
})
@phil-monroe
phil-monroe / SassMeister-input-HTML.haml
Created October 20, 2015 00:33
Generated by SassMeister.com.
%header
.name
The is the name
.actions
These are actions
.print-only
Only in Print
@phil-monroe
phil-monroe / SassMeister-input-HTML.haml
Created October 20, 2015 00:39
Generated by SassMeister.com.
%header
.name
The is the name
.actions
These are actions
.print-only
Only in Print
# 0) do only if you done have the code
git clone REPO_URL
# 1) pull latest master
git checkout master
git pull origin master
# 2) create new branch.
git checkout -b feature/foobar
@phil-monroe
phil-monroe / audio.rb
Created February 19, 2014 14:48
Use CoreAudio with Ruby to make a real time CLI level meter and frequency response chart
require "thread"
require "fftw3"
require "coreaudio"
require 'ruby-progressbar'
# progressbar = ProgressBar.create
# progressbar.total = 100
Thread.abort_on_exception = true
@phil-monroe
phil-monroe / rails_2_papertrail.rb
Created December 19, 2012 00:30
Things needed to log rails to papertrail.
class MultiIO
def initialize(*targets)
@targets = targets
end
def write(*args)
puts "writing"
@targets.each { |t| t.write(*args) }
end
@phil-monroe
phil-monroe / haproxy
Created January 11, 2013 01:47
HAProxy init.d script.
#!/usr/bin/env bash
# haproxyd
# Script to start|stop|restart haproxy from /etc/init.d/
# By Phil Monroe.
HAPROXY_PATH=/usr/sbin
HAPROXY_DAEMON=$HAPROXY_PATH/haproxy
HAPROXY_CONFIG=/etc/haproxy/haproxy.cfg
test -x $HAPROXY_DAEMON || exit 0
@phil-monroe
phil-monroe / tools.md
Last active December 11, 2015 07:28
Tools that I find useful and use everyday.

Development Tools

Productivity Tools

Asana

By far the best ToDo list I have ever used.

  • asana.com
  • Asana.app - Fluid app to make the Asana web interface seem like a native OS X App.
@phil-monroe
phil-monroe / permissions.sql
Created January 30, 2013 00:05
Gist to test postgres permissions so multiple apps can connect and use the same DB in a namespaced way
--- cleanup
drop database test;
drop user piston;
drop user crankshaft;
drop user identified;
--- setup
create database test;
\c test