Skip to content

Instantly share code, notes, and snippets.

@toritori0318
toritori0318 / isucon4_lapis_recipe.rb
Last active September 26, 2022 18:21
isucon4 Lapis版 Itamaeレシピ
# 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 / nginx_for_production.conf
Last active December 29, 2021 19:04
nginx balancer example
worker_processes 1;
daemon off;
error_log /dev/stdout;
events {
worker_connections 1024;
}
http {
@toritori0318
toritori0318 / install.sh
Created September 12, 2016 16:25
tsung install for amazon linux
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
@toritori0318
toritori0318 / redis-benchmark.txt
Created January 9, 2018 16:56
redis-benchmark: 4.9.58-18.55.amzn1.x86_64: c4.large: redis-2.8.24
$ 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 January 9, 2018 16:05
redis-benchmark: 4.9.75-25.55.amzn1.x86_64: c4.large: redis-2.8.24
$ 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 April 9, 2017 09:49
request_id 引き回し
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 / autoscale_template.json
Last active July 5, 2016 14:36
AutoScaleのCloudFormationのサンプル
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template AutoScalingKeepAtNSample: Create a load balanced, Auto Scaled sample website. This example creates an Auto Scaling group behind a load balancer with a simple health check using a basic getting start AMI that has a simple Apache Web Server-based PHP page. The web site is available on port 80, however, the instances can be configured to listen on any port (8888 by default). **WARNING** This template creates one or more Amazon EC2 instances and an Elastic Load Balancer. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"InstanceType" : {
"Description" : "WebServer EC2 instance type",
"Type" : "String",
"Default" : "m1.small",
@toritori0318
toritori0318 / setup_drone_gitlab.sh
Last active March 27, 2016 13:56
Docker+Drone+Gitlabを一発で構築するスクリプト
#!/bin/sh
set -x
GITLAB_URL='http://ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com:81'
# docker
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y docker.io
@toritori0318
toritori0318 / Vagrantfile
Last active December 22, 2015 15:49
vagrant provision test
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'pp'
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos"
config.vm.network :forwarded_port, guest: 80, host: 8888
config.vm.network :private_network, ip: "192.168.33.10"
@toritori0318
toritori0318 / pb_redis_ver2.pl
Created September 5, 2013 17:32
Parallel::Benchmark + RedisDB
use strict;
use warnings;
use Data::Dumper;
use Parallel::Benchmark;
use RedisDB;
use String::Random;
my $host = shift || 'localhost';
my $port = shift || '6379';