Search the web
Sign In
New User? Sign Up
xml-rpc · XML-RPC Discussion
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Fw: xmlrpc time, thanks for the info   Message List  
Reply | Forward Message #3688 of 6839 |
 
----- Original Message -----
From: Randy Lea
Sent: Wednesday, October 03, 2001 3:36 PM
Subject: xmlrpc time, thanks for the info

Dave,
 
I have been using the NIST web server to set my sytem time, doing it the hard way dealing with HTML. After I read the blogged info on the time/xmlrpc, I just created this little 8 line program to set my Win32 box's time/date.
 
Thanks,
 
Randy Lea
 
 
 
+++++++++++++++++++++++++++++++++++++++++++++++++++
# time.py
 
# set the system date and time to that found on
# the xmlrpc.com server (win32 only)
 
# Import the xmlrpclib module into namespace
from xmlrpclib import *
 
# import string and os modules
import string, os
 
# Instantiate a new XML-RPC Server object
# pointed at the xmlrpc.com time server
server = Server("http://time.xmlrpc.com/RPC2")
 
# get the time and date, convert it to a list
now = (string.split("%s" % server.currentTime.getCurrentTime()))[1]
 
# create a command string with the correct values
dateCmd = "date %s-%s-%s" % (now[4:6],now[6:8],now[:4])
timeCmd = "time %s" % now[9:]
 
# execute the win32 shell commands to set time and date
os.system(timeCmd)
os.system(dateCmd)
 
##print timeCmd
##print dateCmd


Wed Oct 3, 2001 10:38 pm

dave@...
Send Email Send Email

Forward
Message #3688 of 6839 |
Expand Messages Author Sort by Date

... From: Randy Lea To: dave@... Sent: Wednesday, October 03, 2001 3:36 PM Subject: xmlrpc time, thanks for the info Dave, I have been using the NIST...
Dave Winer
dave@...
Send Email
Oct 3, 2001
10:38 pm

If you want accurate time accurate to a fraction of a second, you might try using an ntp client. NTP is a protocol designed to allow accurate distribution of...
Ian Marsman
imarsman@...
Send Email
Oct 4, 2001
5:56 am

I look at things from a security perspective... If you're going to pass anything into os.system() then you'd better validate the heck out of it. The code as...
bukys@...
Send Email
Oct 4, 2001
11:05 am

Help me understand -- I'm a relative newbie to the issues of clock synchronization. I understand that a hack on our system could screw up systems that are...
Dave Winer
dave@...
Send Email
Oct 4, 2001
2:49 pm

os.system("time blah; rm -rf /") -Alex- ... ___________________________________________________________________ S. Alexander Jacobson...
S. Alexander Jacobson
alex@...
Send Email
Oct 4, 2001
3:24 pm

White man speak with forked tongue. ;-> Dave ... From: "S. Alexander Jacobson" <alex@...> To: <xml-rpc@yahoogroups.com> Sent: Thursday, October 04, 2001...
Dave Winer
dave@...
Send Email
Oct 4, 2001
3:28 pm

... The point is simply that you need to protect yourself from people smugling bad stuff into your shell commands (using ";" to separate commands"). The sampe...
S. Alexander Jacobson
alex@...
Send Email
Oct 4, 2001
3:47 pm

Ahhhhhhhhhhhhhh. Light bulb goes on. I didn't see this because we don't do that kind of stuff in our environment. We have a built-in verb called clock.set that...
Dave Winer
dave@...
Send Email
Oct 4, 2001
3:57 pm

... Regardless of what you're doing in Frontier, ther rest of the OS may be *extremely* dependent on reliable and accurate time. Things like Kerberos tickets...
Bill Kearney
wkearney99@...
Send Email
Oct 4, 2001
4:28 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help