Skip to content

Instantly share code, notes, and snippets.

View shenqihui's full-sized avatar
💭
I may be slow to respond.

大饼 shenqihui

💭
I may be slow to respond.
View GitHub Profile
@shenqihui
shenqihui / ubuntu1404.sh
Last active November 5, 2015 10:23
ubuntu 1404 init sh
# aliyun apt source
# sudo sh -c 'echo "deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty universe \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty universe \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty multiverse \n\
set nocompatible " Don't be compatible with vi
let mapleader="," " change the leader to be a comma vs slash
command! W :w
cmap W! w !sudo tee % >/dev/null
map <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
@shenqihui
shenqihui / pac.js
Created May 22, 2015 02:47
pacpacpacpacpacpacpac
function FindProxyForURL(u, h) {
h = h.toLowerCase();
if (h === "appdownload.itunes.apple.com") {
return "DIRECT"
}
if (/\.?blogspot\.\w{2,3}$/.test(h) || /\.?wordpress\.com/.test(h) || /\.herokuapp\.com/.test(h) || /\.?heroku\.com/.test(h) || /\.google\.com\.\w{2}$/.test(h) || /amazonaws\.com/.test(h) || /\.google\.com$/.test(h) || /hexo\.io$/.test(h) || /gstatic\.com/.test(h) || /googleusercontent\.com/.test(h) || /(google\.\w{2}$|google\.co\.\w{2}$)/.test(h) || /rdio[^\.]*\.akamaihd\.net/.test(h) || /.*rdio.com/.test(h) || /t\.co/.test(h)) {
return "PROXY proxy.net:3344";
}
a = ["tudou.com", "weibo.com", "xunlei.com", "pptv.com", "sohu.com", "taobao.com", "qq.com", "163.com", "sina.cn", "alipay.com", "youku.com"];
for (i = 0; i < a.length; i++) {
@shenqihui
shenqihui / pac.js
Last active August 29, 2015 14:22
SS PAC
function FindProxyForURL(u, h) {
h = h.toLowerCase();
var DEFAULT_PROXY_PROFILE = "DirectConnection";
var FIRST_RUNNING_PROXY = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080;";
var i;
var regs = [
'blogspot.',
'gitlab.com',
@shenqihui
shenqihui / proxy.sh
Last active August 29, 2015 14:23
proxy via socker
all_proxy=socks5://127.0.0.1:1080 curl http://ip.cn # 当前命令有效
export all_proxy=socks5://127.0.0.1:1080 # 当前 session 有效。
@shenqihui
shenqihui / gameengines.md
Last active August 29, 2015 14:26 — forked from bebraw/gameengines.md
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
@shenqihui
shenqihui / wr703n-openwrt.md
Last active August 29, 2015 14:27 — forked from ninehills/wr703n-openwrt.md
WR703N OpenWrt 配置流程

WR703N OpenWrt 配置流程

下载安装

访问WR703N在OpenWrt的[Wiki页][wr703n-openwrt],然后在Flashing一节中找到下载链接:[squashfs-factory.bin][flash.bin],下载后别忘了[比对md5][md5sum]。[1]

进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。

@shenqihui
shenqihui / wm.js
Created August 14, 2015 08:23
wm.js
function bin2hex(s) {
var i, l, o = '', n;
s += '';
for (i = 0, l = s.length; i < l; i++) {
n = s.charCodeAt(i).toString(16);
o += n.length < 2 ? '0' + n : n;
}
return o;
}
var canvas = document.createElement('canvas');
@shenqihui
shenqihui / shadowsocks-on-openwrt.md
Last active August 29, 2015 14:27 — forked from messense/shadowsocks-on-openwrt.md
shadowsocks on openwrt

配置 shadowsocks

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

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

@shenqihui
shenqihui / pkg.js
Created August 15, 2015 03:40
WRT703N openwrt 刷机就有的包
["base-files", "busybox", "dnsmasq", "dropbear", "firewall", "fstools", "hostapd-common", "ip6tables", "iptables", "iw", "jshn", "jsonfilter", "kernel", "kmod-ath", "kmod-ath9k", "kmod-ath9k-common", "kmod-cfg80211", "kmod-crypto-aes", "kmod-crypto-arc4", "kmod-crypto-core", "kmod-gpio-button-hotplug", "kmod-ip6tables", "kmod-ipt-conntrack", "kmod-ipt-core", "kmod-ipt-nat", "kmod-ipt-nathelper", "kmod-ipv6", "kmod-lib-crc-ccitt", "kmod-mac80211", "kmod-nls-base", "kmod-ppp", "kmod-pppoe", "kmod-pppox", "kmod-slhc", "kmod-usb-core", "kmod-usb2", "libblobmsg-json", "libc", "libgcc", "libip4tc", "libip6tc", "libiwinfo", "libiwinfo-lua", "libjson-c", "libjson-script", "liblua", "libnl-tiny", "libubox", "libubus", "libubus-lua", "libuci", "libuci-lua", "libxtables", "lua", "luci", "luci-app-firewall", "luci-base", "luci-lib-nixio", "luci-mod-admin-full", "luci-proto-ppp", "luci-theme-bootstrap", "mtd", "netifd", "odhcp6c", "odhcpd", "opkg", "ppp", "ppp-mod-pppoe", "procd", "swconfig", "uboot-envtools", "ubox", "ub