By far the best ToDo list I have ever used.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zprofile | |
echo 'eval "$(rbenv init -)"' >> ~/.zprofile | |
exec $SHELL -l | |
brew install readline openssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rufus/scheduler' | |
require 'redis' | |
require 'redis-lock' | |
if $0 == 'sidekiq' | |
$redis = Redis.new | |
def run_rake task | |
$redis.lock_for_update(task, 100, 0) do | |
puts "scheduling #{task}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- cleanup | |
drop database test; | |
drop user piston; | |
drop user crankshaft; | |
drop user identified; | |
--- setup | |
create database test; | |
\c test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p ~/bin/ | |
curl -s -L https://gist.github.com/raw/4477190/pmrcp.rb > ~/bin/pmrcp | |
chmod +x ~/bin/pmrcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiIO | |
def initialize(*targets) | |
@targets = targets | |
end | |
def write(*args) | |
puts "writing" | |
@targets.each { |t| t.write(*args) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def models | |
Module.constants.inject([]) do |models, k| | |
klass = Kernel.const_get k | |
models << klass if klass.respond_to? :ancestors and klass.ancestors.include? ActiveRecord::Base | |
models | |
end | |
end |