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_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'
@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 / 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.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 / log_rotate
Created May 17, 2013 21:16
Exemplo de script de log rotate com script pos rotate
/omnilogic/retailcore/shared/log/*.log {
daily
missingok
rotate 0
compress
delaycompress
notifempty
copytruncate
sharedscripts
postrotate
@viniciusdaniel
viniciusdaniel / d3js.pt-br.js
Created October 29, 2014 23:01
D3.js localize pt-BR for time and number formatting
/**
* Configuração de localização em Português do Brasil(PT-BR) para o D3.js realizar formatação tempo e números
* Mais detalhes conferir a documentação: https://github.com/mbostock/d3/wiki/Time-Formatting
*/
var localized = d3.locale({
"decimal": ",",
"thousands": ".",
"grouping": [3],
"currency": ["R$", ""],
@viniciusdaniel
viniciusdaniel / generate-new-debug-keystore.sh
Last active January 13, 2016 20:47
Re-generate a debug.keystore file with defaults passwords and common name data, using SHA-2 and size of 2048bits
# If ~/.android/debug.keystore exists you need remove this previosly
keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keysize 2048 -keyalg RSA -sigalg SHA256withRSA -validity 30000 -dname "CN=Android Debug,O=Android,C=US"
ADOBE Creative Suite 5 Master Collection
1023-1631-3275-3276-0087-5426
1325-1576-4130-9475-8280-4266
1325-1548-7004-9142-5077-1912
1325-1684-1405-3432-6260-7438
1325-1238-0019-6636-5160-2146
1325-1966-4532-5397-9277-9204
@viniciusdaniel
viniciusdaniel / match.sh
Last active February 19, 2018 20:48
Regexp matches string and return only matched or group
# String matcher for shell
# author: Vinícius Daniel Antunes Oliveira <viniciusdaniel@gmail.com>
# license: MIT <https://opensource.org/licenses/MIT>
#
#!/bin/bash
# Usage:
# cat /tmp/file | match.sh <regexp> [group match]
# match.sh <filename> <regexp> [group match]
# match.sh <string> <regexp> [group match]
#
@viniciusdaniel
viniciusdaniel / 51-android.rules
Created January 30, 2017 14:13
Install Android Tools: ADB Fastboot on Ubuntu Linux
# /etc/udev/rules.d/51-android.rules
# udev rule to detect android devices
# These rules refer to http://developer.android.com/tools/device.html
# Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev"
# Archos
SUBSYSTEM=="usb", ATTR{idVendor}=="0e79", MODE="0666", GROUP="plugdev"
# Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"