Skip to content

Instantly share code, notes, and snippets.

View vitaliel's full-sized avatar

Vitalie Lazu vitaliel

  • Moldova, Chisinau
View GitHub Profile
@vitaliel
vitaliel / debug.rb
Created October 25, 2009 22:39 — forked from tmm1/debug.rb
# collect information about a running process
# ruby debug.rb <pid>
begin
raise ArgumentError unless pid = ARGV[0]
pid = pid.to_i
raise ArgumentError unless pid > 0
Process.kill(0,pid)
rescue TypeError, ArgumentError
raise 'pid required'
# Generate logrotate conf for rails sites deployed with capistrano
# it scans current directory for rails site, it assumes that webserver is passenger
# cd /u/apps && ~/bin/gen_logrotate.rb
require 'etc'
Dir['*'].each do |entry|
next unless File.directory? entry
dir = File.expand_path entry
log_dir = dir + "/shared/log"