<?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>Technology: Learn and Share</title>
	<atom:link href="http://crazytoon.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://crazytoon.com</link>
	<description>Enterprise level solutions, LAMP, Linux, Apache, MySQL, PHP, Perl, Windows, Cache, Optimization</description>
	<lastBuildDate>Fri, 10 Mar 2017 09:32:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.7.3</generator>
	<item>
		<title>[CentOS] OpenVZ &#8211; container based virtualization quick guide.  Part 2</title>
		<link>http://crazytoon.com/2011/03/29/centos-openvz-container-based-virtualization-quick-guide-part-2/</link>
		<comments>http://crazytoon.com/2011/03/29/centos-openvz-container-based-virtualization-quick-guide-part-2/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 19:32:33 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=234</guid>
		<description><![CDATA[In this guide, we will be exploring how to use the tools which come with OpenVZ and setup a internet facing container/vm. This part of the guide also assumes you have followed part 1 to setup the container already and have a working environment. In part 1, we setup a CentOS container which we could [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In this guide, we will be exploring how to use the tools which come with OpenVZ and setup a internet facing container/vm.  This part of the guide also assumes you have followed <a href="http://crazytoon.com/2010/11/30/centos-openvz-container-based-virtualization-quick-guide-part-1-of-2/">part 1</a> to setup the container already and have a working environment.</p>
<p>In <a href="http://crazytoon.com/2010/11/30/centos-openvz-container-based-virtualization-quick-guide-part-1-of-2/">part 1</a>, we setup a CentOS container which we could enter/exit but we didn&#8217;t do anything else on the network.  What we want to do is set it up so we have the ability to bridge our hosts&#8217; network and define static IP for network interface.</p>
<p><code><br />
yum install bridge-utils</p>
<p>[root@tooncent ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0<br />
# Broadcom Corporation NetXtreme BCM5761 Gigabit Ethernet PCIe<br />
DEVICE=eth0<br />
ONBOOT=yes<br />
BRIDGE=bridge0</p>
<p>[root@tooncent ~]# cat /etc/sysconfig/network-scripts/ifcfg-bridge0<br />
DEVICE=bridge0<br />
TYPE=Bridge<br />
BOOTPROTO=dhcp<br />
ONBOOT=yes<br />
DHCP_HOSTNAME="tooncent.com"</p>
<p>/etc/init.d/network restart</p>
<p>[root@tooncent ~]# cat ifcfg-veth101.0<br />
# Broadcom Corporation NetXtreme BCM5761 Gigabit Ethernet PCIe<br />
DEVICE=veth101.0<br />
ONBOOT=yes<br />
BRIDGE=bridge0</p>
<p>vzctl set 101 --netif_add eth0 --save<br />
echo '<br />
DEVICE=eth0<br />
ONBOOT=yes<br />
BOOTPROTO=dhcp<br />
' >  /vz/private/101/etc/sysconfig/network-scripts/ifcfg-eth0</code></p>
<p>After this just start and you should be good to go.  </p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2011/03/29/centos-openvz-container-based-virtualization-quick-guide-part-2/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>[CentOS] OpenVZ &#8211; container based virtualization quick guide.  Part 1 of 2</title>
		<link>http://crazytoon.com/2010/11/30/centos-openvz-container-based-virtualization-quick-guide-part-1-of-2/</link>
		<comments>http://crazytoon.com/2010/11/30/centos-openvz-container-based-virtualization-quick-guide-part-1-of-2/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 23:00:21 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=231</guid>
		<description><![CDATA[This quick guide will walk you through setting up OpenVZ on CentOS. I followed these steps on CentOS release 5.5 x64 version. If you want more detail on install via different methods and/or have different flavor of CentOS and run into an issue, you can follow instructions provided by OpenVZ site. Once you are done [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This quick guide will walk you through setting up OpenVZ on CentOS.  I followed these steps on CentOS release 5.5 x64 version.  If you want more detail on install via different methods and/or have different flavor of CentOS and run into an issue, you can follow instructions provided by <a title="OpenVZ quick installation guide." href="http://wiki.openvz.org/Quick_installation" target="_blank">OpenVZ site</a>.  Once you are done with this guide, you will have CentOS container running for you to play with.</p>
<p>For my purposes,  I started with very basic installation of CentOS 5.5.  I have done this on existing installations of CentOS without any issues as well.  Ok so let&#8217;s start with getting the OpenVZ repository added to our system.  This means that we will be going down &#8220;yum&#8221; path instead of &#8220;rpm&#8221; path.  This is the quickest and easiest way to get OpenVZ installed.</p>
<p><code>cd /etc/yum.repos.d<br />
wget http://download.openvz.org/openvz.repo<br />
rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ</code></p>
<p>Before we move on, let&#8217;s turn off selinux:</p>
<p><code>vi /etc/selinux/config<br />
:0,$s/=enforcing/=disabled/g<br />
:wq</code></p>
<p>Go ahead and reboot the box and check:</p>
<p><code>[root@tooncent ~]# getenforce<br />
Disabled</code></p>
<p>Now since we have the OpenVZ repository added and selinux disabled, we can go ahead and move on with installation part:<br />
<code>yum install vzkernel.x86_64 #install kernel with openvz support</code></p>
<p><code>echo '<br />
# ----------added for OpenVZ installation----------------<br />
# On Hardware Node we generally need<br />
# packet forwarding enabled and proxy arp disabled<br />
net.ipv4.ip_forward = 1<br />
net.ipv6.conf.default.forwarding = 1<br />
net.ipv6.conf.all.forwarding = 1<br />
net.ipv4.conf.default.proxy_arp = 0<br />
# Enables source route verification<br />
net.ipv4.conf.all.rp_filter = 1<br />
# Enables the magic-sysrq key<br />
kernel.sysrq = 1<br />
# We do not want all our interfaces to send redirects<br />
net.ipv4.conf.default.send_redirects = 1<br />
net.ipv4.conf.all.send_redirects = 0<br />
' &gt;&gt; /etc/sysctl.conf</code></p>
<p>Note:  by executing above snippet, you will end up creating duplicate entries.  It&#8217;s always a good idea to clean up duplicates to avoid confusion/mistakes later.</p>
<p>Following step is optional and mostly for clarity.  Edit your grub.conf and change CentOS to say OpenVZ:</p>
<p><code>vi /etc/grub.conf</code></p>
<p>Change the first &#8220;title CentOS&#8221; to &#8220;title OpenVZ&#8221; (without the quotes).  For example:</p>
<p><code>title CentOS (2.6.18-194.17.1.el5.028stab070.7)<br />
root (hd0,0)<br />
kernel /vmlinuz-2.6.18-194.17.1.el5.028stab070.7 ro root=/dev/VolGroup00/LogVol00<br />
initrd /initrd-2.6.18-194.17.1.el5.028stab070.7.img</code></p>
<p>becomes:</p>
<p><code>title OpenVZ (2.6.18-194.17.1.el5.028stab070.7)<br />
root (hd0,0)<br />
kernel /vmlinuz-2.6.18-194.17.1.el5.028stab070.7 ro root=/dev/VolGroup00/LogVol00<br />
initrd /initrd-2.6.18-194.17.1.el5.028stab070.7.img</code></p>
<p>Ok at this point we are ready to reboot and use the new kernel.  Issue a &#8220;reboot&#8221;.  Let&#8217;s install the utilities to manage OpenVZ:<br />
<code>yum install vzctl.x86_64 vzquota.x86_64</code></p>
<p>We need to start up vz manually once.</p>
<p><code>/etc/init.d/vz start</code></p>
<p>Alright!  we got OpenVZ running.  Now, let&#8217;s get a precreated template from <a title="OpenVZ template downloads" href="http://wiki.openvz.org/Download/template/precreated" target="_blank">OpenVZ site</a>.</p>
<p><code>cd /vz/template/cache/<br />
wget http://download.openvz.org/template/precreated/centos-5-x86_64.tar.gz</code></p>
<p>Ok now comes the fun part; let&#8217;s get our first container up and running:<br />
Note: ostemplate name is the file you downloaded minus .tar.gz.  <strong>centos-5-x86_64</strong>.tar.gz</p>
<p><code>[root@tooncent cache]# vzctl create 101 --ostemplate centos-5-x86_64<br />
Creating container private area (centos-5-x86_64)<br />
Performing postcreate actions<br />
Container private area was created<br />
[root@tooncent cache]#</code></p>
<p>Container files are created under /vz/private/101  &lt; &#8211; 101 is the id you give it.  You can put any numeric number above 100.  Documentation says not to use anything below 101 since its a reserved range.</p>
<p>Let&#8217;s set a hostname so there is no confusion:</p>
<p><code>vzctl set 101 --hostname toontest.tooncent.com --save<br />
Set hostname: toontest.tooncent.com<br />
Saved parameters for CT 101</code></p>
<p>To start your new container:</p>
<p><code>[root@tooncent ~]# vzctl start 101<br />
Starting container ...<br />
Container is mounted<br />
Setting CPU units: 1000<br />
Set hostname: toontest.tooncent.com<br />
Container start in progress...<br />
[root@tooncent ~]#</code></p>
<p>To access your container:</p>
<p><code>vzctl enter 101</code></p>
<p>To exit the container, type: exit</p>
<p>To stop the container:</p>
<p><code># vzctl stop 101<br />
Stopping container ...<br />
Container was stopped<br />
Container is unmounted</code></p>
<p>Congratulations!   You have successfully setup a container.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2010/11/30/centos-openvz-container-based-virtualization-quick-guide-part-1-of-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[Bash] Performing array intersection with Bash</title>
		<link>http://crazytoon.com/2010/10/25/bash-performing-array-intersection-with-bash/</link>
		<comments>http://crazytoon.com/2010/10/25/bash-performing-array-intersection-with-bash/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 01:15:51 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=224</guid>
		<description><![CDATA[I am currently working on a project to deploy new website builds to a small number of servers. I needed something simple and reliable that could be built in a very short period of time. I decided to whip something up in bash with the intent of refining it in Python later. As I began [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I am currently working on a project to deploy new website builds to a<br />
small number of servers.  I needed something simple and reliable that could<br />
be built in a very short period of time.  I decided to whip something up in<br />
bash with the intent of refining it in Python later.</p>
<p>As I began to write this code, I realized that it probably would have been<br />
quicker to do it in Python from the start.  I decided to stick with bash as<br />
somewhat of an academic exercise.  The vast majority of these deployment<br />
scripts were trivial; check the code out of git, create a manifest, package<br />
it up, spew it to the servers, etc, etc.  The problem came during the last<br />
step.  We decided to use a symlink to point to the active build out of a<br />
number of builds that could be available on the server at any given time.<br />
Since all of our servers should be running the exact same version of the<br />
build, it makes sense that I should only allow a user of my deployment<br />
scripts to link a build which exists on all servers.  But how do you<br />
accomplish this in bash?</p>
<p>In most other languages, you have access to numerous array helping<br />
functions that allow you to perform intersects, uniqs, and merges.  My goal<br />
was to do the same thing in bash without forking out to any external<br />
binary.  So how do you ensure that a particular thing exists on N number of<br />
servers?  Here it is:</p>
<pre lang="bash">function in_array() {
 local x
 ENTRY=$1
 shift 1
 ARRAY=( "$@" )
 [ -z "${ARRAY}" ] && return 1
 [ -z "${ENTRY}" ] && return 1
 for x in ${ARRAY[@]}; do
   [ "${x}" == "${ENTRY}" ] && return 0
 done
 return 1
}

MASTER=()
CURRENT=()
FIRST=1
for SERVER in ${SERVERS}; do
 # collect all builds from server and populate CURRENT list
 COMMAND="${LS} -1fd ${WEBROOT}/${SITE}.*"
 BUILDS=`${SSH} ${SSHOPTS} root@${SERVER} "${COMMAND}"`
 for BUILD in ${BUILDS}; do
   CURRENT=( ${CURRENT[@]-} ${BUILD} )
 done

 # if this is our first time around, copy CURRENT to MASTER
 if [ ${FIRST} -eq 1 ]; then
   MASTER=( ${CURRENT[@]} )
   FIRST=0
 fi

 # now we do a compare between MASTER and CURRENT to see what builds
 # are common
 INTERSECT=()
 for ENTRY in ${CURRENT[@]}; do
   in_array "${ENTRY}" "${MASTER[@]}"
   RET=$?
   if [ "${RET}" -eq 0 ]; then
     INTERSECT=( ${INTERSECT[@]-} ${ENTRY} )
   fi
 done
 MASTER=( ${INTERSECT[@]} )

 # clear the CURRENT array
 CURRENT=()
done</pre>
<p>Let me take a moment to explain the code above:</p>
<ul>
<li> In order to check for array intersection, you need an in_array()<br />
function</p>
<ul>
<li>The first argument as the &#8220;needle&#8221; and the second is the<br />
&#8220;haystack&#8221;</li>
<li>We verify that both parameters were passed</li>
<li>We simply loop through the haystack checking for the needle</li>
<li>If we find it, return success.  Otherwise, eventually return<br />
false</li>
</ul>
</li>
<li>We need to loop through each server eventually, but we&#8217;ll start with<br />
the first one</p>
<ul>
<li>Run an SSH command to get a listing of builds</li>
<li>Populate an array ($CURRENT) with the builds that were found</li>
</ul>
<ul>
<li>Since the first server has no previous server to compare with, so we<br />
just copy it to $MASTER</li>
</ul>
</li>
<li>We then loop to the 2nd server, and put the result of getting builds<br />
into $CURRENT</p>
<ul>
<li>Now that we have the first server&#8217;s builds in $MASTER, we perform an<br />
intersect with $CURRENT</li>
<li>We realize the need for an $INTERSECT array to hold the intersections<br />
found above</li>
<li>$INTERSECT becomes $MASTER since it only contains similar builds from<br />
the 1st and 2nd server</li>
</ul>
</li>
<li>Looping to the 3rd server, we get the builds and put them in $CURRENT
<ul>
<li>Since $MASTER contains only the similar builds thus far, we again<br />
compare it with $CURRENT</li>
<li>The intersect can now be used to compare against builds on the 4th<br />
server, and so on</li>
</ul>
</li>
<li>Once you finish looping through all servers, your $MASTER should<br />
contain only similar builds</li>
</ul>
<p>There are a few guides out there which show you how to do this via<br />
forking, but I thought someone may appreciate the elegance of using 100%<br />
bash to accomplish this.  I hope this helps someone else out there!</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2010/10/25/bash-performing-array-intersection-with-bash/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Error while compiling apache on CentOS 5.5</title>
		<link>http://crazytoon.com/2010/07/16/error-while-compiling-apache-on-centos-5-5/</link>
		<comments>http://crazytoon.com/2010/07/16/error-while-compiling-apache-on-centos-5-5/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 20:24:40 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux System]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=221</guid>
		<description><![CDATA[I got the following error when I was trying to modify my existing installation of Apache. Only thing I changed was to add &#8211;with-expires to my configure. Here is the error: libtool: link: cannot find the library `/usr/local/src/httpd-2.2.14/srclib/apr-util/xml/expat/lib/libexpat.la' or unhandled argument `/usr/local/src/httpd-2.2.14/srclib/apr-util/xml/expat/lib/libexpat.la' I was able to fix this error by adding: --with-expat=builtin Remember to do [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I got the following error when I was trying to modify my existing installation of Apache.  Only thing I changed was to add &#8211;with-expires to my configure.  Here is the error: </p>
<p><code>libtool: link: cannot find the library `/usr/local/src/httpd-2.2.14/srclib/apr-util/xml/expat/lib/libexpat.la' or unhandled argument `/usr/local/src/httpd-2.2.14/srclib/apr-util/xml/expat/lib/libexpat.la'</code></p>
<p>I was able to fix this error by adding:  <code>--with-expat=builtin</code></p>
<p>Remember to do <code>make clean</code> or untar again before doing configure.  Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2010/07/16/error-while-compiling-apache-on-centos-5-5/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How do you print number of files for each folder in a directory [Linux]</title>
		<link>http://crazytoon.com/2010/04/05/get-file-counts-for-folders-linux/</link>
		<comments>http://crazytoon.com/2010/04/05/get-file-counts-for-folders-linux/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 20:37:06 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=208</guid>
		<description><![CDATA[I have been annoyed by the fact that I couldn&#8217;t easily print file count for all of the folders in certain directory.Â  Most of the time I just want to see what space each folder is using (du -hs *) but there are times when I need to know how many files are in each [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I have been annoyed by the fact that I couldn&#8217;t easily print file count for all of the folders in certain directory.Â  Most of the time I just want to see what space each folder is using (du -hs *) but there are times when I need to know how many files are in each folder (checking cache folder, session folders etc).Â Â  So I whipped together a command line which does just that for me:</p>
<p><code>for i in `find -maxdepth 1 -type d`; doÂ  echo -n $i " ";find $i|wc -l; done</code></p>
<p>I am sure there are many different ways to show file count for each folder in a directory and I am curious to see what people do so please do post comments with what you do.</p>
<p>Above command is pretty simple and can be expanded to do whatever you need.Â  For example, you can throw it into a bash script and be able to pass parameters.Â  For example:Â  count_files /home/Â  In this case your command line would look like:</p>
<p><code>for i in `find /home/ -maxdepth 1 -type d`; doÂ  echo -n $i " ";find $i|wc  -l; done</code></p>
<p>only difference would be that /home/ would be argument you passed and therefore will be $1.Â  Here is a sample script for above example:</p>
<p><code>#!/bin/bash<br />
for i in `find $1 -maxdepth 1 -type d`; do<br />
echo -n $i " ";<br />
find $i|wc -l;<br />
done</code></p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet  carefully. Make backups often. And yeah.. last but not least.. I am not  responsible for any damage caused by this posting. <strong>Use at your  own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2010/04/05/get-file-counts-for-folders-linux/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>PHP: Curl being slow from php call on CentOS 5.4</title>
		<link>http://crazytoon.com/2010/01/19/php-curl-being-slow-from-php-call-on-centos-5-4/</link>
		<comments>http://crazytoon.com/2010/01/19/php-curl-being-slow-from-php-call-on-centos-5-4/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 22:12:28 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=204</guid>
		<description><![CDATA[I ran into an issue where curl request run within few ms from command line but same url fetch was taking over 10 secs. After doing some debugging and research it turned out that call to check (getaddr ipv6 was timing out. Obviously you can do multiple things to fix this (including enabling ipv6 support) [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I ran into an issue where curl request run within few ms from command line but same url fetch was taking over 10 secs.  After doing some debugging and research it turned out that call to check (getaddr ipv6 was timing out.  Obviously you can do multiple things to fix this (including enabling ipv6 support) but since I did not have a need for ipv6 (it is disabled in my network configuration), I decided to recompile curl and disable ipv6.  Here is the command for recompiling curl and installing into /usr/local/curl directory with ipv6 disabled.</p>
<p>./configure &#8211;prefix=/usr/local/curl &#8211;disable-ipv6</p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2010/01/19/php-curl-being-slow-from-php-call-on-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Virus:  What is mygener.im virus on facebook?</title>
		<link>http://crazytoon.com/2009/05/07/virus-what-is-mygenerim-virus-on-facebook/</link>
		<comments>http://crazytoon.com/2009/05/07/virus-what-is-mygenerim-virus-on-facebook/#comments</comments>
		<pubDate>Thu, 07 May 2009 17:26:54 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[mygener.im]]></category>
		<category><![CDATA[Virus]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=182</guid>
		<description><![CDATA[If you are a facebook user, please be aware that mygener.im virus is spreading quickly on facebook. From what I have seen online so far, it seems to redirect to a site which probably is stealing data from you computer and/or installing trojans. Initially it looks like this site allows to create generation tree and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>If you are a facebook user, please be aware that mygener.im virus is spreading quickly on facebook.  From what I have seen online so far, it seems to redirect to a site which probably is stealing data from you computer and/or installing trojans. Initially it looks like this site allows to create generation tree and looks like a legit domain.  This is being spread via messages to you from other friends of yours who are &#8220;infected&#8221;.</p>
<p>One of the things you can do to prevent getting &#8220;infected&#8221; is to not click on any links on facebook.  Even if it comes from friends you trust. Â It would also be a good idea to arm your self with theÂ <a href="http://www.eset.com/us/" target="_blank">best virus protection software</a>. Â If you do click on a link, make sure you don&#8217;t enter any login/passwordsÂ  on any sites you end up on.</p>
<p>Here is an article on eHow which talks about avoiding the virus:Â  <a title="mygener.im virus facebook" href="http://www.ehow.com/how_5000713_advoid-mygenerim-virus-facebook.html">how to avoid mygener.im on facebook</a></p>
<p>EDIT:Â  some people have reported that destination url has changed at least once so you may end up on a site which looks like aother &#8220;legit&#8221; site.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2009/05/07/virus-what-is-mygenerim-virus-on-facebook/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Health: H1N1 Swine Flu Google Map</title>
		<link>http://crazytoon.com/2009/04/27/health-h1n1-swine-flu-google-map/</link>
		<comments>http://crazytoon.com/2009/04/27/health-h1n1-swine-flu-google-map/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 02:33:44 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Swine Flu]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=176</guid>
		<description><![CDATA[There has been a lot of talk on the news about the swine flu and how it is spreading fast and a lot of people are affected. Here is something worth checking out, a google map with incidents marked with information on areas affected, how many dead, infection reported, etc. http://tinyurl.com/cosuzr Watch where you hang [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There has been a lot of talk on the news about the swine flu and how it is spreading fast and a lot of people are affected.  Here is something worth checking out, a google map with incidents marked with information on areas affected, how many dead, infection reported, etc.</p>
<p><a title="Swine Flu Google Map" href="http://maps.google.com/maps/ms?ie=UTF8&amp;hl=en&amp;t=p&amp;msa=0&amp;msid=106484775090296685271.0004681a37b713f6b5950&amp;ll=32.639375,-110.390625&amp;spn=15.738151,25.488281&amp;source=embed">http://tinyurl.com/cosuzr<br />
</a></p>
<p>Watch where you hang out and if you are feeling any symptoms, go see a doctor.</p>
<p>Here is some info fromÂ  <a title="2009 Swine flu outbreak" href="http://en.wikipedia.org/wiki/2009_swine_flu_outbreak">wikipedia</a>:</p>
<blockquote><p>Mexican officials state that since March 2009 there have been over 1600 reported cases and put the death toll at 149, with 20 confirmed to be linked to a new swine influenza strain of influenza A virus subtype H1N1.</p>
<p>In the US, twenty-eight cases have been confirmed among New York students, seven in California, two in Texas, two in Kansas and one in Ohio; all have recovered. Kansas state health officials confirmed two cases of swine flu in Kansas on April 25, 2009, just minutes after eight school children in New York City were believed to be infected after a school trip to Mexico. The New York case had been confirmed as influenza A virus, which met the Centers for Disease Control and Prevention (or CDC) definition of a probable case of swine flu. Tests have now confirmed that this flu virus is the new strain of H1N1, according to reports on UK BBC News. On April 25, 2009, Texas closed a high school near San Antonio indefinitely after a third student showed symptoms of swine flu.</p>
<p>In Canada, the virus has now been confirmed in six cases. There are also three confirmed cases outside North America. The first confirmed case in Europe has occurred in a man in Spain, the second and third in Scotland in the UK. In Scotland there are two confirmed cases being treated in a hospital in Airdrie, Lanarkshire. The results from their tests came in at 6.10pm on 27 April 2009 and were confirmed as positive. These are the first two confirmed cases in the UK and the second and third in Europe. On April 26, 2009, students from Rangitoto College and Northcote College, both on the North Shore of Auckland, New Zealand, returned from school trips to Mexico and began exhibiting signs of influenza. Like the US students, they tested positive for influenza A which means swine flu is highly likely, however definite results are pending. There have also been reports of suspected infection in Australia, Brazil, Chile, France and Israel. Airports worldwide are on alert, with passengers from Mexico entering Japan being screened for the virus.</p>
<p>The head of the World Health Organization will lead the agency&#8217;s efforts against a deadly swine flu outbreak. The World Health Organization warns this new swine flu has the potential to become an international influenza pandemic. On April 25, 2009, the World Health Organization issued a document called the Swine influenza frequently asked questions. On April 24, 2009, the World Health Organization agreed that the current situation constitutes a public health emergency of international concern. The EU are advising against non essential travel to Mexico and the USA. Experts warn that use of face masks does not provide adequate protection. Face masks only work when dry; after an hour or two the breath causes the fabric to become damp and then it does not provide filtration of infection. A face mask must be replaced every two hours and the one used disposed of or cleaned. The WHO have increased the level pandemic alert to phases 4 on a 6 point scale. Phase 4 indicates a &#8220;significant increase in risk of pandemic&#8221;.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2009/04/27/health-h1n1-swine-flu-google-map/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Telnet: shell script to issue commands to telnet session.</title>
		<link>http://crazytoon.com/2009/01/03/telnet-shell-script-to-issue-commands-to-telnet-session/</link>
		<comments>http://crazytoon.com/2009/01/03/telnet-shell-script-to-issue-commands-to-telnet-session/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 15:25:43 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[telnet]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=159</guid>
		<description><![CDATA[This is a quick post to show how one can issue commands to telnet session from a shell script or command line with out going into interactive mode. I use this to get stats from our memcache servers or issue a flush_all via telnet from a script/cron. So without further delay, following command will telnet [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This is a quick post to show how one can issue commands to <a title="man telnet - man page for telnet " href="http://www.lamp-tips.com/man-pages/telnet /" target="_blank">telnet</a> session from a shell script or command line with out going into interactive mode.  I use this to get stats from our memcache servers or issue a flush_all via <a title="man telnet - man page for telnet " href="http://www.lamp-tips.com/man-pages/telnet /" target="_blank">telnet</a> from a script/cron.</p>
<p>So without further delay, following command will telnet to local memcached server on port 11211 and issue one of the memcached commands, stats</p>
<p><code>(sleep .5;echo stats) | telnet localhost 11211</code><br />
You may have to play with the sleep timer to get it to work for your environment but in our .5 was the sweet spot.  Good luck and let me know if you have another shell command.  Obviously we can do this from perl, php, python, etc but the beauty of this is that you do not need any other dependencies plus its a very short command.</p>
<p>Since &#8220;jsled&#8221; commented about <a title="man nc - man page for nc" href="http://www.lamp-tips.com/man-pages/nc/" target="_blank">nc</a> (thanks jsled), here is the syntax to do the same thing with <a title="man nc - man page for nc" href="http://www.lamp-tips.com/man-pages/nc/" target="_blank">nc</a>:</p>
<p><code>echo "stats" | nc localhost 11211</code></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2009/01/03/telnet-shell-script-to-issue-commands-to-telnet-session/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>RewriteRule:  How to avoid passing query string when you redirect.</title>
		<link>http://crazytoon.com/2008/12/11/rewriterule-how-to-avoid-passing-query-string-when-you-redirect/</link>
		<comments>http://crazytoon.com/2008/12/11/rewriterule-how-to-avoid-passing-query-string-when-you-redirect/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 08:01:07 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[RewriteRule]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=162</guid>
		<description><![CDATA[Today I ran into an issue which I could not figure out for quite a while. I was trying to redirect a url to another url using RewriteRule. It was supposed to be a pretty straightforward redirect which made it even more annoying than complicated ones. Hopefully somebody is able to explain what I am [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Today I ran into an issue which I could not figure out for quite a while.  I was trying to redirect a url to another url using RewriteRule.  It was supposed to be a pretty straightforward redirect which made it even more annoying than complicated ones.  Hopefully somebody is able to explain what I am missing here and if my solution is a good solution or not.</p>
<p>I needed to redirect a url:Â  http://www.example.com/testpage.php?foo=bar to http://www.example.com/</p>
<p>So I added this to .htaccess file:</p>
<p><code>RewriteRule ^testpage\.php / [R=301,L]</code></p>
<p>This did do a 301 redirect as I wanted but query string passed so my redirected url looked like:Â  http://www.example.com/?foo=bar</p>
<p>Obviously this is not what I wanted so in order for me to fix it, I had to take a rather lame approach.Â  My new redirect is:</p>
<p><code>RewriteRule ^testpage\.php /<strong>?</strong> [R=301,L]</code></p>
<p>The only difference is the &#8220;?&#8221; after / for target url.Â  I am just curious to know why query-string was passed.Â  I have not used rewrites for long time but I do not remember this behavior.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/12/11/rewriterule-how-to-avoid-passing-query-string-when-you-redirect/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>SVN:  How do you use svn command line on Windows with ssh tunneling?</title>
		<link>http://crazytoon.com/2008/11/19/svn-how-do-you-use-svn-command-line-on-windows-with-ssh-tunneling/</link>
		<comments>http://crazytoon.com/2008/11/19/svn-how-do-you-use-svn-command-line-on-windows-with-ssh-tunneling/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 14:58:03 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[Windows System]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=151</guid>
		<description><![CDATA[If you ever used svn command line, you know it is not optimal to type in your password every time you do checkout, checkin, info, etc.Â  In linux world, it is very easy to setup keys to get around this.Â  Of course in the world of Windows it is not as easy.Â Â Here are the steps [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>If you ever used svn command line, you know it is not optimal to type in your password every time you do checkout, checkin, info, etc.Â  In linux world, it is very easy to <a title="SSH: setting up public key authentication over SSH" href="http://crazytoon.com/2007/08/05/ssh-setting-up-public-key-authentication-over-ssh-centos-redhat-linux-fedora/" target="_blank">setup keys</a> to get around this.Â  Of course in the world of Windows it is not as easy.Â Â Here are the steps you need to follow to get private/public keys working with your SVN under Windows using ssh tunneling.</p>
<p><strong>Assumptions</strong>:Â  you will be connecting as user &#8220;root&#8221; to svn server located at &#8220;10.0.0.1&#8221;.Â  All your files will be saved at c:\ including your svn command line utility</p>
<p>First we will have to generate a key.Â  We can accomplish this by using a free utility called <a title="puttygen: free key generator" href="http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe" target="_blank">puttygen</a>.Â  Run puttygen and click on &#8220;Generate&#8221; button.Â  You will have a key similar to below example:</p>
<div id="attachment_153" style="width: 310px" class="wp-caption alignnone"><a href="http://crazytoon.com/wp-content/uploads/2008/11/puttygen_key.gif"><img class="size-medium wp-image-153" title="puttygen key example" src="http://crazytoon.com/wp-content/uploads/2008/11/puttygen_key-300x288.gif" alt="Example of a key generated by puttygen" width="300" height="288" srcset="http://crazytoon.com/wp-content/uploads/2008/11/puttygen_key-300x288.gif 300w, http://crazytoon.com/wp-content/uploads/2008/11/puttygen_key.gif 484w" sizes="(max-width: 300px) 100vw, 300px" /></a><p class="wp-caption-text">Example of a key generated by puttygen</p></div>
<p>Copy this, you will need it in few mins.Â  At this point, go ahead and create a private key by clicking on:Â  &#8220;Save private key&#8221;.Â  Save this as private.ppk on your C:\.Â  </p>
<p>Now let us log in to the svn server and add this public key to the authorized_keys2 (see <a title="SSH: setting up public key authentication over SSH" href="http://crazytoon.com/2007/08/05/ssh-setting-up-public-key-authentication-over-ssh-centos-redhat-linux-fedora/" target="_blank">setting up keys</a> for step by step instructions).Â  I will assume you are using &#8220;root&#8221; as login.</p>
<p><code>vi /root/.ssh/authorized_keys2</code></p>
<p>Make sure when you paste, it is not broken into different lines.Â  All of the key should be one line.</p>
<p>Ok now back to your Windows machine.Â  Now we need to set up ssh tunnel to our server.Â  There are few ways of doing this but for our purpose, we will use another free program provided by the same developers as puttygen: <a title="plink: used to create ssh tunnel" href="http://the.earth.li/~sgtatham/putty/latest/x86/plink.exe" target="_blank">download plink</a> to C:\.Â  If you do not do this step, you will get following error:</p>
<p><code>svn: Can't create tunnel: The system cannot find the file specified.</code></p>
<p>Ok let us set the variables for svn.Â  Go to command prompt and type (you can also set this in your scripts and inside windows environment.Â  But since this post is to show you an example, we will just do this):</p>
<p><code>set SVN_SSH="/plink.exe" -i /private.ppk -l root</code></p>
<p>Now let&#8217;s run this one time manually to cache key:</p>
<p><code>/plink.exe -i /private.ppk -l root 10.0.0.1</code></p>
<p>Press &#8220;y&#8221; when it asks you to save.Â  Type exit and get back to your prompt.</p>
<p>Ok now we can test our svn utility.</p>
<p><code>/svn info svn+ssh://10.0.0.1/svn/testrepo/trunk/</code></p>
<p>This should display output similar to:</p>
<p><code>Path: trunk<br />
URL: svn+ssh://10.0.0.1/svn/testrepo/trunk<br />
Repository Root: svn+ssh://10.0.0.1/svn/testrepo<br />
Repository UUID: b9143312-b1a1-11ba-a111-11cdcd1d2222<br />
Revision: 10<br />
Node Kind: directory<br />
Last Changed Author: root<br />
Last Changed Rev: 4<br />
Last Changed Date: 2008-11-18 15:18:47 -0800 (Tue, 18 Nov 2008)</code></p>
<p>Now you are ready to script your checkouts, do checkin&#8217;s with out having to type in your password, etc.</p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/11/19/svn-how-do-you-use-svn-command-line-on-windows-with-ssh-tunneling/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>sshfs: How do you install sshfs and fuse? [CentOS/Linux/Redhat]</title>
		<link>http://crazytoon.com/2008/10/07/sshfs-how-do-you-install-sshfs-and-fuse-centoslinuxredhat/</link>
		<comments>http://crazytoon.com/2008/10/07/sshfs-how-do-you-install-sshfs-and-fuse-centoslinuxredhat/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 23:06:50 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[sshfs]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=84</guid>
		<description><![CDATA[One may wonder what is sshfs and why would you want it?Â  Well simply put, sshfs allows you to mount another server&#8217;s filesystem into a folder on your local system which in the background is doing ssh commands and transfers.Â  As a mounted folder, you are able to move about and copy files back and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One may wonder what is sshfs and why would you want it?Â  Well simply put, sshfs allows you to mount another server&#8217;s filesystem into a folder on your local system which in the background is doing ssh commands and transfers.Â  As a mounted folder, you are able to move about and copy files back and forth as everything was on local server.Â  As you can see this makes it very easy for you to work with files on multiple servers.</p>
<p><strong>Note</strong>:Â  you only have to do the following installations on the server where you are doing the mounts on.</p>
<p>Let us download and install the filesystem framework which is a requirement for sshfs called fuse.</p>
<p><code>wget http://voxel.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.4.tar.gz<br />
tar zxpfv fuse-*.gz<br />
cd fuse*<br />
./configure</code></p>
<p>If you get the following error, you will either have to point to the location of the kernel source or install it if needed.</p>
<p><code>checking kernel source directory... Not found<br />
configure: error:<br />
*** Please specify the location of the kernel source with<br />
*** the '--with-kernel=SRCDIR' option<br />
configure: error: ./configure failed for kernel</code></p>
<p>In our case here, we will be installing the source using yum.</p>
<p><code>yum -y install kernel-devel</code></p>
<p>Once installed, you will have to find out the directory it is installed in</p>
<p><code>ls -l /usr/src/kernels/<br />
total 4.0K<br />
drwxr-xr-x 18 root root 4.0K OctÂ  7 14:50 <strong>2.6.18-92.1.13.el5-x86_64</strong>/</code></p>
<p><code>./configure --with-kernel=/usr/src/kernels/<strong>2.6.18-92.1.13.el5-x86_64</strong><br />
make &amp;&amp; make install<br />
cd ..</code></p>
<p>Now let us get sshfs source and install it.</p>
<p><code>wget http://voxel.dl.sourceforge.net/sourceforge/fuse/sshfs-fuse-2.1.tar.gz<br />
tar zxpfv sshfs*<br />
cd sshfs-fuse-*<br />
./configure</code></p>
<p>If you get the following error:</p>
<p><code>checking for SSHFS... configure: error: The pkg-config script could not be found or is too old.Â  Make sure it<br />
is in your PATH or set the PKG_CONFIG environment variable to the full<br />
path to pkg-config.</code></p>
<p>OR</p>
<p><code>checking for SSHFS... configure: error: Package requirements (fuse &gt;= 2.2 glib-2.0 gthread-2.0) were not met:</code></p>
<p>No package &#8216;glib-2.0&#8217; found<br />
No package &#8216;gthread-2.0&#8217; found</p>
<p>You need to install glib2.Â  Do the following:</p>
<p><code>yum install glib2-devel</code></p>
<p>Once installation is done, continue with configure.</p>
<p><code>./configure<br />
make &amp;&amp; make install</code></p>
<p>After installation is done, we can move on with testing the installation:</p>
<p><code>cd /mnt<br />
mkdir test<br />
sshfs 10.0.0.2:/ test</code></p>
<p>If you get the following error,<br />
<code>sshfs: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory</code><br />
execute this:  NOTE:  this is for x64 system.  If you have 32 bit system, you have to symlink to /lib instead.<br />
<code>ln -s /usr/local/lib/libfuse.so.2 /lib64/</code><br />
Let us try mounting again:<br />
<code>sshfs 10.0.0.2:/ test</code><br />
At this point it would be like if you were making a ssh connection to 10.0.0.2  You will have to type in a password to get the mount to happen.  You may get the following error:  <code>fuse: device not found, try 'modprobe fuse' first</code></p>
<p>If you do &#8216;modprobe fuse&#8217;, as they tell you to, and you get:<br />
<code>modprobe fuse<br />
FATAL: Module fuse not found.</code></p>
<p>That means your running kernel is not the same version as the one you compiled with.  You have two options here:<br />
1) you can upgrade your kernel by typing:  yum update kernel<br />
2) find the source files for the kernel you have running and recompile fuse.</p>
<p>I went with option 1.  Once you do the update, reboot and try doing <em>modprobe fuse</em> again.</p>
<p>At this point we can try doing the mount again.<br />
<code>cd /mnt<br />
sshfs 10.0.0.2:/ test</code></p>
<p>If you do not get any errors, do df -h to see the mount:<br />
<code>...<br />
sshfs#10.0.0.2:/  1000G     0 1000G   0% /mnt/test<br />
...</code></p>
<p>At this point you can browse 10.0.0.2 server filesystem as it was local on your server.</p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-</p>
<p><small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/10/07/sshfs-how-do-you-install-sshfs-and-fuse-centoslinuxredhat/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Lance Armstrong come back to cycling to raise awareness of the global cancer burden</title>
		<link>http://crazytoon.com/2008/09/09/lance-armstrong-come-back-to-cycling-to-raise-awareness-of-the-global-cancer-burden/</link>
		<comments>http://crazytoon.com/2008/09/09/lance-armstrong-come-back-to-cycling-to-raise-awareness-of-the-global-cancer-burden/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 22:25:04 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[cancer awareness]]></category>
		<category><![CDATA[Lance Armstrong]]></category>
		<category><![CDATA[Tour de France]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=123</guid>
		<description><![CDATA[I know this is not one of my normal type of posts, but I really wanted to get this out to raise some awareness on the topic of cancer which most of us do not think about because it does not affect us directly.Â  It is sad how many people are affected by cancer and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I know this is not one of my normal type of posts, but I really wanted to get this out to raise some awareness on the topic of cancer which most of us do not think about because it does not affect us directly.Â  It is sad how many people are affected by cancer and how many people die every year because of losing fight with cancer.</p>
<p>It is wonderful when famous people who can help make a difference do things to help a cause.Â  One of those people is <a title="Lance Armstrong" href="http://en.wikipedia.org/wiki/Lance_Armstrong" target="_blank">Lance Armstrong</a>, winner of <a title="Tour de France" href="http://en.wikipedia.org/wiki/Tour_de_France">Tour de France</a> a record-breaking seven consecutive years.Â  He is also a cancer survivor.Â Â  Today I found out that Lance Armstrong announced that he is coming back to professional cycling in order to raise cancer awareness.  Below is the full press release from <a title="Lance's Comeback to Cycling in 2009" href="http://www.livestrong.com/lance2009/" target="_blank">livestrong.com</a> website.Â  You can also visit the site to watch the video:</p>
<p>&#8220;I am happy to announce that after talking with my children, my family and my closest friends, I have decided to return to professional cycling in order to raise awareness of the global cancer burden. This year alone, nearly eight million people will die of cancer worldwide. Millions more will suffer in isolation, victims not only of the disease but of social stigma. After the passage of Proposition 15 in Texas, a $3 billion investment in the fight against cancer which is helping to make this disease part of the national dialogue in America, it&#8217;s now time to address cancer on a global level.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/09/09/lance-armstrong-come-back-to-cycling-to-raise-awareness-of-the-global-cancer-burden/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Linux: How do you find out what your server&#8217;s outgoing ip is?</title>
		<link>http://crazytoon.com/2008/09/04/linux-how-do-you-find-out-what-your-servers-outgoing-ip-is/</link>
		<comments>http://crazytoon.com/2008/09/04/linux-how-do-you-find-out-what-your-servers-outgoing-ip-is/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 14:27:05 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Notes for self]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=110</guid>
		<description><![CDATA[There are many times when I needed to find out my outgoing (or external) IP for the servers which are behind load balancers or firewalls.Â  I used to just login to another external server from the server in question and find out by looking at &#8220;who&#8221; what my external ip is.Â  Even though it works [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There are many times when I needed to find out my outgoing (or external) IP for the servers which are behind load balancers or firewalls.Â  I used to just login to another external server from the server in question and find out by looking at &#8220;<a title="man who - manpage for who" href="http://www.lamp-tips.com/man-pages/who/" target="_blank">who</a>&#8221; what my external ip is.Â  Even though it works and I am so used to it, today I decided to figure out a more graceful way of finding my outgoing ip.Â  As most of us already know, whatismyip.com is the quickest way to find out your outgoing ip from the browser.Â  So I decided to use the same way on the servers.Â  So I issued a wget:</p>
<p><code>wget http://www.whatismyip.org</code></p>
<p>Well that does the trick.Â  But being lazy as I am, I did not want to have to cat the output file to find out the ip (plus there is no point of creating extra files and doing extra work to remove them).Â  So if you are ssh&#8217;ed in, you can issue following command (I am sure there is another way of doing it, but this is the quickest way I could think of):</p>
<p><code><a title="man wget - manpage for wget" href="http://www.lamp-tips.com/man-pages/wget/" target="_blank">wget</a> -q -O - http://www.whatismyip.org</code></p>
<p>-O tells wget to redirect output to the following file (- being the standard out ).Â  So it basically echo&#8217;s output to our console.</p>
<p>-q makes wget run inÂ  quiet mode so you do not see all of the connection/download/etc output.</p>
<p>That is it!Â  I am curious to know what other ways people use to get the same information.Â  Please share your way if possible.</p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-</p>
<p><small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/09/04/linux-how-do-you-find-out-what-your-servers-outgoing-ip-is/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Quick tip:  how do you rename all files so spaces are converted to underscores?</title>
		<link>http://crazytoon.com/2008/08/25/quick-tip-how-do-you-rename-all-files-so-spaces-are-converted-to-underscores/</link>
		<comments>http://crazytoon.com/2008/08/25/quick-tip-how-do-you-rename-all-files-so-spaces-are-converted-to-underscores/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 23:36:13 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[man tr]]></category>
		<category><![CDATA[rename files]]></category>
		<category><![CDATA[spaces to underscores]]></category>
		<category><![CDATA[uppercase to lowercase]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=97</guid>
		<description><![CDATA[My friend today asked me how to convert all spaces in filenames under a specified directory to underscores. Also, at the same time lowercase all of the filenames. Here is a quick script to do what is needed. Let us start with creating some test data in a temp directory: mkdir temp cd temp touch [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>My friend today asked me how to convert all spaces in filenames under a specified directory to underscores.  Also, at the same time lowercase all of the filenames.  Here is a quick script to do what is needed.  Let us start with creating some test data in a temp directory:</p>
<p><code>mkdir temp<br />
cd temp<br />
touch Foo FooO "Foo Bar" "FOO BAaR"<br />
\ls | while read -r FILENAME<br />
do<br />
mv -v "$FILENAME" `echo $FILENAME| tr ' ' '_'| tr '[A-Z]' '[a-z]'`<br />
done</code></p>
<p>Note:Â  I intentionally have slash in front of ls (\ls).Â  \ls means that we want to make sure there is no ls alias overwriting our command.  This is needed if your system has alias setup to display ls in a different way instead of default listing.Â  mv -v shows us the filenames being renamed as your script goes through the whole dir.Â  Your output should be like:</p>
<p><code>`Foo' -&gt; `foo'<br />
`FOO BAaR' -&gt; `foo_baar'<br />
`Foo Bar' -&gt; `foo_bar'<br />
`FooO' -&gt; `fooo'</code></p>
<p>One of the very powerful commands in this post is the &#8220;tr&#8221; command.  This command is not as popular as sed or awk but it is very useful and simple to use (<a title="man tr - man page for tr" href="http://www.lamp-tips.com/man-pages/tr/" target="_blank">read more about tr</a>).</p>
<p>If you only needed to convert spaces to underscores and you are using CentOS/Fedora/Redhat, you can use this simpler method.  <strong>NOTE</strong>:  this command is not available on all distributions:  <code>rename " " "_" *</code></p>
<p>Learn more about <a title="man rename - man page for rename" href="http://www.lamp-tips.com/man-pages/rename/" target="_blank">rename </a>command<br />
â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/08/25/quick-tip-how-do-you-rename-all-files-so-spaces-are-converted-to-underscores/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Apache/http monitoring:  monitor http traffic in realtime using httptop</title>
		<link>http://crazytoon.com/2008/08/12/apachehttp-monitoring-monitor-http-traffic-in-realtime-using-httptop/</link>
		<comments>http://crazytoon.com/2008/08/12/apachehttp-monitoring-monitor-http-traffic-in-realtime-using-httptop/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 20:05:59 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Server load]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[apache monitoring]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[realtime monitoring]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=86</guid>
		<description><![CDATA[Server monitoring is a big part of running a solid web site.Â  As an admin, you must know what is going on your server.Â  One of the tools most Linux/Unix admins are used to is called &#8220;top&#8221;.Â  &#8220;top&#8221; by itself is a very powerful tool.Â  Here is a quick guide on how to read output [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Server monitoring is a big part of running a solid web site.Â  As an admin, you must know what is going on your server.Â  One of the tools most Linux/Unix admins are used to is called &#8220;top&#8221;.Â  &#8220;<a title="Introduction to load averages under &quot;top&quot;" href="http://crazytoon.com/2007/01/29/what-is-this-load-average-i-keep-hearing-about/" target="_blank">top</a>&#8221; by itself is a very powerful tool.Â  Here is a quick guide on how to read output from top:Â  <a title="Introduction to load averages under &quot;top&quot;" href="http://crazytoon.com/2007/01/29/what-is-this-load-average-i-keep-hearing-about/">introduction to load averages under top</a>.Â  It just makes sense that somebody went and created http<strong>top</strong> to monitor http traffic.</p>
<p>Install perl modules:</p>
<p><code>install Term::ReadKey<br />
install File::Tail<br />
install Time::HiRes<br />
</code><br />
Now copy paste the script below and save it in a location and set +x attribute on it so you can execute it.Â  On my setup, I have the script under /usr/bin/httptop:</p>
<p><code>#!/usr/bin/perl -w<br />
use Time::HiRes qw( time );<br />
use File::Tail (Â  );<br />
use Term::ReadKey;<br />
use Getopt::Std;<br />
use strict;<br />
### Defaults you might be interested in adjusting.<br />
my $Update = 2; # update every n secs<br />
my $Backtrack = 250; # backtrack n lines on startup<br />
my @Paths = qw(<br />
%<br />
/title/%/logs/access_log<br />
/var/log/httpd/%/access_log<br />
/usr/local/apache/logs/%/access_log<br />
);<br />
my $Log_Format = "combined";<br />
my %Log_Fields = (<br />
combined =&gt; [qw/ Host x x Time URI Response x Referer Client /],<br />
vhost =&gt; [qw/ VHost Host x x Time URI Response x Referer Client /]<br />
);<br />
### Constants &amp; other thingies. Nothing to see here. Move along.<br />
my $Version = "0.4.1";<br />
sub by_hits_per (Â  ) { $b-&gt;{Rate} &lt;=&gt; $a-&gt;{Rate} }<br />
sub by_total (Â  ) { $b-&gt;{Total} &lt;=&gt; $a-&gt;{Total} }<br />
sub by_age (Â  ) { $a-&gt;{Last} &lt;=&gt; $b-&gt;{Last} }<br />
my $last_field = "Client";<br />
my $index = "Host";<br />
my $show_help = 0;<br />
my $order = \&amp;by_hits_per;<br />
my $Help = "htlwufd?q";<br />
my %Keys = (<br />
h =&gt; [ "Order by hits/second" =&gt; sub { $order = \&amp;by_hits_per } ],<br />
t =&gt; [ "Order by total recorded hits" =&gt; sub { $order = \&amp;by_total } ],<br />
l =&gt; [ "Order by most recent hits" =&gt; sub { $order = \&amp;by_age } ],<br />
w =&gt; [ "Show remote host" =&gt; sub { $index = "Host" } ],<br />
u =&gt; [ "Show requested URI" =&gt; sub { $index = "URI" } ],<br />
f =&gt; [ "Show referring URL" =&gt; sub { $index = "Referer" } ],<br />
d =&gt; [ "Show referring domain" =&gt; sub { $index = "Domain" } ],<br />
'?' =&gt; [ "Help (this thing here)" =&gt; sub { $show_help++ } ],<br />
q =&gt; [ "Quit" =&gt; sub { exit } ]<br />
);<br />
my @Display_Fields = qw/ Host Date URI Response Client Referer Domain /;<br />
my @Record_Fields = qw/ Host URI Referer Domain /;<br />
my $Max_Index_Width = 50;<br />
my $Initial_TTL = 50;<br />
my @Months = qw/ Jan Feb Mar Apr May Jun Jul Aug Sep Nov Dec /;<br />
my %Term = (<br />
HOME =&gt; "\033[H",<br />
CLS =&gt; "\033[2J",<br />
START_TITLE =&gt; "\033]0;", # for xterms etc.<br />
END_TITLE =&gt; "\007",<br />
START_RV =&gt; "\033[7m",<br />
END_RV =&gt; "\033[m"<br />
);<br />
my ( %hist, %opt, $spec );<br />
$SIG{INT} = sub { exit };<br />
END { ReadMode 0 };<br />
### Subs.<br />
sub refresh_output<br />
{<br />
my ( $cols, $rows ) = GetTerminalSize;<br />
my $show = $rows - 3;<br />
my $count = $show;<br />
my $now = (shift || time);<br />
for my $type ( values %hist ) {<br />
for my $peer ( values %$type ) {<br />
# if ( --$peer-&gt;{_Ttl} &gt; 0 ) {<br />
my $delta = $now - $peer-&gt;{Start};<br />
if ( $delta &gt;= 1 ) {<br />
$peer-&gt;{ Rate } = $peer-&gt;{ Total } / $delta;<br />
} else {<br />
$peer-&gt;{ Rate } = 0<br />
}<br />
$peer-&gt;{ Last } = int( $now - $peer-&gt;{ Date } );<br />
# } else {<br />
# delete $type-&gt;{$peer}<br />
# }<br />
}<br />
}<br />
$count = scalar( values %{$hist{$index}} ) - 1 if $show &gt;= scalar values %{$hist{$index}};<br />
my @list = ( sort $order values %{$hist{$index}} )[ 0 .. $count ];<br />
my $first = 0;<br />
$first = ( $first &lt;= $_ ? $_ + 1 : $first ) for map { $_ ? length($_-&gt;{$index}) : 0 } @list;<br />
$first = $Max_Index_Width if $Max_Index_Width &lt; $first;<br />
print $Term{START_TITLE}, "Monitoring $spec at: ", scalar localtime, $Term{END_TITLE} if $ENV{TERM} eq "xterm"; # UGLY!!!<br />
my $help = "Help/?";<br />
my $head = sprintf( "%-${first}s %6s %4s %4s %s (%d total)",<br />
$index, qw{ Hits/s Tot Last }, $last_field,<br />
scalar keys %{$hist{$index}}<br />
);<br />
#<br />
# Truncate status line if need be<br />
#<br />
$head = substr($head, 0, ($cols - length($help)));<br />
print @Term{"HOME", "START_RV"}, $head, " " x ($cols - length($head) - length($help)), $help, $Term{END_RV}, "\n";<br />
for ( @list ) {<br />
# $_-&gt;{_Ttl}++;<br />
my $line = sprintf( "%-${first}s %6.3f %4d %3d %s",<br />
substr( $_-&gt;{$index}, 0, $Max_Index_Width ), @$_{(qw{ Rate Total Last }, $last_field)} );<br />
if ( length($line) &gt; $cols ) {<br />
substr( $line, $cols - 1 ) = "";<br />
} else {<br />
$line .= " " x ($cols - length($line));<br />
}<br />
print $line, "\n";<br />
}<br />
print " " x $cols, "\n" while $count++ &lt; $show;<br />
}<br />
sub process_line<br />
{<br />
my $line = shift;<br />
my $now = ( shift || time );<br />
my %hit;<br />
chomp $line;<br />
@hit{@{$Log_Fields{$Log_Format}}} = grep( $_, split( /"([^"]+)"|\[([^]]+)\]|\s/o, $line ) );<br />
$hit{ URI } =~ s/HTTP\/1\S+//gos;<br />
$hit{ Referer } = "&lt;unknown&gt;" if not $hit{Referer} or $hit{Referer} eq "-";<br />
( $hit{Domain} = $hit{Referer} ) =~ s#^\w+://([^/]+).*$#$1#os;<br />
$hit{ Client } ||= "&lt;none&gt;";<br />
$hit{ Client } =~ s/Mozilla\/[\w.]+ \(compatible; /(/gos;<br />
$hit{ Client } =~ s/[^\x20-\x7f]//gos;<br />
# if $now is negative, try to guess how old the hit is based on the time stamp.<br />
if ( $now &lt; 0 ) {<br />
my @hit_t = ( split( m![:/\s]!o, $hit{ Time } ))[ 0 .. 5 ];<br />
my @now_t = ( localtime )[ 3, 4, 5, 2, 1, 0 ];<br />
my @mag = ( 3600, 60, 1 );<br />
# If the hit didn't parse right, or didn't happen today, the hell with it.<br />
return unless $hit_t[2] == ( $now_t[2] + 1900 )<br />
and $hit_t[1] eq $Months[ $now_t[1] ]<br />
and $hit_t[0] == $now_t[0];<br />
splice( @hit_t, 0, 3 );<br />
splice( @now_t, 0, 3 );<br />
# Work backward to the UNIX time of the hit.<br />
$now = time;<br />
$now -= (shift( @now_t ) - shift( @hit_t )) * $_ for ( 3600, 60, 1 );<br />
}<br />
$hit{ Date } = $now;<br />
for my $field ( @Record_Fields ) {<br />
my $peer = ( $hist{$field}{$hit{$field}} ||= { Start =&gt; $now, _Ttl =&gt; $Initial_TTL } );<br />
@$peer{ @Display_Fields } = @hit{ @Display_Fields };<br />
$peer-&gt;{ Total }++;<br />
}<br />
}<br />
sub display_help {<br />
my $msg = "httptop v.$Version";<br />
print @Term{qw/ HOME CLS START_RV /}, $msg, $Term{END_RV}, "\n\n";<br />
print " " x 4, $_, " " x 8, $Keys{$_}[0], "\n" for ( split "", $Help );<br />
print "\nPress any key to continue.\n";<br />
}<br />
### Init.<br />
getopt( 'frb' =&gt; \%opt );<br />
$Backtrack = $opt{b} if $opt{b};<br />
$Update = $opt{r} if $opt{r};<br />
$Log_Format = $opt{f} if $opt{f};<br />
$spec = $ARGV[0];<br />
die &lt;&lt;End unless $spec and $Log_Fields{$Log_Format};<br />
Usage: $0 [-f &lt;format&gt;] [-r &lt;refresh_secs&gt;] [-b &lt;backtrack_lines&gt;] &lt;logdir | path_to_log&gt;<br />
Valid formats are: @{[ join ", ", keys %Log_Fields ]}.<br />
End<br />
for ( @Paths ) {<br />
last if -r $spec;<br />
( $spec = $_ ) =~ s/%/$ARGV[0]/gos;<br />
}<br />
die "No access_log $ARGV[0] found.\n" unless -r $spec;<br />
my $file = File::Tail-&gt;new(<br />
name =&gt; $spec,<br />
interval =&gt; $Update / 2,<br />
maxinterval =&gt; $Update,<br />
tail =&gt; $Backtrack,<br />
nowait =&gt; 1<br />
) or die "$spec: $!";<br />
my $last_update = time;<br />
my ( $line, $now );<br />
# Backtracking.<br />
while ( $Backtrack-- &gt; 0 ) {<br />
last unless $line = $file-&gt;read;<br />
process_line( $line, -1 );<br />
}<br />
$file-&gt;nowait( 0 );<br />
ReadMode 4; # Echo off.<br />
print @Term{"HOME", "CLS"}; # Home &amp; clear.<br />
refresh_output;<br />
### Main loop.<br />
while (defined( $line = $file-&gt;read )) {<br />
$now = time;<br />
process_line( $line, $now );<br />
while ( $line = lc ReadKey(-1) ) {<br />
$show_help = 0 if $show_help;<br />
$Keys{$line}[1]-&gt;(Â  ) if $Keys{$line};<br />
}<br />
if ( $show_help == 1 ) {<br />
display_help;<br />
$show_help++; # Don't display help again.<br />
} elsif ( $now - $last_update &gt; $Update and not $show_help ) {<br />
$last_update = $now;<br />
refresh_output( $now );<br />
}<br />
}</code></p>
<p>Save/exit and make sure you make it executable by setting it to +x (<a title="man chmod - man page for chmod" href="http://www.lamp-tips.com/man-pages/chmod/" target="_blank">chmod </a>+x httptop)</p>
<p>Now you can run httptop by typing:Â  <code>httptop -f combined -r 1 /usr/local/apache2/logs/access_log</code></p>
<p>NOTE:Â  Your access_log file might be in different location.Â  Point to the right location.Â  This sets the refresh rate to 1 sec (-r 1).Â  Now you can run httptop any time you want to checkout how your http traffic is doing.Â  Remember to press &#8220;?&#8221; to get help once you are in.</p>
<p>â€”â€”â€”â€”â€”</p>
<p><small>DISCLAIMER: As always, if you find any inaccurate information, please comment and let me know. When you do comment, make sure you give me some references to confirm.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/08/12/apachehttp-monitoring-monitor-http-traffic-in-realtime-using-httptop/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>MySQL:  How do you enable sphinxse (Sphinx Storage Engine) in your mysql installation?</title>
		<link>http://crazytoon.com/2008/08/05/mysql-how-do-you-enable-sphinxse-sphinx-storage-engine-in-your-mysql-installation/</link>
		<comments>http://crazytoon.com/2008/08/05/mysql-how-do-you-enable-sphinxse-sphinx-storage-engine-in-your-mysql-installation/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 22:21:32 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fulltext search]]></category>
		<category><![CDATA[open source full text search engine]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[sphinx]]></category>
		<category><![CDATA[sphinx storage engine]]></category>
		<category><![CDATA[sphinxse]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=88</guid>
		<description><![CDATA[As you may know mysql fulltext search is not highly scalable.Â  One of the options to get around this scalability limitation, which I prefer, is to use Sphinx.Â  You can use Sphinx with out having to alter your mysql installation.Â  But, if you would like to use from within mysql and not have to worry [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As you may know mysql fulltext search is not highly scalable.Â  One of the options to get around this scalability limitation, which I prefer, is to use <a title="Sphinx Homepage" href="http://www.sphinxsearch.com/" target="_blank">Sphinx</a>.Â   You can use Sphinx with out having to alter your mysql installation.Â  But, if you would like to use from within mysql and not have to worry about how to pass data between Sphinx and MySQL, you can enable sphinxse (sphinx storage engine).Â  It is not included with mysql by default so you will have to compile it yourself.</p>
<p>Here are the instructions on how to get sphinxse compiled with your mysql installation on CentOS x64.Â  I am sure same instructions will work for other flavors but I have not tested it.Â  I will be compiling the most current version of sphinx (0.9.8) with most current stable version of mysql (5.0.51b) at the time of the writing.Â  Let&#8217;s get the appropriate packages first:</p>
<p><code>wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz<br />
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz/from/http://mysql.he.net/<br />
tar zxpf sphinx*<br />
tar zxpf mysql*</code></p>
<p>You will also need &#8220;bison&#8221;, &#8220;patch&#8221;, &#8220;automake&#8221; and &#8220;libtool&#8221; installed.Â  Let us just do a yum install for it.</p>
<p><code>yum -y install bison patch automake libtool</code></p>
<p><strong>NOTE</strong>:Â  if you don&#8217;t install bison, you will get the following error:<br />
<code>sed '/^#/ s|y\.tab\.c|sql_yacc.cc|' y.tab.c &gt;sql_yacc.cct &amp;&amp; mv sql_yacc.cct sql_yacc.cc<br />
sed: can't read y.tab.c: No such file or directory<br />
make[2]: *** [sql_yacc.cc] Error 2</code></p>
<p>Let us continue with patching mysql source with sphinx storage engine (sphinxse) code and compile/install our new binaries.</p>
<p><code>cd mysql*<br />
patch -p1 &lt; ../sphinx-0.9.8/mysqlse/sphinx.5.0.37.diff #Make sure everything succeeded.<br />
BUILD/autorun.sh<br />
mkdir sql/sphinx<br />
cp ../sphinx-0.9.8/mysqlse/* sql/sphinx<br />
./configure --prefix=/usr/local/mysql --with-sphinx-storage-engine<br />
make<br />
make install</code></p>
<p>Now start your mysql installtion and check if engine support is compiled in:</p>
<p><code>mysql&gt; show engines\G<br />
Engine: SPHINX<br />
Support: YES<br />
Comment: Sphinx storage engine 0.9.8</code></p>
<p>To read more about how to use Sphinx storage engine, please refer to:Â  <a title="Sphinx Documentation for using Sphinx Storage Engine" href="http://www.sphinxsearch.com/doc.html#sphinxse-using" target="_blank">Sphinx documentation for using sphinx storage engine</a></p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/08/05/mysql-how-do-you-enable-sphinxse-sphinx-storage-engine-in-your-mysql-installation/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Linux:  yum options you may not know exist.</title>
		<link>http://crazytoon.com/2008/06/16/linux-yum-options-you-may-not-know-exist/</link>
		<comments>http://crazytoon.com/2008/06/16/linux-yum-options-you-may-not-know-exist/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 15:18:17 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=85</guid>
		<description><![CDATA[Most of the users who work with distributions such as: centos, fedora, redhat, etc use yum as a package update/installer. Most of them know how to do &#8220;yum update [packagename]&#8221; (to update all or [certain packages]) or they do &#8220;yum install packagename&#8221; to install certain package(s). But yum can do so much more. Here are [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Most of the users who work with distributions such as: centos, fedora, redhat, etc use yum as a package update/installer.  Most of them know how to do &#8220;yum update [packagename]&#8221; (to update all or [certain packages]) or they do &#8220;yum install packagename&#8221; to install certain package(s).  But yum can do so much more.  Here are some options you may find useful:</p>
<p>Following command will search for the string you specified.   Generally this will give you all of the packages which has specified string in title or description.  Most of the time you will have to look through a lot of output to find what you are looking for.</p>
<p><code>yum search string</code></p>
<p>Probably one of the most important options for yum is provides/whatprovides.  If you know what command you need, you can find out what package you have to install in order to have that command available to you.</p>
<p><code>yum provides (or whatprovides) command</code><br />
<code></code></p>
<p>Following command is same as above but with less output.</p>
<p><code> yum -d 1 provides command</code></p>
<p>So for example if you are trying to figure out what you need to install to use bunzip2, type:</p>
<p><code>yum -d 1 provides bunzip2</code></p>
<p>you will get a similar output as below.</p>
<p><code># yum -d 1 provides bunzip2<br />
bzip2.x86_64                             1.0.2-13.EL4.3         base<br />
bzip2.x86_64                             1.0.2-13.EL4.3         base<br />
man-pages-fr.noarch                      0.9.7-13.el4           base<br />
man-pages-ja.noarch                      20050215-2.EL4.3       base<br />
man-pages-pl.noarch                      0.23-5                 base</code></p>
<p>As you can see bunzip2 is part of bzip2 package.  So now you can you just install bzip2.x86_64 to get bunzip2.</p>
<p>To learn more about what else is available, <a title="man yum - man page for yum" href="http://www.lamp-tips.com/man-pages/yum/" target="_blank">read man yum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/06/16/linux-yum-options-you-may-not-know-exist/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MySQL:  Fix Microsoft Word characters.  Shows weird characters on the web page.</title>
		<link>http://crazytoon.com/2008/06/05/mysql-fix-microsoft-word-characters-shows-weird-characters-on-the-web-page/</link>
		<comments>http://crazytoon.com/2008/06/05/mysql-fix-microsoft-word-characters-shows-weird-characters-on-the-web-page/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 21:03:50 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Microsoft Word characters]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=82</guid>
		<description><![CDATA[As a consultant, I do a lot of content migrations for clients. One issue I run into quite often is the encoding of databases, tables, columns differs between source and destination. Most clients do not want me to go and change the way their encoding is to fix issues since they are too afraid about [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As a consultant, I do a lot of content migrations for clients.  One issue I run into quite often is the encoding of databases, tables, columns differs between source and destination.  Most clients do not want me to go and change the way their encoding is to fix issues since they are too afraid about messing with production data.  Of course amongst other issues, it creates weird characters for data which is copied/pasted from Microsoft Word. You see weird characters like:   Ã¢â‚¬â„¢ Ã¢â‚¬Â¦ Ã¢â‚¬â€œ Ã¢â‚¬Å“ Ã¢â‚¬ Ã¢â‚¬Ëœ</p>
<p>So if you just want to replace these with appropriate symbols, you may do it with a simple sql query.  Note that below queries are without <strong>where </strong>clause.  You may what to test it with one of your rows before making changes to the whole table.  Of course, you should always backup your data before you try this out.  If you have a dev system, that is even better.  I put all my sql queries into a file ex: fix.sql and sourced it with mysql client.</p>
<p>vi fix.sql</p>
<p><code>update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬â„¢', '\'');<br />
update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬Â¦','...');<br />
update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬â€œ','-');<br />
update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬Å“','"');<br />
update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬Â','"');<br />
update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬Ëœ','\'');<br />
update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬Â¢','-');<br />
update table_name set  fieldname = replace(fieldname, 'Ã¢â‚¬Â¡','c');</code></p>
<p>Save/exit.</p>
<p><code># mysql<br />
mysql&gt; source fix.sql;<br />
</code><br />
I am not sure if I am missing any other chars.  If you know of any other chars, please comment with them and I will add on to the script here.</p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/06/05/mysql-fix-microsoft-word-characters-shows-weird-characters-on-the-web-page/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Subversion:  What to do when your repository server moves to another ip?</title>
		<link>http://crazytoon.com/2008/06/02/subversion-what-to-do-when-your-repository-server-moves-to-another-ip/</link>
		<comments>http://crazytoon.com/2008/06/02/subversion-what-to-do-when-your-repository-server-moves-to-another-ip/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 23:14:42 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=81</guid>
		<description><![CDATA[This weekend our networking guys decided to change ips for all of our servers. They also changed our subversion server&#8217;s ip. This caused some issues in the subversion world with developers who had checkouts pointing to ips instead of hostname, using command similar to: svn co svn+ssh://192.168.1.10/svn/myrepos/ /home/mycheckout/ Now when they do &#8220;svn update&#8221; inside [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This weekend our networking guys decided to change ips for all of our servers.  They also changed our subversion server&#8217;s ip.  This caused some issues in the subversion world with developers who had checkouts pointing to ips instead of hostname, using command similar to:</p>
<p><code>svn co svn+ssh://192.168.1.10/svn/myrepos/ /home/mycheckout/</code></p>
<p>Now when they do &#8220;svn update&#8221; inside the their /home/mycheckout/ directory, they get an error:</p>
<p>We needed to point the checkout to the new ip.  Easiest way to do this is to delete your checkout and re-checkout.  Unfortunately, some of the developers had a lot of modified files which wasn&#8217;t checked in yet.  I fixed it by issuing:<br />
<code><br />
find /home/mycheckout  -name "entries"|xargs /usr/bin/perl -w -i -p -e "s/192.168.1.10/10.1.1.10/g"</code></p>
<p>Find command helps us in finding all the files with name &#8220;entries&#8221; and xargs takes the filename and passes it to perl.  To understand what perl command is doing, see <a title="http://crazytoon.com/2007/10/29/linux-how-do-i-mass-find-and-replace-text-in-files-under-linux-using-perl/ " href="http://http://crazytoon.com/2007/10/29/linux-how-do-i-mass-find-and-replace-text-in-files-under-linux-using-perl/" target="_blank">this post</a>.</p>
<p>Another method which may be preferred as mentioned in comments is:  svn switch  Only downside I see with this is that you have to remember what you used originally.  If you did checkout as user@192.168.1.10, you would have to pass that to the command below.</p>
<p>Syntax is:</p>
<p><code>svn switch --relocate svn+ssh://192.168.1.10 svn+ssh://10.1.1.10</code></p>
<p>I would suggest at this time you switch to using hostname instead of ip.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/06/02/subversion-what-to-do-when-your-repository-server-moves-to-another-ip/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Apache2 gzip compression:  How do I speed up my website download time?</title>
		<link>http://crazytoon.com/2008/05/29/apache-gzip-compression-how-do-i-speed-up-my-website-download-time/</link>
		<comments>http://crazytoon.com/2008/05/29/apache-gzip-compression-how-do-i-speed-up-my-website-download-time/#comments</comments>
		<pubDate>Thu, 29 May 2008 15:54:06 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Server load]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=76</guid>
		<description><![CDATA[One of the things people tend to forget is the ability for web servers to compress content before sending it back to client. Client&#8217;s browser then uncompresses the data and displays it to the user. Pretty much all of the recent browsers support gzip compression. In this post, I will go over how to setup [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One of the things people tend to forget is the ability for web servers to compress content before sending it back to client.  Client&#8217;s browser then uncompresses the data and displays it to the user.  Pretty much all of the recent browsers support gzip compression.  In this post, I will go over how to setup apache2 to use compression.  First let&#8217;s see if your Apache installation has &#8220;deflate&#8221; enabled.  You can check to see if you have deflate by typing:</p>
<p><code># /usr/local/apache2/bin/apachectl -t -D DUMP_MODULES<br />
Loaded Modules:<br />
...<br />
deflate_module (static)<br />
...<br />
Syntax OK</code></p>
<p>If you don&#8217;t have have deflate_module, you would have to recompile your apache with &#8220;&#8211;enable-deflate&#8221; option.</p>
<p>Going forward, I am going to assume you have deflate_module.  Add the following to your apache conf file:</p>
<p><code>&lt;Location /&gt;<br />
SetOutputFilter DEFLATE<br />
BrowserMatch ^Mozilla/4\.0[678] no-gzip\<br />
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html<br />
# Don't compress images<br />
SetEnvIfNoCase Request_URI \<br />
<strong>\.(?:gif|jpe?g|png)$ no-gzip dont-vary</strong><br />
&lt;/Location&gt;</code></p>
<p>The main thing you need to configure is the line which says &#8220;no-gzip dont-vary&#8221; also in bold above.  This tells apache to not compress certain type of files.  I have noticed on some of my sites that swf (flash) files do not work as expected if they are compressed.  So if you have swf files in your site, you may want to add <strong>|swf </strong>right after png.</p>
<p>This is all what it takes for you to enable gzip compression in Apache2.  Once you restart your apache so it reads the conf file, you can test if your site is getting compressed or not by using this tool:  <a title="http://www.gidnetwork.com/tools/gzip-test.php" href="http://www.gidnetwork.com/tools/gzip-test.php" target="_blank">http://www.gidnetwork.com/tools/gzip-test.php</a></p>
<p>Here are the results for my blog:</p>
<p style="padding-left: 30px;">Results for: http://crazytoon.com<br />
Web page compressed? 	Yes<br />
Compression type? 	gzip<br />
Size, Markup (bytes) 	57,337<br />
Size, Compressed (bytes) 	11,666<br />
Compression % 	79.7</p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/05/29/apache-gzip-compression-how-do-i-speed-up-my-website-download-time/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Amazing Photos from Botanical Garden In Beijing, China</title>
		<link>http://crazytoon.com/2008/05/28/amazing-photos-from-botanical-garden-in-beijing-china/</link>
		<comments>http://crazytoon.com/2008/05/28/amazing-photos-from-botanical-garden-in-beijing-china/#comments</comments>
		<pubDate>Wed, 28 May 2008 07:29:24 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Photos]]></category>
		<category><![CDATA[Beijing]]></category>
		<category><![CDATA[Botanical]]></category>
		<category><![CDATA[China]]></category>
		<category><![CDATA[Garden]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=79</guid>
		<description><![CDATA[KPICASA_GALLERY(GardeningInBEIJINGChina)]]></description>
				<content:encoded><![CDATA[<p>KPICASA_GALLERY(GardeningInBEIJINGChina)</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/05/28/amazing-photos-from-botanical-garden-in-beijing-china/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>MySQL: How do you install innotop to monitor innodb in real time?</title>
		<link>http://crazytoon.com/2008/05/21/mysql-how-do-you-install-innotop-to-monitor-innodb-in-real-time/</link>
		<comments>http://crazytoon.com/2008/05/21/mysql-how-do-you-install-innotop-to-monitor-innodb-in-real-time/#comments</comments>
		<pubDate>Wed, 21 May 2008 09:06:11 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[innodb]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[innotop]]></category>
		<category><![CDATA[mysql monitoring]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=78</guid>
		<description><![CDATA[Innotop is a very useful tool to monitor innodb information in real time. This tool is written by Baron Schwartz who is also an author of &#8220;High Performance MySQL, Second edition&#8221; book. [Side note: I highly recommend getting this book when it comes out (in June, 08?). Other authors include: Peter Zaitsev, Jeremy Zawodny, Arjen [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Innotop is a very useful tool to monitor innodb information in real time.  This tool is written by Baron Schwartz who is also an author of &#8220;High Performance MySQL, Second edition&#8221; book. <small>[Side note: I highly recommend getting this book when it comes out (in June, 08?).  Other authors include: Peter Zaitsev, Jeremy Zawodny, Arjen Lentz, Vadim Tkachenko and Derek J. Balling.]</small> Quick summary of what innotop can monitor (from: http://innotop.sourceforge.net/):  InnoDB transactions and internals, queries and processes, deadlocks, foreign key errors, replication status, system variables and status and much more.</p>
<p>Following are the instructions on how to install innotop on CentOS x64/Fedora/RHEL (Redhat enterprise).  Most probably same instructions can be used on all flavors of Linux.  If not, leave me a comment and I will research a solution for you.  Let us start with downloading innotop.  I used version 1.6.0 which is the latest at the time of writing.</p>
<p><code>wget http://internap.dl.sourceforge.net/sourceforge/innotop/innotop-1.6.0.tar.gz</code></p>
<p>Now let us go ahead and unzip and create the MakeFile to get it ready for install</p>
<p><code>tar zxpf innotop-1.6.0.tar.gz<br />
cd innotop-1.6.0<br />
perl Makefile.PL</code></p>
<p>At this point if you get the following output, you are good to continue:</p>
<p><code>Checking if your kit is complete...<br />
Looks good<br />
Writing Makefile for innotop</code></p>
<p>If you get something similar to following, you will need to take care of the prerequisites:</p>
<p><code>Looks good<br />
Warning: prerequisite DBD::mysql 1 not found.<br />
Warning: prerequisite DBI 1.13 not found.<br />
Warning: prerequisite Term::ReadKey 2.1 not found.<br />
Writing Makefile for innotop</code></p>
<p>Just because they are warnings does not mean you ignore them.  So let us install those prerequisites.  We will use perl&#8217;s cpan shell to get this installed (visit my post on <a title="How do I install Perl modules? eg. Installing LWP module for Perl." href="http://crazytoon.com/2007/05/21/perl-how-do-i-install-perl-modules-eg-installing-lwp-module-for-perl/">how to install perl modules</a> for more details).  If it is your first time starting this up, you will have to answer some questions.  Defaults will work fine in all cases.</p>
<p><code>perl -MCPAN -eshell<br />
install Term::ReadKey<br />
install DBI<br />
install DBD::mysql</code></p>
<p>Note:  you must install DBI before you can install DBD::mysql.</p>
<p>If you get an error like following when you are installing DBD::mysql:</p>
<p><code>Error:  Can't load '/root/.cpan/build/DBD-mysql-4.007/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.</code></p>
<p>You will have to create a symlink to the object file in your lib64 (or lib if you are not using x64 version) folder:</p>
<p><code>ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.15 /lib64/</code></p>
<p>Once all prerequisites are done, type  perl Makefile.PL and you should have no warnings.  Continue the install:</p>
<p><code>make install</code></p>
<p>At this point you should have innotop installed on your system.  Let us do some quick set up so you can start using innotop.  We start with configuring your .my.cnf to include connection directives.<br />
<code><br />
vi ~/.my.cnf</code></p>
<p>Add the following (edit to reflect your install) and save/exit</p>
<p><code>[mysql]<br />
port            = 3306<br />
socket          = /tmp/mysql.sock</code></p>
<p>Start up innotop by typing innotop at your shell prompt.  First prompt will ask you to &#8220;Enter a name:&#8221;.  I just put localhost since this will be used to connect locally.  Next prompt asks you about DSN entry.  I use:  DBI:mysql:;mysql_read_default_group=mysql</p>
<p>This tells innotop to read .my.cnf file and use group [mysql] directives.  Next prompt is optional (I just press enter).  Next two prompts you enter information if you need to.</p>
<p>At this point your innotop installation / testing is complete.  You can read <a title="man innotop - Man page for innotop" href="http://www.lamp-tips.com/man-pages/innotop/" target="_blank">man innotop</a> to get more details on how to use innotop.</p>
<p>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/05/21/mysql-how-do-you-install-innotop-to-monitor-innodb-in-real-time/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Oh dear MySQL slave, where did you put those rows?</title>
		<link>http://crazytoon.com/2008/05/17/mysql-missing-data-on-slave-mysql-replicatio/</link>
		<comments>http://crazytoon.com/2008/05/17/mysql-missing-data-on-slave-mysql-replicatio/#comments</comments>
		<pubDate>Sat, 17 May 2008 10:35:00 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL backup]]></category>
		<category><![CDATA[uh...]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=75</guid>
		<description><![CDATA[I need help from my fellow mysql users.Â  I know some of the people who read this are alot better then me with mysql so hopefully you can help 🙂 So today we decided that we are going to migrate one of our master database servers to new hardware.Â  Since we got the hardware this [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I need help from my fellow mysql users.Â  I know some of the people who read this are alot better then me with mysql so hopefully you can help 🙂</p>
<p>So today we decided that we are going to migrate one of our master database servers to new hardware.Â  Since we got the hardware this morning and we wanted to move on to it asap, we decided that we will take our slave down, copy data from it, and bring it up on future master server.Â  At that point, we will let it run as slave to the current master server until its time for us to take it down.Â  Reason we did that instead of mysqldump/import was to avoid the lag mysqldump creates on our server.</p>
<p>After we did all this and put up the new master server, we started to notice odd issues.Â  After looking around and comparing old db with new, we found out that new db was missing data.Â  How it happened is beyond me and is the reason why I am writing this.Â  We never had issues with the slave which would cause data to be lost; so what happened to those missing rows?Â  Is this something which is common?Â  Can we not trust our slave enough to use it as master if master died?Â  Can we not run backups off the slave with confident that our data is protected and up to date so to keep load down on our master?Â  All these questions which keep me awake and wondering&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/05/17/mysql-missing-data-on-slave-mysql-replicatio/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Forums @ crazytoon.com is up!</title>
		<link>http://crazytoon.com/2008/05/16/forums-crazytoon-com-is-up/</link>
		<comments>http://crazytoon.com/2008/05/16/forums-crazytoon-com-is-up/#comments</comments>
		<pubDate>Fri, 16 May 2008 10:08:13 +0000</pubDate>
		<dc:creator><![CDATA[Sunny Walia]]></dc:creator>
				<category><![CDATA[Linux Apache MySQL PHP]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=74</guid>
		<description><![CDATA[I have thought about putting up forums on my blog for LONG time and even thought about writing my own. But after playing with phpBB3 for a while on my other site (http://totalplaystation.com/forum), I have decided to use it instead. Let&#8217;s just face it; I don&#8217;t have the time or resources to write all of [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I have thought about putting up forums on my blog for LONG time and even thought about writing my own.  But after playing with phpBB3 for a while on my other site (<a title="TotalPlayStation.com" href="http://totalplaystation.com/forum" target="_blank">http://totalplaystation.com/forum</a>), I have decided to use it instead.  Let&#8217;s just face it; I don&#8217;t have the time or resources to write all of the functionality phpbb3 provides.  Isn&#8217;t it a big reason why we all love open source?</p>
<p>If any of the phpbb guys read this, Thank you and keep up the good work! 🙂</p>
<p>Check out the forums:  <a title="http://crazytoon.com/forum/" href="http://crazytoon.com/forum/" target="_blank">http://crazytoon.com/forum/</a> and feel free to postÂ  questions, comments, suggestions, rants, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/05/16/forums-crazytoon-com-is-up/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
