This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) { | |
var PROXY = "PROXY 127.0.0.1:8080;SOCKS5 127.0.0.1:7070"; | |
var DEFAULT = "DIRECT"; | |
// domain .com/.net/.org | |
if (/(asahichinese|appspot|delicious|facebook|googleusercontent|googleapis|ggpht|html5rocks|hulu|twitter|twimg|staticflickr)\.com/i.test(host)) return PROXY; | |
if (/(4sqi|akamai|akamaihd|fbcdn)\.net/i.test(host)) return PROXY; | |
if (/(nobelprize|python|wikipedia|wikisource|wikimedia)\.org/i.test(host)) return PROXY; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPO_ROOT=/home/git/node | |
cd ${REPO_ROOT} | |
if [ -z "$1" ]; then | |
echo "------ fail: repository name required. ------" | |
exit 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# node.js | |
cd ~ | |
wget http://nodejs.org/dist/v0.10.36/node-v0.10.36-linux-x64.tar.gz | |
tar zxvf node-v0.10.36-linux-x64.tar.gz | |
cp ./node-v0.10.36-linux-x64 /usr/local/node | |
ln -s /usr/local/node/bin/* /usr/sbin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#source ~/.bash_profile | |
export PATH=/usr/sbin:/usr/local/bin:$(npm bin):$PATH | |
# refresh dir. | |
git --git-dir=. --work-tree=$PWD/.. reset --hard | |
cd .. | |
# build. | |
echo '--- build start ---' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%1" == "" goto nohost | |
if "%2" == "" goto nodb | |
:sync | |
mongodump --host %1 --db %2 | |
mongorestore --db %2 --drop dump/%2 | |
:dropdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
doskey ls=dir /b $* | |
doskey ll=dir $* | |
doskey cat=type $* | |
doskey ..=cd.. | |
doskey grep=find "$1" $2 | |
doskey mv=ren $* | |
doskey rm=del $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
DESC="tengine daemon" | |
NAME=nginx | |
DAEMON=/usr/local/tengine/sbin/nginx | |
CONFIGFILE=/usr/local/tengine/conf/nginx.conf | |
PIDFILE=/usr/local/tengine/logs/tengine.pid | |
SCRIPTNAME=/etc/init.d/tengine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# chkconfig: 2345 55 25 | |
# Description: Startup script for php-fpm on Debian. Place in /etc/init.d and | |
# run 'update-rc.d -f php-fpm defaults', or use the appropriate command on your | |
# distro. For CentOS/Redhat run: 'chkconfig --add php-fpm' | |
### BEGIN INIT INFO | |
# Provides: php-fpm | |
# Required-Start: $all | |
# Required-Stop: $all |