Skip to content

Instantly share code, notes, and snippets.

@ljjjustin
Created January 16, 2020 06:15
Show Gist options
  • Save ljjjustin/9cd38bd7d669b97434ad81c81b3df34a to your computer and use it in GitHub Desktop.
Save ljjjustin/9cd38bd7d669b97434ad81c81b3df34a to your computer and use it in GitHub Desktop.
#!/bin/bash
if grep -q pypi.pdcts.com.cn /etc/hosts; then
sed -i "/pypi.pdcts.com.cn/ d" /etc/hosts
fi
echo "10.1.1.2 pypi.pdcts.com.cn" >> /etc/hosts
mkdir -p ~/.pip/
touch ~/.pip/pip.conf
cat > ~/.pip/pip.conf << EOS
[global]
timeout = 60
index-url = http://pypi.pdcts.com.cn/pypi/cache/+simple/
trusted-host = pypi.pdcts.com.cn
EOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment