diff --git a/README.md b/README.md index ce19e8e..8a4721f 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,26 @@ -# Github Acceleration Best Practices - -Github Acceleration Best Practices, see at: [GitHub 加速最佳实践](https://dbarobin.com/2017/01/24/github-acceleration-best-practices). - -## Installation - -Installation via git clone or download this repo. - -## Usage - -1. Git clone or download zip -2. Execute `python github_hosts.py`, python 2.7+ required -3. Copy content of `github_hosts.txt` to local hosts file -4. Enjoy GitHUb! - -## Contributing - -1. Fork it! -2. Create your feature branch: `git checkout -b my-new-feature` -3. Commit your changes: `git commit -am 'Add some feature'` -4. Push to the branch: `git push origin my-new-feature` -5. Submit a pull request :D - -## Contact - -blockxyz@gmail.com - -## License - -MIT. - - +# 最新方法 +参考此项目 https://github.com/521xueweihan/GitHub520#22-%E8%87%AA%E5%8A%A8%E6%96%B9%E5%BC%8F + +--- +> 以下方法不保证有效,仅供参考 + +## 使用方法 + +参见博客文章[github代码clone加速](http://nullpointer.pw/github%E4%BB%A3%E7%A0%81clone%E5%8A%A0%E9%80%9F.html) + +最麻烦的方式就是去手动修改 host 文件,最简单的方式就是下载 [Switch Host](https://oldj.github.io/SwitchHosts/) 软件进行 host 修改,跨平台,因为 hosts 文件每日都会自动更新,所以需要本地的 hosts 也能自动更新, 好在 SwitchHosts 提供了远程 hosts 的功能。 + +1. 复制如下 hosts 地址 + ``` + https://gitee.com/Mosiki/github/raw/master/github_hosts.txt + ``` +1. 新增远程 hosts +笔者在 mac 下操作,win 是同理。 +![](http://img12345.5-project.com/blog/20190404212331.png) +1. 设置自动更新 +选择 24 小时即可,第一次添加的时候需要手动点击刷新按钮,刷新获取一下远程的 hosts +![](http://img12345.5-project.com/blog/20190404212810.png) +更新完成之后点击确定保存即可。 +1. 打开 hosts 开关 +![](http://img12345.5-project.com/blog/20181124164505.png) +如图设置完,把开关打开就 Ok 了。 diff --git a/github_domain.txt b/github_domain.txt index e247044..f668333 100644 --- a/github_domain.txt +++ b/github_domain.txt @@ -13,4 +13,6 @@ avatars4.githubusercontent.com avatars5.githubusercontent.com avatars6.githubusercontent.com avatars7.githubusercontent.com -avatars8.githubusercontent.com \ No newline at end of file +avatars8.githubusercontent.com +github.githubassets.com +github.global.ssl.fastly.net diff --git a/github_hosts.py b/github_hosts.py index 4afd0a5..36134a2 100644 --- a/github_hosts.py +++ b/github_hosts.py @@ -35,8 +35,8 @@ def main(): result.write(ip.strip('\n') + " " + host) f = open('github_hosts.txt','a') - f.write("# GitHub End\n") + f.write("\n# GitHub End\n") f.close() if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/github_hosts.txt b/github_hosts.txt index 04a0580..edbde41 100644 --- a/github_hosts.txt +++ b/github_hosts.txt @@ -1,18 +1,21 @@ # GitHub Start -192.30.255.113 github.com -192.30.255.119 gist.github.com -185.199.110.153 assets-cdn.github.com -151.101.228.133 raw.githubusercontent.com -151.101.228.133 gist.githubusercontent.com -151.101.228.133 cloud.githubusercontent.com -151.101.228.133 camo.githubusercontent.com -151.101.228.133 avatars0.githubusercontent.com -151.101.228.133 avatars1.githubusercontent.com -151.101.228.133 avatars2.githubusercontent.com -151.101.228.133 avatars3.githubusercontent.com -151.101.228.133 avatars4.githubusercontent.com -151.101.228.133 avatars5.githubusercontent.com -151.101.228.133 avatars6.githubusercontent.com -151.101.228.133 avatars7.githubusercontent.com -151.101.228.133 avatars8.githubusercontent.com -# GitHub End \ No newline at end of file +52.74.223.119 github.com +13.250.177.223 gist.github.com +185.199.111.153 assets-cdn.github.com +151.101.76.133 raw.githubusercontent.com +151.101.76.133 gist.githubusercontent.com +151.101.76.133 cloud.githubusercontent.com +151.101.76.133 camo.githubusercontent.com +151.101.76.133 avatars0.githubusercontent.com +151.101.76.133 avatars1.githubusercontent.com +151.101.76.133 avatars2.githubusercontent.com +151.101.76.133 avatars3.githubusercontent.com +151.101.76.133 avatars4.githubusercontent.com +151.101.76.133 avatars5.githubusercontent.com +151.101.76.133 avatars6.githubusercontent.com +151.101.76.133 avatars7.githubusercontent.com +151.101.76.133 avatars8.githubusercontent.com +185.199.110.154 github.githubassets.com +31.13.83.8 github.global.ssl.fastly.net + +# GitHub End diff --git a/proxychains.conf b/proxychains.conf index 7698c95..cc7105e 100644 --- a/proxychains.conf +++ b/proxychains.conf @@ -10,4 +10,4 @@ localnet 172.16.0.0/255.240.0.0 localnet 192.168.0.0/255.255.0.0 [ProxyList] -http 127.0.0.1 1235 +http 127.0.0.1 1087