Skip to content

Instantly share code, notes, and snippets.

@vctrtvfrrr
Created August 9, 2019 14:41
Show Gist options
  • Save vctrtvfrrr/78cdbefb1d780ad109e9a4fdd5413ef9 to your computer and use it in GitHub Desktop.
Save vctrtvfrrr/78cdbefb1d780ad109e9a4fdd5413ef9 to your computer and use it in GitHub Desktop.
Oneliner that select best (by download speed) mirror based on mirrors.ubuntu.com for yours ip
# Oneliner that select best (by download speed) mirror based on mirrors.ubuntu.com for yours ip.
curl -s http://mirrors.ubuntu.com/mirrors.txt | xargs -n1 -I {} sh -c 'echo `curl -r 0-102400 -s -w %{speed_download} -o /dev/null {}/ls-lR.gz` {}' |sort -g -r |head -1| awk '{ print $2 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment