Skip to content

Instantly share code, notes, and snippets.

@wisicn
wisicn / surge.conf
Created November 8, 2015 08:30 — forked from soffchen/surge.conf
surge.conf
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0/9, 119.0.
@wisicn
wisicn / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@wisicn
wisicn / user_rule.txt
Created March 22, 2015 01:57
user defined rule of gfwlist2pac
!this is a user defined rule
google.com
googlecode.com
twitter.com
youtube.com
cloudfront.net
erepublik.net
gmail.com
google.com.hk
googleapis.com
@wisicn
wisicn / enable-ntfs-write-os-x-yosemite.md
Last active November 12, 2015 18:49
Enable NTFS Write support on Mac OS X Yosemite with Homebrew and Homebrew Cask

Last update: 2015/01/17

1. install lastest Xcode with Mac App Store

2. check if we have Xcode Command Line Tools installed

xcode-select -p

if we do not have it, install it by

xcode-select --install
 

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

@wisicn
wisicn / rtorrent.sh
Last active August 29, 2015 14:07 — forked from wangyan/rtorrent.sh
#!/bin/sh
case "$1" in
start)
echo -n "Starting rtorrent"
su - root -c "screen -A -m -d -S rtorrent /usr/local/bin/rtorrent" &
echo "."
;;
stop)
echo -n "Stopping rtorrent"
@wisicn
wisicn / .rtorrent.rc
Last active August 29, 2015 14:07 — forked from wangyan/.rtorrent.rc
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# 每个种子所允许的最小最大连接数
#min_peers = 40
#max_peers = 100
# 同上,但仅针对已完成的种子(-1 表示与下载中的种子一致)
#min_peers_seed = 10
@wisicn
wisicn / fixBrew
Last active August 29, 2015 14:07 — forked from nmccready/fixBrew
#!/bin/sh
#reinstall everything you currently have in brew
for f in `brew list`; do
echo $f
brew uninstall $f && brew install $f
done
@wisicn
wisicn / swissarmy.txt
Last active May 21, 2022 12:20
my linux swiss army knife tools sed/grep/awk collection
#Deleting comment lines starting with a special symbol
sed '/^\#/d' myFile > output.txt
#delete empty lines with SED
sed '/^$/d' myFile > output.txt
#mv empty lines and comments lines together
sed '/^\#/d' myFile | sed '/^$/d' > output.txt
#To remove all leading whitespace (including tabs) from left to first word
sed -e 's/^[ \t]*//' myFile > output.txt
sed -e 's/^\s*//' myFile > output.txt
#To delete trailing whitespace from end of each line
@wisicn
wisicn / dnsmasq.conf
Created February 21, 2013 17:32
my dnsmasq configuration for both DNS/DHCP/TFTP
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# General Configure
#Don't read /etc/resolv.conf. Get upstream servers only from the command line or the dnsmasq configuration file.
no-resolv
#Don't poll /etc/resolv.conf for changes.
no-poll
#upstream server is google
server=8.8.8.8
server=8.8.4.4
#CN TLD is 114.114.114.114