You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
I'm splitting this out from #24. I want to add an alert whenever your public IP changes.
I can easily get GeoIP from the public IP, and display latency by pinging 8.8.8.8. This will create a useful alert that shows the following:
local IP <latency ms> public ip (geolocation)
The command to get the new public ip is:
dig +short myip.opendns.com @resolver1.opendns.com
-> 123.123.123.123The command to get the GeoIP reported city is (requires
brew install geoip
):geoiplookup 123.123.123.123 | tail -1 | perl -pe 's/.*?: .*?, .., .*?, //g' | perl -pe 's/, .*$//g'
-> MontréalThe command to get the latency is:
ping -c 1 -t 1 8.8.8.8 | tail -1 | perl -pe 's/^(.* = \d*\.\d*\/)(\d*)(.\d*\/.*)$/$2 ms/gm'
-> 19msThe text was updated successfully, but these errors were encountered: