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 | |
if [ $# -ne 5 ]; then | |
prog=`basename $0` | |
echo "Usage $prog <short-hostname> <eth0> <eth1> <eth2> <eth3>" >&2 | |
exit -1 | |
fi | |
set -xe |
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
yourproject/ | |
- Vagrantfile | |
- manifests/ | |
- centos62-64.pp | |
- modules/ | |
- rbenv/ <-- git submodule of https://github.com/alup/puppet-rbenv |
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
# Prevent accidentally calling #[] on a number, we don't bit-slice in this house | |
[Fixnum, Bignum].each do |k| | |
k.class_eval do | |
def [](*args) | |
raise NoMethodError, "Calling #[] on numbers is wrong. Don't do it." | |
end | |
end | |
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
# | |
# New Relic Server Monitor configuration file. | |
# | |
# Lines that begin with a # are comment lines and are ignored by the server | |
# monitor. For those options that have command line equivalents, if the | |
# option is specified on the command line it will over-ride any value set | |
# in this file. | |
# | |
# |
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
# PH'NGLUI MGLW'NAFH! | |
# IA IA IA! | |
module SubrequestHelper | |
def get_subrequest_for_uri( uri ) | |
sub_env = request.env.dup | |
sub_env['REQUEST_URI'] = uri | |
sub_env['REQUEST_METHOD'] = 'GET' | |
sub_env['rack.input'] = StringIO.new("") | |
sub_env.delete('QUERY_STRING') | |
sub_env.delete_if { |k,v| k =~ /^action_controller/ } |
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 'delayed_job' | |
module DelayedJobHelper | |
def self.included(klass) | |
klass.class_eval <<-RUBY | |
extend ClassMethods | |
RUBY | |
end | |
module ClassMethods |
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
ActionController::Routing::Routes.draw do |map| | |
... | |
end | |
module CustomRoutes | |
protected | |
def incident_url( record, options = {} ) | |
account_application_alert_url(record.account_id, record.application_id, record.id, options) | |
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
development: | |
strategy: oauth | |
oauth_consumer_key: YOUR_KEY_HERE | |
oauth_consumer_secret: YOUR_SECRET_HERE | |
base_url: "https://twitter.com" | |
authorize_path: "/oauth/authenticate" | |
api_timeout: 10 | |
remember_for: 14 # days | |
oauth_callback: "http://localhost:3000/oauth_callback" | |
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 ruby | |
# Bundler needs to find the Gemfile in the current directory, so we | |
# need to dereference symlinks, then chdir to where this script lives | |
this_file = __FILE__ | |
while( File.symlink?(this_file) ) | |
this_file = File.readlink(this_file) | |
end | |
Dir.chdir(File.dirname(this_file)) |