Skip to content

Instantly share code, notes, and snippets.

@emorrp1
Created June 13, 2015 17:32
Show Gist options
  • Save emorrp1/eea576daf0be74877b31 to your computer and use it in GitHub Desktop.
Save emorrp1/eea576daf0be74877b31 to your computer and use it in GitHub Desktop.
netselect-apt combined with apt-spy
#/bin/sh
sudo netselect-apt -o /dev/null > netselect-apt.out
sudo netselect-apt -o /dev/null >> netselect-apt.out
sudo netselect-apt -o /dev/null >> netselect-apt.out
awk -F'/' '{print $3}' netselect-apt.out | sed '/^$/d' > netselect-apt
apt-spy update -m apt-spy.mirrors
grep -f netselect-apt apt-spy.mirrors | grep -v '^ ' > apt-spy.domains
echo -e "AA\n" > apt-spy
cat apt-spy.domains >> apt-spy
echo >> apt-spy
apt-spy -d jessie -m apt-spy -s AA -o sources.list
rm netselect-apt* apt-spy*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment