Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# nginx – this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# pidfile: /opt/nginx/logs/nginx.pid
@ankion
ankion / default.custom.yaml
Created December 28, 2013 07:03
鼠鬚管 Squirrel 設定檔
patch:
schema_list:
- schema: boshiamy_t # 嘸蝦米中文模式
- schema: boshiamy_j # 嘸蝦米日文模式
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
ascii_composer:
good_old_caps_lock: true
@ankion
ankion / squirrel.yaml
Created December 28, 2013 07:05
鼠鬚管 Squirrel 設定檔
# Squirrel settings
# encoding: utf-8
config_version: "0.22"
us_keyboard_layout: false
# for veteran chord-typist
chord_duration: 0.1 # seconds
@ankion
ankion / nginx-unicorn-config
Last active August 29, 2015 14:02
sample for nginx with unicorn
upstream [project name]_unicorn_socket {
server unix:/home/deploy/[project name]/shared/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name 192.168.3.103;
root /home/deploy/[project name]/current/public;
client_max_body_size 5M;
@ankion
ankion / debian_basic_command.md
Created June 20, 2014 06:41
Debian basic command

修改預設的編輯器

sudo update-alternatives --config editor
@ankion
ankion / sources.list
Created July 10, 2014 02:28
Ubuntu 12.04 LTS Sources list
#
# deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release i386 (20120424.1)]/ precise main restricted
#deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release i386 (20120424.1)]/ precise main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://tw.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ precise main restricted
@ankion
ankion / gist:a4f4a0c8b1942e202017
Last active August 29, 2015 14:03
mysql notes
$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)
@ankion
ankion / AutoPasteMode.vim
Created December 16, 2014 01:53
Auto Paste Mode
if &term =~ "xterm.*"
let &t_ti = &t_ti . "\e[?2004h"
let &t_te = "\e[?2004l" . &t_te
function XTermPasteBegin(ret)
set pastetoggle=<Esc>[201~
set paste
return a:ret
endfunction
map <expr> <Esc>[200~ XTermPasteBegin("i")
imap <expr> <Esc>[200~ XTermPasteBegin("")
#!/bin/bash
# install xcode command tool
xcode-select --install
# check
xcode-select -p
# install brew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# check brew
@ankion
ankion / gist:fb152542d887391c9b6d
Last active August 29, 2015 14:24
Qnap install flexget
#Upgrade
/opt/local/bin/pip2.7 install --upgrade flexget
#IOError: [Errno 28] No space left on device
mount -o remount,size=64M /tmp