Archive for the ‘Tech’ Category

MD5 seriously broken (welcome to the “old news” segment)

Friday, June 10th, 2005

http://www.cits.rub.de/MD5Collisions/ - best example yet of MD5 being broken for serious use as a cryptographic hash. OMFG! What’s the new hash for a new era? Looks like SHA1 is reasonably promising as a general usage hash, the way MD5 used to be.

Microsoft’s Hotmail Sucks!

Monday, May 16th, 2005

Hehe. Now that I’ve gotten your attention, what’s the story with Hotmail’s support for UTF-8?? Try sending a HTML mail in the UTF-8 encoding, accented characters will come out like gobbledegook.

This is 2005, not 1997, UTF-8 is seriously becoming (sorry, has become) the lingua franca of the Internet, and I really did not expect Hotmail not to have full support for it.

So I have a bug in work, “Incorrect handling of accented characters when viewed with Hotmail”, and I’m thinking “what now?”. I have a UTF-8 mail, do I just always transcode to ISO-8859-1 (sorry, Windows-1252)? What does that do to Chinese people, or 日本人? Nothing good, is the answer.

P.S. If this actually gets read by people at Microsoft, I am seriously impressed! Maybe we should call it “sidetalking”. Oh wait, that one was taken already ;-)

Using cvs+ssh with an alternative ssh key…

Friday, May 13th, 2005

Is this really the best way to use an alternative ssh key for checking out from CVS?

#include
#include

int main(int argc, char **argv)
{
char **args;
int i;

args = (char **) malloc((argc + 3) * sizeof(char *));

if (args == NULL)
{
fprintf(stderr, “Out of memory\n”);
exit(1);
}

args[0] = argv[0];
args[1] = “-i”;
args[2] = “/opt/gary/ssh/identity”;

for (i = 1; i

IPv6 on Ubuntu

Sunday, April 17th, 2005

I’ve started using an IPv6 tunnel on my laptop at home - using [SixXS](http://www.sixxs.net/) as a tunnel broker. It works very well actually, just wish there was more to do with IPv6 right now, except play around with it :-)
There are some Debian packages, but when I decided to recompile against Ubuntu, I made some changes:

* Debconf support
* Init script that can detect failed connections, also looks like other Ubuntu init scripts
* Installs man page
* Installs Sxx, Kxx rcX.d scripts
* Miscellaneous other changes

The biggest change is obviously debconf support, but it’s something that really makes the package look well integrated with the system. Quite proud of it, really!

Some Screenshots!
=================

First, debconf asks for your SixXS username and password.

![debconf asks for username/password](/diary/debconf1.png)

Then if the username and password are correct, it may (depending on the frontend) ask you to select from a list of available tunnels.

![debconf asks for a tunnel selection](/diary/debconf2.png)

If the username and/or password are incorrect, it will ask if you want to recheck your authentication details before continuing.

![debconf asks if you want to recheck authentication](/diary/debconf3.png)

And that’s it! It reads and writes the configuration to /etc/aiccu.conf, and it all seems to work well.

Update: some working apt sources:

deb [http://www.lyranthe.org/ubuntu/](http://www.lyranthe.org/ubuntu/) hoary universe

deb-src [http://www.lyranthe.org/ubuntu/](http://www.lyranthe.org/ubuntu/) hoary universe

MS Word only real commercial word processor option in Japan

Monday, February 7th, 2005

Another example of patent abuse at work. I feel disgusted that this kind of thing (software patents, to be a bit more precise) could become mandatory throughout the EU. Sorry - for anybody who actually does believe that it would be a good thing… no how, no way. I want no Sword of Damocles hanging over any piece of code I write, thank you very much.

For the people who use 一太郎 in Japan, 今仕様がない。

Use lynx, go to jail

Friday, January 28th, 2005

Ho ho ho. Courtesy of Boing Boing:

Jailed for using a non-standard browser.

Silly BT personage :-)

libxml2 thread safety

Thursday, January 20th, 2005

After an episode today in work with stability testing, where my code turned out not to be very stable, I think it’s time that I start thinking about putting up a page with details of how to efficiently perform multithreading with libxml2 and libxslt.

Things like (this is what bit me today) mutex-locking the creation and destruction of XSLT parser and stylesheet contexts - as they share dictionaries, and the reference counting for the dictionaries isn’t thread-safe.
I don’t know if this page will actually happen, but I’m sure I’ll come across a few more gotchas before I’m finished with this project!

The kind of backtrace I got was:

#0 0×400c2b41 in __kill () from /lib/i686/libc.so.6
#1 0×4004987b in raise (sig=6) at signals.c:65
#2 0×400c40c2 in abort () at ../sysdeps/generic/abort.c:88
#3 0×0822ddae in xxxxx (ptr=0×876cfd8, f=0×82c6479 “xxxxx.c”, l=646) at xxxxx.c:xxx
#4 0×080b36ef in free_func (mem=0×876cfd8) at xxxxx.c:xxx
#5 0×081b9ded in xmlDictFree (dict=0×8762ec0) at dict.c:472
#6 0×08192a0c in xmlFreeDoc (cur=0×8766158) at tree.c:1157
#7 0×081c9bf5 in xsltFreeStylesheet (sheet=0×8766268) at xslt.c:495

That was caused by an abort() upon detection of a double-free. The crash was also seen under xmlXPathFreeCompExpr(), also when freeing the dictionary.

*Mini-Update:* I decided to send a patch to the libxml2 mailing list instead. It’s quite likely to be more efficient (more granular locking). And the acceptance of patches like this means that a page on how to do multithreading with libxml2 is a bit less important.

I think actually that it was only with 2.6.7 or thereabouts that libxml2 seriously began to take care of internal race conditions in certain shared areas (like the catalog).

Software Patent Vote Delayed

Tuesday, December 21st, 2004

The Register is reporting that the patent vote has been delayed until 3pm. This is apparently because the Polish minister wants to make a statement on the directive. This is somewhat unusual for an “A item”, which is normally passed without any debate or meaningful comment whatsoever. In addition, the Munich mayor has called on the German minister to take the item off the agenda. However, this action would be unprecedented. More news later :-)
Update: As mentioned on the FFII site, the Polish minister requested the removal of the directive from the agenda. And it has been. So looks like we might be safe for another short period of time, at least (until the next meeting of the Competitiveness Council).

Software Patent Directive on Agricultural Council List of A-Items

Monday, December 20th, 2004

The so-called Software Patent Directive has been tabled as an A-item at tomorrow’s Agriculture and Fisheries meeting, in spite of the current less than stellar support among the individual countries. It seems that diplomatic issues are stalling recognition that there is no longer a qualified majority, and that this should not be passed without further debate.

There is an online letter available which summarises the issue, and should be linked to where possible. Of course, the best way to proceed is to fax your local Minister for Agriculture.

Our local Minister for Agriculture is Ms. Mary Coughlan. She is in Brussels at the moment, but the department will forward on messages. The fax number for the department is 01-6614515, or you can hand in letters by hand at Agriculture House, Kildare Street, Dublin 2.

My first play with Mono

Thursday, July 1st, 2004

$ mcs hello.cs
Compilation succeeded
$ ls
hello.cs hello.exe
$ file hello.exe
hello.exe: MS Windows PE 32-bit Intel 80386 console executable

*cough* I’m not sure what I expected, but it wasn’t that! But Debian handles it nicely (and transparently)…

$ /usr/sbin/update-binfmts –display
cli (enabled):
package = mono-common
type = magic
offset = 0
magic = MZ
mask =
interpreter = /usr/bin/cli
detector = /usr/lib/cli/binfmt-detector-cli
python2.3 (enabled):
package = python2.3
type = magic
offset = 0
magic = \x3b\xf2\x0d\x0a
mask =
interpreter = /usr/bin/python2.3
detector =

$ ./hello.exe
Hello World