Skip to content

Instantly share code, notes, and snippets.

@johnf
johnf / gist:1496601
Created December 19, 2011 10:49
new relic example
require 'newrelic_rpm'
# https://support.newrelic.com/help/discussions/support/7631-not-seeing-database-data
NewRelic::Agent.add_instrumentation(File.join(Gem.loaded_specs['newrelic_rpm'].full_gem_path, "lib/new_relic/agent/instrumentation/rails3/active_record_instrumentation.rb"))
# From lib/new_relic/agent/instrumentation/rails3/active_record_instrumentation.rb
require 'new_relic/agent/instrumentation/rails3/active_record_instrumentation'
ActiveRecord::ConnectionAdapters::AbstractAdapter.module_eval do
include ::NewRelic::Agent::Instrumentation::ActiveRecordInstrumentation
end
ActiveRecord::Base.class_eval do
@johnf
johnf / gist:1496171
Created December 19, 2011 08:57
php-fastcgi
# php-fastcgi - Manages php5-cgi in FastCGI mode
description "Manage a PHP FastCGI process"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
env PHP_FCGI_CHILDREN=8
@johnf
johnf / gist:1363386
Created November 14, 2011 06:32
Pass argc to exec
#include <unistd.h>
int main(int argc, char *argv[]) {
execv("/bin/ls", argv);
}
// A
enum _foo_type {
FOO
};
typedef enum _foo_type foo_type;
// B
typedef enum {
BAR
[user]
name = John Ferlito
email = [email protected]
[color]
branch = auto
diff = auto
interactive = auto
ui = true
pager = true
<VirtualHost *:80>
ServerName mail.inodes.org
RewriteEngine On
RewriteRule ^/(.*) https://mail.inodes.org/
</VirtualHost>
<VirtualHost 192.168.223.31:443>
ServerName mail.inodes.org