Skip to content

Instantly share code, notes, and snippets.

View Vaduz's full-sized avatar

Satoru Yoshihara Vaduz

View GitHub Profile
@Vaduz
Vaduz / gist:7611302
Created November 23, 2013 05:50
Private IP detection
['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16'].any? {|range| IPAddr.new(range).include?(ip)}
@Vaduz
Vaduz / mime.types
Created November 23, 2013 06:11
Add JSON Content-Type to nginx
application/json json;
charset UTF-8;
charset_types application/json;
@Vaduz
Vaduz / gist:7611419
Last active December 29, 2015 03:59
Using rbenv on crontab
# ~/.bashrc
export PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"
# crontab
. $HOME/.bashrc; /path/to/ruby_script.rb
@Vaduz
Vaduz / ssh_config
Created November 23, 2013 06:17
Using Kerberos auth only specified domain
Host *
GSSAPIAuthentication no
Host *.your-kerberos-auth-domain.com
GSSAPIAuthentication yes
@Vaduz
Vaduz / gist:7611819
Last active December 29, 2015 03:59
custom css for "Attitude"
html, body, .entry-title {
font-family: 'Trebuchet MS', 'Arial', 'Helvetica', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', 'メイリオ', Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif;
}
body {
color: #454545;
}
#site-title {
font-family: 'Verdana', 'Arial';
@Vaduz
Vaduz / gist:7612492
Created November 23, 2013 09:12
apc.stat=0
Server Software: nginx
Server Hostname: blog.vaduz.tk
Server Port: 80
Document Path: /
Document Length: 19762 bytes
Concurrency Level: 10
Time taken for tests: 58.115 seconds
Complete requests: 1000
@Vaduz
Vaduz / gist:7612552
Created November 23, 2013 09:21
Installed "001 Prime Strategy Translate Accelerator"
Server Software: nginx
Server Hostname: blog.vaduz.tk
Server Port: 80
Document Path: /
Document Length: 19762 bytes
Concurrency Level: 10
Time taken for tests: 50.411 seconds
Complete requests: 1000
@Vaduz
Vaduz / gist:7612596
Last active December 29, 2015 04:09
Installed "Quick Cache" #1
Server Software: nginx
Server Hostname: blog.vaduz.tk
Server Port: 80
Document Path: /
Document Length: 19762 bytes
Concurrency Level: 10
Time taken for tests: 53.054 seconds
Complete requests: 1000
@Vaduz
Vaduz / gist:7612608
Created November 23, 2013 09:29
Installed "Quick Cache" #2
Server Software: nginx
Server Hostname: blog.vaduz.tk
Server Port: 80
Document Path: /
Document Length: 19762 bytes
Concurrency Level: 10
Time taken for tests: 48.410 seconds
Complete requests: 1000