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
# Used to graph results from autobench | |
# | |
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv | |
# | |
# This will generate three svg & png graphs | |
require "rubygems" | |
require "scruffy" | |
require 'csv' | |
require 'yaml' |
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 'irb' | |
def consolize &block | |
yield | |
IRB.setup(nil) | |
irb = IRB::Irb.new | |
IRB.conf[:MAIN_CONTEXT] = irb.context |
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
""" | |
Automated installation of ejabberd with a postgresql backend inspired by this | |
article: http://www.planeterlang.org/en/planet/article/How_to_install_ejabberd_2.0.0_with_PostgreSQL_support/ | |
""" | |
from fabric.api import run, sudo | |
EJABBERD_VERSION = '2.0.5' | |
EJABBERD_SOURCE_HOME = '~/dev/xmpp/oss' | |
POSTGRES_PSQL_PASSWORD = 'user' |
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 'mechanize' | |
@username = 'user@domain.com' | |
@password = 'hi2u' | |
@download_path = File.expand_path 'downloads' | |
@wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt' | |
unless File.directory? @download_path | |
puts "@{download_path} doesn't exist!" | |
exit |
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
diff -U 0 -r rails-3.1.0.beta1/.gitignore rails-3.1.1/.gitignore | |
--- rails-3.1.0.beta1/.gitignore 2011-10-07 11:56:15.000000000 -0400 | |
+++ rails-3.1.1/.gitignore 2011-10-07 12:59:12.000000000 -0400 | |
@@ -4,0 +5 @@ | |
+.sass-cache/ |
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
first: brew install highlight | |
second: add to your .zshrc (or .bashrc) | |
function hlr { | |
filename=`echo $1 | cut -d . -f 1` | |
highlight --syntax ruby -k Menlo -K 20 -O rtf -s edit-xcode $1 > $filename.rtf | |
} | |
third: it will generate a .rtf file. just open and copy the highlighted code and add to your Keynote talk. |
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
<source> | |
type tail | |
path path_to_file1 | |
pos_file path_to_pos_file1 | |
tag app.file1 | |
format /^(?<ip>[^ ]+) [^ ]+ [^ ]+ \[(?<time>[^\]]+)\] "(?<method>\S+) /(?<country>[A-Z0-9]{0,3})_(?<domain>[^/]+)/(?<module>[^/]+)/(?<controller>[^/]+)/(?<action>[^/]+)/(?<record>\S*)" (?<code>\d+) (?<res_time>\d+) "(?<referer>[^\"]*)" "(?<old_device>[^_\" ]*)_(?<device>[^_\" ]*)_(?<browser>[^_\" ]*) ?(?<guid>[^\"]*)" "(?<vuid>\d*) ?(?<option>[^\"]*)"$/ | |
time_format %d/%b/%Y:%H:%M:%S %z | |
rotate_wait = 5s | |
</source> |
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
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
if [ ! -f /usr/bin/chef-client ]; then | |
yum groupinstall -y 'Development tools' | |
yum install -y libxml2-devel libxslt-devel | |
yum install -y ruby19 ruby19-devel rubygems19 rubygem19-rdoc rubygem19-rake rubygem19-bigdecimal | |
ln -sf /usr/bin/ruby1.9 /usr/bin/ruby | |
ln -sf /usr/bin/gem1.9 /usr/bin/gem | |
ln -sf /usr/bin/irb1.9 /usr/bin/irb |
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 | |
# This is an alternative to using EM::Iterator. It allows us to use | |
# MultiRequest but still limit the number of concurrent requests that | |
# are created. | |
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http-request' |
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
/** | |
* Notes: This code uses AsyncValue[T], a custom class that uses actors | |
* to allow concurrent operations on the provided type. It can be replaced | |
* by an Atomic object from the java.util.concurrent package or something | |
* that provides similar functionality. | |
*/ | |
/** | |
* Resets the offsets for the given group / topic pair. |
OlderNewer