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
#!/usr/bin/python | |
# -*- encoding: utf-8 -*- | |
import os, sys, tarfile, tempfile, re | |
try: | |
tar = tarfile.open(sys.argv[1], 'r:gz') | |
tar.extractall(tempfile.gettempdir()) | |
dirname = os.path.join(tempfile.gettempdir(), | |
os.path.basename(sys.argv[1])[:-len('.tar.gz')]) |
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 | |
mkdir $HOME/.npm-global | |
npm config set prefix $HOME/.npm-global | |
echo 'PATH=$PATH:/home/int64ago/.npm-global/bin' >> ~/.bashrc | |
source ~/.bashrc | |
npm config set registry https://registry.npm.taobao.org | |
npm config set disturl https://npm.taobao.org/dist |
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
#!/usr/bin/python | |
import sys, re, StringIO, json | |
data = {'data': []} | |
def findPlayer(_id): | |
for player in data['data']: | |
if player['name'] == _id: | |
return player |
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
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse |
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
alias topy='tmux attach -t topy || tmux new-session -s topy -d "htop" \; rename-window htop \; split-window -v -p 50 "nload -u K" \; attach -t topy' |
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
石家庄市 | |
唐山市 | |
秦皇岛市 | |
邯郸市 | |
邢台市 | |
保定市 | |
张家口市 | |
承德市 | |
沧州市 | |
廊坊市 |
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 | |
if [ X$1 = X ] | |
then | |
echo 'No passwd input!' | |
exit | |
fi | |
apt-get update | |
apt-get -y install python-pip python-m2crypto supervisor | |
pip install shadowsocks |
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
# -*- coding: utf-8 -*- | |
# Dependents: | |
# qiniu-sdk(https://github.com/qiniu/python-sdk/releases) | |
# requests(http://docs.python-requests.org/en/latest/user/install/) | |
from qiniu import Auth | |
from qiniu import BucketManager | |
access_key = '...' | |
secret_key = '...' | |
bucket_name = '...' |
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
#!/usr/bin/python2 | |
import urllib, json | |
from BeautifulSoup import BeautifulSoup | |
data = {} | |
# inconformity | |
blacklist = ['mathjax', 'yui', 'documentup'] | |
res = urllib.urlopen('https://cdnjs.com/').read() | |
soup = BeautifulSoup(res) | |
libs = soup.findAll('tr', attrs={'data-library-name': True}) |
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 | |
cnlist() { | |
wget -4 --no-check-certificate -O /etc/dnsmasq.d/accelerated-domains.china.conf https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf | |
wget -4 --no-check-certificate -O /etc/dnsmasq.d/bogus-nxdomain.china.conf https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf | |
} | |
adblock() { | |
wget -4 --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt | | |
grep ^\|\|[^\*]*\^$ | | |
sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' | uniq > /etc/dnsm |