Update hosts to access GitHub in China
python githubhosts_auto_updater.py
-
Install
Crontab
.(You can check this bycrontab -l
, nothing appears is normal.) -
Download the script to somewhere you like, such as
wget -P ~/.githubhosts_auto_updater/ https://raw.fastgit.org/F-Unction/githubhosts_auto_updater/main/githubhosts_auto_updater.py
-
Make it run by itself, such as
sudo crontab -eu root
Input
echo "0 * * * * python ~/.githubhosts_auto_updater/githubhosts_auto_updater.py
. Save and exit.
Hosts file from https://cdn.jsdelivr.net/gh/521xueweihan/GitHub520@main/hosts