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
# Request Limiter checking multiple values with small footprint | |
# if referer is not set | |
map $http_referer $limit_referer { | |
default ""; | |
"" "1"; | |
"-" "1"; | |
} | |
# if custom parameter is not set. i.e. you always expect urls like "/tracker?campaignid=1234" |
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
#!/usr/bin/env python | |
import redis | |
import statsd | |
import time | |
import argparse | |
import logging | |
import sys | |
import os |
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
echo "deb http://nginx.org/packages/ubuntu/ precise nginx" > /etc/apt/sources.list.d/nginx.list | |
echo "deb-src http://nginx.org/packages/ubuntu/ precise nginx" >> /etc/apt/sources.list.d/nginx.list | |
wget -O - http://nginx.org/keys/nginx_signing.key | apt-key add - | |
apt-get update | |
cd /usr/local/src | |
apt-get install build-essential libpcre3-dev zlib1g-dev libssl-dev | |
apt-get source nginx | |
wget http://naxsi.googlecode.com/files/naxsi-core-0.48.tgz | |
tar -xvzf naxsi-core-0.48.tgz | |
cd nginx-1.2.4/ |
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
description "Unicorn" | |
# starting unicorn with bundler, and a user contained rvm: | |
start on filesystem or runlevel [2345] | |
stop on runlevel [!2345] | |
chdir /path/to/current |
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
if($xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadsBusy'} && | |
$xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadCount'}) { | |
print "busy.value " . $xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadsBusy'} . "\n"; | |
print "idle.value " . | |
($xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadCount'} - | |
$xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadsBusy'}) . "\n"; | |
} else { | |
print "busy.value U\n"; | |
print "idle.value U\n"; | |
} |
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
# set max_body_size and http_basic_auth in your nginx config | |
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
"none ya business" | |
end | |
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
description "Tomcat Server" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 10 5 | |
# run as non privileged user | |
# add user with this command: | |
## adduser --system --ingroup www-data --home /opt/apache-tomcat apache-tomcat |