July 18th, 2008
The memcache protocol requires that all lines in the server response end with CRLN (\r\n). The Starling server doesn’t strictly obey this for the STATS command. The fix is trivial and the author has been notified of the fix.
Edit lib/starling/handler.rb and add the following gsub right before .freeze in the STATS_RESPONSE:
%sEND\r\n”.gsub(/\r?\n/, “\r\n”).freeze
And the same for QUEUE_STATS_RESPONSE:
STAT queue_%s_expired_items %d\n”.gsub(/\r?\n/, “\r\n”).freeze
Posted in uncategorized | No Comments »
July 5th, 2008
Recently, I was getting the error
Warning: session_start() [function.session-start]: Function spl_autoload_call() hasn’t defined the class it was called for in…
In my particular case, the problem stemmed from defining a deserialization function using
ini_set(’unserialize_callback_func’, ’spl_autoload_call’)
(well, symfony defines it)
In the process of deserializing an object, it tried to instantiate a class which hadn’t yet been loaded. The autoloader wasn’t able to find the class and the spl autoload functionality therefore croaked.
The problem was that I had defined a property inside of one my model objects that referenced the sfWebRequest. This property should never have been serialized. Infact, only the properties of the object as defined in model should get serialized. The fix was defined a __sleep method in the model.
public function __sleep()
{
return MySampleObjectPeer::getFieldNames(BasePeer::TYPE_FIELDNAME);
}
Replace MySampleObjectPeer with the appropriate peer class.
Posted in uncategorized | 1 Comment »
June 19th, 2008
If you want to install CPAN modules as Debian packages, this HOWTO is for you.
First, install dh-make-perl:
apt-get install dh-make-perl
Then build & install the package. For example, if you wish to install the module Nagios::Plugins::Memcached from CPAN, simply run:
dh-make-perl --install --cpan Nagios::Plugins::Memcached
You’re done.
Posted in HOWTO, notes | No Comments »
May 14th, 2008
The following Nginx configuration technique will allow you to do rewrites to status codes.
rewrite ^.*?\.(?:swf|xml|gif|jpg|png|css|js)$ @404 break;
location = @404 {
return 404;
}
Posted in uncategorized | No Comments »
April 30th, 2008
Yum always gets stuck on dead mirrors or slow mirrors. Avoid this by installing yum-fastestmirror
yum install yum-fastestmirror
yum clean all
Posted in uncategorized | No Comments »
April 30th, 2008
rpm -qa --qf “%{NAME}\n” > /tmp/installed-packages.log
To install those packages, run:
yum install -y $(cat /tmp/installed-packages.log)
Posted in uncategorized | No Comments »
April 25th, 2008
Up until recently, it was not possible to upload large files asynchronously to 2 or more machines simultaneously. This was due to a problem in the ruby ssh implementation. A patch is available which fixes this.
http://rubyforge.org/tracker/index.php?func=detail&aid=17857&group_id=274&atid=1123
If applying the patch is not an option, you can always change the transfer mode to synchronous.
set :synchronous_connect, true
Posted in uncategorized | No Comments »