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 | |
# Upgrade to rspec-rails 2.2.2 | |
# response.headers["Status"].should == "201 Created" does not work any more | |
# response.status.should == "201 Created" does work now | |
# | |
# find all controllers specs which contains response.headers["Status"].should | |
# sort them | |
# and remove duplications | |
for c in `grep 'Status' -r spec/controllers | grep 'response.headers' | cut -d':' -f1 | sort | uniq` |
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 | |
# | |
# Detect the models which are associated with non existing account. | |
# | |
# Usage: | |
# $ cd RAILS_ROOT | |
# $ RAILS_ENV=test ./check-assoc | |
# | |
require 'config/environment' |
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
# Maksim Horbul | |
# | |
# clean up the remote branches according to the Unfuddle Reports | |
# | |
require 'rubygems' | |
require 'feed-normalizer' | |
require 'net/http' | |
require 'net/https' |
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 | |
# -*- shell -*- | |
sudo su - | |
# | |
# Audio: fix ubuntu 9.04 broken sound | |
# | |
apt-get install build-essential xmlto libncurses5-dev |
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 'mq' | |
class Foo | |
def run | |
setup_queue | |
setup_recovering(@recover_timeout) | |
setup_subscription | |
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 | |
# Maksim Horbul | |
# - Setup Ruby/Rails environment on OSX Leopard | |
sudo su - | |
# setup MySQL Server | |
MYSQL_VERSION=5.1.36 | |
cd /tmp | |
wget -O - http://opensource.become.com/mysql/Downloads/MySQL-5.1/mysql-$MYSQL_VERSION.tar.gz \ |
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
class MySingleton | |
@@a = 0 | |
self.class_eval do | |
def a=(v); @@a = v; end | |
def a; @@a; end | |
end | |
end | |
puts MySingleton.a # => 0 | |
MySingleton.a = 1 |
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 # erl -sname foo -setcookie `cat /var/run/rabbitmq/.erlang.cookie` -remsh rabbit@<vhostname> | |
# Once inside the erlang shell, use: | |
erl> rabbit_amqqueue:stat_all(). | |
# Find the queue name you need. If it's the first one on the list, for example, use this: | |
erl> {ok, Worker, _, _} = lists:nth(1,rabbit_amqqueue:stat_all()). | |
erl> {ok, Q} = rabbit_amqqueue:lookup(Worker). | |
# Purge the particular queue |
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 'mq' | |
[ | |
{:host => "localhost", :port => "5671"}, | |
{:host => "localhost", :port => "5672"} | |
].each do |options| | |
begin | |
puts options.inspect | |
@conn = AMQP.start(options) do | |
puts "connected" |
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 | |
# | |
# Usage: deploy-gem.sh remote-host-name gem-name [branch] | |
# | |
# NOTE: you can provide more than one remote hosts like | |
# deploy-gem.sh rhost1,rhost2,rhost3 gem-name [branch] | |
# | |
# if the branch is provided in the the following format 'master' | |
# the sonian repository git@github.com:sonain/<gem-name>.git will be used | |
# |
OlderNewer