跳转到内容
  • curl brew配置代理
bash
export http_proxy="http://192.168.1.123:7895"
export https_proxy="http://192.168.1.123:7895"
export ALL_PROXY="socks5://192.168.1.123:7895"

cat > ~/.bash.profile << EOF
export http_proxy="http://192.168.1.123:7897"
export https_proxy="https://192.168.1.123:7897"
export ALL_PROXY="socks5://192.168.1.123:7897"
EOF
  • apt 配置代理
bash
sudo touch  /etc/apt/apt.conf.d/proxy.conf
cat > /etc/apt/apt.conf.d/proxy.conf << EOF
Acquire {
  http::Proxy "http://192.168.1.123:7895";
  https::Proxy "http://192.168.1.123:7895";
}
EOF
  • opkg 配置代理
bash
vi /etc/opkg.conf
# 文件末尾添加。 option http_proxy https://dockerproxy.com

opkg update
  • fedora-dnf 配置代理
bash
vim /etc/dnf.conf
# 文件末尾添加: proxy=http://192.168.1.42:7897
  • docker 配置代理
bash
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/http-proxy.conf
sudo cat > /etc/systemd/system/docker.service.d/http-proxy.conf << EOF
[Service]
Environment="HTTP_PROXY=http://192.168.1.123:7895"
Environment="HTTPS_PROXY=http://192.168.1.123:7895"
EOF
sudo systemctl show --property=Environment docker
sudo systemctl daemon-reload
sudo systemctl restart docker
  • pip
bash
docker compose exec jupyter-notebook pip install jupyterlab-language-pack-zh-cn -i https://pypi.tuna.tsinghua.edu.cn/simple
  • git
bash
git config --global http.https://github.com.proxy http://192.168.1.123:7895
git config --global https.https://github.com.proxy https://192.168.1.123:7895

git config --global --unset http.proxy
git config --global --unset https.proxy

git config --global -l
  • npm
bash
npm config set proxy http://192.168.1.123:7895
npm config set https-proxy http://192.168.1.123:7895

npm config delete proxy
npm config delete https-proxy

npm config get proxy
npm config get https-proxy

基于 MIT 许可发布