Archive for the ‘LAMP’ Category
Sunday, July 31st, 2005
On this new server I’ve got, Horde is configured to use the qmail smtp demon on localhost to send emails. Qmail is pre-configured by Plesk. I ran into this mysterious delay every time when I tried to send an email from Horde. When I opened up each test message source from the receiving end, the headers would show exactly a 30 seconds delay for the “localhost hop”. That smelled like some kind of timeout to me… and a bit digging into qmail’s documentation proved it - qmail’s tcp-env would time out after 30 seconds when trying to get the TCPREMOTEINFO data from the remote host. And tcp-env is exactly what xinetd uses to drive qmail-smtpd everytime there is an smtp connection comes in.
So in case you are running into the same problem, here’s the solution - go to /etc/xinet.d, open up smtp_psa, and add a “-R” to the beginning of server_args. Then “ps -e | grep xinetd” to get the pid of xinetd, and “kill -USR2 <the pid>” to put the config change into effect.
Posted in LAMP | 2 Comments »
Friday, July 15th, 2005
For some reason, after I upgraded from mysql 3.23 to 4.1 using the rpms, mysql refused to start, with this error message:
[ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists!
All the files mysql used to work with happily(like the data files) now only have 27 for both the owner and group. Apparently for some reason rpm decided to remove the 'mysql' user & group as part of the upgrading procedure. Here are the two commands that fixed everything (the same uid and gid is reused so I don't have to cd around and do a bunch of adhoc chown's and chgrp's:
CODE:
-
groupadd -g 27 mysql
-
adduser -s /sbin/nologin -m -u 27 -g mysql mysql
Posted in LAMP | No Comments »
Thursday, July 14th, 2005
Here's an interesting (and real) story happened when I tried to set up a new dedicated server rented from 1and1... more...
Posted in LAMP | 3 Comments »
Sunday, May 15th, 2005
Small cosmetic changes. A few tidy-ups in the behind-scene code. Give it a try!
Posted in LAMP, poker | 1 Comment »
Tuesday, May 3rd, 2005
I googled and this seems to have been around for a while, but for some reason it hasn't been fixed. If you install a binary package of Apache 1.x in Linux, it'll leave the first line of the apxs to be
CODE:
-
#!no-perl5-on-this-system
even when perl is available. Simply replace it with the path to the perl file, e.g., use
Posted in LAMP | No Comments »
Saturday, April 30th, 2005
PokerHelper is a Texas Hold'em hand odds/probability calculator I put together along my growing interest in poker. There are many odds calculators on the internet, but most of them only give a table of outs. PokerHelper lets you pick actual cards that are dealt in your particular hand, than only reports the relevant odds.
From a more technical standpoint, while calculating the odds is rather straightforward, given any particular hand with any number of cards from 2 to 7 (representing different stages of a hand), it is rather interesting to come up with the data structure and algorithm to figure out all the outs in a hand. It has been particularly interesting to me, considering most of my other projects involve enterprise e-commerce where most of the "gist" is in designing the architecture and running the project rather than actually coding. Some of the PHP's dynamic language features really made the implementation easier, and gave me more time to focus on the algorithm itself. This would have been more heavyweight had I chosen Java (that is, also considering my usual tendency to overdesign things in Java
.) That being said, jumping back and forth between PHP and Java, together with PHP's, er, forgiving manner, indeed set me up good with some pitfalls, which I will share in another post.
Posted in LAMP, poker | No Comments »