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
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts | |
# Scan known hosts | |
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.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
#!/usr/bin/env ruby | |
require 'benchmark' | |
require 'date' | |
Benchmark.bm do|b| | |
ITERATE = 100000 | |
b.report("strptime") do | |
time = "2011-05-25 00:00:03 -0400" | |
fmt = "%Y-%m-%d %H:%M:%S %z" |
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 python | |
############################################################################# | |
# Print POW config with nice formatting ##################################### | |
# | |
# Works as is with Python 2.6. For Python 2.7, 'import simplejson as json' | |
# instead. Save this file to a location in your PATH and make sure it is | |
# executable. Then you can call 'powconfig' from anywhere and see the active | |
# POW 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
cache: [GET /events] miss | |
E, [2011-12-09T16:30:47.083257 #7114] ERROR -- : app error: deadlock; recursive locking (ThreadError) | |
E, [2011-12-09T16:30:47.083428 #7114] ERROR -- : /var/www/staging-ra-eauctionservices-com/shared/bundle/ruby/1.9.1/gems/rack-1.3.5/lib/rack/lock.rb:14:in `lock' | |
E, [2011-12-09T16:30:47.083533 #7114] ERROR -- : /var/www/staging-ra-eauctionservices-com/shared/bundle/ruby/1.9.1/gems/rack-1.3.5/lib/rack/lock.rb:14:in `call' | |
E, [2011-12-09T16:30:47.083600 #7114] ERROR -- : /var/www/staging-ra-eauctionservices-com/shared/bundle/ruby/1.9.1/gems/rack-cache-1.1/lib/rack/cache/context.rb:132:in `forward' | |
E, [2011-12-09T16:30:47.083669 #7114] ERROR -- : /var/www/staging-ra-eauctionservices-com/shared/bundle/ruby/1.9.1/gems/rack-cache-1.1/lib/rack/cache/context.rb:241:in `fetch' | |
E, [2011-12-09T16:30:47.083739 #7114] ERROR -- : /var/www/staging-ra-eauctionservices-com/shared/bundle/ruby/1.9.1/gems/rack-cache-1.1/lib/rack/cache/context.rb:181:in `lookup' | |
E, [2011-12-09T16:30:47.083815 #7114] ERROR |
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 | |
# Sorts slice sequence images output by MCMap Live. Creates folders of every | |
# five and ten images for inspection. | |
require 'fileutils' | |
class McSorter | |
def initialize |
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 | |
######################################################################### | |
# # | |
# # | |
# NATO String converter # | |
# # | |
# Description: converts string (first parameter given) # | |
# to NATO phonetics-alphabet # | |
# # |
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
# bench_encoding.rb | |
#!/usr/bin/env ruby -wKU | |
# encoding: UTF-8 | |
require 'benchmark' | |
p "Encoding is currently: #{__ENCODING__}" | |
report_width = 32 | |
Benchmark.bm(report_width) do|b| |
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 collect_mysql_variables | |
@data.values.collect { |value| value.key }.uniq! | |
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
#!/usr/bin/env ruby -wKU | |
require 'csv' | |
$: << File.expand_path(__FILE__) | |
# Compares the output of `show variables;` run in the CLI mysql client. The | |
# script expects the output of this query executed with the `--tables` flag. | |
# Output is written to the STDOUT, so you'll need to use standard shell | |
# redirection. Output format is CSV. Example usage: |
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 -wKU | |
class DataAnalyzer | |
def initialize | |
# Check for Ruby 1.9 | |
unless RUBY_VERSION.scan('1.9').length > 0 | |
puts "This script reqires Ruby 1.9 (specifically, ordered hashes). Sorry! Check out RVM or rbenv for easy management of Ruby versions." | |
exit 1 | |
end | |
# We must have at least one file to process |