This file contains hidden or 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/env python | |
#coding=utf-8 | |
# | |
# Generate a list of dnsmasq rules with ipset for gfwlist | |
# | |
# Copyright (C) 2014 http://www.shuyz.com | |
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules | |
import urllib2 | |
import re |
This file contains hidden or 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/env python | |
#coding=utf-8 | |
# | |
# Generate a list of dnsmasq rules with ipset for gfwlist | |
# | |
# Copyright (C) 2014 http://www.shuyz.com | |
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules | |
import urllib2 | |
import re |
This file contains hidden or 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 | |
# Please run this shell with "sudo ..." | |
SERVICE=Wi-Fi | |
# You could change the service. List all network services via: | |
# networksetup -listallnetworkservices | |
echo "" | |
echo "Current DNS on ${SERVICE}:" |
This file contains hidden or 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 | |
# | |
# /etc/rc.d/init.d/supervisord | |
# | |
# Supervisor is a client/server system that | |
# allows its users to monitor and control a | |
# number of processes on UNIX-like operating | |
# systems. | |
# | |
# chkconfig: - 64 36 |
This file contains hidden or 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
set msg to "" | |
tell application "System Events" | |
tell current location of network preferences | |
set VPNservice to service "VPN (PPTP)" | |
if exists VPNservice then | |
set isConnected to connected of current configuration of VPNservice | |
if isConnected then | |
disconnect VPNservice | |
set msg to "Disconnected" | |
else |
This file contains hidden or 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 fp='ps aux|grep' | |
alias vi='mvim' | |
alias df="df -h" | |
alias mv="mv -i" | |
alias slink="link -s" | |
alias l="ls -lh" | |
alias la="ls -lhAF" | |
alias ll="ls -lhF" | |
alias lt="ls -lhtrF" | |
alias l.="ls -lhtrdF .*" |
This file contains hidden or 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
require 'formula' | |
class TmuxIterm2 < Formula | |
url 'https://iterm2.googlecode.com/files/tmux-for-iTerm2-20130319.tar.gz' | |
sha1 'f14a0bad6991b9e3380d5c3a6057e09f62597d1f' | |
head 'git://tmux.git.sourceforge.net/gitroot/tmux/tmux' | |
depends_on 'pkg-config' => :build | |
depends_on 'libevent' |
This file contains hidden or 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
# | |
# | |
216.73.93.70/31 | |
216.73.93.72/31 | |
216.239.32.0/19 | |
64.233.160.0/19 | |
66.249.80.0/20 | |
72.14.192.0/18 | |
209.85.128.0/17 |
This file contains hidden or 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 [ $(id -u) != "0" ]; then | |
printf "Error: You must be root to run this tool!\n" | |
exit 1 | |
fi | |
clear | |
printf " | |
#################################################### | |
# # |
This file contains hidden or 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
#!/user/bin/env python | |
# -*- coding: utf-8 -*- | |
class arithmetic(): | |
def __init__(self): | |
pass | |
''' 【编辑距离算法】 【levenshtein distance】 【字符串相似度算法】 ''' | |
def levenshtein(self,first,second): | |
if len(first) > len(second): |
NewerOlder