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 'tinder' | |
pid = 2461 | |
message = "DB restore complete!" | |
campfire = Tinder::Campfire.new 'subdomain', :token =>'zxzxc' | |
room = campfire.find_room_by_name 'roomname' | |
puts "watching and waiting for pid #{pid} to complete" | |
while `ps --no-headers #{pid}`.size > 0 | |
puts "pid lives, waiting" | |
sleep 10 |
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
git push -f staging v1.3^{}:master |
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
#pry -r ./rate_limit_test.rb | |
require './using_rate_limits' | |
require './rate_limitable' | |
f = UsingRateLimits.new | |
require'pry';binding.pry | |
f.some_method | |
#using_rate_limits.rb | |
require './rate_limitable' | |
class UsingRateLimits |
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
# https://github.com/bugsnag/bugsnag-api-ruby | |
require 'bugsnag/api' | |
Bugsnag::Api.configure do |config| | |
config.auth_token = "your-account-api-token" | |
end | |
errors = Bugsnag::Api.errors(web_project_id) | |
error = Bugsnag::Api.error(error_id) | |
events = Bugsnag::Api.error_events error_id |
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
Rails.application.routes.routes.each do |route| | |
puts route.path.spec.to_s | |
end;nil | |
# specs with stubbed routes: https://github.com/blakechambers/matterhorn/blob/master/spec/support/url_test_helpers.rb | |
routes.routes.each do |route| | |
puts route.path.spec.to_s | |
end;nil | |
Rails.application.routes.named_routes.helpers |
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
solr = RSolr.connect :url => solr_server #http://solr:8983/solr/some-index | |
response = solr.get 'select', :params => { | |
:q => '*:*', | |
:rows => 0 | |
} |
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
netstat -nputw |
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
$ alias hostip="ip route show 0.0.0.0/0 | grep -Eo 'via \S+' | awk '{ print \$2 }'" | |
$ docker run --add-host=docker:$(hostip) --rm -it debian |
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
# create queue | |
# /api/queues/vhost/name | |
curl -i -u $AMQP_USER:$AMQP_PASSWORD -H "content-type:application/json" \ | |
-XPUT -d'{"auto_delete":false,"durable":true,"arguments":[]}' \ | |
"http://$AMQP_HOST:$RABBIT_MGT_PORT/api/queues/%2F/$SCHEDULER_TRIGGER_QUEUE" | |
# create exchange | |
# PUT /api/exchanges/vhost/name | |
curl -i -u $AMQP_USER:$AMQP_PASSWORD -H "content-type:application/json" \ | |
-XPUT -d'{"type":"direct","auto_delete":false,"durable":true,"arguments":[]}' \ |
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
find . -type f -name '*.rb' -exec sed -i '' 's/rfc3339(9)/rfc3339/g' \{\} \; |
OlderNewer