Skip to content

Instantly share code, notes, and snippets.

@cyounkins
Created July 13, 2021 20:21
Show Gist options
  • Save cyounkins/c6b00b79a7f1fd137dc9a81b644786d6 to your computer and use it in GitHub Desktop.
Save cyounkins/c6b00b79a7f1fd137dc9a81b644786d6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env fish
for domain in google.com www.google.com youtube.com amazon.com facebook.com zoom.us ebay.com reddit.com wikipedia.org netflix.com salesforce.com walmart.com
for dns in 8.8.8.8 208.67.222.222 4.2.2.1 8.26.56.26 84.200.69.80 9.9.9.9 1.1.1.1
echo -n "$domain $dns $domain|$dns "
cat "$domain-$dns.txt" | sed -E 's|[^0-9]*([0-9]+).*|\1|' | awk '{if(min==""){min=max=$1}; if($1>max) {max=$1}; if($1<min) {min=$1}; total+=$1; count+=1} END {print total/count, max, min}'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment