View Single Post
Old 12-07-2012, 08:04 AM   #1
bhaak
Groupie
bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.
 
bhaak's Avatar
 
Posts: 164
Karma: 164969
Join Date: Dec 2011
Device: Palm IIIx, (iPhone|Kindle) Touch
Time synchronization on the Touch and PW

I noticed a funny thing about how the Kindle Touch and Paperwhite do their time synchronization.

The system calls the shell script /usr/sbin/updatetime (identical on the Touch and the PW).

This script first calls a NTP server at Amazon configured in /etc/sysconfig/ntp.

So far, nothing special. Using NTP is standard procedure.

If the script can't reach the NTP server it falls back on making a web request to an Amazon web server, filtering out the date header from the web server's response.

Nice idea for those situation where only http requests into the net are allowed.

In my case this doesn't help as I have blocked any access out of my intranet on my Touch so I changed the address to a local web server. But then I noticed that the web request is not completely standard compliant (the line endings are wrong) and because of that there was no response.

I changed the get_web_time() function and then it worked flawlessly:
Code:
get_web_time()
{
    printf "HEAD / HTTP/1.0\r\n\r\n" | nc ${HTTP_SERVER} 80 | grep "Date: " | cut -d ' ' -f 3-
}
bhaak is offline   Reply With Quote