Session IDs and the Birthday Paradox
If you have a database (or in general some writable store), the bestway to do authentication in a web app is with session ID cookies. Everytime someone logs in, you pick a large random number to be their sessionID, give them a cookie with the session ID, and then store all of thedetails in your database under the session ID. When they come back, youget the session ID cookie, look it up in the database, make sure it's(still) valid
The charm of Sun's Freeware collection
Presented on a stock install Solaris 9:
$ cat hello.cpp#includemain(){ cout << "Hello World!\n";}$ g++ hello.cpp$ ./a.outld.so.1: a.out: fatal: libstdc++.so.2.10.0: \ open failed: No such file or directoryKilled (Line wrapping added for clarity.)
To get the Sun Freeware g++
Using the tempfile module to get temporary files
Courtesy of Planet Python , I stumbledover Peter Bengtsson's puzzlement with Python's tempfile module ,especially the
mkstemp()function. It's an understandablepuzzlement, because what's going on is fairly tied to Unix semantics(although Python supportsmkstemp()on all platforms).The tempfile module's
mkstemp()is a relatively thin shim over theUnixmkstemp(3)library routine, which exists to securely createtemporary files. This is more difficult than it looks; there are all
The id attribute considered dangerous
I've been doing various overhauls of DWiki recently (a faster andbetter DWikiText to HTML renderer written by Daniel Martin (and hackedby me, so blame me for any problems) went in tonight, for example).As part of this, I've been looking at the HTML DWiki generates,running it past HTML Tidy and the W3C validator and so on. It's been a learningexperience.
One of the things I've learned is that almost everywhere DWiki codeand templates were
$PATH in Solaris
It's always the little things about new Unix systems that get to me.Take
$PATHon Solaris.On a modern Linux distribution with a stock install, a sysadmin's full$PATH needs only five directories:
/bin /usr/bin /sbin /usr/sbin /usr/X11R6/bin(Sometimes
/usr/bin/X11is used instead of/usr/X11R6/bin.)On Solaris 9, my $PATH is
The sysadmin's life
A one-line addition to
httpd.conf: 30 seconds.Restarting Apache: 30 seconds.
Making sure that the addition was the right thing to do to an oldversion of Apache and wouldn't kill the server: much longer .
(And of course the much longer doesn't look too much like work, anddoesn't entirely feel like work.)
And more of the sysadmin's life:
Accidentally using
kill -USR2instead ofkill -USR1to gracefullyrestart the
More on simple markup languages
In a reply to my WhySimpleMarkup post, Chris Wage wrote , inpart:
I like the idea of a simple markup language, but the reality is thatthey are implemented in an obscure and often counter-intuitivefashion.
I'll unfortunately agree with this; it's one reason why I created myown for DWiki . Pretty much all of the existing wikitext dialects Ilook at struck me as ugly to see, tiresome to write, or both. Lookinggood as plain text and being easy to write in
Weekly spam summary on February 4th, 2006
Hotmail seems to be shuffling its numbers around significantly thisweek, to my surprise. I'm not sure the result is really better, butit's certainly different:
- 4 email messages accepted from Hotmail, although 3 of them look alot like typical advance fee fraud spam Hotmail addresses.
- only 79 messages rejected because they came from non-Hotmail emailaddresses.
- 138 messages sent to our spamtraps.
- 27 messages refused because their sender addresses had already hitour spamtraps.
- 20 messages refused due
Why simple markup languages make sense
I'm a big fan of simple markup languages for writing web pages (or infact any sort of document; it just happens that web sites are prettymuch everything I write these days). Recently I figured out a goodexpression of why:
Simple markup languages are the same idea as high level programminglanguages: less make-work and more of what actually matters.
(And as an added bonus, less interruption of my writing to sprinkleHTML all over.)
Languages like C and Java have a bunch
Van Jacobson illustrates the importance of cache effects
One of the most exciting presentation at the recent linux.conf.au 2006 conference(ironically held in New Zealand) was Van Jacobson's talk on speeding upthe Linux networking stack. On a TCP stack that he says is already oneof the fastest going, he managed to well over double the performance,while removing and simplifying code, even in driver hot paths.
(For more details, see David Miller's summary here ;Van Jacobson's slides are here (1.4
Menu
![]()