Skip to content

Instantly share code, notes, and snippets.

View bootjp's full-sized avatar
🏠
Working from home

Yoshiaki Ueda (bootjp) bootjp

🏠
Working from home
View GitHub Profile
@bootjp
bootjp / setup_nginx_php-fpm_memcached.sh
Last active August 29, 2015 14:06
CentOS6 自動セットアップ Nginx MySQL php-fpm memcached
#!/bin/bash
# CentOS6 Auto Install Nginx MySQL PHP-FPM memcached and iptables setting
# Argument is "YoursiteDomain"
# Use ex. ./startup.sh example.com
if [ $# -ne 1 ]; then
echo "argument is missing"
exit 1
fi
@bootjp
bootjp / head.html
Last active August 29, 2015 14:06
OGPとTwitterCardとGoogleとかその辺のまとめ
<!--OGP-->
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
<meta property="og:type" content="article" />
<meta property="og:title" content="タイトル" />
<meta property="og:description" content="要約" />
<meta property="og:image" content="http://example.com/foo.png" />
<meta property="og:site_name" content="タイトル" />
<meta property="og:url" content="http://example.com/hogehoge/" />
<!--Twitter Card-->
<meta property="twitter:card" content="summary" />
@bootjp
bootjp / OAuth.php
Last active August 29, 2015 14:07
OAuth.php SSLの時のエラー暫定対応
<?php
$port = @$parts['port'] = 443; // At iLne 383
?>
@bootjp
bootjp / nginx.conf
Last active August 29, 2015 14:07
NginxでSSLの時
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/ssl/certs/hogehoge;
ssl_certificate_key /etc/ssl/certs/hogehoge;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
}
@bootjp
bootjp / nginx.conf
Last active August 29, 2015 14:07
NginxでProxyかませるとき
location /foo/bar/ {
root /hoge/;
proxy_pass http://example.com/foo/bar/;
proxy_cache_valid 200 302 60m;
expires 7d;
}
@bootjp
bootjp / nginx.conf
Created September 29, 2014 13:11
NginxでPHP-FPMな時
location ~ \.php$ {
root /hoge/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
@bootjp
bootjp / nginx.conf
Created September 30, 2014 04:53
Nginxのブラウザキャッシュ
if ($request_uri ~* "(png|jpg$|css|js)") {
expires 7d;
break;
}
@bootjp
bootjp / sysctl.conf
Last active August 29, 2015 14:07
overcommit_memory防止
#/etc/sysctl.conf
kernel.panic=15
vm.overcommit_memory=2
#Source:http://passingloop.tumblr.com/post/11957331420/overcommit-and-oom-killer
@bootjp
bootjp / ulimit -a
Created September 30, 2014 09:51
ulimit -a メモ
[root@hoge ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63896
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
@bootjp
bootjp / mem_clean.sh
Last active August 29, 2015 14:11
CentOS5 , メモリー解放シェルスクリプト
#!/bin/bash
echo 3 > /proc/sys/vm/drop_caches;
echo 0 > /proc/sys/vm/drop_caches;
#cronで回せばいいんじゃないかな?