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
# When resque workers are no longer around, but records of them are still sitting around in Redis... | |
def remove_resque_workers worker, ips | |
ips.each do |ip| | |
eval(" | |
def worker.to_s | |
'#{ip}:*' | |
end | |
") | |
worker.unregister_worker |
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
Resque::Failure.all(28044, Resque::Failure.count - 28044).each do |j| | |
next unless j["retried_at"].nil? | |
e = j["error"] | |
ids = e[(e.index('[')+1)...e.index(']')].split(', ').map(&:to_i) | |
Jobs::MigrateLegacyUsers.submit_job(ids) | |
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
numbers_to_delete = (10..20).to_a # or any array of numbers you need to operate on | |
name_prefix = 'server-name-prefix-' # will be used in a search, ie: "name:server-name-prefix-11" | |
names_to_delete = numbers_to_delete.map { |i| "#{name_prefix}#{i}" } | |
nodes_to_destroy = search(:node, names_to_delete.map { |n| "name:#{n}" }.join(" OR ")) | |
nodes_to_destroy.each { |n| n.destroy } | |
clients_to_destroy = search(:client, names_to_delete.map { |n| "name:#{n}" }.join(" OR ")) | |
clients_to_destroy.each { |c| c.destroy } |
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 bash | |
usage() { | |
printf " | |
Usage: | |
rvm-install-system-wide [options] | |
Options: |