This file contains hidden or 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
#!/bin/bash | |
# Update all repositories in ~/code | |
# Keep in ~/bin | |
trap "exit" INT | |
for dir in ~/code/* ; do | |
if [ -d $dir/.svn ] ; then | |
echo "Updating `basename $dir` (svn)" | |
svn update $dir | |
elif [ -d $dir/.git ] ; then | |
echo "Updating `basename $dir` (git)" |
This file contains hidden or 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
#!/usr/bin/perl | |
# Delete inactive log files. | |
use strict; | |
use warnings; | |
my $dir = '/opt/tomcat6/logs'; | |
# Files which are open | |
my %open; |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Take advantage of environments where Subversion server also NFS exports /home to make more efficient Subversion operations. | |
require 'net/ssh' | |
server = "admin01" | |
temporary_root = "file:///srv/svn" | |
pwd = ENV["PWD"] | |
user = ENV["USER"] | |
remote_command = "cd #{pwd} && svn " + ARGV.join(" ") | |
lock_file = ".qsvn_lock" |
This file contains hidden or 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
/* | |
* Add X-Request-Start header so we can track queue times in New Relic RPM beginning at Varnish. | |
* | |
*/ | |
#include <sys/time.h> | |
struct timeval detail_time; | |
gettimeofday(&detail_time,NULL); | |
char start[20]; |
This file contains hidden or 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
sub vcl_recv { | |
if (req.url == "/crossdomain.xml") { | |
error 843 "OK"; | |
} | |
/* ... */ | |
} | |
sub vcl_error { | |
if (obj.status == 843) { | |
set obj.status = 200; |
This file contains hidden or 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
sub vcl_recv { | |
if (req.url == "/crossdomain.xml") { | |
error 843 "OK"; | |
} | |
} | |
sub vcl_error { | |
if (obj.status == 843) { | |
set obj.status = 200; | |
set obj.http.Content-Type = "application/xml; charset=utf-8"; |
This file contains hidden or 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
>> test_email | |
=> {:body=>"test body", :subject=>"test subject", :authentication=>:plain, :domain=>"heroku.com", :address=>"smtp.sendgrid.net", :from=>"[email protected]", :user_name=>"[email protected]", :port=>25, :to=>"[email protected]", :password=>"XXXXXXXXXXXXXXX"} | |
>> Pony.mail(test_email) | |
=> #<Mail::Message:23867391363740, Multipart: false, Headers: <Date: Tue, 02 Nov 2010 13:26:22 -0700>, <From: [email protected]>, <To: [email protected]>, <Message-ID: <[email protected]>>, <Subject: test subject>, <Mime-Version: 1.0>, <Content-Type: text/plain>, <Content-Transfer-Encoding: 7bit>> | |
>> |
This file contains hidden or 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
sub vcl_recv { | |
if (req.http.Cookie) { | |
set req.http.Cookie = regsuball(req.http.Cookie, "(^|; ) *__utm.=[^;]+;? *", "\1"); | |
if (req.http.Cookie == "") { | |
remove req.http.Cookie; | |
} | |
} |
This file contains hidden or 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
class PingdomController < ActionController::Base | |
def check | |
ActiveRecord::Base.connection.select_value("SELECT 1") | |
Delayed::Job.enqueue( MyUrgentTask.new ) | |
render :xml => { :status => :ok } | |
end | |
end |
This file contains hidden or 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
global | |
description prod | |
maxconn 7777 # About 54k per connection; 400MB free on this machine. | |
stats socket /var/run/haproxy.stat mode 600 level admin | |
user haproxy | |
group haproxy | |
defaults | |
mode http | |
maxconn 7700 # Should be slightly smaller than global.maxconn. |
OlderNewer