月度归档:2014年12月

Gulp.js及前端静态资源管理参考

传送门:

http://viget.com/extend/gulp-browserify-starter-faq
http://stefanimhoff.de/2014/gulp-tutorial-13-revisioning/
http://www.dbpoo.com/getting-started-with-gulp/
https://phphub.org/topics/49
https://github.com/fouber/blog/issues/3

http://js8.in/categories/前端开发/
http://mweb.baidu.com/p/baidusearch-front-end-road.html
http://fex.baidu.com/blog/2014/04/fis-static-resource-management/

ubuntu安装shadowsocks

官方安装说明:https://github.com/clowwindy/shadowsocks/wiki/Shadowsocks-使用说明

增加Debian sid源:

# /etc/apt/sources.list
deb ftp://ftp.it.debian.org/debian/ sid main contrib non-free
deb-src ftp://ftp.it.debian.org/debian/ sid main contrib non-free

执行更新并安装shadowsocks:

apt-get update
apt-get install shadowsocks

服务器的启动和配置参照官方说明即可。

如果防火墙屏蔽了服务器的自定义端口, 在/etc/iptables.rules的filter部分加上一句话:

// 替换下面的 $端口$ 为 自定义端口
-A INPUT -p tcp --dport $端口$ -j ACCEPT

然后应用:

iptables-apply /etc/iptables.rules

以上是服务器端的任务,在客户端使用可以用官方文档里面的客户端链接,比如Mac OSX的客户端安装后,打开配置一下server,就可以使用了,不需要用SwitchySharp。因为mac的客户端设置好并连上服务器以后,会在系统网络面板高级项中自动设置代理配置,比如:
proxies

传送门:搭建VPN

pptpd类型:

http://blog.atime.me/note/pptpd.html
http://www.xueqi.tk/?p=984
一键脚本:

wget https://github.com/halida/install_script/raw/master/pptp-debian.sh
sh ./pptp-debian.sh

L2TP/IPSec类型:

https://apple4us.com/2010/05/setting-up-l2tp-vpn-on-debian-ubuntu/
http://qiaodahai.com/debian-ubuntu-linux-vps-l2tp-ipsec-vpn.html

http://lowendtalk.com/discussion/22014/fully-automated-ipsec-l2tp-vpn-setup-with-libreswan
https://blog.ls20.com/ipsec-l2tp-vpn-auto-setup-for-ubuntu-12-04-on-amazon-ec2/
一键脚本:
wget https://gist.githubusercontent.com/hwdsl2/9030462/raw/8778e8db382492f342dcbd5f94f7d4b36521cebe/vpnsetup.sh
用法:

  1. Prepare your server with a fresh install of Ubuntu 14.04 or 12.04 LTS.
  2. Save the script as vpnsetup.sh on your VPS. Edit it in your favorite editor. From there, change the first line to #!/bin/bash, replace the three variables IPSEC_PSK, VPN_USER and VPN_PASSWORD as mentioned above, and change PRIVATE_IP=… and PUBLIC_IP=… to the actual IP addresses of your VPS. In case your VPS is run on its public IP directly with no private IP, just use that public IP for both.
  3. Save and exit the editor. Finally, run bash vpnsetup.sh to install.