Skip to content

Instantly share code, notes, and snippets.

@ijin
ijin / svfes201311_sysctl.conf
Created December 13, 2013 08:19
Server Festa 2013 Autumn base kernel tuning
fs.file-max = 1048576
net.ipv4.ip_local_port_range = 1024 65535
net.core.wmem_max = 16777216
net.core.rmem_max = 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
@ijin
ijin / svfes201311_base_nginx.conf
Last active December 31, 2015 05:29
svfes201311_base_nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
@ijin
ijin / svfes201311_base_supervisord.conf
Created December 13, 2013 07:44
Server Festa 2013 Autumn base supervisord.conf
[program:syncer]
command=/home/mho/.rvm/bin/ruby /home/mho/syncer/sync.rb 5
stdout_logfile_maxbytes=1MB
stderr_logfile_maxbytes=1MB
stdout_logfile=/tmp/%(program_name)s-stdout.log
stderr_logfile=/tmp/%(program_name)s-stderr.log
user=mho
directory=/home/mho/syncer
autostart=true
autorestart=true
@ijin
ijin / svfes201311_base_sync.rb
Last active December 31, 2015 05:29
Server Festa 2013 Autumn base syncer
require 'mysql2'
require 'dalli'
require 'connection_pool'
$stdout.sync = true
unless ARGV[0]
puts "Usage: sync.rb PAGE_ID"
exit 1
end
@ijin
ijin / svfes201311_base_my.cnf
Created December 13, 2013 07:40
Server Festa 2013 Autumn base my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server = utf8
max_connections = 1000
key_buffer_size = 32M
@ijin
ijin / svfes201311_backend_default.vcl
Last active December 31, 2015 05:29
Server Festa 2013 Autumn backend Varnish default.vcl
import std;
import memcached;
import curl;
import parsereq;
import throttle;
import header;
backend default {
.host = "127.0.0.1";
.port = "8080";
@ijin
ijin / svfes201311_backend_nginx.conf
Last active December 31, 2015 05:29
Server Festa 2013 Autumn backend nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@ijin
ijin / nginx.sh
Created November 24, 2013 05:30
openresty nginx init script for centos 6
#!/bin/sh
#
# nginx Startup script for nginx (openresty)
#
# chkconfig: - 85 15
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid
# description: nginx is an HTTP and reverse proxy server
@ijin
ijin / mha_vip
Created June 27, 2013 09:54
heartbeat IPAddr2 modified to stop MySQL, for MHA
#!/bin/sh
#
# $Id: IPaddr2.in,v 1.24 2006/08/09 13:01:54 lars Exp $
#
# OCF Resource Agent compliant IPaddr2 script.
#
# (Modified for MHA)
#
# Based on work by Tuomo Soini, ported to the OCF RA API by Lars
# Marowsky-Br�e. Implements Cluster Alias IP functionality too.
######################################
# usage
# mylogin_dumper.pl ~/.mylogin.conf
######################################
use strict;
use warnings;
use Crypt::ECB;
#use Crypt::OpenSSL::AES;
my $my_login_file = shift;