Skip to content

Instantly share code, notes, and snippets.

@nibalizer
Created September 24, 2012 16:53
Show Gist options
  • Select an option

  • Save nibalizer/3776982 to your computer and use it in GitHub Desktop.

Select an option

Save nibalizer/3776982 to your computer and use it in GitHub Desktop.
script to get ntp servers from ntp.org
#!/usr/bin/zsh
link_base=http://support.ntp.org
relative_links=`curl http://support.ntp.org/bin/view/Servers/StratumOneTimeServers 2>/dev/null | grep Col1 | grep Servers | awk '{print $6}' | cut -d \" -f 2 | grep -v '<a' | grep -v nofollow`
for url_end in `echo "$relative_links" `
do
#echo "$link_base$url_end"
curl $link_base$url_end 2>/dev/null | grep -A1 Address | grep -v Address | tr '\n' ' ' | read v4 v6; #echo 4: $v4; echo 6: $v6
curl $link_base$url_end 2>/dev/null | grep -A1 CountryCode | grep -v CountryCode | tr '\n' ' ' | read countrycode ; #echo Country: $countrycode
curl $link_base$url_end 2>/dev/null | grep -A1 Hostname | grep -v Hostname | tr '\n' ' ' | read hname ; #echo Country: $hname
# echo $hname $countrycode $v4 $v6
if `echo $v6 | grep p >/dev/null` ;then
v6=None
fi
printf "%40s%4s%20s%40s\n" "$hname" "$countrycode" "$v4" "$v6"
done
@indyjgh
Copy link

indyjgh commented Feb 19, 2018

hi i\am hacker i will hack you now fuck u

@KidDeath
Copy link

85029c7a0c1511fac566fa21a1a1e9b4--fantasy-comics-fantasy-art

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment