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
update_current_git_vars |
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 'csv' | |
require 'date' | |
CSV::Reader.parse(File.open(ARGV[0])) do |row| | |
date = row[0].match(/^\d{4}-\d{2}-\d{2}/) ? Date.strptime(row[0], "%Y-%m-%d") : row[0] | |
hours = row[2] | |
memo = "#{row[3]} #{row[4]}" | |
puts "#{date} | #{hours} | #{memo}" | |
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 | |
# Jabber-SH — SH console via XMPP/Jabber (GTalk) | |
# | |
# Jabber-SH allows you to administrate a remote computer via a command line | |
# through a Jabber client. It’s like SSH via GoogleTalk! :) | |
# This is just a hack but it might be usefull sometime to run basic commands | |
# on a machine that is not accessible via ssh. | |
# | |
# Philippe Creux. pcreux/AT/gmail/DOT/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/ruby | |
# Migrate rubygems to Ruby Enterprise Edition (REE) | |
# Make REE install the gems used by your default ruby environment. | |
REE_PATH = ENV['REE_PATH'] || Dir.glob('/opt/ruby-enterprise-*').last | |
unless REE_PATH | |
puts "Can't find path to ruby enterprise edition. Please use the following command:" | |
puts "REE_PATH=/path/to/ruby-enterprise ruby migrate-rubygems-to-ree" |
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 | |
# script/runner for rails 3.0 | |
APP_PATH = File.expand_path('../../config/environment', __FILE__) | |
require 'rubygems' | |
require 'rails/commands/runner' |
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 'rspec' | |
def set(attribute, &block) | |
before(:all) do | |
instance_variable_set("@#{attribute}", yield) | |
end | |
let(attribute) { instance_variable_get("@#{attribute}") } | |
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
# Set @@variable_name in a before(:all) block and give access to it | |
# via let(:variable_name) | |
# | |
# Example: | |
# describe Transaction do | |
# set(:transaction) { Factory(:transaction) } | |
# | |
# it "should be in progress" do | |
# transaction.state.should == 'in_progress' | |
# 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 'rubygems' | |
# Set up gems listed in the Gemfile. | |
GEMFILE_PATH = File.expand_path('../../Gemfile', __FILE__) | |
if File.exist?(GEMFILE_PATH) | |
# Force the rails 3 application to use its Gemfile | |
ENV['BUNDLE_GEMFILE'] = GEMFILE_PATH | |
require 'bundler' | |
Bundler.setup | |
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
#/bin/bash | |
# From http://wiki.opscode.com/display/chef/Package+Installation+on+Debian+and+Ubuntu | |
# Run: wget http://gist.github.com/raw/568876/install_chef_client.sh && bash install_chef_client.sh | |
echo "Add the Opscode APT Repository" | |
echo 'deb http://apt.opscode.com/ lucid main' | sudo tee /etc/apt/sources.list.d/opscode.list | |
sudo apt-get update | |
echo "Install curl" | |
sudo apt-get install curl |
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
merb : chef-server (api) : worker (port 4000) ~ Started request handling: Tue Sep 07 15:25:42 -0700 2010 | |
merb : chef-server (api) : worker (port 4000) ~ Params: {"format"=>nil, "action"=>"show", "id"=>"apps", "q"=>"*:*", "start"=>"0", "rows"=>"1000", "controller"=>"search", "sort"=>"X_CHEF_id_CHEF_X asc"} | |
merb : chef-server (api) : worker (port 4000) ~ undefined method `closed?' for nil:NilClass - (NoMethodError) | |
/usr/lib/ruby/1.8/net/http.rb:1060:in `request' | |
/usr/share/chef-server-api/lib/../../chef-solr/lib/chef/solr.rb:58:in `solr_select' | |
/usr/share/chef-server-api/lib/../../chef-solr/lib/chef/solr/query.rb:63:in `raw' | |
/usr/share/chef-server-api/lib/../../chef-solr/lib/chef/solr/query.rb:84:in `search' | |
/usr/share/chef-server-api/app/controllers/search.rb:48:in `show' | |
/usr/lib/ruby/1.8/merb-core/controller/abstract_controller.rb:315:in `send' | |
/usr/lib/ruby/1.8/merb-core/controller/abstract_controller.rb:315:in `_call_action' |
OlderNewer