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 | |
#export IFS=$'\n' | |
which -s mkisofs || { | |
echo can\'t not find mkisofs >&2 | |
exit 1 | |
} | |
path="$(dirname "$1")" | |
name="$(basename "$1")" | |
folder="${name%.[Dd][Mm][Gg]}" | |
cd "$path" |
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/env python2.7 | |
# This script simply produces a working pac file, | |
# no fancy input arguments support yet. | |
# If someone is really interested in using this script, | |
# download the gfwlist.txt, decode it through base64, name it as "gfwlist_decoded.txt" | |
# and put it in the same direcotry with this script | |
# run the script in terminal. | |
import re |
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/env python2.7 | |
import re | |
import os, os.path | |
import sys | |
import urllib2 | |
from contextlib import closing | |
USAGE = "{0} hosts".format(sys.argv[0]) |
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 ! which vdfuse &>/dev/null;then | |
echo Can not find vdfuse >&2 | |
exit 1 | |
fi | |
if [[ ! -f "$1" ]];then | |
echo Disk file does not exist >&2 | |
exit 1 |
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
[Adblock Plus 2.0] | |
www.cnbeta.com##.wrapper.global_head > .tiny_bar > .cb_rss | |
www.safaribooksonline.com###js-subscribe-nag.subscribe-nag.clearfix.trial-panel.collapsed.slideUp | |
hi.baidu.com##.mod-page-body > .mod-page-main.wordwrap.clearfix > .x-page-container > .mod-blogpage-wraper > .grid-80.mod-blogpage > .mod-text-content.mod-post-content.mod-cs-contentblock > .mod-post-info.clearfix > .op-box.mod-cs-opBox > .pv | |
www.mtime.com###carter > embed | |
qun.qzone.qq.com##.td_upload_counts | |
www.talkshowcn.com###wideRight.col-md-4.column | |
||cnzz.com/stat.php | |
||cpro.baidustatic.com |
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
cuttor() { | |
local cutopts files | |
declare -a cutopts | |
declare -a files | |
while [[ $# -gt 0 ]];do | |
case "$1" in | |
-f) shift; cutopts+=(-f "$1") ;; | |
-f?*) cutopts+=("$1") ;; | |
*) files+=("$1") ;; | |
esac |
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/env python2.7 | |
from optparse import OptionParser | |
from subprocess import call | |
from os.path import splitext | |
import sys, os | |
def ffaac(filename, opts): | |
cmd = ['ffmpeg', '-hide_banner', '-y', '-i', filename, | |
'-c:a', 'libfdk_aac'] |
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/env python2 | |
import sys | |
import os.path | |
import datetime | |
from subprocess import call | |
width = 1280 | |
sec = str(datetime.timedelta(seconds=int(sys.argv[1]))) |
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/env python2.7 | |
from optparse import OptionParser | |
from subprocess import call,Popen, PIPE | |
from os.path import splitext | |
import sys, os, re | |
def mediainfo(filename): | |
bitratePtn = re.compile(r'^\s*Duration:.+, (bitrate: (\d+) kb/s).*$') |
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 | |
# Usage: | |
# navigate the MacOS folder inside the app bundle you want to block | |
# usually where it is "SomeApp.app/Contents/MacOS" | |
# open terminal at current location | |
# run "blockit.sh executable" | |
# note the name "executable varies per apps" | |
# then this app is no longer be able to connect to internet. | |
if [[ -z "$1" ]];then |