惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
GRAHAM CLULEY
T
Tenable Blog
Know Your Adversary
Know Your Adversary
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Privacy International News Feed
S
Security Affairs
NISL@THU
NISL@THU
O
OpenAI News
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Schneier on Security
Schneier on Security
S
SegmentFault 最新的问题
S
Schneier on Security
G
Google Developers Blog
V
V2EX
C
Check Point Blog
U
Unit 42
Google DeepMind News
Google DeepMind News
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
T
The Exploit Database - CXSecurity.com
Recent Announcements
Recent Announcements
M
MIT News - Artificial intelligence
S
Secure Thoughts
博客园 - 司徒正美
Recorded Future
Recorded Future
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
K
Kaspersky official blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
AI
AI
博客园 - 聂微东
N
News and Events Feed by Topic
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
The Hacker News
The Hacker News
The Last Watchdog
The Last Watchdog
Project Zero
Project Zero
W
WeLiveSecurity
博客园 - Franky

博客园 - 后厂村思维导图馆

一道小学一年级数学题,国产大模型全军覆没 Java日志框架的依赖设置备查(SLF4J, Log4j, Logback) 简单了解一下国产操作系统 我整理了近五年的开发者报告,看看国内外有什么差异? 简单了解一下国产GPU Docsify on VPS,搭建最简个人博客 简单了解一下国产CPU 向量数据库Pinecone,治疗ChatGPT幻觉的药方? 今天看到博客园的捐款求助,园龄17年6个月的我有些感慨 如何假装你懂机器学习? 如何假装你懂Meta Segment Anything? 如何假装你懂GPU? 如何假装你懂图片生成AI(Midjourney、文心一格)? 如何假装你懂ChatGPT? APP开发,微信第三方登录的介绍 Java Lambda基础——Function, Consumer, Predicate, Supplier, 及FunctionalInterface接口 Kerberos ticket lifetime及其它 HBase + Kerberos 配置示例(二) HBase + Kerberos 配置示例(一) Hadoop-2.6.0 + Zookeeper-3.4.6 + HBase-0.98.9-hadoop2环境搭建示例
程序员生存指南——镜像加速
后厂村思维导图馆 · 2018-12-11 · via 博客园 - 后厂村思维导图馆

【注:结尾有大福利哦!】

由于一种众所周知的原因,国内对外网的访问经常出现速度缓慢或者干脆无法连接的情况,而程序员则是这种现象最大的受害者(没有之一),常常Maven Resolve一下,一天时间就过去了,老板会听你解释吗,不存在的好吗。

我们也很绝望啊,所以作为程序员,一个必要的生存技巧就是,要会设置各种镜像加速,例如以下几种(以设置阿里云的各种镜像为例)。

  • Maven

编辑~/.m2/settings.xml(如不存在则创建):

<mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
</mirrors>
  •  Gradle

编辑/.gradle/init.gradle(如不存在则创建):

allprojects{
    repositories {
        def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
        def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
                    remove repo
                }
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL."
                    remove repo
                }
            }
        }
        maven {
                url ALIYUN_REPOSITORY_URL
                url ALIYUN_JCENTER_URL
        }
    }
}
  • Pip

编辑~/.pip/pip.conf(如不存在则创建): 

[global] 
index-url = http://mirrors.aliyun.com/pypi/simple/ 
[install] 
trusted-host=mirrors.aliyun.com
  • Docker

编辑/etc/docker/daemon.json(如不存在则创建):

注:需要有阿里云账号(可以用淘宝之类的账号登陆),登陆阿里云之后在产品列表选择“容器镜像服务”,点击左侧“镜像加速器”,即可看的属于你的镜像地址。

{
  "registry-mirrors": ["https://yourcode.mirror.aliyuncs.com"]
}

需要重启docker:

sudo systemctl daemon-reload
sudo systemctl restart docker
  • Yum

Yum使用阿里云镜像(先备份原repo,再下载阿里云的repo文件):

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

好了,今天的生存指南就先到这,下期见!

福利在这里,凡关注“后厂村思维导图馆”公众号的,馆长将免费送出大数据经典书籍,没错,就是下面这本,纸质书哦!还犹豫什么,抓紧点击关注吧。

(由于文章留言功能目前有问题,请大家直接在公众号里留言给出发货地址,如果不想要纸质书的,我也可以发一些经典的大数据PDF给到家,谢谢!)