一、Github加速拉取
以下地址提供了GitHub拉取的加速服务:
直接在GitHub仓库地址前加入域名即可,如:
1
| git clone https://hub.gitmirror.com/https://github.com/lzwme/ql-scripts.git
|
二、Python国内pip下载加速镜像站
使用方法如:
1 2
| pip install ddddocr -i https://pypi.tuna.tsinghua.edu.cn/simple/ pip install ddddocr -i https://mirrors.aliyun.com/pypi/simple/
|
三、Python开虚拟环境
方式一:
1 2 3 4 5 6 7 8 9 10
| pip3 install python3-venv
# 创建虚拟环境(可选) python -m venv venv
# 激活虚拟环境 # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
|
方式二:
1 2 3 4 5 6 7 8 9
| sudo apt install python3-pip pip3 install virtualenv virtualenv venv # 激活虚拟环境 # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
|
三、Docker的加速地址
给 /etc/docker/daemon.json 配置如下地址
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| { "registry-mirrors": [ "https://docker.xuanyuan.me", "https://docker.sunzishaokao.com", "https://docker.xuanyuan.me/", "https://docker.1ms.run", "https://docker.1panel.live", "https://hub.rat.dev", "https://docker.wanpeng.top", "https://doublezonline.cloud", "https://docker.mrxn.net", "https://docker.anyhub.us.kg", "https://dislabaiot.xyz", "https://docker.fxxk.dedyn.io", "https://docker-mirror.aigc2d.com", "https://docker.m.daocloud.io", "https://docker.imgdb.de", "https://docker-0.unsee.tech", "https://docker.hlmirror.com", "https://cjie.eu.org", "https://docker.m.daocloud.io", "https://huecker.io", "https://dockerhub.timeweb.cloud", "https://noohub.ru" ] }
|
然后重启
1
| sudo systemctl daemon-reload && sudo systemctl restart docker
|
四、npm下载加速
cnpm是淘宝团队维护的国内npm镜像站,任何涉及到npm安装下载的,都可以换成cnpm,国内的下载速度将会更快。下面介绍如何安装cnpm
方法一:传统安装方法
1 2
| npm install -g cnpm --registry=https://registry.npmmirror.com # 安装cnpm cnpm install 包名 # 通过cnpm安装包
|
但是如上的方法也依然容易出错,可以使用方法二
方法二:小众安装方法
1 2 3 4
| npm cache clean --force npm install -g cnpm --registry=https://registry.npm.taobao.org --strict-ssl=false 或者使用如下 npm install --registr=https://registry.npmmirror.com
|
五、cmd走代理加速或拦截
在 cmd 中执行工具或命令前先进行如下设置
1 2
| set http_proxy=http://127.0.0.1:7897 set https_proxy=http://127.0.0.1:7897
|
在 Linux的终端走代理加速
1 2
| export HTTP_PROXY=http://127.0.0.1:7897 export HTTPS_PROXY=http://127.0.0.1:7897
|