Skip to content

Instantly share code, notes, and snippets.

View schubert's full-sized avatar

Michael Schubert schubert

View GitHub Profile
@schubert
schubert / install.bash
Last active August 29, 2015 14:23
hawq-checkman-bootstrap
#!/bin/bash
CHECKMAN_INTERVAL=30 # Seconds between running checks
CHECKMAN_VERSION=25d77c1
get_ci_infrastructure_repo() {
mkdir -p ~/workspace/
if [ ! -e ~/workspace/ci-infrastructure ]; then
git clone git@github.com:Pivotal-DataFabric/ci-infrastructure.git ~/workspace/ci-infrastructure
else
pushd ~/workspace/ci-infrastructure
### Keybase proof
I hereby claim:
* I am schubert on github.
* I am schubert (https://keybase.io/schubert) on keybase.
* I have the public key with fingerprint 9094 50D8 C4F4 0C27 8898  454A 1966 539A 86D1 D29C
To claim this, I am signing this object:
@schubert
schubert / test.rb
Created August 24, 2012 05:09
Chef WTF
directory node["application"]["path"] do
not_if "test -d #{node['application']['path']}"
action :create
recursive true
owner node["environment"]["user"]
group node["environment"]["group"]
mode "775"
end
directory node["application"]["path"] do
@schubert
schubert / capistrano_colors.rb
Created August 9, 2012 21:46
color hooks for capistrano deployments
namespace :deploy do
reset = "\033[0m"
success = "\033[32m" # Green
failure = "\033[31m" # Bright Red
task :completed do
puts "#{success}"
puts "*" * 40
puts "SUCCESS"
puts "*" * 40
@schubert
schubert / mixlib_log_monkey_patch.rb
Created August 9, 2012 21:43
colorize your chef solo output (put in libraries)
require "mixlib/log/formatter"
module Mixlib
module Log
class Formatter < Logger::Formatter
# Prints a log message as '[time] severity: message' if Chef::Log::Formatter.show_time == true.
# Otherwise, doesn't print the time.
def call(severity, time, progname, msg)
if @@show_time
reset = "\033[0m"
@schubert
schubert / example.bash
Created July 27, 2012 19:05
nginx config trick to force specific return code for testing
$ curl -I http://some.local.app.dev/?return=402
HTTP/1.1 402 Payment Required
Server: nginx/1.2.2
Date: Fri, 27 Jul 2012 19:08:19 GMT
Content-Type: text/html
Content-Length: 182
Connection: keep-alive
Keep-Alive: timeout=10