Blog
I’ve been wanting to set up a weblog for ages, but I’ve never really found any software I felt was good enough. So every time i thought about it I decided I’d have to create my own. With me, this is about the same as deciding not to do it at all, and this is of course what happend. Until now; I finally got over myself, and installed Movable Type.
I had to make some alterations to make everything fit with my way of doing things. The whole prosess was “mostly harmless” but quite a bit of work. So far I’ve future proofed the URL space and worked on the templates to make everything look like the rest of the website. All pages are written as both HTML 4.01 and XHTML 1.1, and content negotiation picks the one best fitting your browser. This basically mean that if your browser sends an Accept: header listing application/xhtml+xml with a higher priority then text/html you get the XHTML 1.1 version, if not the default is HTML 4.01. The same technique is used on most of the rest of the website as well.
If there’s any interrest I may do a writeup about how I’ve put it together with Movable Type.
Blog
This demonstrates how to create a dynamic progress bar image using the PHP GD functions.
http://db.org/demo/2003/02/17/progress-bar/
Blog
Someone posted a challenge to create a PHP script that would scale and overlay an image, and I couldn’t resist.
http://db.org/demo/2003/02/14/scale-and-overlay/
Blog
Introduction
Following a discussion on the Norwegian news group no.it.tjenester.www.design about language tags in different browsers and their default values, I configured db.org to log the contents of Accept-*: headers. The following is an analysis of this log, based on traffic from Tuesday February 4th to Tuesday February 11th 2003.
Accept-Language
The list below shows the different language tags seen during the week in question. Everything looks mostly like expected with two notable exceptions. The first is the tag no-bm, which i assume signifies Norwegian Bokmål. According to the User-Agent: header this is sent by Opera 5.12 running under Windows 95. There is no no-nn tag in the list, but it would be reasonable to assume that a browser using no-bm for Norwegian Bokmål also uses no-nn for Norwegian Nynorsk.
The second issue is the use of the language tag pdf, comming from Mozilla 4.79 running under Windows 98. If someone has an explanation to this, or even a plausible theory, I would like to know about it.
The list was produced with the following command:
cat negotiation.log \
| sed -e 's/^\"\(.*\)\" \"\(.*\)\" \"\(.*\)\" \"\(.*\)\"/\4/' \
| sed -e 's/,/\
/g'| sed -e 's/ *\(.*\)/\1/' \
| sed -e 's/^\(.*\);.*/\1/' \
| sort -f | uniq -i
bg
da
de
de-at
en
en-au
en-bz
en-ca
en-gb
en-ie
en-jm
en-nz
en-ph
en-tt
en-us
en-za
en-zw
es
es-mx
es-pr
fr
he
ie-ee
it
ja
lt
nb
nb-no
nl
nn
nn-no
no
no-bm
no-bok
no-nyn
pdf
pl
pt-br
ru
sk
sr
sv
tr
zh-cn
Accept-Encoding
The selection of encodings are noticeably smaller and mostly as can be expected. I noticed that Internet Explorer, Opera and Konqueror all send both gzip and x-gzip. x-compress on other hand is used only by robots/spiders, in this case RPT-HTTPClient and NPBot. For those of you who, like me, has never heard of the identity encoding, RFC 2616 offers the following explanation:
The default (identity) encoding; the use of no transformation whatsoever. This content-coding is used only in the Accept-Encoding header, and SHOULD NOT be used in the Content-Encoding header.
The list was produced with the following command:
cat negotiation.log \
| sed -e 's/^\"\(.*\)\" \"\(.*\)\" \"\(.*\)\" \"\(.*\)\"/\3/' \
| sed -e 's/,/\
/g'| sed -e 's/ *\(.*\)/\1/' \
| sed -e 's/^\(.*\);.*/\1/' \
| sort -f | uniq -i
compress
deflate
gzip
identity
x-compress
x-gzip
Accept-Charset
Another narrow selection. The only interesting thing to note is that Opera, on both Windows and Linux, is the only browser asking for documents in the windows-1252 character set.
The list was produced with the following command:
cat negotiation.log \
| sed -e 's/^\"\(.*\)\" \"\(.*\)\" \"\(.*\)\" \"\(.*\)\"/\2/' \
| sed -e 's/,/\
/g'| sed -e 's/ *\(.*\)/\1/' \
| sed -e 's/^\(.*\);.*/\1/' \
| sort -f | uniq -i
ISO-8859-1
ISO-8859-15
utf-16
-
utf-8
windows-1252
Apache Configuration
If you would like to make a similar analysis on your own traffic, the log file can be generated using the following directives in Apache’s httpd.conf.
LogFormat "\"%{User-agent}i\" \
\"%{Accept-charset}i\" \
\"%{Accept-encoding}i\" \
\"%{Accept-language}i\"\" \
negotiation
CustomLog /path/to/logdir/negotiation.log negotiation