持续获取可访问谷歌的hosts(已证实可用)
@echo off
REM 欢迎圈我,在顶栏的"查找人员"处输入Felix Hsu即可
REM Patched by logicmd
REM 准备工作,先清一下DNS缓存,再备份hosts
ipconfig /flushdns
cls
REM 测试时有的朋友会不耐烦的点掉,咱提示一下:
echo Google+ hosts自动修改脚本
echo 请稍等一下,正在通过网络获取可用IP
REM 然后ping www.google.cn和www.google.com以获取最新的IP,赋值%CNIP%和%COMIP%
REM ping ditu.google.cn获取最新的IP,赋值%MAPIP%
for /f "tokens=2 delims=[]" %%i in ('ping www.g.cn') do set CNIP=%%i
for /f "tokens=2 delims=[]" %%i in ('ping www.l.google.com') do set COMIP=%%i
for /f "tokens=2 delims=[]" %%i in ('ping ditu.google.cn') do set MAPIP=%%i
REM 找到之前改过的行,删掉,很stupid的方法...
type %windir%\System32\drivers\etc\hosts|find "#THISISNOTE" /i /v|find "#Google Plus" /i /v|findstr "." >>%windir%\System32\drivers\etc\hosts2
ren %windir%\System32\drivers\etc\hosts hosts3
ren %windir%\System32\drivers\etc\hosts2 hosts
del hosts3 /s /q
REM 为了美观和避免直接在文件末尾添加的惨剧,咱空一行
echo. >>%windir%\System32\drivers\etc\hosts
echo #Google Plus >>%windir%\System32\drivers\etc\hosts
REM 把获取到的%CNIP%和%COMIP%给写进去,为了方便以后可以删除,加了一个#THISISNOTE 的注释,我实在是想不出怎么做了,望见谅
echo %CNIP% plus.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% talkgadget.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% picasaweb.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% lh1.ggpht.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% lh2.ggpht.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% lh3.ggpht.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% lh4.ggpht.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% lh5.ggpht.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% lh6.ggpht.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% lh6.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% lh5.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% lh4.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% lh3.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% lh2.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% lh1.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% plus.google.com.hk #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% s2.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% s1.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images1-focus-opensocial.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images2-focus-opensocial.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images3-focus-opensocial.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images4-focus-opensocial.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images5-focus-opensocial.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images6-focus-opensocial.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images-pos-opensocial.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% maps-api-ssl.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% www.google.com.hk #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% www.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% webcache.googleusercontent.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% mail.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% www.googlelabs.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% docs.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% plus.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% profiles.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% services.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% clients4.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% clients2.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% chrome.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% tools.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
REM 把获取到的%MAPIP%
echo %MAPIP% maps.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %MAPIP% ditu.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
REM ok,搞定
echo 您的hosts编辑完成.
REM 按任意键继续的功能千万别有,否则别人问你按任意键是神马意思的话...
来自:https://plus.google.com/102216617437795883914/posts/EzYX2HJjm61
持续获取可访问谷歌的hosts(已证实可用)的更多相关文章
- android开发遇到SDK无法访问谷歌而安装不了的情况
遇到SDK无法访问谷歌而安装不了的情况 1.修改C:\Windows\System32\drivers\etc的HOSTS文件,添加 #google_android更新203.208.46.146 d ...
- Linux分析日志获取最多访问的前10个IP
原文地址:http://xuqq999.blog.51cto.com/3357083/774714 apache日志分析可以获得很多有用的信息,现在来试试最基本的,获取最多访问的前10个IP地址及访问 ...
- linux分析apache日志获取最多访问的前10个IP
apache日志分析可以获得很多有用的信息,现在来试试最基本的,获取最多访问的前10个IP地址及访问次数. 既然是统计,那么awk是必不可少的,好用而高效. 命令如下: awk '{a[$1] += ...
- PHP 获取当前访问的完整URL
代码如下: <?php // php 获取当前访问的完整url function GetCurUrl() { $url = 'http://'; if(isset($_SERVER['HTTPS ...
- 获取ip,获取客户端浏览器,获取客户端访问操作系统,获取客户端访问设备
/** * 获取ip */ public static function getIp() { if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CL ...
- Nginx反向代理+Tomcat+Springmvc获取用户访问ip
Nginx+Tomcat+Springmvc获取用户访问ip 1.Nginx反向代理 修改Nginx配置文件 location / { ***********之前代码*******; proxy_se ...
- Windows10 64位下安装TensorFlow谷歌人工智能系统已官方原生支持
Windows10 64位下安装TensorFlow谷歌人工智能系统已官方原生支持 GitHub - tensorflow/tensorflow: Computation using data flo ...
- 第14.4节 使用IE浏览器获取网站访问的http信息
上节<第14.3节 使用google浏览器获取网站访问的http信息>中介绍了使用Google浏览器怎么获取网站访问的http相关报文信息,本节介绍IE浏览器中怎么获取相关信息.以上节为基 ...
- C#开发BIMFACE系列3 服务端API之获取应用访问凭证AccessToken
系列目录 [已更新最新开发文章,点击查看详细] BIMFACE 平台为开发者提供了大量的服务器端 API 与 JavaScript API,用于二次开发 BIM 的相关应用. BIMFACE ...
随机推荐
- Network Address Translation(转载)
Network Address Translation 来源:http://alexanderlaw.blog.hexun.com/9791596_d.html 地址转换用来改变源/目的 ...
- Oracle表空间不足
Oracle临时表空间不足 -- 用户的缺省表空间.临时表空间 select t.username, t.default_tablespace, t.temporary_tablespace from ...
- sql查看数据字典(表结构)
SELECT (case when a.colorder=1 then d.name else null end) 表名, a.colorder 字段序号,a.name 字段名, (case when ...
- JVM内存结构之二--新生代及新生代里的两个Survivor区(下一轮S0与S1交换角色,如此循环往复)、常见调优参数
一.为什么会有年轻代 我们先来屡屡,为什么需要把堆分代?不分代不能完成他所做的事情么?其实不分代完全可以,分代的唯一理由就是优化GC性能.你先想想,如果没有分代,那我们所有的对象都在一块,GC的时候我 ...
- redmine 配置邮件发送为async后,不能发送邮件(转载)
通过参考:http://www.oschina.net/question/2005703_16688 之前configuration.yaml文件中email的相关配置如下: production: ...
- 【Python与机器学习】:利用Keras进行多类分类
多类分类问题本质上可以分解为多个二分类问题,而解决二分类问题的方法有很多.这里我们利用Keras机器学习框架中的ANN(artificial neural network)来解决多分类问题.这里我们采 ...
- sql查询指定范围内的所有月份
),) FROM master..spt_values WHERE type='P' AND DATEADD(MONTH,number,'2016-01-01')<='2017-01-01'
- Django model 中meta options之 abstract
当abstract=True时,这个model就变成了abstrct base class,那这个基类有什么特性呢? 当某一model中设置了abstract=True时,就会使该model中的字段都 ...
- 转 C# 给某个方法设定执行超时时间
在某些情况下(例如通过网络访问数据),常常不希望程序卡住而占用太多时间以至于造成界面假死. 在这时.我们可以通过Thread.Thread + Invoke(UI)或者是 delegate.Begin ...
- Spark Streaming源码解读之生成全生命周期彻底研究与思考
本期内容 : DStream与RDD关系彻底研究 Streaming中RDD的生成彻底研究 问题的提出 : 1. RDD是怎么生成的,依靠什么生成 2.执行时是否与Spark Core上的RDD执行有 ...