quick-and-dirty-ubuntu-mirror-chooser
Thursday, April 19, 2007 2:28:43 AM
Just grab the mirrors list from the Ubuntu Archive mirrors list, and put it into a file called mirrors.txt, like this:
http://archive.ubuntu.org.cn/ubuntu/
http://debian.cn99.com/ubuntu/
http://mirror.lupaworld.com/ubuntu/
http://mirrors.kernel.org/ubuntu/
http://mirror.cs.umn.edu/ubuntu/
http://lug.mtu.edu/ubuntu/
http://mirror.clarkson.edu/pub/distributions/ubuntu/
http://ubuntu.mirrors.tds.net/ubuntu/
http://www.opensourcemirrors.org/ubuntu/
http://ftp.ale.org/pub/mirrors/ubuntu/
http://ubuntu.secs.oakland.edu/
http://mirror.mcs.anl.gov/pub/ubuntu/
http://mirrors.cat.pdx.edu/ubuntu/
http://ubuntu.cs.utah.edu/ubuntu/
http://ftp.ussg.iu.edu/linux/ubuntu/
http://mirrors.xmission.com/ubuntu/
http://ftp.osuosl.org/pub/ubuntu/
http://mirrors.cs.wmich.edu/ubuntu/
http://mirrors.ccs.neu.edu/archive.ubuntu.com/
http://mirrors.easynews.com/linux/ubuntu/
http://cudlug.cudenver.edu/ubuntu/
http://mirrors.acm.jhu.edu/ubuntu/
http://ubuntu.cs.uaf.edu/ubuntu/
http://mirror.utdlug.org/linux/distributions/ubuntu/packages/
http://apt.ubuntu.org.tw/ubuntu/
http://apt.nc.hcc.edu.tw/pub/ubuntu/
http://ubuntu.csie.ntu.edu.tw/ubuntu/
http://ftp.cse.yzu.edu.tw/pub/Linux/Ubuntu/ubuntu/
http://mirror.nttu.edu.tw/ubuntu/
http://ubuntu.csie.nctu.edu.tw/ubuntu/
http://ubuntu.mithril-linux.org/archives/
http://ftp.cse.yzu.edu.tw/ftp/Linux/Ubuntu/ubuntu-cd/
http://apt.ubuntu.org.tw/releases/
http://ubuntu.csie.ntu.edu.tw/ubuntu-releases/
http://apt.nc.hcc.edu.tw/pub/ubuntu-cd/
http://ubuntu.mithril-linux.org/releases/
http://mirror.letsopen.com/os/ubuntu-ISO/
http://ubuntu.progression-asia.com/
Read through the super-short script and you’ll figure it out.
#!/bin/bash
mirrors=`cat mirrors.txt`
results="results.txt"
target="ls-lR.gz"
for mirror in $mirrors
do
echo "Testing $mirror ..."
curl -s $mirror$target -o $target \
-w 'Got speed: %{speed_download} from %{url_effective}\n' \
--connect-timeout 3 | tee -a $results
rm -f $target
done









