Monitor dummy
February 3rd, 2007
I recently came across a computer that refused to boot without a monitor. That problem made it hard to use the computer as a server as one had to hook in a monitor when rebooting. The solution was to create a VGA dummy which fakes a real attached monitor.
I have not seen any such dummies for sale, but it’s really easy to assemble from scratch (and very cheap).
MySQL: quick random rows
January 22nd, 2007
There’s a quicker alternative to using ORDER BY RAND() in MySQL. My only concern is just how random MySQL’s random generator is since the documentation has the following to say.
RAND() is not meant to be a perfect random generator, but instead is a fast way to generate ad hoc random numbers which is portable between platforms for the same MySQL version.
Adding additional domains to sendmail
January 21st, 2007
Basically just add the host names to /etc/mail/local-host-names (and set up the corresponding MX-record).
One might also want to add a catch all for the domain by adding ”@domain.tld user” in the /etc/mail/virtusertable file (where user is the user that should get the catch all mails).
Converting from MyISAM to InnoDB
January 15th, 2007
The innodb engine is not enabled in MySQL by default (in my dist at least), so it first has to be enabled in the configuration file. Just commenting out “skip-innodb” didn’t work for me, I had to explicitly add “innodb” to configuration to enable the engine.
Some basic configuration options and a shell script for converting a bunch of tables at once might also come in handy.
Serving large files through lenya
January 8th, 2007
I have been experiencing an annoying problem with serving large files through lenya, more specifically with DKP Log Parser’s download page. The problem manifests itself as an http error while downloading a file, resulting in an aborted download and a 0 length file being downloaded to the client. It appears rather random, some times the downloads work fine, some times they don’t. Restarting tomcat usually helps though, so I’m suspecting that the problem is caused by some buffer’s memory running low.
I have been unsuccessful in finding a solution despite searching for one. Today I however found a possible solution, it seems to work so far at least.
AWStats: Combining logs
December 23rd, 2006
I gzip my rotated weblogs, so only the most recent log is uncompressed. I don’t want AWStats to only scan the most recent log though because then it will probably miss some data that was added to the rotated log after AWStats last scanned it. Therefor I combine the output from an uncompressed source with a compressed source and pipe it to AWStats so that it can scan both logs each time (hence guaranteeing that it doesn’t miss anything).
There’s no example of how to do that in the configuration file so I thought I might add it here. Entering the following as value for “LogFile” will do it.
(cat /pathtologs/log1 ; gzip -d < /pathtologs/log2.gz) |
Setting up AWStats
December 15th, 2006
I recently set up AWStats version 6.5 as a static report generator. So far I’m quite pleased with AWStats, but I ran into some undocumented problems during the setup. Nothing major, but it takes a few extra minutes of debugging.
Setting up dovecot and sendmail
December 8th, 2006
Dovecot is my current POP3 server of choice. I recently found a guide on how to set up dovecot with sendmail which also covers some basic spam and virus filtering of the email.
Self signed SSL certificates
December 6th, 2006
Using SSL for encryption is a nice way to avoid people sniffing passwords when one for instance logs into admin panels. However there’s a non-trivial prerequisite to setting up SSL: obtaining a SSL certificate .