r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Syllable] The free desktop and server operating system family

Graham
15-Sep-2008
[1631]
#!/sbin/rebol  -qw
Rebol [
 file: %update.r

 purpose: {Update the system clock based upon the nist.gov time server}
 author: {Graham Chiu}
 date: 15-Apr-2007
]

get-nist-correction: func [/local nist-time cpu-time mjd hms] [
 nist-time: read daytime://time-a.nist.gov
 cpu-time: now

 parse/all nist-time [skip copy mjd 5 skip 2 thru " " copy hms 8 skip]
 nist-time: 17/Nov/1858 + to integer! mjd
 nist-time/time: to time! hms
 nist-correction: difference nist-time cpu-time
]

forever [
 if error? set/any 'err try [
 print [ "Current time was: " now ]
 current-time: now + get-nist-correction
 print [ "New time is: " current-time ]

 s: rejoin [ "date -s " {"} current-time/month "/" current-time/day 
 "/" current-time/year " " current-time/time {"} ]
 probe s
 call s 
 ][ probe mold disarm err ]
 wait 00:02:00 ;; wait 2 mins
]
Kaj
15-Sep-2008
[1632]
Interesting case, though. Virtualisation is one of the areas I want 
to focus on with Syllable Server
Graham
15-Sep-2008
[1633x3]
Looks like Ladislav and I wrote this.
the other way is just setup a time server on the host os and use 
the daylight protocol
daytime
Kaj
15-Sep-2008
[1636]
How big is your RebelBB message database at the momen?
Graham
15-Sep-2008
[1637x4]
not very big.  It's just a mail folder
wouldn
wouldn't be more than 100 messages
I use it as a knowledgebase
Kaj
15-Sep-2008
[1641x3]
Oh :-)
That's very lightweight
Could replace the whole RebelBB/Dovecot thing with a REBOL script 
in an evening :-)
Graham
15-Sep-2008
[1644]
It's supposed to be scaleable :)
Kaj
15-Sep-2008
[1645]
It would be :-)
Graham
15-Sep-2008
[1646]
I actually stripped out all the html and compress the data which 
is then downloaded by a rebol client
Kaj
15-Sep-2008
[1647]
Aargh. How about just doing this with REBOL/Services?
Graham
15-Sep-2008
[1648]
then I would have to write a bbs ( again again again ) in Rebol!
Kaj
15-Sep-2008
[1649x2]
Well, if you call a table of hundred lines a BBS :-)
Is it even updated through a web interface, or just through the REBOL 
client?
Graham
15-Sep-2008
[1651]
registration is via the web ...
Kaj
15-Sep-2008
[1652]
OK
Graham
15-Sep-2008
[1653]
but messages are thru the Rebol client
Kaj
15-Sep-2008
[1654]
Odd. Doesn't sound like a problem to combine it?
Graham
15-Sep-2008
[1655x2]
Saved me time :)
http://www.compkarori.co.nz:9000/cgi-bin/rebelBB.cgi
Kaj
15-Sep-2008
[1657x2]
Sounds like it costs more time to configure all the pieces (and keep 
them running on time) then to write it in REBOL
Similar considerations made me build two operating systems instead 
of keeping messing with Linux and Windows
Graham
15-Sep-2008
[1659]
the idea was to avoid writing any specific rebol scripts
Kaj
15-Sep-2008
[1660]
But you did, for the REBOL client, and the time?
Graham
15-Sep-2008
[1661]
and to avoid messing with dbms
Kaj
15-Sep-2008
[1662]
But you configured an IMAP database?
Graham
15-Sep-2008
[1663x2]
sure ...
well, there's only one user ... the rebelbb script.
Kaj
15-Sep-2008
[1665]
I'll let it go around in my brain and keep you posted on my work
Graham
15-Sep-2008
[1666]
I did try using yahoo mail as the imap server but there was too much 
latency
Kaj
15-Sep-2008
[1667]
Have you worked with REBOL/Services?
Graham
15-Sep-2008
[1668x2]
No
Just the Beer implementation
Kaj
15-Sep-2008
[1670]
Does your REBOL client just download a file?
Graham
15-Sep-2008
[1671]
it does an async read of the messages
Kaj
15-Sep-2008
[1672]
Oh, IMAP of course
Kaj
16-Sep-2008
[1673x2]
Did the first build run of a stripped Syllable Server last night. 
Worked right away. Stripping out things such as printing and scanning 
reduced the footprint from 370 MB to under 250
That's with all the REBOL goodies still in :-)
Henrik
16-Sep-2008
[1675]
How much do the REBOL goodies take up?
Graham
16-Sep-2008
[1676]
what is scanning doing in a server build?
Kaj
16-Sep-2008
[1677x4]
I'm sure someone could think up a scanning server. :-) Document archiving 
or in an embedded device or so
In any case, the regular Syllable Server is meant to be full-featured
The REBOL goodies are tiny, of course
REBOL/Core is 700 KB and that includes rebbase and a bit of documentation