#!/usr/bin/env python # Sets the time on a RISC PC. # (c) 2007 Silas S. Brown. License: GPL # This script should be run on another machine # (any platform that supports Python). The # clock of the machine on which this script is # running should be correct. The RISC PC # should be running a Telnet server. # Set this to the IP address of your RISC PC: risc = "192.168.142.2" import socket,time s=socket.socket() s.connect((risc,23)) # or whatever def slowsend(str): for c in str: s.send(c) ; s.recv(100) slowsend('basic\n') h = (int)(time.time()*100) + 0x336E93EBE4L # hundreths of a sec since 1900 if time.localtime()[-1]: h += 360000 # BST/DST slowsend('SYS "Territory_SetTime",CHR$(%d)+CHR$(%d)+CHR$(%d)+CHR$(%d)+CHR$(%d)\n' % (h&255, (h>>8)&255, (h>>16)&255, (h>>24)&255, (h>>32)&255))