Skip to content

Instantly share code, notes, and snippets.

View paukul's full-sized avatar

Pascal Friederich paukul

View GitHub Profile
curl -o /tmp/skaes-rubypatches-ruby-187-24843.patch https://gist.github.com/raw/2d90a8e61044074bbfe5/6d944ebeb0eaa80e64e167df4537a622d11ac5da/svn-diff-skaes-ruby.patch
rvm install 1.8.7-r24843 --patch /tmp/skaes-rubypatches-ruby-187-24843.patch -C --enable-gcdebug
rm /tmp/skaes-rubypatches-ruby-187-24843.patch
require 'bunny'
#
# By default the logs are routed to the host, exchange and key specified in DEFAULT_OPTIONS
# Change the configuration when creating logger with an argument hash:
#
# logging_config = { :routing_key => "applogging",
# :host => AppConfig.amqp_logging.host,
# :exchange => AppConfig.amqp_logging.exchange }
#
def all_servers
# go figure...
[:server_1, :server_2, :server_3]
end
def run(stuff)
@active_servers.each {|s| puts "Running #{stuff} on #{s}" }
end
def on(server, &block)
logging_config = { :routing_key => "applogging",
:host => AppConfig.amqp_logging.host,
:exchange => AppConfig.amqp_logging.exchange }
logger = AMQPLogging::Logger.new(config.log_path, logging_config)
config.logger = logger
[ paukul@codeslave ~/code/paukul/githubfuse/lol/skaes ]$ cd ..
[ paukul@codeslave ~/code/paukul/githubfuse/lol ]$ ll
total 8
dr-xr-xr-x 1 paukul staff 4,0K 24 Dez 12:43 skaes/
[ paukul@codeslave ~/code/paukul/githubfuse/lol ]$ mkdir leehambley
[ paukul@codeslave ~/code/paukul/githubfuse/lol ]$ cd leehambley/
[ paukul@codeslave ~/code/paukul/githubfuse/lol/leehambley ]$ ll
total 192
dr-xr-xr-x 1 paukul staff 4,0K 24 Dez 12:43 LOIC/
dr-xr-xr-x 1 paukul staff 4,0K 24 Dez 12:43 benchmark_middleware/
@paukul
paukul / paralell_runner.rb
Created December 26, 2010 08:52
hydra, deeptest and others were a little heavyweight for my needs
ENV['RAILS_ENV'] = "test"
require 'test/unit/testsuite'
require 'test/unit/collector/objectspace'
require 'test/unit/ui/testrunnermediator'
require 'test/unit/ui/console/testrunner'
require 'test/unit/testresult'
require 'config/environment'
require 'drb'
no_workers = 4
tell application "Skype"
send command "SET USERSTATUS DND" script name "pomodoro"
end tell
tell application "Mail" to quit
tell application "Tweetie" to quit
@paukul
paukul / query_builder_helper.rb
Created September 26, 2011 12:25
solr query sanitizer using a statemachine (like a baws!)
# the only dependencies are http://rubygems.org/gems/transitions
# and I think active support
module Search
module QueryBuilderHelper
def sanitize_field_for_solr_query(query)
if query.is_a?(Hash)
query.inject({}) do |result, query_component|
result[query_component.first] = query_component.first == '*' ? query_component.last : QueryField.sanitize(query_component.last)
result
@paukul
paukul / 1.8.7-p352-railsexpress
Created October 4, 2011 16:24
ruby-build definition for skaes ruby 1.8.7-p352
use_gcc42_on_lion
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
install_git "ruby-1.8.7-p352-railsexpress" "https://github.com/skaes/matzruby.git" "ruby187pl352railsexpress" autoconf standard
install_package "rubygems-1.3.7" "http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz" ruby
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
install_git "ruby-1.9.2-p290-railsexpress" "https://github.com/paukul/matzruby.git" "ruby192pl290railsexpress" autoconf standard