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
sudo yum install socat # if not already installed | |
sudo nano -w /etc/haproxy/haproxy.cfg # add ..."level admin" to stats socket line | |
sudo /etc/init.d/haproxy reload # reload config | |
sudo socat readline /tmp/haproxy.sock | |
prompt | |
> set timeout cli 1d | |
> help | |
> disable server rails_app_servers/rails-app1 | |
> disable server rails_app_servers_ssl/rails-app1 | |
> enable server rails_app_servers/rails-app1 |
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
var collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |
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
# Adapted from https://raw.github.com/github/hubot-scripts/master/src/scripts/plusplus.coffee | |
# | |
# Description: | |
# Give or take away points. Keeps track and even prints out graphs. | |
# | |
# Dependencies: | |
# "underscore": ">= 1.0.0" | |
# "clark": "0.0.6" | |
# | |
# Configuration: |
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 | |
# I don't remember where I found this, but all credit goes to them. | |
require 'rubygems' | |
gem 'term-ansicolor', '=1.0.3' | |
require 'term/ansicolor' | |
class GitCommit | |
attr_reader :content |
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 | |
# Set the CHECK_RAILTIE environment variable to star (*) gems without Railties (warning: SLOW). | |
require 'bundler' | |
require 'benchmark' | |
REGEXPS = [ | |
/^no such file to load -- (.+)$/i, | |
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i, |
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 | |
# Set the CHECK_RAILTIE environment variable to star (*) gems without Railties (warning: SLOW). | |
require 'benchmark' | |
REGEXPS = [ | |
/^no such file to load -- (.+)$/i, | |
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i, | |
/^Missing API definition file in (.+)$/i, |
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 'rubygems' | |
require 'sinatra' | |
require 'json' | |
get '/latest' do | |
# This is where the [ugly] magic happens. Grep an appropriate path from the _end_ of the incoming log file, | |
# excluding office IP range and paying special attention to escaping... | |
line = `tac /var/log/heroku.log | grep ".*GET [^\?]*/home\/[^/ \\"]*" | grep -v "controls\\|pending\\|99\\.99\\." -m 1` | |
if match = line.match(/\/home\/([a-z0-9\-]*)/i) | |
return match[1].to_json |
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
[ | |
[1913,1,9.8], | |
[1913,2,9.8], | |
[1913,3,9.8], | |
[1913,4,9.8], | |
[1913,5,9.7], | |
[1913,6,9.8], | |
[1913,7,9.9], | |
[1913,8,9.9], | |
[1913,9,10.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
#!/usr/bin/env ruby | |
require 'rubygems' | |
gem 'term-ansicolor', '=1.0.3' | |
require 'term/ansicolor' | |
class GitCommit | |
attr_reader :content | |
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
[cache] | |
LOCAL_DATA_DIR = /opt/graphite/storage/whisper/ | |
# Specify the user to drop privileges to | |
# If this is blank carbon runs as the user that invokes it | |
# This user must have write access to the local data directory | |
USER = www-data | |
# Limit the size of the cache to avoid swapping or becoming CPU bound. | |
# Sorts and serving cache queries gets more expensive as the cache grows. |