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
# 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" |
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
# 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' |