设置:
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
取消:
git config --global --unset http.proxy
git config --global --unset https.proxy
设置:
export http_proxy=http://127.0.0.1:1080
export https_proxy=https://127.0.0.1:1080
export https_proxy="socks5://127.0.0.1:1080"
取消:
unset http_proxy
$Env:http_proxy="http://127.0.0.1:1080";
$Env:https_proxy="http://127.0.0.1:1080"
设置:
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080
set http_proxy_user=user
set http_proxy_pass=pass
set https_proxy_user=user
set https_proxy_pass=pass
取消:
set http_proxy=
set https_proxy=
由于 ping
不走代理,可以使用 curl -v https://www.google.com
验证。
https://mirrors.aliyun.com/pypi/simple/
https://pypi.tuna.tsinghua.edu.cn/simple/
https://pypi.mirrors.ustc.edu.cn/simple/
使用 pip3 install -i <src> <package name>
临时指定安装源
若需要全局换源,则修改~/.pip/pip.conf
文件如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
https://mirrors.ustc.edu.cn/ubuntu/
http://mirrors.aliyun.com/ubuntu/
修改 /etc/apt/sources.list
使用vim替换可参考如下正则::%s/http:\/\/archive.ubuntu.com/https:\/\/mirrors.ustc.edu.cn/g
上面是两个整站镜像,可以浏览和下载。
不建议登录,因为不是直接访问原站,存在安全隐患。
download.fastgit.org
将网址中的 github.com
替换为 download.fastgit.org
即可
假设下载链接为 https://github.com/A/A/releases/download/1.0/1.0.tar.gz
转换为 https://download.fastgit.org/A/A/releases/download/1.0/1.0.tar.gz
下载即可
将网址中的 raw.githubusercontent.com
替换为 raw.sevencdn.com
即可
将网址中的 github.com
替换为 cdn.jsdelivr.net/gh
即可。
ps. jsdelivr
不支持exe
下载。
一个可以方便的管理 hosts 配置的软件。
左边栏
=> 设置
=> 自定义命令
可以添加每次更改 hosts 后执行的命令。
windows可以添加ipconfig /flushdns
命令,令其每次更改 hosts 后自动刷新。