From 41f212598e0aa3f738264f415d3f5fc0f14e3bc8 Mon Sep 17 00:00:00 2001 From: "Weihong.Guan" Date: Tue, 5 Feb 2013 01:34:02 +0800 Subject: [PATCH 1/4] add .gitattributes and .gitignore --- .gitattributes | 8 ++++++++ .gitignore | 2 ++ fetch-hosts.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100755 fetch-hosts.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6ef434b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# Set default behaviour, in case users don't have core.autocrlf set. +* text=auto + +downloads/raw/ipv4_win_ansi/hosts text eol=crlf +downloads/raw/ipv6_win_ansi/hosts text eol=crlf + + +hosts text eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a8452a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +downloads/tmp +*.tmp diff --git a/fetch-hosts.sh b/fetch-hosts.sh new file mode 100755 index 0000000..fe6a292 --- /dev/null +++ b/fetch-hosts.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +newhost=/tmp/hosts.$$ + +echo "1. Download ipv6 host for unix:" +wget https://raw.github.com/aguegu/huhamhire-hosts/master/downloads/raw/ipv6_unix_utf8/hosts -O $newhost + +echo "2. Implant hostname:" +if [ $? -eq 0 ] +then + sed -i $newhost -e "s/#Replace Your Device Name Here!/$(hostname)/g" + echo "Done. hostname: " $(hostname) +else + echo "Download failed." + rm -r $newhost + exit 1 +fi + +echo "3. Copy new hosts to /etc/hosts:" +if [ $(whoami) = "root" ] +then + cp $newhost /etc/hosts + rm $newhost +else + echo "Update Failed. script needs to be processed by root" + exit 2 +fi + +echo "Host updates successfully." +exit 0 From 9667059dcd0763e5d7819c56f68d73f2f611a19d Mon Sep 17 00:00:00 2001 From: "Weihong.Guan" Date: Tue, 5 Feb 2013 02:29:06 +0800 Subject: [PATCH 2/4] update fectch-hosts.sh to download zip file not raw text --- fetch-hosts.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fetch-hosts.sh b/fetch-hosts.sh index fe6a292..ac79477 100755 --- a/fetch-hosts.sh +++ b/fetch-hosts.sh @@ -3,16 +3,19 @@ newhost=/tmp/hosts.$$ echo "1. Download ipv6 host for unix:" -wget https://raw.github.com/aguegu/huhamhire-hosts/master/downloads/raw/ipv6_unix_utf8/hosts -O $newhost +wget https://raw.github.com/aguegu/huhamhire-hosts/master/downloads/zip/ipv6_unix_utf8.zip -O $newhost.zip -echo "2. Implant hostname:" +echo "2. Extract & Implant hostname:" if [ $? -eq 0 ] then + unzip $newhost.zip + mv hosts $newhost sed -i $newhost -e "s/#Replace Your Device Name Here!/$(hostname)/g" echo "Done. hostname: " $(hostname) else echo "Download failed." rm -r $newhost + rm -r $newhost.zip exit 1 fi From e766fefb80fabac99dba9e9e1b02d8244c142185 Mon Sep 17 00:00:00 2001 From: "Weihong.Guan" Date: Tue, 5 Feb 2013 12:53:35 +0800 Subject: [PATCH 3/4] add a new line to host sections to help cat work --- modules/adblock_mods/hostsx.hosts | 1 + modules/adblock_mods/mvps.hosts | 3 ++- modules/adblock_mods/mwsl.hosts | 21 +++++++++++---------- modules/adblock_mods/yoyo.hosts | 3 ++- modules/combine.py | 2 +- modules/info.hosts | 3 ++- modules/ipv4_mods/facebook.hosts | 3 ++- modules/ipv4_mods/google.hosts | 3 ++- modules/ipv4_mods/other.hosts | 3 ++- modules/ipv4_mods/twitter.hosts | 3 ++- modules/ipv4_mods/wikipedia.hosts | 3 ++- modules/ipv4_mods/youtube.hosts | 3 ++- modules/ipv6_mods/facebook.hosts | 3 ++- modules/ipv6_mods/google.hosts | 3 ++- modules/ipv6_mods/other.hosts | 3 ++- modules/ipv6_mods/twitter.hosts | 3 ++- modules/ipv6_mods/wikipedia.hosts | 3 ++- modules/ipv6_mods/youtube.hosts | 3 ++- modules/localhost.hosts | 3 ++- modules/share_mods/activation.hosts | 3 ++- modules/share_mods/apple.hosts | 3 ++- modules/timestamp.hosts | 3 ++- 22 files changed, 51 insertions(+), 30 deletions(-) diff --git a/modules/adblock_mods/hostsx.hosts b/modules/adblock_mods/hostsx.hosts index 60f46fe..8131927 100644 --- a/modules/adblock_mods/hostsx.hosts +++ b/modules/adblock_mods/hostsx.hosts @@ -11122,3 +11122,4 @@ 127.0.0.1 pic.tameili.net ######## HostsX END ######## + diff --git a/modules/adblock_mods/mvps.hosts b/modules/adblock_mods/mvps.hosts index 882bf55..af3fccd 100644 --- a/modules/adblock_mods/mvps.hosts +++ b/modules/adblock_mods/mvps.hosts @@ -16094,4 +16094,5 @@ 127.0.0.1 www.stickylogic.com 127.0.0.1 www.winadiscount.com #[Dr.Web.Adware.Xbarre] 127.0.0.1 www.winaproduct.com -# [end of entries generated by WinHelp2002] \ No newline at end of file +# [end of entries generated by WinHelp2002] + diff --git a/modules/adblock_mods/mwsl.hosts b/modules/adblock_mods/mwsl.hosts index 742fa5a..d7ea81d 100644 --- a/modules/adblock_mods/mwsl.hosts +++ b/modules/adblock_mods/mwsl.hosts @@ -1,12 +1,12 @@ -*************************************** -恶意网站实验室(MWSL) -恶意网站HOSTS屏蔽文件-2012.9.17 ---------------------------------------- -注意:115.47.219.95为MWSL的拦截警示页面 -警告:不得将此数据用于违法犯罪行为! ---------------------------------------- -All Rights Reserved 2007-2012 -*************************************** +# *************************************** +# 恶意网站实验室(MWSL) +# 恶意网站HOSTS屏蔽文件-2012.9.17 +# --------------------------------------- +# 注意:115.47.219.95为MWSL的拦截警示页面 +# 警告:不得将此数据用于违法犯罪行为! +# --------------------------------------- +# All Rights Reserved 2007-2012 +# *************************************** 115.47.219.95 c.bbslc.com 115.47.219.95 www.baiduduyou5.cn 115.47.219.95 baiduduyou5.cn @@ -16512,4 +16512,5 @@ All Rights Reserved 2007-2012 115.47.219.95 www.7daygwj.com 115.47.219.95 www.bettercopartner.com 115.47.219.95 dgal.cdwzt.com -115.47.219.95 www.yihuajixie.com \ No newline at end of file +115.47.219.95 www.yihuajixie.com + diff --git a/modules/adblock_mods/yoyo.hosts b/modules/adblock_mods/yoyo.hosts index c0e789b..be221ff 100644 --- a/modules/adblock_mods/yoyo.hosts +++ b/modules/adblock_mods/yoyo.hosts @@ -2769,4 +2769,5 @@ 127.0.0.1 zeus.developershed.com 127.0.0.1 zeusclicks.com 127.0.0.1 zintext.com -127.0.0.1 zmedia.com \ No newline at end of file +127.0.0.1 zmedia.com + diff --git a/modules/combine.py b/modules/combine.py index 2b19c8f..65924df 100644 --- a/modules/combine.py +++ b/modules/combine.py @@ -148,4 +148,4 @@ def delTmpDir(self): if __name__ == '__main__': ops = combineHosts('./') ops.run() - print('Done!') \ No newline at end of file + print('Done!') diff --git a/modules/info.hosts b/modules/info.hosts index 88f5152..c3f8a5b 100644 --- a/modules/info.hosts +++ b/modules/info.hosts @@ -33,4 +33,5 @@ # ::1 localhost # # Special thanks to: smarthosts, hostsx, ipv6-hosts, mwsl, yoyo, -# mvps, ATGFW and hpHosts \ No newline at end of file +# mvps, ATGFW and hpHosts + diff --git a/modules/ipv4_mods/facebook.hosts b/modules/ipv4_mods/facebook.hosts index 4fa091d..5f62f81 100644 --- a/modules/ipv4_mods/facebook.hosts +++ b/modules/ipv4_mods/facebook.hosts @@ -57,4 +57,5 @@ 69.171.246.17 channel-staging-ecmp-05-ash3.facebook.com 69.171.246.18 channel-testing-ecmp-05-ash3.facebook.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv4_mods/google.hosts b/modules/ipv4_mods/google.hosts index dab516c..b4b5681 100644 --- a/modules/ipv4_mods/google.hosts +++ b/modules/ipv4_mods/google.hosts @@ -508,4 +508,5 @@ 74.125.128.141 www.panoramio.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv4_mods/other.hosts b/modules/ipv4_mods/other.hosts index 7e03b2d..72f5c3d 100644 --- a/modules/ipv4_mods/other.hosts +++ b/modules/ipv4_mods/other.hosts @@ -194,4 +194,5 @@ ######## IPv4 HOSTS END ######## -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv4_mods/twitter.hosts b/modules/ipv4_mods/twitter.hosts index 6ab1067..1b4f2c6 100644 --- a/modules/ipv4_mods/twitter.hosts +++ b/modules/ipv4_mods/twitter.hosts @@ -29,4 +29,5 @@ 199.59.149.213 upload.twitter.com 199.59.149.210 t.co -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv4_mods/wikipedia.hosts b/modules/ipv4_mods/wikipedia.hosts index de36fdd..8bd8f9d 100644 --- a/modules/ipv4_mods/wikipedia.hosts +++ b/modules/ipv4_mods/wikipedia.hosts @@ -50,4 +50,5 @@ 208.80.152.201 mediawiki.org 208.80.152.201 www.mediawiki.org -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv4_mods/youtube.hosts b/modules/ipv4_mods/youtube.hosts index 0b3bb04..eeb6d72 100644 --- a/modules/ipv4_mods/youtube.hosts +++ b/modules/ipv4_mods/youtube.hosts @@ -622,4 +622,5 @@ 173.194.38.166 v23.lscache8.c.youtube.com 173.194.38.166 v24.lscache8.c.youtube.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv6_mods/facebook.hosts b/modules/ipv6_mods/facebook.hosts index 57b328b..84d5179 100644 --- a/modules/ipv6_mods/facebook.hosts +++ b/modules/ipv6_mods/facebook.hosts @@ -162,4 +162,5 @@ 69.171.246.17 channel-staging-ecmp-05-ash3.facebook.com 69.171.246.18 channel-testing-ecmp-05-ash3.facebook.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv6_mods/google.hosts b/modules/ipv6_mods/google.hosts index e8b6f10..94d847c 100644 --- a/modules/ipv6_mods/google.hosts +++ b/modules/ipv6_mods/google.hosts @@ -3519,4 +3519,5 @@ #Google Plus 2001:778:0:ffff:64:0:1faa:a606 plus.url.google.com.hk #非官方,有错误请汇报 -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv6_mods/other.hosts b/modules/ipv6_mods/other.hosts index 6dc4cd3..21729cb 100644 --- a/modules/ipv6_mods/other.hosts +++ b/modules/ipv6_mods/other.hosts @@ -401,4 +401,5 @@ ######## IPv6 HOSTS END ######## -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv6_mods/twitter.hosts b/modules/ipv6_mods/twitter.hosts index 35b19e8..16642ea 100644 --- a/modules/ipv6_mods/twitter.hosts +++ b/modules/ipv6_mods/twitter.hosts @@ -59,4 +59,5 @@ 2001:778:0:ffff:64:0:5f64:4f90 si5.twimg.com #e3826.g.akamaiedge.net 2001:778:0:ffff:64:0:b8a9:4f21 widgets.twimg.com #orig-10012.twitter.cotcdn.net -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv6_mods/wikipedia.hosts b/modules/ipv6_mods/wikipedia.hosts index 1d0af47..39c1840 100644 --- a/modules/ipv6_mods/wikipedia.hosts +++ b/modules/ipv6_mods/wikipedia.hosts @@ -844,4 +844,5 @@ 2001:778:0:ffff:64:0:4a78:bc7d uncyclopedia.wikia.com 2001:778:0:ffff:64:0:4a78:bc7d cn.uncyclopedia.wikia.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/ipv6_mods/youtube.hosts b/modules/ipv6_mods/youtube.hosts index ce8ffec..dcc3980 100644 --- a/modules/ipv6_mods/youtube.hosts +++ b/modules/ipv6_mods/youtube.hosts @@ -1054,4 +1054,5 @@ 2404:6800:4005::19 r20.maa03s08.c.youtube.com 2404:6800:4005:1::19 r20.maa03s09.c.youtube.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/localhost.hosts b/modules/localhost.hosts index dd72f91..3726891 100644 --- a/modules/localhost.hosts +++ b/modules/localhost.hosts @@ -18,4 +18,5 @@ ff02::3 ip6-allhosts fe80::1 lo0 localhost 255.255.255.255 broadcasthost -######## Localhost END ######## \ No newline at end of file +######## Localhost END ######## + diff --git a/modules/share_mods/activation.hosts b/modules/share_mods/activation.hosts index f64be35..96cfa14 100644 --- a/modules/share_mods/activation.hosts +++ b/modules/share_mods/activation.hosts @@ -27,4 +27,5 @@ 127.0.0.1 parallels.com 127.0.0.1 update.parallels.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/share_mods/apple.hosts b/modules/share_mods/apple.hosts index 20cee29..09f9334 100644 --- a/modules/share_mods/apple.hosts +++ b/modules/share_mods/apple.hosts @@ -2025,4 +2025,5 @@ 63.141.192.105 a1999.phobos.apple.com 63.141.192.105 a2000.phobos.apple.com -# endregion \ No newline at end of file +# endregion + diff --git a/modules/timestamp.hosts b/modules/timestamp.hosts index 2ae50e4..4174915 100644 --- a/modules/timestamp.hosts +++ b/modules/timestamp.hosts @@ -1,4 +1,5 @@ # # HostsVer Timestamp : 1359561600 # Creation Timestamp : 1359561600 -# \ No newline at end of file +# + From 9425f69ca9b990b40d3077d134fbd46ae7880ca5 Mon Sep 17 00:00:00 2001 From: "Weihong.Guan" Date: Tue, 5 Feb 2013 13:03:51 +0800 Subject: [PATCH 4/4] remove blank lines in yoyo.hosts --- modules/adblock_mods/yoyo.hosts | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/modules/adblock_mods/yoyo.hosts b/modules/adblock_mods/yoyo.hosts index be221ff..185ed61 100644 --- a/modules/adblock_mods/yoyo.hosts +++ b/modules/adblock_mods/yoyo.hosts @@ -2351,38 +2351,9 @@ 127.0.0.1 searchportal.information.com 127.0.0.1 searchramp.com 127.0.0.1 secure.webconnect.net - - - - - - - - 127.0.0.1 servedbyopenx.com - 127.0.0.1 service1.adten.de - - - - - - - - - - - - - - - - 127.0.0.1 shorttail.net - - - - 127.0.0.1 sitebrand.geeks.com 127.0.0.1 sitemerkezi.net 127.0.0.1 sitemeter.com