Skip to content

Instantly share code, notes, and snippets.

Tsuyoshi Torii toritori0318

Block or report user

Report or block toritori0318

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@toritori0318
toritori0318 / redis-benchmark.txt
Created Jan 9, 2018
redis-benchmark: 4.9.58-18.55.amzn1.x86_64: c4.large: redis-2.8.24
View redis-benchmark.txt
$ redis-cli -n 1 flushdb
###############################################################################################
$ redis-benchmark --dbnum 1
====== PING_INLINE ======
100000 requests completed in 0.78 seconds
50 parallel clients
3 bytes payload
keep alive: 1
@toritori0318
toritori0318 / redis-benchmark.txt
Last active Jan 9, 2018
redis-benchmark: 4.9.75-25.55.amzn1.x86_64: c4.large: redis-2.8.24
View redis-benchmark.txt
$ redis-cli flushall
OK
##############################################################################################
$ redis-benchmark
====== PING_INLINE ======
100000 requests completed in 0.93 seconds
50 parallel clients
3 bytes payload
keep alive: 1
@toritori0318
toritori0318 / nginx.conf
Last active Apr 9, 2017
request_id 引き回し
View nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$_request_id"';
@toritori0318
toritori0318 / install.sh
Created Sep 12, 2016
tsung install for amazon linux
View install.sh
yum update -y
yum groupinstall -y "Development Tools"
yum install -y erlang perl perl-devel perl-Template-Toolkit openssl-devel
git clone https://github.com/processone/tsung
cd tsung
./configure && make && make install
View nginx_for_production.conf
worker_processes 1;
daemon off;
error_log /dev/stdout;
events {
worker_connections 1024;
}
http {
@toritori0318
toritori0318 / watch_event_consul.sh
Created Dec 8, 2015
Consulからイベント受け取ってItamae実行とか
View watch_event_consul.sh
#!/bin/sh
if [ ! -p /dev/stdin ] ; then
exit 0
fi
VM=""
RECIPE=""
# 標準入力から受け取り
STDIN_STR=$(cat -)
PAYLOAD=`echo $STDIN_STR | jq -r '.[0] .Payload' | base64 -d`
@toritori0318
toritori0318 / define.rb
Created Feb 14, 2015
こんな風に書きたい
View define.rb
define :install_and_enable_package, version: nil do
# install
action :install, :default do
package params[:name] do
version params[:version] if params[:version]
action :install
end
service params[:name] do
action :enable
end
@toritori0318
toritori0318 / entrypoint.rb
Last active Aug 29, 2015
itamae define再定義問題
View entrypoint.rb
include_recipe "./recipe1.rb"
include_recipe "./recipe2.rb"
@toritori0318
toritori0318 / isucon4_lapis_recipe.rb
Last active Aug 29, 2015
isucon4 Lapis版 Itamaeレシピ
View isucon4_lapis_recipe.rb
# attributes
pcre_version='8.36'
openresty_version='1.7.7.1'
openresty_prefix='/opt/openresty'
luarocks_version='2.0.13'
########################################
# iscon bashrc
execute "add bashrc" do
command <<-"EOH"
@toritori0318
toritori0318 / install.sh
Last active Aug 29, 2015
openresty install
View install.sh
PCRE_VERSION=8.36
OPENRESTY_VERSION=1.7.7.1
LUAROCKS_VERSION=2.2.0
# depends
sudo yum install -y openssl-devel
# pcre
cd /tmp
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PCRE_VERSION}.tar.gz
You can’t perform that action at this time.