各種加速

过错發表於2024-06-11

一 nuget

https://repo.huaweicloud.com/repository/nuget/v3/index.json
https://mirrors.cloud.tencent.com/nuget/

二 pip

全域性設定pip加速。 查詢pip.ini檔案。新增

[global]
index-url = http://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn

pyproject.toml檔案加入以下內容可以加速。執行 poetry install 命令

[[tool.poetry.source]]
name="aliyun"
url="http://pypi.tuna.tsinghua.edu.cn/simple/"
default=true

如果上面報錯 執行 poetry lock --no-update

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

conda

注意如果需要pytorch, 還需要新增pytorch的映象:

conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/pytorch/

npm

npm config set registry https://registry.npm.taobao.org

還原 npm config set registry https://registry.npmjs.org/

yarn

yarn config set registry https://registry.npmmirror.com

還原 yarn config set registry https://registry.yarnpkg.com

pnpm

pnpm config set registry https://registry.npmmirror.com

還原 pnpm config set registry https://registry.npmjs.org

mvn
<mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>

修改${maven.home}/conf或者${user.home}/.m2資料夾下的settings.xml檔案,在<mirrors>標籤下加入上述內容即可。如下:

`````` xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <!-- 阿里雲倉庫 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>

        <!-- 中央倉庫1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>

        <!-- 中央倉庫2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
    </mirrors>
</settings>

##### github 檔案下載

https://d.serctl.com/   將zip地址填入