Skip to content

Instantly share code, notes, and snippets.

@kevin39
Created September 23, 2016 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevin39/3f207234a81202aa7ad7a8969b3e4d9b to your computer and use it in GitHub Desktop.
Save kevin39/3f207234a81202aa7ad7a8969b3e4d9b to your computer and use it in GitHub Desktop.
Export Spotify servers IPs
#!/bin/sh
curl -A "http://bgp.he.net/search?search%5Bsearch%5D=spotify&commit=Search" -o /tmp/ips.raw "http://bgp.he.net/search?search%5Bsearch%5D=spotify&commit=Search"
grep -aoEw -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?/[0-9]{2})" -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" /tmp/ips.raw | sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment