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
#in environment.rb refer to this file BEFORE Initializer block or load in a file via require | |
# then use in code like this MyOracle.city_mapping_table | |
module MyOracle | |
module Configuration | |
def oracle | |
MyOracle | |
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
module Varnish | |
require 'net/telnet' | |
#requires telnet access from deploy machine | |
def global_purge(varnish_host,varnish_port) | |
#It WILL timeout, just accept it. Varnish does not have a command prompt. | |
result = run_varnish_cmd(varnish_host,varnish_port,'url.purge .*',3) | |
if result.include?("200") | |
return [true,"Varnish purged OK."] | |
else |
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
curl -s -o "/dev/null" -w "\n\nSTATS:\n\ttime_total\t%{time_total}\n\ttime_namelookup\t%{time_namelookup}\n\ttime_connect\t%{time_connect}\n\ttime_appconnect\t%{time_appconnect}\n\ttime_pretransfer\t%{time_pretransfer}\n\ttime_starttransfer\t%{time_starttransfer}\n\tspeed_download\t%{speed_download}\n\tnum_connects\t%{num_connects}\n" "<url>" |
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
x=1; while [ $x -le 10 ]; do RAILS_ENV=benchmark rake test:benchmark;x=$(( $x + 1 )); done |
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
find . -type f -mtime 0 | egrep -v '.*(git|coverage|metric).*' |
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
releases = for-each-ref --sort=taggerdate --format='%(refname:short)' refs/tags |
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 initialize(options = {}) | |
options.each do |key, value| | |
send("#{key}=", value) if respond_to?(key) | |
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
module MaxMedia | |
module Configuration | |
def ldap | |
MaxMedia | |
end | |
end | |
class << self | |
attr_accessor :server, :port, :query, :content_group, :approval_group, :publish_group, :bind_user, :password, :user_base | |
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
require 'net/smtp' | |
message = <<MESSAGE_END | |
From: Hank Beaver <hbeaver@maxmedia.com> | |
To: Hank Beaver <hbeaver@gmail.com> | |
Subject: SMTP e-mail test | |
This is a test e-mail message. | |
MESSAGE_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
mongo --eval "db.getCollectionNames().forEach(function(name){if(name.match(/^tmp/)){db[name].drop()}})" cms |
OlderNewer