Skip to content

Instantly share code, notes, and snippets.

View mickey's full-sized avatar

Michael Bensoussan mickey

View GitHub Profile
---
layout: post
title: "Monitoring Apache with Bluepill"
---
h1. {{ page.title }}
p(meta). 22 December 2009
I always used "god":http://god.rubyforge.org/ to monitor my processes. god is working fine, has a lot of features and is very easy to use, but has some serious "memory":http://groups.google.com/group/god-rb/browse_thread/thread/1cca2b7c4a581c2/69f69f602add7636?lnk=gst&q=memory+leak#69f69f602add7636 leaks. To handle this problem I usually set-up a cron to restart god every day.
class Activity < ActiveRecord::Base
belongs_to :user
belongs_to :target, :polymorphic => true
#validates_presence_of :user, :activity_type, :target
AUDITION_POSTED = 1 #target --> audition
AUDITION_FEEDBACK_UPDATED = 2 #target --> audition
AUDITION_VIEWED = 3 #target --> video
NEW_PART = 4 #target --> part
rak -k "^.*(tmp|plugin|spec).*$" store_and_encode
>> Part.find("980950747").auditions.count
=> 16
>> Part.find("980950747").auditions.good
=> []
>> Part.find("980950747").auditions.good.count
=> 17
>> Part.find("980950747").auditions.length
=> 16
>> Part.find("980950747").auditions.good
#HAML
- @casting_call.ambiance_images.each do |i|
%span.ambiance_images
= link_to(image_tag(i.image.url(:mini, :size => '60x60')), i.image.url(:original), :rel => "ambiance")
# JAVASCRIPT
$(function() {
if ($("a[rel='ambiance']").length > 0) {
HOME_PATH = File.expand_path(File.dirname(__FILE__) + '/..')
Bluepill.application("revelatr_#{ENV["RAILS_ENV"]}") do |app|
app.process("delayed_job_#{ENV["RAILS_ENV"]}") do |process|
process.working_dir = HOME_PATH
process.start_grace_time = 10.seconds
process.stop_grace_time = 10.seconds
process.restart_grace_time = 10.seconds
broadcastings = Broadcasting.find(:all, :conditions => ["airingdate <= NOW() and DATE_ADD(airingdate, INTERVAL duration MINUTE) >= NOW()"], :include => [:show, :channel])
broadcastings = Broadcasting.find(:all, :conditions => ["airingdate <= ? and airingdate >= ?", now, now - 4.hours], :include => [:show, :channel])
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/ettercap-ng/0.7.3 --mandir=/usr/local/Cellar/ettercap-ng/0.7.3/share/man --infodir=/usr/local/Cellar/ettercap-ng/0.7.3/share/info --disable-gtk --disable-plugins --with-openssl=/usr --with-libpcap=/usr --with-libncurses=/usr --with-libpcre=/usr/local --with-libnet=/usr/local
## --------- ##
## Platform. ##
HOMEBREW_VERSION: 0.8
HEAD: e148c2ff95bb5dfa06a926a5bd49035cc3aafe8c
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.6.6
Kernel Architecture: i386
Ruby: 1.8.7-174
HOMEBREW_VERSION: 0.8
HEAD: e148c2ff95bb5dfa06a926a5bd49035cc3aafe8c
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.6.6
Kernel Architecture: i386
Ruby: 1.8.7-174