drewp for 2008 January

<M <Y
M>

T 2008-01-01T01:26:12 testing my new program to post phone camera mails to my blog. :

T 2008-01-12T22:59:02 Holidays in unix seconds:

I just missed the turning of the unix clock from 1,199,999,999 to 1,200,000,000. It happened last Thursday.

I remember the IRC party for the billennium- lots of people had big ascii art to roll by when their clock said we were going from 999,999,999 to 1,000,000,000 (timezones don't matter, but there are plenty of sync and delay issues on IRC). That was on 2001-09-08, a week which probably won't be remembered for the unix billennium.

1,300,000,000 is in about 3 years, but (aside from the billennium, which could have led to some breakage) these decmial holidays are just for entertainment. The year 2038 is another story, though. Read about the year 2038 bug or 2038bug.com.

 

T 2008-01-22T02:16:04 Smooth migration from CVS to darcs:

I moved another project from CVS to darcs. The main secret is just cvs2darcs, which has worked perfectly for me. But in this case, I knew I there were some URLs in the wild pointing into my viewcvs site, which I didn't want to break.

So I fired up darcsweb, which is nicer than I expected it would be. I'm using nginx, so I can't just run darcsweb as CGI. While eventually the darcsweb toplevel code should be rewritten to not be CGI, for now I'm running a simple twisted.web CGI server. Here's the full code:

#!/usr/bin/python
import sys
from twisted.internet import reactor
from twisted.python import log
from twisted.web import server, resource, static, twcgi

class Root(resource.Resource):
def __init__(self):
resource.Resource.__init__(self)
for f in ['darcs.png', 'minidarcs.png', 'style.css']:
self.children[f] = static.File(f)
self.children[''] = twcgi.CGIScript(filename='./darcsweb.cgi')

log.startLogging(sys.stdout)
reactor.listenTCP(8004, server.Site(Root()))
reactor.run()


Finally, to make the URLs redirect, I added a nginx rewrite rule:

server { include conf/stdsite.conf; 
server_name cvs.bigasterisk.com;
location / {
proxy_pass http://bang:8003/;

# for 'room', filenames in viewcvs forward to the new darcs repository
# e.g. '/viewcvs/room/evening_lights?rev=1.3'
rewrite ^/viewcvs/room/([^\?]*).* "http://bigasterisk.com/darcs/?r=room;a=headblob;f=/$1?" permanent;
}
}

So now you can go to an old link to viewcvs and it'll redirect to a reasonable point in darcsweb. Until I relocate all my files into new directories, which darcs will let me do easily :)

 

 


[Main]

Unless otherwise noted, all content licensed by Drew Perttula
under a Creative Commons License.