Skip to content

Instantly share code, notes, and snippets.

View viniciusdaniel's full-sized avatar

Vinicius Daniel Antunes Oliveira viniciusdaniel

View GitHub Profile
@viniciusdaniel
viniciusdaniel / resque.rake
Created July 31, 2012 04:11 — forked from denmarkin/resque.rake
My rake task for clearing Resque queues and stats
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version
# see https://github.com/defunkt/resque/issues/49
# see http://redis.io/commands - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
@viniciusdaniel
viniciusdaniel / nginx_status_codes.rb
Created May 9, 2012 14:49 — forked from mipearson/nginx_status_codes.rb
Very simple munin plugin to graph nginx HTTP error codes
#!/usr/bin/env ruby
CODES = {
'400' => 'Bad Request',
'401' => 'Unauthorized',
'403' => 'Forbidden',
'404' => 'Not Found',
'405' => 'Method Not Allowed',
'406' => 'Not Acceptable',
'408' => 'Request Timeout',
@viniciusdaniel
viniciusdaniel / resque_active_workers.rb
Created May 4, 2012 23:11
munin plugin for show active resque workers
#!/usr/bin/env ruby
# Description: Show number of workers active by queue based on "https://gist.github.com/1334470"
# Source: https://gist.github.com/2598272
#
require 'rubygems'
require 'resque'
HOST = ENV['host'] ? ENV['host'] : '127.0.0.1'
PORT = ENV['port'] ? ENV['port'] : '6379'
@viniciusdaniel
viniciusdaniel / resque_workers.rb
Created May 4, 2012 23:06
munin plugin for show resque workers
#!/usr/bin/env ruby
# Description: Show number of workers by server based on "https://gist.github.com/1334470"
# Source: https://gist.github.com/2598254
#
require 'rubygems'
require 'resque'
HOST = ENV['host'] ? ENV['host'] : '127.0.0.1'
PORT = ENV['port'] ? ENV['port'] : '6379'