Skip to content

Instantly share code, notes, and snippets.

@zernel
zernel / .gvimrc
Last active November 26, 2015 08:28
My vim config with Neobundle
"set colortheme
"colorscheme autumn
"colorscheme blackboard
colorscheme asu1dark
" 启动gvim时窗口的大小
set lines=42 columns=170
" set font
@zernel
zernel / .zshrc
Created September 18, 2015 02:52
ZSH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@zernel
zernel / surge.conf
Created November 30, 2015 08:28
Surge Config Sample
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114
loglevel = notify
[Proxy]
Proxy = custom,hk2.iss.tf,8989,aes-256-cfb,40997300,http://surge.pm/ss.module
[Rule]
@zernel
zernel / surge.conf
Created June 30, 2016 06:39
📦 Surge 安装步骤导览 | http://bit.ly/292EJz3
# 规则配置仅供参考,适用于 Surge iOS & Mac;
# 包含 Proxy Group、URL Rewrite 特性
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计
# 屏蔽 Hao123、百度联盟广告以及部分运营商网页漂浮广告
# 部分特性可能仅适用于最新的 TestFlight 版本
[General]
# warning, notify, info, verbose
loglevel = notify
ipv6 = true
# Why do we need KudeURI? Because the URI.join method doing something stupid:
#
# URI.join('http://example.com/subpath', 'hello', '?token=secret')
# => “http://example.com/hello?token=secret”
#
# But what I expected is “http://example.com/subpath/hello?token=secret", the subpath is gone.
# By using SmartURI, you can handle the case above gracefully:
#
# SmartURI.join('http://example.com/subpath', 'hello', query: { token: secret })
# => "http://example.com/subpath/hello?token=secret"
@zernel
zernel / Caddyfile
Created November 17, 2017 09:21
Rails Deployment (Puma + Nginx/Cathy)
https://domain {
gzip
root /apps/app/public
log dev.access.log
proxy / unix:///apps/app/tmp/sockets/puma.sock {
fail_timeout 300s
transparent
header_upstream X-Forwarded-Ssl on
except /assets /fonts /robots.txt /favicon.ico /404.html /422.html /500.html
@zernel
zernel / Caddyfile
Created November 18, 2017 01:35 — forked from bendo01/Caddyfile
Caddy Web Server As Service on Centos 7
#cd /etc/caddy/Caddyfile
example.com {
root /usr/share/nginx/html
gzip
log /var/log/caddy/access.log
#fastcgi / unix:/var/run/php-fpm/php-fpm.sock php # Fast CGI php interpreter
#fastcgi / fastcgi / 127.0.0.1:9000 php # Fast CGI php interpreter
#using with laravel
fastcgi / unix:/var/run/php-fpm/php-fpm.sock php {
index index.php
@zernel
zernel / install.sh
Last active March 6, 2018 05:52 — forked from chuyik/install.sh
Bandwagon(搬瓦工) CentOS 7 安装 shadowsocks-libev 和 kcptun
######################
## shadowsocks-libev
######################
# install dependencies
yum install epel-release -y
yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y
# install shadowsocks-libev
cd /etc/yum.repos.d/
@zernel
zernel / rails-puma.conf
Last active July 3, 2018 08:23
Nginx Conf
upstream my_app {
# server unix:///apps/my_app/tmp/sockets/puma.sock fail_timeout=0;
server unix:///apps/my_app/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name my_appms.example.com;
root /apps/my_app/public;
@zernel
zernel / psql-with-gzip-cheatsheet.sh
Created August 18, 2018 03:00 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database