Update system time with HTTP
The other day I needed to update the time on a server that didn’t have access to any NTP servers. It was a server located in a locked down network with only HTTP/HTTPS access to the internet. I found the following command that allowed me to update the time/date through HTTP
date -s "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"
Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.