<?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>KP Solutions &#187; Tips</title>
	<atom:link href="http://www.kpsolution.com/blog/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kpsolution.com/blog</link>
	<description>Solutions for Day to Day Technical Problems</description>
	<lastBuildDate>Tue, 24 Aug 2010 02:37:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to limit connections per User IP in Apache 2.2 CentOs</title>
		<link>http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/</link>
		<comments>http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:41:22 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=59</guid>
		<description><![CDATA[If you are a system admin or a webmaster, you will face this question at some point of time. How do I limit connections per user ip in Apache 2.2? Generally, you get good users visiting your site who use &#8230; <a href="http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are a system admin or a webmaster, you will face this question at some point of time. How do I limit connections per user ip in Apache 2.2? Generally, you get good users visiting your site who use the site normally requesting one or two page at a time. But then there are a few malicious user who would want cause grief to you and your server by overloading the server with requests. To handle such malicious user, you need the mod_limitipconn module. This module keeps check on the number of connections a single ip can make simultaneously. There are configurable options that help you tune this module. So, now to the point.. How do I install this on my server?</p>
<p>I am outlining the steps for my server, ie. CentOs 5.2 with Apache 2.2</p>
<ul>
<li>wget http://dl.atrpms.net/all/mod_limitipconn-0.23-4.el5.x86_64.rpm</li>
<li>rpm -i mod_limitipconn-0.23-4.el5.x86_64.rpm</li>
<li>vi /etc/http/modules/ipconn.conf<br />
<blockquote><p>Add following to the content of ipconn.conf<br />
# LimitIPConn module limits the number of connection to apache<br />
# per IP address. This helps in limiting the simultaneous downloads and will help<br />
# prevent slow users from blocking your servers.<br />
#<br />
&lt;IfModule prefork.c&gt;<br />
LoadModule limitipconn_module modules/mod_limitipconn.so<br />
&lt;/IfModule&gt;</p></blockquote>
</li>
<li>Make sure &#8216;<strong>ExtendedStatus</strong>&#8216; is <strong>ON</strong> in /etc/httpd/conf/httpd.conf</li>
<li>You will have to configure the module for each of your virtual host that you need to implement the limitip for.<br />
<blockquote><p>&lt;IfModule mod_limitipconn.c&gt;<br />
&lt;Location /forums&gt;<br />
MaxConnPerIP 3<br />
# exempting images from the connection limit is often a good<br />
# idea if your web page has lots of inline images, since these<br />
# pages often generate a flurry of concurrent image requests<br />
NoIPLimit image/*<br />
&lt;/Location&gt;<br />
&lt;Location /video&gt;<br />
MaxConnPerIP 1<br />
# In this case, all MIME types other than audio/mpeg and video*<br />
# are exempt from the limit check<br />
OnlyIPLimit audio/mpeg video<br />
&lt;/Location&gt;<br />
&lt;/IfModule&gt;</p></blockquote>
</li>
<li>Save the config file and test the new configuration &#8220;/etc/init.d/httpd configtest&#8221;. If you get &#8220;Syntax OK&#8221;, then all you need to do is restart the server and you are good to go.</li>
</ul>
<p>This is a brief guide on how I got mod_limitipconn working on my server. If you have any questions, please feel free to post in comment and I will try to answer your questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove all comments in a file</title>
		<link>http://www.kpsolution.com/blog/tips/how-to-remove-all-comments-in-a-file/10/</link>
		<comments>http://www.kpsolution.com/blog/tips/how-to-remove-all-comments-in-a-file/10/#comments</comments>
		<pubDate>Wed, 14 May 2008 15:03:40 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/tips/how-to-remove-all-comments-in-a-file/10/</guid>
		<description><![CDATA[If you are ever stuck in situation where you want to remove all the comments regardless of what they are in a source file. Here&#8217;s a small command that you can issue in VIM. It is for pattern search and &#8230; <a href="http://www.kpsolution.com/blog/tips/how-to-remove-all-comments-in-a-file/10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are ever stuck in situation where you want to remove all the comments regardless of what they are in a source file. Here&#8217;s a small command that you can issue in VIM. It is for pattern search and replace using regex.</p>
<p>Open the file in VIM then</p>
<p>:g/\/\/.\+/s</p>
<p>Above command will look for anything after including the &#8220;//&#8221; characters which is basically a comment in C, C++, php and several other languages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/tips/how-to-remove-all-comments-in-a-file/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to clear sendmail queue</title>
		<link>http://www.kpsolution.com/blog/tips/how-to-clear-sendmail-queue/9/</link>
		<comments>http://www.kpsolution.com/blog/tips/how-to-clear-sendmail-queue/9/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 13:37:33 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/tips/how-to-clear-sendmail-queue/9/</guid>
		<description><![CDATA[If you ever felt the need of flushing the sendmail queue then this post will be handy to you. How to flush sendmail queue under linux sendmail mailq command in linux how to flush mail queue in sendmail under linux &#8230; <a href="http://www.kpsolution.com/blog/tips/how-to-clear-sendmail-queue/9/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you ever felt the need of flushing the sendmail queue then this post will be handy to you.</p>
<p>How to flush sendmail queue under linux sendmail mailq command in linux how to flush mail queue in sendmail under linux</p>
<p>If u r worried about sendmail pending mail flush do the following 2 things.</p>
<p>1) manually method &#8211;&gt; delete /var/spool/mail/*.* files in this dir &#8211;&gt; delete /var/mqueue/*.* files</p>
<p>then check if all mail gone using mailq command. all mail will be deleted.</p>
<p>2) using command:</p>
<p>use simple command sendmail -v -q in root prompt. it will flush all pending mails. rest to confirm u can run mailq command if all are really gone !!&#8230;.</p>
<p>3) if u want perticular domain or user or recepitience mail to delete use this command</p>
<p>sendmail -qS -v test.com it will delete all mail from *@test.com</p>
<p>sendmail -qR -v hotmail.com it will delete all mail from recepient of hotmail&#8230;.</p>
<p>Cheers!!</p>
<p>Ketan</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/tips/how-to-clear-sendmail-queue/9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to edit HEX file in VI?</title>
		<link>http://www.kpsolution.com/blog/tips/how-to-edit-hex-file-in-vi/5/</link>
		<comments>http://www.kpsolution.com/blog/tips/how-to-edit-hex-file-in-vi/5/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 14:12:29 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://kpsolution.com/blog/company/how-to-edit-hex-file-in-vi/5/</guid>
		<description><![CDATA[Open the hex file or any file that you want to edit in hex format in &#8220;vi&#8220;. Lets call that file &#8220;myFile.hex&#8221;. To open the file in &#8220;vi&#8220;, type in terminal &#8220;vi myFile.hex&#8221; After the file is opened in the &#8230; <a href="http://www.kpsolution.com/blog/tips/how-to-edit-hex-file-in-vi/5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Open the hex file or any file that you want to edit in hex format in &#8220;<strong>vi</strong>&#8220;. Lets call that file &#8220;myFile.hex&#8221;.</p>
<p>To open the file in &#8220;<strong>vi</strong>&#8220;, type in terminal &#8220;<em>vi myFile.hex</em>&#8221;</p>
<p>After the file is opened in the &#8220;<strong>vi</strong>&#8220;, make sure you are in the command mode. If you are not sure, just hit &#8220;ESC&#8221; couple of times and it should then be in command mode.</p>
<p>Now type the following &#8220;<em>:%!xxd</em>&#8220;.</p>
<p>Voila, you are editing the file in hex mode now! Isn&#8217;t this awesome?</p>
<p>If you want to revert back to regular editing mode instead of hex mode, then make sure you are in command mode &#038; then type the following &#8220;<em>:%!xxd -r</em>&#8220;.</p>
<p>This will bring you back to normal editing mode. Isn&#8217;t this easy?</p>
<p>Let me know if you have some tricks saved in your sleeves, we can share it here with others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/tips/how-to-edit-hex-file-in-vi/5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
