<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bit Matrix &#187; Linux</title>
	<atom:link href="http://blog.bit-matrix.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bit-matrix.com</link>
	<description>Tech. Code. Linux. MySQL. Ones. Zeroes.</description>
	<lastBuildDate>Tue, 31 Aug 2010 01:10:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[haXe] Failed to load library : std.ndll</title>
		<link>http://blog.bit-matrix.com/2010/02/18/haxe-failed-to-load-library-std-ndll/</link>
		<comments>http://blog.bit-matrix.com/2010/02/18/haxe-failed-to-load-library-std-ndll/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 05:00:26 +0000</pubDate>
		<dc:creator>Bit Matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[haXe]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://blog.bit-matrix.com/?p=135</guid>
		<description><![CDATA[If, like me, you just started playing around with haXe and you might get the following error when including an external Flash resource:
Uncaught exception &#8211; load.c(232) : Failed to load library : std.ndll (std.ndll: cannot open shared object file: No such file or directory)
The solution is simple, you just need to install neko and neko-dev:
sudo [...]]]></description>
			<content:encoded><![CDATA[<p>If, like me, you just started playing around with haXe and you might get the following error when including an external Flash resource:</p>
<blockquote><p>Uncaught exception &#8211; load.c(232) : Failed to load library : std.ndll (std.ndll: cannot open shared object file: No such file or directory)</p></blockquote>
<p>The solution is simple, you just need to install neko and neko-dev:</p>
<blockquote><p>sudo apt-get install neko neko-dev</p></blockquote>
<p>Now simply run the setup:</p>
<blockquote><p>sudo haxelib setup</p></blockquote>
<p>Happy haXe-ing!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bit-matrix.com/2010/02/18/haxe-failed-to-load-library-std-ndll/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lower-case all URLs with Apache mod_rewrite</title>
		<link>http://blog.bit-matrix.com/2010/02/05/lower-case-all-urls-with-apache-mod_rewrite/</link>
		<comments>http://blog.bit-matrix.com/2010/02/05/lower-case-all-urls-with-apache-mod_rewrite/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 20:46:36 +0000</pubDate>
		<dc:creator>Bit Matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://blog.bit-matrix.com/?p=109</guid>
		<description><![CDATA[Search engines, like Google, will index URLs on your site in a case-sensitive fashion, so www.yoursite.com/iamtest shows up as a different page than www.yoursite.com/iAmTest. This has negative consequences for your search rankings as these different URLs will be interpreted as duplicate content.
In this case we want to re-direct our users and any bots to the [...]]]></description>
			<content:encoded><![CDATA[<p>Search engines, like Google, will index URLs on your site in a case-sensitive fashion, so www.yoursite.com/iamtest shows up as a different page than www.yoursite.com/iAmTest. This has negative consequences for your search rankings as these different URLs will be interpreted as duplicate content.<span id="more-109"></span></p>
<p>In this case we want to re-direct our users and any bots to the same version of the URL (i.e. all lowercase). If you are running Apache, make sure <b>mod_rewrite</b> is installed and make the following changes to your configuration.</p>
<p>1. In your server config or virtual host file:<br />
<code>RewriteMap  lc int:tolower</code></p>
<p>2. In your .htaccess file at the root of your site:<br />
<code><br />
# Lower-case and 301 all requests<br />
RewriteEngine On<br />
RewriteCond %{REQUEST_URI} [A-Z]<br />
RewriteRule ^(.*)$ /${lc:$1} [L,R=301]<br />
</code></p>
<p><b>Note:</b> Beware that some standard files are mixed case and might be broken by doing this (such as AC_RunActiveContent.js).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bit-matrix.com/2010/02/05/lower-case-all-urls-with-apache-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.10 Problems on T61 Thinkpad</title>
		<link>http://blog.bit-matrix.com/2009/10/28/ubuntu-810-problems-on-t61-thinkpad/</link>
		<comments>http://blog.bit-matrix.com/2009/10/28/ubuntu-810-problems-on-t61-thinkpad/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 19:44:28 +0000</pubDate>
		<dc:creator>Bit Matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[8.10]]></category>
		<category><![CDATA[intrepid ibex]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.bit-matrix.com/?p=26</guid>
		<description><![CDATA[I don&#8217;t often complain about the state of some OSS projects understanding that it is all part of the growth process. However, every once in a while a new version of our favorite product ends up being worse than the outgoing. My personal experience with Ubuntu 8.10 Intrepid Ibex is one such occurence. I upgraded [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t often complain about the state of some OSS projects understanding that it is all part of the growth process. However, every once in a while a new version of our favorite product ends up being worse than the outgoing. My personal experience with Ubuntu 8.10 Intrepid Ibex is one such occurence. I upgraded my 8.04 install to 8.10 as soon as it came out. Whereas 8.04 was rock solid and functional (it is a LTS release after all) 8.10 is proving anything but. For the record, the aforementioned copy of Ubuntu is running on a T61 Thinkpad with NVidia graphics and Intel Wireless (pretty standard hardware).</p>
<p><strong>Update:</strong> I recently updated the T61 to Ubuntu 9.04 and all of the problems mentioned below have disappeared. So, thumbs-up to canonical and all the OSS contributors involved in this (and any) distribution.</p>
<p><strong>Update:</strong> Ubuntu 9.10 runs even better than 9.04 including a boot speedup from 1:35 down to 45 seconds!<br />
<span id="more-26"></span></p>
<p>Here is a list of the problems I am having with 8.10, ranging from annoying to wasteful to downright show stoppers:</p>
<h5>Shortcut Keys Stopped Working</h5>
<p>The T61 has a few shortcut keys along the top for adjusting volume, muting etc. While these worked in 8.04 out of the box, in 8.10 they are not recognized at all. Yes, there is probably something wrong with the X keyboard map that I could fix but that is annoying and I shouldn&#8217;t have to. This, after all, is fairly low on the priority list and I&#8217;ve already aliased the commands to other key combinations.</p>
<h5>All your CPU are belong to us &#8211; klogd and dd</h5>
<p>Every so often, even when idle, klogd and dd would fire up out of nowhere and start writing oodles of useless log messages. They happily split the two CPU cores between them and proceede to make a silicon bonfire out of them resulting in 2GB kern.log and syslog files. I&#8217;ve tried a few things to pacify this dynamic due including updating the wireless drivers and turning off ACPI but so far no luck. As a result I do not feel comfortable leaving my laptop on when I am not working on it since such rampant CPU abuse can only lead to something bad down the road (and a full disk). Again, this problem never appeared in 8.04.</p>
<h5>Kernel Panic &#8211; BOOM!</h5>
<p>Leaving the computer idle until it falls asleep results in a kernel panic from which there is no return other than a hard reboot. The kernel panic manifests itself with a blinking CAPS LOCK. This hurts, but at least it might prevent klogd and dd from burning my CPU to death. :-/</p>
<h5>Cannot Shutdown</h5>
<p>Every second or third shutdown event ends with the computer still on but the screen blank &#8211; fail.</p>
<h5>Conclusion</h5>
<p>I have installed 8.10 by upgrading from 8.04 and, perhaps that is where the problem lies. Recently if been preparing to re-install 8.10 cleanly and give that a shot. However, in the past I have upgraded between versions with no issues whatsoever. It is quite disappointing that this latest version of Ubuntu is so poor. Is it possible that their commitment to a six month release cycle has resulted in rushing out this release? The release schedule certainly seems like a boon compared to the multi-year waits for Debian but it can also present a problem in cases like this.</p>
<p>I can only hope that my problems with 8.10 are an isolated case with my machine, perhaps all related to one root cause (Intel wireless, I&#8217;m looking at you).</p>
<p>I would like to hear other opinions and experiences with 8.10, particularly anyone&#8217;s with a T61 Thinkpad.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bit-matrix.com/2009/10/28/ubuntu-810-problems-on-t61-thinkpad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install PHP 5.2 on CentOS 5</title>
		<link>http://blog.bit-matrix.com/2009/10/22/how-to-install-php-52-on-centos-5/</link>
		<comments>http://blog.bit-matrix.com/2009/10/22/how-to-install-php-52-on-centos-5/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 06:43:16 +0000</pubDate>
		<dc:creator>Bit Matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 5]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php 5.2]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://blog.bit-matrix.com/?p=66</guid>
		<description><![CDATA[I recently needed to install PHP 5.2 on CentOS 5.3. This version of CentOS comes with PHP 5.1 but, in order to run phpMyAdmin, I needed 5.2. The CentOS software repositories are, unfortunately, still stuck with 5.1 and the only way to get a newer version of PHP installed via the package manager (yum) is [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to install PHP 5.2 on CentOS 5.3. This version of CentOS comes with PHP 5.1 but, in order to run phpMyAdmin, I needed 5.2. The CentOS software repositories are, unfortunately, still stuck with 5.1 and the only way to get a newer version of PHP installed via the package manager (yum) is to add another repository that has a newer version.<span id="more-66"></span></p>
<p>For this we will use the CentOS testing repository:<br />
<code><br />
cd /etc/yum.repos.d/<br />
sudo wget http://dev.centos.org/centos/5/CentOS-Testing.repo<br />
sudo rpm --import http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing<br />
</code></p>
<p>Now we can fetch package information about PHP using the new repository:<br />
<code><br />
yum --enablerepo=c5-testing info php<br />
</code></p>
<p>Check the version number. If it is what you need you can go ahead and install it using yum:<br />
<code><br />
sudo  yum --enablerepo=c5-testing update php<br />
</code></p>
<p>Assuming that worked, you can now restart Apache and be on your way:<br />
<code><br />
sudo /etc/init.d/httpd restart<br />
</code></p>
<h4>Memcache</h4>
<p>If, like me, you were using memcache you might run into a problem where memcache never got updated to the proper version because it did not exist in the CentOS testing repository. The memcache module on the system ends up with a different PHP API version than is required by the new version of PHP you just installed.</p>
<p>Upon starting PHP you might see a warning similar to this:<br />
<code><br />
Module compiled with API 20040429<br />
PHP compiled with API 20060613<br />
</code></p>
<p>Again, we will add a new repository from <a href="http://blog.famillecollet.com/pages/Config-en">Remi Collet</a>. The steps should be as follows:<br />
<code><br />
cd /etc/yum.repos.d/<br />
wget http://rpms.famillecollet.com/remi-enterprise.repo<br />
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm<br />
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm<br />
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm<br />
</code></p>
<p>Now we can install the newest memcache library:<br />
<code><br />
sudo yum --enablerepo=remi install libmemcached\*<br />
</code></p>
<p>Build the PHP module using Pecl (you might have to install php-devel packages for this):<br />
<code><br />
pecl install memcache<br />
</code></p>
<p>Edit /etc/php.d/memcache.ini and add:<br />
<code><br />
extension=memcache.so<br />
</code></p>
<p>Restart Apache:<br />
<code><br />
sudo /etc/init.d/httpd restart<br />
</code></p>
<p>With a little bit of luck you will now have PHP 5.2.x and Memcache!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bit-matrix.com/2009/10/22/how-to-install-php-52-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress spam killing script</title>
		<link>http://blog.bit-matrix.com/2009/01/30/wordpress-spam-killing-script/</link>
		<comments>http://blog.bit-matrix.com/2009/01/30/wordpress-spam-killing-script/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 08:55:35 +0000</pubDate>
		<dc:creator>Bit Matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.bit-matrix.com/?p=58</guid>
		<description><![CDATA[Blog comment spam is an unfortunate reality of having a blog. See the chart to get a sense of how much spam comes in on a daily basis to one of my blogs that receives a moderate amount of traffic. The red line shows the 30-day moving average for the number of spam comments daily.



Weeding [...]]]></description>
			<content:encoded><![CDATA[<p>Blog comment spam is an unfortunate reality of having a blog. See the chart to get a sense of how much spam comes in on a daily basis to one of my blogs that receives a moderate amount of traffic. The red line shows the 30-day moving average for the number of spam comments daily.</p>
<div class="mceTemp">
<a href="http://blog.bit-matrix.com/wp-content/uploads/2009/12/spam_comments.jpg"><img class="size-full wp-image-85" title="Number of daily spam comments on the typical blog" src="http://blog.bit-matrix.com/wp-content/uploads/2009/12/spam_comments.jpg" alt="Number of daily spam comments on the typical blog" /></a>
</div>
<p><span id="more-58"></span></p>
<p>Weeding out comments daily can be a real nuisance and, if you&#8217;ve missed a few days, the spam can pile up until it becomes a real time waster. Using the Akismet plugin for Wordpress goes a long way to rid you of spam and I would recommend that everyone use it. If, for some reason, you are looking for a standalone solution, I have hacked up a quick script to mark Wordpress Comments as spam based on the number of links in the comment. It is quite crude but if you have thousands of spam messages pilled up, you will appreciate it.</p>
<p>You will need Perl and the DBI module (if you don&#8217;t know what this is you should probably get the Akismet plugin <img src='http://blog.bit-matrix.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ).</p>
<pre>#!/usr/bin/perl
#
# wp_spam_kill.pl - brute force spam killing script
#
# Kill spam comments in WordPress based on the number of links in the comment
#
# date   : 2009.01.31
# http://bit-matrix.com
# license: GPL

use strict;
use DBI;

$| = 1;

# Configure your blog database
my $db = "DATABASE_NAME";
my $host = "DATABASE_HOST";
my $username = "DATABASE_USERNAME";
my $password = "DATABASE_PASSWORD";
my $comments_table = 'comments';
my $port = "3306";

# If a comment has more than this many links, mark it as spam
my $spam_level = 4;

sub query($$){
    my $dbh = shift;
    my $pre_bind = shift;

    my $sql = $dbh-&gt;prepare($pre_bind);
    return $sql-&gt;execute() ? $sql : undef;
};

# Connect to database
print "Connecting to $db...\n";
my $dsn = sprintf "DBI:mysql:database=%s;host=%s;port=%s;",$db,$host,$port;
my $dbh = DBI-&gt;connect($dsn,$username,$password);

# Fetch all unapproved comments
print "Getting comments...\n";
my $query = 'SELECT * FROM '.$comments_table.' WHERE comment_approved="0";';
my $c_sql = query($dbh,$query);
printf "%d Comments not approved yet\n",$c_sql-&gt;rows();

# Check each comment for number of links and mark it as spam if it has more links
my $spam_killed = 0;
while(my $c = $c_sql-&gt;fetchrow_hashref()){
    my @links = $c-&gt;{comment_content} =~ /(http:\/\/)/gs;
    if( $#links+1 &gt;= $spam_level ){
        printf "SPAM - %d links in comment\n",$#links+1;
        query($dbh,'UPDATE '.$comments_table.' SET comment_approved="spam" WHERE comment_ID="'.$c-&gt;{comment_ID}.'" LIMIT 1;');
        $spam_killed++;
    };
};

printf "Marked %d messages as spam\n",$spam_killed;

0;

__END__</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.bit-matrix.com/2009/01/30/wordpress-spam-killing-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
