September 2006 Archives
Mo Sep 18 17:21:56 CEST 2006
Xgl and Compiz for Gnome under Debian unstable
Installing XGL & Compiz on Debian (even unstable) still is a pain in the ass. The xserver-xgl deb package has not yet arrived so the easiest way is to abuse some ubuntu packages:
~# su - deathbird:~# cat >> /etc/apt/source-list deb http://www.beerorkid.com/compiz dapper main deb http://media.blutkind.org/xgl/ dapper main deb http://ubuntu.compiz.net/ dapper main ^D( That last character stands for hitting ctrl-d, just in case you did not recognize that. )
deathbird:~# apt-get update deathbird:~# apt-get install xserver-xgl compiz libsvg libsvg-cairo cgwd \ cgwd-themes compiz-gnome xfonts-75dpi deathbird:~# cd /etc/X11 deathbird:/etc/X11# mv X Xorg deathbird:/etc/X11# ln -s /usr/bin/Xgl X deathbird:/etc/X11# logout ~# cat >> ~/.xsession cgwd & compiz gconf decoration wobbly fade minimize cube rotate zoom \ scale move resize place menu switcher water --replace & ^D ~# chmod +x ~/.xsession
I also had to change my
/etc/X11/xorg.conf configuration as they seem to have moved some fonts and Xgl won't run without them (there
are a bazillion ways to work around this). Look for fonts and change their path to
/usr/share/fonts so that they more or less match these lines:
Section "Files" FontPath "/usr/share/fonts/X11/misc" FontPath "/usr/share/fonts/X11/misc/:unscaled" FontPath "/usr/share/fonts/X11/100dpi/:unscaled" FontPath "/usr/share/fonts/X11/75dpi/:unscaled" FontPath "/usr/share/fonts/X11/Type1" FontPath "/usr/share/fonts/X11/100dpi" FontPath "/usr/share/fonts/X11/75dpi" EndSection
In case you also use gdm you can change the gdm setting in
/etc/gdm/gdm.conf. Look for
0=Standard and replace
that line with:
#0=Standard 0=Xgl [server-Xgl] name=Xgl command=/usr/X11R6/bin/Xgl :0 -fullscreen -ac -br -accel glx:pbuffer -accel xv:fbo( This line works for nvidia cards.. )
When you're done your desktop MIGHT look like this:
Mo Sep 18 15:29:53 CEST 2006
myisam vs innodb
Very quick'n'dirty almost unuseable benchmark of mysql 5 myIsam vs. innoDB tables. In these rudimentary tests (which btw have no correlations with reality) myIsam is about 2.7 times as fast as innoDB is - or innoDB is even 2.7 times as slow as myIsam is, depending on your point of view..
MyIsam lacks support of transactions and locks tables instead of rows, so you should use innoDB anyway - although it is slower and needs more space.
iso@deathbird:~$ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 to server version: 5.0.24a-Debian_3-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database testeimer; Query OK, 1 row affected (0.04 sec) mysql> use testeimer; Database changed mysql> create table `testmyisam` ( `id` bigint auto_increment, `title` varchar(128), primary key (`id`)) type=MyISAM charset=utf8; Query OK, 0 rows affected, 1 warning (0.02 sec) mysql> create table `testinnodb` ( `id` bigint auto_increment, `title` varchar(128), primary key (`id`)) type=innoDB charset=utf8; Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> Bye iso@deathbird:~$ vi testme.sql iso@deathbird:~$ head -1 testme.sql INSERT INTO `testmyisam` ( `title` ) values ( 'kapsobor' ); iso@deathbird:~$ wc testme.sql 100000 1000000 6000000 testme.sql iso@deathbird:~$ time mysql -u root testeimer < testme.sql real 1m43.189s user 0m8.269s sys 0m3.572s iso@deathbird:~$ vi testme.sql iso@deathbird:~$ head -1 testme.sql INSERT INTO `testinnodb` ( `title` ) values ( 'kapsobor' ); iso@deathbird:~$ wc testme.sql 100000 1000000 6000000 testme.sql iso@deathbird:~$ time mysql testeimer < testme.sql real 4m48.227s user 0m9.785s sys 0m3.720s iso@deathbird:~$ time mysql testeimer -e "update testmyisam set title='eimersaufen'"; real 0m4.308s user 0m0.020s sys 0m0.004s iso@deathbird:~$ time mysql testeimer -e "update testinnodb set title='eimersaufen'"; real 0m7.569s user 0m0.016s sys 0m0.012s iso@deathbird:~$ time mysql testeimer -e "select count(*) from testmyisam" +----------+ | count(*) | +----------+ | 100000 | +----------+ real 0m0.118s user 0m0.020s sys 0m0.000s iso@deathbird:~$ time mysql testeimer -e "select count(*) from testinnodb" +----------+ | count(*) | +----------+ | 100000 | +----------+ real 0m0.572s user 0m0.024s sys 0m0.004s iso@deathbird:~$ time mysql testeimer -e "select count(id) from testmyisam" +-----------+ | count(id) | +-----------+ | 100000 | +-----------+ real 0m0.110s user 0m0.024s sys 0m0.004s iso@deathbird:~$ time mysql testeimer -e "select count(id) from testinnodb" +-----------+ | count(id) | +-----------+ | 100000 | +-----------+ real 0m0.307s user 0m0.020s sys 0m0.004s iso@deathbird:~$ time mysql testeimer -e "update testmyisam set title=title + 'kapsobor'"; real 0m8.362s user 0m0.016s sys 0m0.008s iso@deathbird:~$ time mysql testeimer -e "update testinnodb set title=title + 'kapsobor'"; real 0m10.894s user 0m0.024s sys 0m0.008s
Sa Sep 16 20:42:50 CEST 2006
Steven Colbert did actually win the hungarian bridge naming vote - even while being challenged by Chuck Norris !!1!
Di Sep 5 01:19:03 CEST 2006
apache AddHandler multiple extensions
I stumbled upon an odd behaviour of Apache today: Apache2 (I did not check Apache1.3.x but I'm quite
sure it will handle it the same way) thanks to mod_mime defines 'extensions' as 'one extension of many'. That's why
AddHandler-Directive treats a given extension as a string which has to exist anywhere(!) in
the filename. So for example
AddHandler cgi-script wurstWill handle all files matching
/^.*\.wurst.*$/i. At first I thought I had to have made some errors in the configuration but a quick look at a fresh apache2 installation differed in no way of handling the file extensions. A deeper search in Apache's Buglyzilla led to Bug #10768 which has been marked invalid as this is a feature, not a bug. Quote:
An "extension" in apache is any period-delimited part of the filename after the first period. So in one.two.three.four, all of two, three and four are extensions.That's of course a whole other thing than I would usually think of, for example wikipedia says:
A filename extension is an extra set of (usually) alphanumeric characters that is appended to the end of a filename
That's why if you have defined a filetype being handled via AddHandler then you better be sure to check uploaded files not only for valid extensions but their whole name for possible dots. Can't wait to check for php-applications only checking uploads for file-ending matching «.php»..
A workaround for only matching file extensions (as in 'ending') is to comment out that AddHandler line and replacing it with:
<Files ~ "\.cgi$"> SetHandler cgi-script </Files>( this will surely boost performance to the max .. )
Mo Sep 4 21:15:07 CEST 2006
Tiny Pingback Client w/ Autodiscovery
For testing my pingback server and being able to link to other blogs I have implemented a quick'n'dirty pingback client.
It's written in php5 (and can be very easily ported to perl) and contains auto-discovery of target links as well as their
coresponding pingback-xmlrpc server-url (via HTTP-HEAD and fallback to HTML-HEAD).
To test it (and as a result of it also the pingback server) I had to link to an article in my blog. There. Did it.
By using this client you can call pingback entries to your URL without your blog software supporting pingbacks. Increcibleously!
Mo Sep 4 20:22:49 CEST 2006
I've stumbled upon this several times now and every single time it drove me crazy until I found the annoying behaviour of zsh being the reason of why those stupid (usually perl-)scripts gave no output:
echo -n wurstAlthough it will actually output «wurst» it will start printing the prompt from the beginning of the current line afterwards. This will of course overwrite your output which subsequently will never be seen.
Now you usually write a newline at the end of your output and are not effected by this. But so often have I
print "[debug]" somewhere in a script and went totally nuts trying to
find the error why it won't even run far enough to print that line and neither prints output nor any error
Usually I repeatedly move this print-line further and further to the top of the to-be-debugged script and then, finally, remember why it does not seem to work even if I write the debug message as first command... grrrr, zsh$!(@#
Edit: Hahahaha: just a couple of minutes after I wrote this entry I had the same problem again and didn't notice for sooo long..
Edit_2: It seems that zsh >= 4.3 has got rid of this problem and continues to write the prompt after the output, the same way as bash does it.