Skip to content

Instantly share code, notes, and snippets.

@imcj
Created June 17, 2013 07:34
Show Gist options
  • Save imcj/5795221 to your computer and use it in GitHub Desktop.
Save imcj/5795221 to your computer and use it in GitHub Desktop.

https://github.com/imcj/get-mirror

get-mirror

通过查询当前设备的IP地址,获得在物理位置上比较接近的镜像服务。

vagrant@vagrant:~$ echo $(get-mirror ubuntu)
cn.archive.ubuntu.com

适用于:

  • pypi
  • gem
  • apt
  • yum
$ pip install -r requirements.txt -i $(get-mirror pypi)

缺陷

  • 没有把抓取到的数据容缓存本地在本地
  • no gem
  • no debian apt
  • no yum

安装

安装非常简单

$ pip install get-mirror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment