Skip to content

Instantly share code, notes, and snippets.

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

Pahud Hsieh pahud

🏠
Working from home
View GitHub Profile
@pahud
pahud / tencentyun.sources.list
Created April 10, 2015 06:27
sources.list for Ubuntu-Server on TencentYun
#
#deb [Ubuntu-Server 10.04.4 LTS _trusty Lynx_ - Release amd64 (20120214.2)]/ lucid main restricted
deb-src http://mirrors.tencentyun.com/ubuntu trusty main restricted
deb-src http://mirrors.tencentyun.com/ubuntu trusty universe
deb-src http://mirrors.tencentyun.com/ubuntu trusty multiverse
deb-src http://mirrors.tencentyun.com/ubuntu trusty-updates main restricted
deb-src http://mirrors.tencentyun.com/ubuntu trusty-updates universe
deb-src http://mirrors.tencentyun.com/ubuntu trusty-updates multiverse
deb http://mirrors.tencentyun.com/ubuntu trusty main restricted
deb http://mirrors.tencentyun.com/ubuntu trusty universe
@pahud
pahud / upyun.nginx.conf
Last active August 29, 2015 14:19
nginx.conf from UPYUN
server {
listen 443 ssl spdy;
server_name upyun.com;
ssl_certificate upyun.com.pem;
ssl_certificate_key upyun.com.key;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
@pahud
pahud / download_ssl_cert.sh
Created April 12, 2015 09:25
download SSL certificate from the HTTPS server
echo -n | openssl s_client -connect <HTTPS_HOSTNAME>:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
@pahud
pahud / shadowsocks-python.md
Last active August 29, 2015 14:19
Run shadowsocks on port 8888 with password 1234
$ docker run -d -p 8888:8888 pahud/shadowsocks-python -s 0.0.0.0 -p 8888 -k 1234 -m aes-256-cfb --workers 5
@pahud
pahud / ubuntu_install_docker.sh
Last active August 29, 2015 14:19
install docker on ubuntu Trusty 14.04
#!/bin/bash
apt-get update
apt-get install -y linux-image-generic-lts-trusty
wget -qO- https://get.docker.com/ | sh
@pahud
pahud / daocloud.sh
Created April 16, 2015 05:54
daocloud for Ubuntu
echo "DOCKER_OPTS=\"\$DOCKER_OPTS --registry-mirror=http://49f8ef35.m.daocloud.io\"" | sudo tee -a /etc/default/docker
sudo service docker restart
@pahud
pahud / sysctl.conf.md
Created April 23, 2015 07:47
sysctl.conf tweaks
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024    65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
@pahud
pahud / cht_roaming.md
Last active August 29, 2015 14:19
中華電信國際漫遊

中華電信國際漫遊申請方式

##在國內

  • 手機撥打免付費「*135#」於互動式選單申請
  • 下載中華電信客服APP進行申請
  • 已持有中華電信月租型門號之客戶,可直接登入emome網站申請服務
  • 手機直撥800或市話撥0800-080-090 免付費客服專線洽詢
  • 至中華電信全區直營服務中心(不含特約服務中心)申請

##在國外

@pahud
pahud / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pahud
pahud / hmac_md5.lua
Created April 27, 2015 05:46
hmac_md5 by lua-resty-hmac
-- check https://github.com/jkeys089/lua-resty-hmac
local hmac = require "resty.hmac"
local hmac_md5 = hmac:new("secret_key", hmac.ALGOS.MD5)
local ok = hmac_md5:update("1234")
local mac = hmac_md5:final()
local str = require "resty.string"
ngx.say("hmac_md5: ", str.to_hex(mac))