Skip to content

Instantly share code, notes, and snippets.

@riywo
riywo / nginx.conf
Created January 18, 2012 18:29
nginxでURIの先頭使ってbackend serverのportを決める
http {
map $uri $backend_port {
include port_map;
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
server {
@riywo
riywo / gist:836630
Created February 21, 2011 03:41
指定秒間だけtcpdumpしてmk-query-digestするshell
#!/bin/sh
SEC=$1
tcpdump -s 65535 -nn -q -tttt -x port 3306 -l > /tmp/tcpdump.3306 2> /dev/null &
PID_3306=$!
tcpdump -s 65535 -nn -q -tttt -x port 11211 -l > /tmp/tcpdump.11211 2> /dev/null &
PID_11211=$!
my $spf_server = Mail::SPF::Server->new;
my $request = Mail::SPF::Request->new(
versions => [1,2],
scope => 'mfrom',
identity => $self->from,
ip_address => $ip,
);
my $result = $spf_server->process($request);
$result->is_code('pass');
@sonots
sonots / why-run.md
Last active August 29, 2015 14:06
why-run でテストできない事象はあるのか

結論:みあたらないので誰か