柚子快报邀请码778899分享:github访问失败

http://yzkb.51969.com/

1. 问题场景

今天了解到notepad++可以安装许多插件,但是自动下载插件时总是失败,这些插件的下载源都是github,将地址复制到浏览器也打不开,所以查了下github的访问问题,目前插件已正常下载。

2. 解决方法

gitee上搜索github520,这是github上开源的一个项目,其中保存有一份host文件,定期更新,该文件记录了访问github所使用的所有相关域名的IP地址,文件内容如下。

# GitHub520 Host Start

140.82.114.25 alive.github.com

140.82.112.5 api.github.com

185.199.110.153 assets-cdn.github.com

185.199.108.133 avatars.githubusercontent.com

185.199.108.133 avatars0.githubusercontent.com

185.199.108.133 avatars1.githubusercontent.com

185.199.108.133 avatars2.githubusercontent.com

185.199.108.133 avatars3.githubusercontent.com

185.199.108.133 avatars4.githubusercontent.com

185.199.108.133 avatars5.githubusercontent.com

185.199.108.133 camo.githubusercontent.com

140.82.112.22 central.github.com

185.199.108.133 cloud.githubusercontent.com

140.82.114.9 codeload.github.com

140.82.114.21 collector.github.com

185.199.108.133 desktop.githubusercontent.com

185.199.111.133 favicons.githubusercontent.com

140.82.113.3 gist.github.com

54.231.163.97 github-cloud.s3.amazonaws.com

52.216.40.233 github-com.s3.amazonaws.com

52.217.49.196 github-production-release-asset-2e65be.s3.amazonaws.com

16.182.72.249 github-production-repository-file-5c1aeb.s3.amazonaws.com

52.216.59.25 github-production-user-asset-6210df.s3.amazonaws.com

192.0.66.2 github.blog

140.82.114.3 github.com

140.82.112.18 github.community

185.199.109.154 github.githubassets.com

151.101.1.194 github.global.ssl.fastly.net

185.199.110.153 github.io

185.199.108.133 github.map.fastly.net

185.199.110.153 githubstatus.com

140.82.114.25 live.github.com

185.199.108.133 media.githubusercontent.com

185.199.110.133 objects.githubusercontent.com

13.107.42.16 pipelines.actions.githubusercontent.com

185.199.108.133 raw.githubusercontent.com

185.199.108.133 user-images.githubusercontent.com

13.107.246.40 vscode.dev

140.82.114.21 education.github.com

# Update time: 2023-11-22T08:53:27+08:00

# Update url: https://raw.hellogithub.com/hosts

# Star me: https://github.com/521xueweihan/GitHub520

# GitHub520 Host End

最新的hosts文件也可以点这里下载https://raw.hellogithub.com/hosts。将该文件内容追加到系统hosts文件末尾,以下列举了不同操作系统的hosts文件的位置,该步骤需要管理员权限。

Windows 系统:C:\Windows\System32\drivers\etc\hostsLinux 系统:/etc/hostsMac(苹果电脑)系统:/etc/hostsAndroid(安卓)系统:/system/etc/hostsiPhone(iOS)系统:/etc/hosts

修改hosts文件后,访问https://github.com/就非常流畅了。如未生效可尝试下面的办法,刷新 DNS,或重启电脑。

Windows:在 CMD 窗口输入:ipconfig /flushdnsLinux 命令:sudo nscd restart,如报错则须安装:sudo apt install nscd 或 sudo /etc/init.d/nscd restartMac 命令:sudo killall -HUP mDNSResponder

GitHub上有个SwitchHosts项目,这是一个应用程序,可用于帮助修改系统hosts文件,可以去这里下载编译好的安装版本https://github.com/oldj/SwitchHosts/releases。按照如下配置,则SwitchHosts会定时从网上下载最新的hosts信息,并追加到系统hosts文件中。

Title: 随意Type: RemoteURL: https://raw.hellogithub.com/hostsAuto Refresh: 最好选 1 hour

3. github镜像网站

对于网页访问以及URL下载github上的文件时,可能会出现访问不了,打开缓慢的问题,此时我们将网址或URL中https://github.com替换为镜像网站的域名,即可正常访问和下载了。 官方:https://github.com/espressif/openocd-esp32 kkgithub镜像:https://kkgithub.com/espressif/openocd-esp32 githubfast镜像:https://githubfast.com/espressif/openocd-esp32,访问这个镜像网址,显示To prevent abuse, only git is allowed,也即目前只能用于git下载。 hscsec镜像:https://github.hscsec.cn/espressif/openocd-esp32,这个目前访问超时。 521github镜像:https://521github.com/espressif/openocd-esp32 gitclone镜像:https://gitclone.com/espressif/openocd-esp32,这个目前访问超时。

4. 参考

Github国内镜像详解 【2024-01】GitHub官网太慢了,亲测最新GitHub镜像加速网站,速度快,保证能用。

柚子快报邀请码778899分享:github访问失败

http://yzkb.51969.com/

精彩链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: