Skip to content

Instantly share code, notes, and snippets.

View keepzero's full-sized avatar

KeepZero keepzero

View GitHub Profile
@keepzero
keepzero / cernet_list.txt
Created October 9, 2012 14:22
CERNET routes for Windows
1.51.0.0/16
1.184.0.0/15
42.244.0.0/14
49.52.0.0/14
49.120.0.0/14
49.140.0.0/15
49.208.0.0/15
58.154.0.0/15
58.192.0.0/12
59.64.0.0/12
@keepzero
keepzero / download.py
Created October 21, 2012 16:01
Download All Xiaobu Teacher's Videos
#!/usr/bin/python2
#下载小布老师的所有 Oracle 学习视频
#http://www.boobooke.com/bbs/thread-272667-1-1.html
import urllib2,urllib,re,sys,os,subprocess
from HTMLParser import HTMLParser
class MyHTMLParser(HTMLParser):
def __init__(self):
@keepzero
keepzero / abspath.sh
Created December 5, 2012 04:27
Get absolute path of this script
#!/bin/bash
# basename - strip directory and suffix from filenames
# dirname - strip last component from file name
ABSDIR=$(cd $(dirname "$0") > /dev/null; pwd)
ABSPATH=$(cd $(dirname "$0") > /dev/null; pwd)/$(basename $0)
echo $ABSDIR
echo $ABSPATH
@keepzero
keepzero / speedfox.sh
Created February 18, 2013 02:44
Run .mozilla in memory
#!/bin/bash
# Alex Alexander (wired) <alex.alexander@gmail.com>
# http://www.linuxized.com
#
# this script makes sure your .mozilla folder is in tmpfs and constantly syncs it
# with a folder on your hdd so you won't lose anything :)
# for more details on how it works visit my blog in the link above.
#
# for this to have any meaning, the MOZTMPFS folder must be on tmpfs
# i.e. to make /var/tmp a tmpfs folder, add the following in /etc/fstab
@keepzero
keepzero / firewall.sh
Last active December 16, 2015 13:48
iptables cheatsheet
#!/bin/bash
# 1. 清除规则
iptables -F
iptables -X
iptables -Z
# 2. 设定政策
iptables -P INPUT ACCEPT #REJECT
iptables -P OUTPUT ACCEPT
@keepzero
keepzero / term_no_256color.sh
Created July 18, 2013 06:36
When terminal not support 256color
if [[ $(echo $TERM | grep "rxvt-unicode") != "" ]]; then
export TERM=rxvt
fi
if [ "$TERM"x = "xterm-256color"x ]; then
export TERM=xterm
fi
if [ "$TERM"x = "screen-256color"x ]; then
export TERM=screen
@keepzero
keepzero / .vimrc
Last active June 30, 2017 11:41
vimrc minimal
set nocompatible
" set encodings
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
" few options just make things better
set scrolloff=3
set showmode
set showcmd
@keepzero
keepzero / etc-paths
Last active May 25, 2017 11:34
dotConfig
/usr/local/bin
/opt/bin
/usr/bin
/bin
/usr/sbin
/sbin
[global]
index-url = https://pypi.douban.com/simple/
[install]
trusted-host = pypi.douban.com
[list]
format = columns
@keepzero
keepzero / .npmrc
Created May 26, 2017 04:30
dotNpmrc
registry = https://registry.npm.taobao.org