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
#!/system/bin/sh | |
# log -t IPTABLES -- $@ | |
# iptables -w -t mangle -A INPUT -i tun0 -j MARK --set-mark 0x3006a | |
IPTABLES="/system/bin/iptables.oem iptables" | |
need_arg=0; | |
last_cmd=""; | |
IIF="" |
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
forward_port() { | |
HOST=$(echo -n $2|sed 's/:.*//') | |
PORT=$(echo -n $2|sed 's/.*://') | |
LOCAL=$(ip route get $HOST|head -n 1|sed 's/.*[^0-9] //') | |
iptables -t nat -A PREROUTING -p tcp --dport $1 -d $LOCAL -m comment --comment "CACHEFILES" -j DNAT --to $FORWARD_TARGET | |
iptables -t nat -A POSTROUTING -p tcp --dport $PORT -d $HOST -m comment --comment "CACHEFILES" -j SNAT --to $LOCAL |
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
# commiter: [email protected] | |
bind '"\x1b[6~":history-search-forward' | |
bind '"\x1b[5~":history-search-backward' |
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
timeout() { | |
exec 4<&1; | |
(sh -c 'echo $PPID'; exec $@ 3<&1 1<&4 4>&-) | (cat; echo END;) | (read PID; read -t 3 || kill $PID) | |
exec 4>&-; | |
} | |
timeout wget http://www.baidu.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
Version: 2.5 | |
uid resource held maxheld barrier limit failcnt | |
3291: kmemsize 19102813 21286912 2147483646 2147483646 0 | |
lockedpages 0 0 999999 999999 0 | |
privvmpages 79971 245015 262144 262144 40 | |
shmpages 963 979 131072 131072 0 | |
dummy 0 0 9223372036854775807 9223372036854775807 0 | |
numproc 53 81 999999 999999 0 | |
physpages 102669 1864041 0 214 |
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
server { | |
#listen 80; ## listen for ipv4; this line is default and implied | |
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6 | |
resolver 8.8.8.8; | |
root /usr/share/nginx/www; | |
index index.html index.htm; | |
# Make site accessible from http://localhost/ | |
server_name www.cachefiles.net; |
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 | |
PATH=${PATH}:/sbin:/usr/sbin | |
ip6tables -F FORWARD | |
iptables -t raw -F PREROUTING | |
#iptables -t raw -A PREROUTING -j NOTRACK | |
iptables -t raw -F OUTPUT |
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/sbin:$PATH | |
tun_dev=tun0 | |
ip address add 10.24.0.1/24 dev ${tun_dev} | |
ip link set dev ${tun_dev} up | |
ip -6 addr add 2001:c0a8:2b01:3576::1/64 dev ${tun_dev} | |
ip -6 route add default dev ${tun_dev} metric 256 proto static |
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
const _net_count = 15641; | |
const _net_list = [ | |
{"net": 0x01000000, "prefix": 24}, {"net": 0x01000400, "prefix": 22}, {"net": 0x01001000, "prefix": 20}, {"net": 0x01004000, "prefix": 18}, | |
{"net": 0x01008000, "prefix": 17}, {"net": 0x01010100, "prefix": 24}, {"net": 0x01014000, "prefix": 18}, {"net": 0x01018000, "prefix": 17}, | |
{"net": 0x01020300, "prefix": 24}, {"net": 0x01028000, "prefix": 17}, {"net": 0x01040000, "prefix": 24}, {"net": 0x01048000, "prefix": 17}, | |
{"net": 0x01050000, "prefix": 16}, {"net": 0x01060000, "prefix": 15}, {"net": 0x01090000, "prefix": 16}, {"net": 0x010a0a00, "prefix": 24}, | |
{"net": 0x010a8000, "prefix": 17}, {"net": 0x010b0000, "prefix": 16}, {"net": 0x01100000, "prefix": 13}, {"net": 0x01200000, "prefix": 13}, | |
{"net": 0x01280000, "prefix": 14}, {"net": 0x012c0000, "prefix": 16}, {"net": 0x012e0000, "prefix": 15}, {"net": 0x01340000, "prefix": 14}, | |
{"net": 0x01400000, "prefix": 14}, {"net": 0x01480000, "prefix": 13}, {"net": 0x016 |