mirror of
https://github.com/gnu4cn/ccna60d.git
synced 2024-05-21 04:55:00 +08:00
20160916
This commit is contained in:
parent
8af7bee7a7
commit
cc191ff0bf
shadowsocks
31
shadowsocks/blockad
Executable file
31
shadowsocks/blockad
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Author: https://github.com/softwaredownload/openwrt-fanqiang
|
||||
# Date: 2016-01-09
|
||||
|
||||
TMP_HOSTS=/tmp/block.hosts.unsorted
|
||||
HOSTS=/etc/dnsmasq.d/blockad.conf
|
||||
|
||||
# remove any old TMP_HOSTS that might have stuck around
|
||||
rm ${TMP_HOSTS} 2> /dev/null
|
||||
|
||||
for URL in \
|
||||
"https://raw.githubusercontent.com/vokins/simpleu/master/hosts" \
|
||||
"http://adaway.org/hosts.txt"
|
||||
do
|
||||
# filter out comment lines, empty lines, localhost...
|
||||
# remove trailing comments, space( ,tab), empty line
|
||||
# replace line to dnsmasq format
|
||||
# remove carriage returns
|
||||
# append the results to TMP_HOSTS
|
||||
wget -4 --no-check-certificate -qO- "${URL}" | grep -v -e "^#" -e "^\s*$" -e "localhost" -e "^;" -e "^@" -e "^:" -e "^[a-zA-Z]" \
|
||||
| sed -E -e "s/#.*$//" -e "s/[[:space:]]*//g" -e "/^$/d" \
|
||||
-e "s/^127.0.0.1/server=\/./" -e "s/0.0.0.0/server=\/./" -e "/^[0-9].*$/d" -e "s/$/\/127.0.0.0/" \
|
||||
| tr -d "\r" >> ${TMP_HOSTS}
|
||||
|
||||
done
|
||||
|
||||
# remove duplicate hosts and save the real hosts file
|
||||
sort ${TMP_HOSTS} | uniq > ${HOSTS}
|
||||
|
||||
rm ${TMP_HOSTS} 2> /dev/null
|
20
shadowsocks/chinalist
Executable file
20
shadowsocks/chinalist
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Author: https://github.com/softwaredownload/openwrt-fanqiang
|
||||
# Date: 2014-07-12
|
||||
|
||||
#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/dnsmasq.d/adblock.conf
|
||||
#
|
||||
# wget -4 --no-check-certificate -O - https://github.com/kcschan/AdditionalAdblock/raw/master/list.txt |
|
||||
# grep ^\|\|[^\*/]*\^$ |
|
||||
# sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' >> /etc/dnsmasq.d/adblock.conf
|
||||
#}
|
||||
|
||||
|
||||
wget -4 --no-check-certificate -O /etc/dnsmasq.d/accelerated-domains.china.conf https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf
|
||||
wget -4 --no-check-certificate -O /etc/dnsmasq.d/bogus-nxdomain.china.conf https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf
|
||||
|
||||
#/etc/init.d/dnsmasq restart
|
7
shadowsocks/shadowsocks.json
Normal file
7
shadowsocks/shadowsocks.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"server":"210.140.75.238",
|
||||
"server_port":11276,
|
||||
"local_port":7654,
|
||||
"password":"M3wAfeqe",
|
||||
"method":"rc4-md5"
|
||||
}
|
Loading…
Reference in New Issue
Block a user