Skip to content

Instantly share code, notes, and snippets.

shell /bin/bash
escape ^t^t
startup_message off
vbell off
defkanji utf-8
msgwait 1
defscrollback 10000
autodetach on
@saitodev
saitodev / start-ssh-agent.bat
Last active December 21, 2015 15:29
This batch file start 'ssh-agent' and set environment variables. Put this file to your startup folder.
C:\cygwin\bin\bash.exe -c "/usr/bin/ssh-agent | /usr/bin/sed -e '/echo/d' | /usr/bin/cut -f 1 -d ';' | /usr/bin/tr '=' ' ' | while read line; do setx.exe $line; done;"
user nginx;
worker_processes 1;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
#!/bin/sh
# -*- coding: utf-8 -*-
IPTABLES=/sbin/iptables
SERVICE=/sbin/service
SSH_PORT=22
$IPTABLES -F # すべてのチェインの内容を削除
$IPTABLES -P INPUT ACCEPT # INPUTチェインのポリシーをACCEPTにする
@saitodev
saitodev / post-receive
Last active December 21, 2015 04:18
git post-receive example implemented in python.
#!/usr/local/bin/python
# -*- coding: utf-8; mode: python -*-
import os
import os.path
import sys
import subprocess
WORK_DIR = '/path/to/work/dir'
GIT_DIR = os.path.join(WORK_DIR, '.git')
export PS1="-- \[\033[0;31m\]\u@\h \[\033[1;34m\]\w \[\033[0m\]-- \n> "
alias ls='ls -hF --color=tty'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias less='less -r' # raw control characters
alias grep='grep --color' # show differences in colourx
alias ll='ls -l -A' # long list
alias la='ls -A' # all but . and ..
;[unix_http_server]
;file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; socket file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
[inet_http_server] ; inet (TCP) server disabled by default
port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
username=admin ; (default is no username (open server))
[ -e /tmp/work/memcached ] || mkdir -p /tmp/work/memcached
cd /tmp/work/memcached
# ユーザーの作成
sudo /usr/sbin/useradd -s /sbin/nologin -d /var/run/memcached -M memcached
sudo mkdir /var/run/memcached
sudo chown memcached.memcached /var/run/memcached
# memcachedのビルド
wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
[ -e /tmp/work/nginx ] || mkdir -p /tmp/work/nginx
cd /tmp/work/nginx
# ユーザーの作成
sudo /usr/sbin/useradd -s /sbin/nologin -d /var/lib/nginx -c "Nginx web server" -M nginx
# nginxのダウンロードとビルド
wget http://nginx.org/download/nginx-1.4.3.tar.gz
tar zxf nginx-1.4.3.tar.gz
cd nginx-1.4.3
@saitodev
saitodev / setup_iptables.sh
Created August 13, 2013 03:45
iptables example
#!/bin/sh
# -*- coding: utf-8 -*-
IPTABLES=/sbin/iptables
SERVICE=/sbin/service
SSH_PORT=22
$IPTABLES -F # すべてのチェインの内容を削除
$IPTABLES -P INPUT ACCEPT # INPUTチェインのポリシーをACCEPTにする