yangweijie / note

个人博客
https://yangweijie.github.io/note/
10 stars 1 forks source link

国内开发提速 #32

Open yangweijie opened 7 years ago

yangweijie commented 7 years ago

腾讯源 https://mirrors.cloud.tencent.com/

linux

修改apt 源 https://www.sunzhongwei.com/modify-the-wsl-ubuntu-1804-default-source-for-ali-cloud-images?from=sidebar_new

清华开源 软件源

https://mirror.tuna.tsinghua.edu.cn/

apt-fast

修改yum源为阿里源

1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、之后运行yum makecache生成缓存

相关链接

brew加速

brew cast https://caskroom.github.io/

https://gitee.com/cunkai/HomebrewCN

加速助手

https://brew.idayer.com/guide/change-source/

brew 添加php 源

brew tap kyslik/php brew tap shivammathur/php brew tap exolnet/homebrew-deprecated

bbr 提速

https://github.com/yangweijie/note/issues/30

node

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

npm config set registry 'https://registry.npmmirror.com' export ELECTRON_MIRROR='https://registry.npmmirror.com/mirrors/electron/' export SASS_BINARY_SITE='https://registry.npmmirror.com/mirrors/node-sass'

php

composer

多线程下载插件

opcache

国内 PHP Composer 镜像列表

Composer 是什么?

Composer 是一个 PHP 包管理的系统,现在越来越多的 PHP 使用 Composer 来管理包。
比如 FastAdmin、 ThinkPHP、Laravel 等都是用 Composer 进行 php 包的管理。

镜像列表

国内也很多开发者使用 Composer,但由于不可控因素,官方的服务器常常连接不上。
所以这里收集了一下国内镜像列表。(先后次序会不定期调整)

镜像名 地址 赞助商 更新频率 状态
Laravel 中文社 Composer 镜像 https://packagist.laravel-china.org 又拍云 24 小时
php.cnpkg.org Composer 镜像 https://php.cnpkg.org 安畅网络 60 秒
阿里云 Composer 镜像 https://mirrors.aliyun.com/composer/ 阿里云 5秒
华为云 Composer 镜像 https://repo.huaweicloud.com/repository/php/ 华为云 未知
腾讯云 Composer 镜像 https://mirrors.cloud.tencent.com/composer/ 腾讯云 未知
PHP 国内 Composer 镜像 https://www.phpcomposer.com/ 又拍云 未知 不稳定
Composer 官方 https://packagist.phpcomposer.com 不稳定

镜像管理工具

https://github.com/slince/composer-registry-manager/blob/master/README-zh_CN.md

pip加速

在Linux系统中:

设置阿里云pip源,加速pip更新速度 mkdir ~/.pip cat > ~/.pip/pip.conf << EOF [global] trusted-host=mirrors.aliyun.com index-url=http://mirrors.aliyun.com/pypi/simple/ EOF

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

在windows系统中:

windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini。内容同上。

如果安装包慢,可以添加国内镜像,清华的源: conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

cmd代理

linux

http_proxy=http://hx.gy:1080
export http_proxy

win

设置好ie代理 netsh winhttp import proxy source=ie

yangweijie commented 5 years ago

Github Start

192.30.253.118 gist.github.com 192.30.255.112 github.com 192.30.255.110 www.github.com 151.101.185.194 github.global.ssl.fastly.net 185.199.111.153 assets-cdn.github.com 151.101.184.133 raw.githubusercontent.com 151.101.184.133 cloud.githubusercontent.com 151.101.184.133 camo.githubusercontent.com 151.101.184.133 avatars0.githubusercontent.com 151.101.184.133 avatars1.githubusercontent.com 151.101.184.133 avatars2.githubusercontent.com 151.101.184.133 avatars3.githubusercontent.com 151.101.184.133 avatars4.githubusercontent.com 151.101.184.133 avatars5.githubusercontent.com 151.101.184.133 avatars6.githubusercontent.com 151.101.184.133 avatars7.githubusercontent.com 151.101.184.133 avatars8.githubusercontent.com

Github End

yangweijie commented 4 years ago

docker 加速

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://xyo1yh7z.mirror.aliyuncs.com", "https://ghcr.nju.edu.cn"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
yangweijie commented 3 years ago

java maven 阿里云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">
<pluginGroups>
</pluginGroups>
<localRepository>D:/AllTools/repository</localRepository>
<mirrors>
<mirror>
<id>Aliyun</id>
<mirrorOf>*</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>Aliyun</id>
        <repositories>
            <repository>
                <id>central</id>
                <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>central</id>
                <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
        </properties>
        <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
        </activation>
    </profile>
</profiles>
</settings>

java maven ide 华为云

最快镜像站: 华为开源镜像站 选中镜像站: Huawei Cloud (huawei) chsrc: 请在您的 maven 配置文件 D:\Program Files\JetBrains\IntelliJ IDEA 2024.1.4\plugins\maven\lib\maven3\conf\settings.xml 中添加:

huawei * 华为开源镜像站 https://mirrors.huaweicloud.com/repository/maven/ -------------------------------- 换源完成,感谢镜像提供方: 华为开源镜像站
yangweijie commented 2 years ago

NuGet

1)NuGet镜像源地址:https://nuget.cnblogs.com/v3/index.json

1.首先是微软云中国区提供的加速地址

针对Nuget慢中国区加速地址

2.其次是由腾讯云提供的加速地址

针对Nuget慢中国区加速地址

3.由国内知名IT社区博客园提供的加速地址

针对Nuget慢中国区加速地址

以上多个地址可以切换使用,基本可以应对目前Nuget访问速度比较慢的问题。
2)在NuGet.Config中添加这个镜像源:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.cnblogs.com" value="https://nuget.cnblogs.com/v3/index.json" protocolVersion="3" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
</configuration>

注:NuGet.Config 在 Windows 中路径是 %appdata%\NuGet\NuGet.Config ,在 Mac 与 Linux 中的路径是 ~/.nuget/NuGet/NuGet.Config ,如果没有 NuGet.Config 文件,可以运行 dotnet restore 命令生成。

或者在Visual Studio中的添加方法:

图片.png

由于目前带宽有限,如果出现下面的问题,说明当前带宽跑满了,您可以稍后再试。

The download of 'https://nuget.cnblogs.com/v3-flatcontainer/system.runtime.extensions/4.3.0
/system.runtime.extensions.4.3.0.nupkg' timed out because no data was received for 60000ms.
yangweijie commented 1 year ago

Sublime package channel

package add channel http://cst.stu.126.net/u/json/cms/channel_v3.json

https://sublimetextcn.com/

yangweijie commented 1 year ago

scoop 加速 https://gitee.com/glsnames/scoop-installer

yangweijie commented 4 months ago

winget 提速 https://dashen.wang/7003.html