<?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>SupportSages &#187; Troubleshooting</title>
	<atom:link href="http://www.supportsages.com/blog/category/troubleshooting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>How to install 32 bit and 64 bit applications on 64 bit Ubuntu OS</title>
		<link>http://www.supportsages.com/blog/2011/05/how-to-install-32-bit-and-64-bit-applications-on-64-bit-ubuntu-os/</link>
		<comments>http://www.supportsages.com/blog/2011/05/how-to-install-32-bit-and-64-bit-applications-on-64-bit-ubuntu-os/#comments</comments>
		<pubDate>Thu, 26 May 2011 17:24:30 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[getlibs]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1853</guid>
		<description><![CDATA[Earlier, with Drapper Drake , you only had to install ia32libs. But after that, may be they decided not to release for future versions, no more release. Hackers always find a way round to get their thing done and that exactly what happened with this as well. A bash file was written and released to the public available at http://frozenfox.freehostia.com/cappy/

I recently had to use this frequently and thought about mentioning it. In last two days, I had two such requirements as well. Here in India, Tata Docomo's USB installation binary, will work only on i386 linux boxes. I would admit ...]]></description>
			<content:encoded><![CDATA[<p>Earlier, with Drapper Drake , you only had to install ia32libs. But after that, may be they decided not to release for future versions, no more release. Hackers always find a way round to get their thing done and that exactly what happened with this as well. A bash file was written and released to the public available at http://frozenfox.freehostia.com/cappy/</p>
<p>I recently had to use this frequently and thought about mentioning it. In last two days, I had two such requirements as well. Here in India, Tata Docomo&#8217;s USB installation binary, will work only on i386 linux boxes. I would admit that that itself is an achievement <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But I had to get it working on a x64 architecture as well. And it was complaining about libqt and a few other 32 bit packages. dkpg&#8217;s &#8211;force-architecture option was also not working because of dependency issue.</p>
<p>This also helped me install a Task Management Software as well, http://codea-dev.com/gtd/download/linux/</p>
<p>Below text is copied from Ubuntu Forum&#8217;s. Author&#8217;s original post can be found at http://ubuntuforums.org/showthread.php?t=474790</p>
<p><span style="font-size: small;"><strong>getlibs works on:</strong></span></p>
<ul>
<li>All Ubuntu and Debian systems</li>
<li>Debian or Ubuntu based distributions (best to use the package name)</li>
</ul>
<p>Tip: To install a 32-bit debian package for a program (not a library!) use</p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo dpkg -i --force-all package_name.deb</pre>
</div>
<p><span style="font-size: small;"><strong>Usage Examples:</strong></span></p>
<p>getlibs on a program to download all missing libraries:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs /usr/bin/skype</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Use getlibs to install a 32-bit library using the library name:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -l libogg.so.0 libSDL-1.2.so.0</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Use getlibs to install a 32-bit library using the package name:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -p libqt4-core libqt4-gui</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Install a 32-bit library file (.deb):</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -i ~/i386_library_1.deb</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Download and install a 32-bit library file (.deb):</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -w http://mirrors.kernel.org/ubuntu/pool/main/s/sdl-image1.2/libsdl-image1.2_1.2.5-3_i386.deb</pre>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+install+32+bit+and+64+bit+applications+on+64+bit+Ubuntu+OS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1853" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+install+32+bit+and+64+bit+applications+on+64+bit+Ubuntu+OS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1853" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/05/how-to-install-32-bit-and-64-bit-applications-on-64-bit-ubuntu-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla in IIS 7 : SEO Friendly URLs not working</title>
		<link>http://www.supportsages.com/blog/2011/04/joomla-in-iis-7-seo-friendly-urls-not-working/</link>
		<comments>http://www.supportsages.com/blog/2011/04/joomla-in-iis-7-seo-friendly-urls-not-working/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 18:34:44 +0000</pubDate>
		<dc:creator>vince</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[seo friendly urls]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1796</guid>
		<description><![CDATA[This post is about how to configure Joomla in IIS]]></description>
			<content:encoded><![CDATA[<p><strong>Scenario</strong></p>
<p>A Joomla website hosted in Linux server is migrated to Windows. Several compatibility issues will be reported. The rules in .htaccess file will not work in Windows Servers which will cause malfunctioning of the website. Here are the steps on how to deal with these issues.</p>
<h3><strong>Solution</strong></h3>
<p>For this to work in IIS, a web.config file should be created and the corresponding rules in .htaccess should be imported to the same file. Here is a sample web.config file. Copy the entire content.</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;configuration&gt;
 &lt;system.webServer&gt;
 &lt;rewrite&gt;
 &lt;rules&gt;
 &lt;rule name="Security Rule" stopProcessing="true"&gt;
 &lt;match url="^(.*)$" ignoreCase="false" /&gt;
 &lt;conditions logicalGrouping="MatchAny"&gt;
 &lt;add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" /&gt;
 &lt;add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" /&gt;
 &lt;add input="{QUERY_STRING}" pattern="(\&amp;lt;|%3C).*script.*(\&gt;|%3E)" /&gt;
 &lt;add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" /&gt;
 &lt;add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" /&gt;
 &lt;/conditions&gt;
 &lt;action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /&gt;
 &lt;/rule&gt;
 &lt;rule name="SEO Rule"&gt;
 &lt;match url="(.*)" ignoreCase="false" /&gt;
 &lt;conditions logicalGrouping="MatchAll"&gt;
 &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" /&gt;
 &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" /&gt;
 &lt;add input="{URL}" negate="true" pattern="^/index.php" ignoreCase="false" /&gt;
 &lt;add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" /&gt;
 &lt;/conditions&gt;
 &lt;action type="Rewrite" url="index.php" /&gt;
 &lt;/rule&gt;
 &lt;/rules&gt;
 &lt;/rewrite&gt;
 &lt;/system.webServer&gt;
&lt;/configuration&gt;</pre>
<p>So, the file web.config is ready. Now the rules in .htaccess has to be converted in accordance with IIS. In IIS6, you can make use of the ISAPI_REWRITE module. Go to http://www.isapirewrite.com/ for downloading it.</p>
<p>If you are having IIS7, here are the steps involved in converting those rules.</p>
<p>The x86 version of URL Rewrite module can be downloaded here : <a  title="x86 URL Rewrite Module" href="http://go.microsoft.com/?linkid=9722533" target="_blank">http://go.microsoft.com/?linkid=9722533</a></p>
<p>The x64 version of URL Rewrite module can be downloaded here : <a  title="x64 URL Rewrite Module" href="http://go.microsoft.com/?linkid=9722532." target="_blank">http://go.microsoft.com/?linkid=9722532</a></p>
<p>Install the module, restart the IIS manager. Choose the website in which you have to convert the rules (under Sites category). You will see the &#8216;URL Rewrite&#8217; module in IIS.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_1.png" class="thickbox no_icon" rel="gallery-1796" title="IIS_1"><img class="alignnone size-full wp-image-1806" title="IIS_1" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_1.png" alt="" width="508" height="376" /></a></p>
<p>Open it. Since the web.config file is already created with some predefined rules, you will see it as Inbound rules (by the Names &#8211; Security Rule and SEO Rule).</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_2.png" class="thickbox no_icon" rel="gallery-1796" title="IIS_2"><img class="alignnone size-full wp-image-1811" title="IIS_2" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_2.png" alt="" width="575" height="335" /></a></p>
<p>You can convert the rules in .htaccess file by accessing the &#8216;Import Rules&#8217; under Inbound Rules category in the Actions pane.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_3.png" class="thickbox no_icon" rel="gallery-1796" title="IIS_3"><img class="alignnone size-full wp-image-1813" title="IIS_3" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_3.png" alt="" width="191" height="352" /></a></p>
<p>Choose the .htaccess file and click Import. You will see the rules in &#8216;Rewrite Rules&#8217; section and the converted rules in &#8216;Converted Rules&#8217; option. Click Apply on the  Actions pane on the right hand side to save these rules to the web.config file (If a web.config file was not created as mentioned earlier, that file will be newly created). Make sure there are no conflicts in the conversion. Watch the Summary on the bottom end. There was a conflict when we did it, its shown here. In such cases, remove any unsupported rules and then click Apply.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_4.png" class="thickbox no_icon" rel="gallery-1796" title="IIS_4"><img class="alignnone size-full wp-image-1816" title="IIS_4" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/IIS_4.png" alt="" width="705" height="528" /></a><strong> </strong></p>
<p><strong>Converting PHP to FastCGI</strong></p>
<p>We have do it from Plesk control panel. If you don&#8217;t have the administrator access, you may need to contact your Administrator. Others (Gods !) read on</p>
<p>Select the Domain, go to Web Hosting Settings.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/Plesk_1.png" class="thickbox no_icon" rel="gallery-1796" title="Plesk_1"><img class="alignnone size-full wp-image-1820" title="Plesk_1" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/Plesk_1.png" alt="" width="668" height="123" /></a></p>
<p>Scroll down to Services. Choose PHP support to run as FastCGI application.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/Plesk_2.png" class="thickbox no_icon" rel="gallery-1796" title="Plesk_2"><img class="alignnone size-full wp-image-1822" title="Plesk_2" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/Plesk_2.png" alt="" width="581" height="160" /></a></p>
<p><strong>Final Steps</strong></p>
<p>Go to Joomla Administrator interface. Access <strong>Global Configuration</strong> from the main menu. Under SEO Settings, make sure the following are set to Yes</p>
<p>Search Engine Friendly URLs : Yes</p>
<p>Use Apache mod_rewrite : Yes</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/SEO.png" class="thickbox no_icon" rel="gallery-1796" title="SEO"><img class="alignnone size-full wp-image-1821" title="SEO" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/SEO.png" alt="" width="310" height="147" /></a></p>
<p>Done, From now your Joomla website shoule work as smooth as it were in the Linux server. Sit back and Enjoy !</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Joomla+in+IIS+7+%3A+SEO+Friendly+URLs+not+working+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1796" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Joomla+in+IIS+7+%3A+SEO+Friendly+URLs+not+working+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1796" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/04/joomla-in-iis-7-seo-friendly-urls-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DDoS, prevention, cure! &#8211; Part 1</title>
		<link>http://www.supportsages.com/blog/2010/12/ddos-prevention-cure-part-1/</link>
		<comments>http://www.supportsages.com/blog/2010/12/ddos-prevention-cure-part-1/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 10:54:22 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1473</guid>
		<description><![CDATA[DDoS - Distributed Denial Of Service  Wiki : <a href="http://en.wikipedia.org/wiki/Denial-of-service_attack">http://en.wikipedia.org/wiki/Denial-of-service_attack</a>
<blockquote>DDoS is an attack on a computer/server or its resources and thereby making it unavailable to intended users.</blockquote>
Web-hosts must be familiar with this term and will be a victim at-least once. The intention of this post is to give  a brief description about DDoS, its prevention and cure if effected. Please note that this will not server as a perfect guide to the mentioned "Subject-line", but a "tip-note".

<strong>Understanding DDoS</strong>:

The four commonly used programs used by attackers to launch DDoS attacks are
<ol>
	<li> <a href="http://en.wikipedia.org/wiki/Trinoo" target="_blank"> Trinoo</a></li>
	<li> <a href="http://en.wikipedia.org/wiki/Tribe_Flood_Network" target="_blank">TFN</a></li>
	<li> <a href="http://packetstormsecurity.org/distributed/TFN2k_Analysis-1.3.txt" target="_blank">TFN2K</a></li>
	<li> ...]]></description>
			<content:encoded><![CDATA[<p>DDoS &#8211; Distributed Denial Of Service  Wiki : <a  href="http://en.wikipedia.org/wiki/Denial-of-service_attack">http://en.wikipedia.org/wiki/Denial-of-service_attack</a></p>
<blockquote><p>DDoS is an attack on a computer/server or its resources and thereby making it unavailable to intended users.</p></blockquote>
<p>Web-hosts must be familiar with this term and will be a victim at-least once. The intention of this post is to give  a brief description about DDoS, its prevention and cure if effected. Please note that this will not server as a perfect guide to the mentioned &#8220;Subject-line&#8221;, but a &#8220;tip-note&#8221;.</p>
<p><strong>Understanding DDoS</strong>:</p>
<p>The four commonly used programs used by attackers to launch DDoS attacks are</p>
<ol>
<li> <a  href="http://en.wikipedia.org/wiki/Trinoo" target="_blank"> Trinoo</a></li>
<li> <a  href="http://en.wikipedia.org/wiki/Tribe_Flood_Network" target="_blank">TFN</a></li>
<li> <a  href="http://packetstormsecurity.org/distributed/TFN2k_Analysis-1.3.txt" target="_blank">TFN2K</a></li>
<li> <a  href="http://en.wikipedia.org/wiki/Stacheldraht" target="_blank">Stacheldraht</a></li>
</ol>
<p><strong>Symptoms of DDos:</strong></p>
<ol>
<li>Unusually slow network performance (opening files or accessing web sites)</li>
<li>Unavailability of a particular web site</li>
<li>Inability to access any web site</li>
<li>Dramatic increase in the number of spam emails received—(this type of DoS attack is considered an e-mail bomb)</li>
<li>Packet loss for pings to IP/Domain</li>
</ol>
<p><strong>How DDoS is done:</strong></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/11/424px-Stachledraht_DDos_Attack.svg_.png" class="thickbox no_icon" rel="gallery-1473" title="424px-Stachledraht_DDos_Attack.svg"><img class="aligncenter size-full wp-image-1477" title="424px-Stachledraht_DDos_Attack.svg" src="http://www.supportsages.com/blog/wp-content/uploads/2010/11/424px-Stachledraht_DDos_Attack.svg_.png" alt="" width="424" height="600" /></a></p>
<p><em>Pictorial representation of Stacheldraht DDoS attack.</em></p>
<p>In Stacheldraht DDoS attack, the attacker uses a client program to connect handlers which is a set of compromised machines that issues commands to the agents which in-turn facilitate the DDoS attack. The agents are another set of machines which is compromised using handlers by the attacker. Each handler can control thousands of agents  and all these widely distributed agents floods the target server and thereby increasing the impact of attack.</p>
<p><strong>DoS and DDoS are not the same:</strong></p>
<p>If the attacker initiates an attack from a single host, it is classified as a DoS  as it is not &#8216;distributed&#8217;. In fact, any attack against availability would be classed as a Denial of Service attack. On the other hand, if an attacker uses a thousand systems to simultaneously launch smurf attacks against a remote host, this would be classified as a DDoS attack.</p>
<p>Then what is <strong>DRDoS</strong>? DRDoS is Distributed Refected Denial of Service. These attacks forge the source address of the IP packets with the victim’s IP and send pings/packets to intermediate hosts. When the intermediate sends back the reply to these pings , it is sent to the victims IP thereby flooding the victim.</p>
<p style="text-align: center;"><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/11/Screenshot.png" class="thickbox no_icon" rel="gallery-1473" title="Screenshot"><img class="aligncenter size-large wp-image-1495" title="Screenshot" src="http://www.supportsages.com/blog/wp-content/uploads/2010/11/Screenshot-1024x623.png" alt="" width="614" height="374" /></a></p>
<p style="text-align: left;">Some other types/methods of <strong><em>DDoS/DRDoS/Dos attacks</em></strong> are :</p>
<p style="text-align: left;"><em>Reflective ICMP attack</em>: The reflective ICMP attack uses public sites like google.com that responds to ICMP ping requests to that of victims IP. The attacker spoofs the victims IP and send requests to the Public servers which will then reply to the actual IP.</p>
<p style="text-align: left;"><em>TCP SYN flood attack </em>: The attacker sends a packet with SYS bit set of the well known TCP three way handshake. The victim responds to the request by sendong a reply packet with SYN_ACK bit set, but the attackr never responds and thereby increasing the TCP receive queues and denying new TCP connetions. But modern  UNIX and Windows fixed this by increasing the queue qize and limited the number of TCP SYS packets allowed.</p>
<p style="text-align: left;"><em>UDP attacks</em> : The UDP is one of the most effective way of DDos/DoS attacks. UDP is a stateless protocol and does not have any acknowledgement mechanism by design. PROTOS,the SNMP test suite, and other SNMP tools have been used successfully to launch application level DoS attacks. The Slammer worm was extremely fast because it did not require a response from the compromised computer.</p>
<p style="text-align: left;"><em>TTL Expiration </em>: The attacker forges the victims IP and send packets with low TTL set to it so that it will expire in the transmit at high speed router. When the TTL reaches zero, the router drops the packet and sends an ICMP TTL expired message to the source address, ie the Victim IP. This attack could be lowered by rate limiting ICMP to all routers in the service provider’s network.</p>
<p style="text-align: left;"><em>Permanent DoS attacks (PDoS)</em><strong> </strong>:  PDoS is an attack that damages the system so badly that it needs the hardware to be replaced or reinstalled. The PDoS is purely a hardware targeted attack in which the attacker modifies the devide fireware by the legitimate method caled flashing. The attacker replaces the hardware firmware with his own modified version which will make the device unstable and render it from the original purpose for which it is made or designed for. The is done by exploiting the hardware security flaws which will allow remote administration of devices such as routers, printers and other networking hardwares.</p>
<p style="text-align: left;"><em>Degradation Of Service Attacks</em> : The compromised computers are used by the atackers to launch short-lived flooding on victims website which will slow down the website rather than crashing it. This is degradation of service rather than deniel of service and is more seriver than DoS as this is pretty difficult to detect and resolve.</p>
<p style="text-align: left;"><em>Un-intentional Denial Of Services </em>:  Sudden spike in popularity for a website is the major cause for this. This happens when an extremely popular wesite posts a link to a second site as a part of referrence for news or article. This will lead significant increase in traffic to the secondary website which will result in crashing or server/services. An example for this hapened when Michael Jackson died in 2009 which took down sites like Google and Twitter. (In this case you cant just blame someone <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p style="text-align: left;"><em>Blind Denial Of Service </em>: In Blind Deniel of Service, the attacker must be able to receive traffic from the victim, then the attacker must either subvert the routing fabric or use the attacker&#8217;s own IP address. Either provides an opportunity for the victim to track the attacker and/or filter out his traffic. With a blind attack the attacker uses a forged IP addresses, making it extremely difficult for the victim to filter out those packets. The TCP SYN flood attack is an example of a blind attack. Designers should make every attempt possible to prevent blind denial of service attacks.</p>
<p style="text-align: left;">
<p style="text-align: left;">
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=DDoS%2C+prevention%2C+cure%21+-+Part+1+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1473" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=DDoS%2C+prevention%2C+cure%21+-+Part+1+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1473" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/12/ddos-prevention-cure-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup Google Apps on your domain with cPanel and create upto 50 custom email accounts for FREE – Part (2)</title>
		<link>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-%e2%80%93-part-2/</link>
		<comments>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-%e2%80%93-part-2/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 11:27:39 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Webmail]]></category>
		<category><![CDATA[50 custom email accounts]]></category>
		<category><![CDATA[free email accounts]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[google apps in cpanel]]></category>
		<category><![CDATA[how to set up google apps]]></category>
		<category><![CDATA[setup google apps for your domain]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1421</guid>
		<description><![CDATA[<strong>Step V : Setting Up Your E-mail Server. </strong>

The next step is to set up the URL you want to use to access Webmail. In most cases, this is either <strong>webmail.example.com</strong> or simply <strong>mail.example.com</strong>. To make this change, click on the '<em><strong>Service Settings</strong></em>' tab in the top menu of the dashboard. Then, click '<em><strong>Email</strong></em>'. From there, specify that you want to use a custom URL, and enter the appropriate subdomain for your domain.

<a href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-webmail.png"><img class="alignnone size-full wp-image-1422" title="webmail" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-webmail.png" alt="" width="607" height="209" /></a>

Submit that form, and Google will then provide you with information about adding a CNAME entry for your ...]]></description>
			<content:encoded><![CDATA[<p><strong>Step V : Setting Up Your E-mail Server. </strong></p>
<p>The next step is to set up the URL you want to use to access Webmail. In most cases, this is either <strong>webmail.example.com</strong> or simply <strong>mail.example.com</strong>. To make this change, click on the &#8216;<em><strong>Service Settings</strong></em>&#8216; tab in the top menu of the dashboard. Then, click &#8216;<em><strong>Email</strong></em>&#8216;. From there, specify that you want to use a custom URL, and enter the appropriate subdomain for your domain.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-webmail.png" class="thickbox no_icon" rel="gallery-1421" title="webmail"><img class="alignnone size-full wp-image-1422" title="webmail" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-webmail.png" alt="" width="607" height="209" /></a></p>
<p>Submit that form, and Google will then provide you with information about adding a CNAME entry for your new subdomain. You should make corresponding entries in the DNS zone to implement this. For example if the URL with which you wish to access your mail is webmail.example.com then you must give a CNAME record &#8216; <strong>ghs.google.com.</strong> &#8216; in the DNS zone for <strong>webmail</strong>. This is shown below :</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real1.png" class="thickbox no_icon" rel="gallery-1421" title="real1"><img class="alignnone size-full wp-image-1424" title="real1" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real1.png" alt="" width="623" height="192" /></a></p>
<p>Step VI : MX Record Changes</p>
<p>Once you have finished creating all of the users, you can return to the dashboard and click &#8216;<em><strong>Activate email</strong></em>&#8216;  and follow the MX change instructions provided by Google. If you are lucky enough to use one of the hosts included in the dropdown menu there, you should be able to get clear, specific instructions explaining how to make the changes in your domains control panel.</p>
<p>Google will have you add seven new MX records to your DNS zone file. Those entries will probably look like:</p>
<p>MX Server address                                  Priority</p>
<p><strong>ASPMX.L.GOOGLE.COM.                 10<br />
ALT1.ASPMX.L.GOOGLE.COM.       20<br />
ALT2.ASPMX.L.GOOGLE.COM.       20<br />
ASPMX2.GOOGLEMAIL.COM.         30<br />
ASPMX3.GOOGLEMAIL.COM.         30<br />
ASPMX4.GOOGLEMAIL.COM.         30<br />
ASPMX5.GOOGLEMAIL.COM.         30 </strong></p>
<p>It’s important that you copy and paste those addresses exactly as they appear in the Google instructions. They all include dots at the end of the addresses, and that dots need to be included. I am attaching a screenshot below which will hopefully give you an idea on how it should be entered.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real2.png" class="thickbox no_icon" rel="gallery-1421" title="real2"><img class="alignnone size-full wp-image-1428" title="real2" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real2.png" alt="" width="576" height="116" /></a></p>
<p>Your new entries will need to look similar to:</p>
<p>your-domain.com    14400    IN    MX    10    ASPMX.L.GOOGLE.COM.</p>
<p>Where your-domain.com is your domain name, the second spot is the <strong>TTL</strong> or Time To Live (which can be left blank if required), the word <strong>&#8216;IN</strong>&#8216; is in the third spot, the fourth spot is filled with <strong>&#8216;MX</strong>&#8216; , the fifth spot is the &#8216;<strong>Priority</strong>&#8216; and the last spot includes the address provided by Google.</p>
<p>Also, in most of the cases you can only add four or five entries to the zone file at a time, so you’ll have to add this first, save the file, and then add the rest.<br />
Once you’ve made those changes, click the  &#8216;<em><strong>I’ve made these changes</strong></em>&#8216; button in the Google Apps window.<br />
Finally you can return to dashboard and click on the &#8216;<em><strong>Activate email</strong></em>&#8216; tab which you will find right below the &#8216;<em><strong>Email</strong></em>&#8216; option. See below :</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-activatemail.png" class="thickbox no_icon" rel="gallery-1421" title="real-activatemail"><img class="alignnone size-full wp-image-1437" title="real-activatemail" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-activatemail.png" alt="" width="584" height="157" /></a></p>
<p><strong>The last and most difficult Step : Waiting</strong>.</p>
<p>At this point, you’re pretty much done. You now simply have to wait because It can take anywhere from one hour to 48 hours before the changes are complete.</p>
<p>Once the changes have completed, though, you can set up your e-mail client (Outlook, Thunderbird etc.) to check your e-mail. The Gmail IMAP settings are fairly simple. They are as follows:</p>
<p><strong>IMAP (incoming) mail:<br />
Server: imap.gmail.com<br />
Port: 993<br />
Encryption: SSL</strong></p>
<p><strong>SMTP (outgoing) mail:<br />
Server: smtp.gmail.com<br />
Port: 465 or 587<br />
Encryption: TLS</strong></p>
<p><strong>***********************************************************************************************************</strong></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+setup+Google+Apps+on+your+domain+with+cPanel+and+create+upto+50+custom+email+accounts+for+FREE+%E2%80%93+Part+%282%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1421" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+setup+Google+Apps+on+your+domain+with+cPanel+and+create+upto+50+custom+email+accounts+for+FREE+%E2%80%93+Part+%282%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1421" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup 50 free Google powered email accounts for your domain with cPanel &#8211; Part (1)</title>
		<link>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-part-1/</link>
		<comments>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-part-1/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 10:43:59 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Webmail]]></category>
		<category><![CDATA[50 custom email accounts]]></category>
		<category><![CDATA[free email accounts]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[google apps in cpanel]]></category>
		<category><![CDATA[how to set up google apps]]></category>
		<category><![CDATA[setup google apps for your domain]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1367</guid>
		<description><![CDATA[This article is on how to setup Google Apps to work on your domain with 6 easy steps. When you purchase a domain (e.g. your-domain.com) for your website from any of the domain registrars such as Godaddy , you normally get a single free email account that includes limited storage space. This is where Google apps comes in for your rescue. By using this feature, provided to you by Google, you can use Google mail servers for transferring your mails and that too from your very own domains. The advantages are plenty, as we all know Gmail has proven over ...]]></description>
			<content:encoded><![CDATA[<p>This article is on how to setup Google Apps to work on your domain with 6 easy steps. When you purchase a domain (e.g. your-domain.com) for your website from any of the domain registrars such as Godaddy , you normally get a single free email account that includes limited storage space. This is where Google apps comes in for your rescue. By using this feature, provided to you by Google, you can use Google mail servers for transferring your mails and that too from your very own domains. The advantages are plenty, as we all know Gmail has proven over the years that it provides the most reliable e-mail service. How many times have you moved your domain to a new server and been frustrated by the fact that you lost all of your e-mail messages? If you switch over to Google Apps, you never have to worry about that again. Again the service and support provided by google is without doubt the best and uncomparable with your hosting companie&#8217;s or your service provider&#8217;s. Another advantage is that the server limits of your account will not affect the number of mails that you can sent or recieve if you use the Google apps. I have only mentioned a few above but the list goes on and on.</p>
<p>The praises can be sung without a pause but its better I stop the boasts here and get down to the original topic.  I’m going to explain, step-by-step, on how to accomplish this task. It’s actually very simple, but it might take quite some time depending on how good a techy you are. To begin with, head on over to Google and sign up for an account. I am siting the link below where you can do this :</p>
<p>http://www.google.com/apps/intl/en/business/index.html</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-homepage.png" class="thickbox no_icon" rel="gallery-1367" title="G-Apps-Homepage"><img class="alignnone size-full wp-image-1373" title="G-Apps-Homepage" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-homepage.png" alt="" width="581" height="387" /></a></p>
<p>In the above page click on the &#8216; <strong><em>Apps Editions</em></strong> &#8216; tab and you will be able to view different schemes they offer, from which you will be able to select the one which suits you the most. For most of us, the standard edition offered by Google is more than enough. However, they do offer a “Premier edition” if your needs exceed the services of the free accounts. In addition to the Standard edition and Premier edition there are  Educational schemes, Govermental schemes etc etc. Once you choose the package required you will be directed to a page with a blue colored &#8216; <em><strong>Get started</strong></em> &#8216; tab on the right most top corner of the page. This is your key, click on it and you are on your way to setting Google apps for your domain. I am going to list  everything step by step from here on in a detailed manner.<br />
<strong> </strong></p>
<p><strong>Step I : Tell them your registered Domain name.</strong></p>
<p>In the very first step you need to provide your domain name as prompted. Obviously enough you should possess a registered domain or you can buy a new domain name through Google which automatically sets everything up for you. You also need to verify that you own the domain or if you are a member of the domain.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/gapps2.png" class="thickbox no_icon" rel="gallery-1367" title="enter-domain"><img class="alignnone size-full wp-image-1382" title="enter-domain" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/gapps2.png" alt="" width="422" height="268" /></a></p>
<p><strong>Step II : Tell them who you are.</strong></p>
<p>Fill in all of your contact information. At least <strong>make sure that you fill in all the boxes which have an aestrics symbol (*)</strong> to the right of the label with proper and valid information. If you don’t provide the required information, you will receive an error when you submit the form.<br />
An important thing that you should be absolutely sure of before filling up the form is that you are able to edit your server’s DNS zone files. If you cannot edit your DNS zone files, do not proceed. You will have to enter MX records pointing to the Google mail servers in your DNS configuration. Signing up for the Google Apps account is useless if you’re not going to be able to modify your server appropriately to have the e-mail go where it’s intended.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-contactinfo.png" class="thickbox no_icon" rel="gallery-1367" title="contactinfo"><img class="alignnone size-full wp-image-1384" title="contactinfo" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-contactinfo.png" alt="" width="596" height="325" /></a></p>
<p>The screenshot above was limited by my monitor boundaries, but you will be able to see the &#8216; <em><strong>Continue</strong></em> &#8216; tab at the bottom of your screen. Click this and you are on step III.<br />
<strong> </strong></p>
<p><strong>Step III : Create your first administrator account.</strong></p>
<p>Create your first e-mail account. This e-mail account will be used as the administrative account for the Google Apps services.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-setup.png" class="thickbox no_icon" rel="gallery-1367" title="admin-setup"><img class="alignnone size-full wp-image-1390" title="admin-setup" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-setup.png" alt="" width="583" height="398" /></a></p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>Below this you will be able to see the terms and conditions, which mostly contains the usual stuff but still worth a read, where you should click on the &#8216; <em><strong>I accept. Continue with setup</strong></em> &#8216; tab to proceed to the next step.</p>
<p><strong>Step IV : Verify Domain Ownership.</strong></p>
<p>The next step in the process is to prove to Google that you own and have administrative rights to the domain you chose.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify.png" class="thickbox no_icon" rel="gallery-1367" title="verify-I"><img class="alignnone size-full wp-image-1393" title="verify-I" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify.png" alt="" width="611" height="231" /></a></p>
<p>Here you will have an option to do it later, but sooner the better. Once you choose the option to continue you will be prompted for the password you chose in the previous step.<br />
You have three options to prove that you own the domain. The first option is to modify your DNS entries to add a unique CNAME record. Next option is to add a meta tag to your site&#8217;s home page.  The last option is to simply create and upload an HTML file to your Web server. Okay now there is no reason for you to panic from hearing all the complex terms, all you need to do is click on these options and viola, all the information you need on &#8216;How to&#8217; gets detailed (or rather spoon fed) right on the screen.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify2.png" class="thickbox no_icon" rel="gallery-1367" title="real-verify2"><img class="alignnone size-full wp-image-1402" title="real-verify2" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify2.png" alt="" width="623" height="348" /></a></p>
<p>As you can see the screenshot above you will have a drop down menu for a list of domain registrars among which you can choose yours and do as instructed. Otherwise you can simply choose the &#8216; <em><strong>Others</strong></em> &#8216; option from the drop down menu and follow the simple set of instructions which gets listed.<br />
This will look somewhat like the following :</p>
<p>&lt;&lt;</p>
<p><em>A TXT record is an entry within the Domain Name System (DNS) that provides supplemental information about your domain. You can create a TXT record that proves to Google that you own the domain.</em></p>
<p><em>1.<strong> Add</strong> the TXT record below to the DNS configuration for <strong>your-domain.com.</strong><br />
google-site-verification=Zy5aERjpb4-T1S0Ig36pGuHDOE5MycRBGsVmCtVeTLY<br />
2. <strong>Click</strong> verify below.<br />
When Google finds this DNS TXT record, we&#8217;ll make you a verified owner of the domain. (Note: DNS changes may take some time. If we don&#8217;t find the record immediately, we&#8217;ll check for it periodically.)<br />
Leave the TXT record in place even after verification succeeds. </em></p>
<p><em>&gt;&gt;<br />
</em></p>
<p>For adding the TXT record in the DNS zone log into your domain control panel and choose the<strong> edit DNS zone</strong> option. The name of the option might vary between control panels, but they provide the same functionalities. I am pasting yet another screenshot which might help you through this simple process.</p>
<p><strong>NOTE</strong> : For the rest of the article I will be siting examples and providing screenshots only from, and in reference to, the <strong>cPanel</strong>. But it will not be difficult to figure out how it is done in other control panels once you get an idea on what we are doing here.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-TXT.png" class="thickbox no_icon" rel="gallery-1367" title="TXT"><img class="alignnone size-full wp-image-1404" title="TXT" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-TXT.png" alt="" width="606" height="76" /></a></p>
<p>You can see that I simply pasted the text mentioned in the instructions. After doing this you can click on &#8216;<em><strong>Verify</strong></em>&#8216; which will, quite obviously, verify if the entry is made and thereby confirming your authority over the domain.</p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+setup+50+free+Google+powered+email+accounts+for+your+domain+with+cPanel+-+Part+%281%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1367" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+setup+50+free+Google+powered+email+accounts+for+your+domain+with+cPanel+-+Part+%281%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1367" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Gems not getting updated</title>
		<link>http://www.supportsages.com/blog/2010/10/ruby-gems-not-getting-updated/</link>
		<comments>http://www.supportsages.com/blog/2010/10/ruby-gems-not-getting-updated/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 10:42:03 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[giving response code 302]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1425</guid>
		<description><![CDATA[On a cPanel server, I ran /scripts/installruby which updated the ruby version from 1.8.6 to 1.8.7

[bash]ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [i686-linux][/bash]

But when updating the gems and the gem itself, we were getting error as below,

<code>
gem update --system
Updating RubyGems...
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
</code>

Solution was to specify another source as below, which was the 302 redirection of http://gems.rubyforge.org/yaml . May be gem now handles the 302 redirection properly.

[bash]gem install rubygems-update --source http://production.s3.rubygems.org/ [/bash]

followed by the gem update itself.

[bash]sudo gem update --system --source http://production.s3.rubygems.org/[/bash]

To add the source permanently, use the command below ...]]></description>
			<content:encoded><![CDATA[<p>On a cPanel server, I ran /scripts/installruby which updated the ruby version from 1.8.6 to 1.8.7</p>
<pre class="brush: bash; title: ; notranslate">ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [i686-linux]</pre>
<p>But when updating the gems and the gem itself, we were getting error as below,</p>
<p><code><br />
gem update --system<br />
Updating RubyGems...<br />
ERROR:  While executing gem ... (Gem::RemoteSourceException)<br />
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml<br />
</code></p>
<p>Solution was to specify another source as below, which was the 302 redirection of http://gems.rubyforge.org/yaml . May be gem now handles the 302 redirection properly.</p>
<pre class="brush: bash; title: ; notranslate">gem install rubygems-update --source http://production.s3.rubygems.org/ </pre>
<p>followed by the gem update itself.</p>
<pre class="brush: bash; title: ; notranslate">sudo gem update --system --source http://production.s3.rubygems.org/</pre>
<p>To add the source permanently, use the command below and for more help
<pre class="brush: plain; title: ; notranslate">gem help sources</pre>
<pre class="brush: bash; title: ; notranslate">gem sources -a http://production.s3.rubygems.org/</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Ruby+Gems+not+getting+updated++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1425" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Ruby+Gems+not+getting+updated++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1425" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/10/ruby-gems-not-getting-updated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IFS</title>
		<link>http://www.supportsages.com/blog/2010/09/ifs/</link>
		<comments>http://www.supportsages.com/blog/2010/09/ifs/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 18:51:19 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Customer Care]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Offers]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Specials]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[ifs]]></category>
		<category><![CDATA[linux. bash]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1236</guid>
		<description><![CDATA[How many times have you written scripts and a had bad time with those having spaces? The remedy to this situation is your IFS value.

IFS or Internal Field Seperator holds the value which seperates the various entities. This can be file names, values read into a script by read etc. It is the character or characters designated as whitespace by the operating system.

The IFS is set to the newline and space character. The global variable $IFS stores the value. To view the exact value stored in IFS execute:
[bash]
echo &#34;$IFS&#34; &#124; cat -vTE
 ^I$
$
[/bash]
Running echo "$IFS" will not give you any ...]]></description>
			<content:encoded><![CDATA[<p>How many times have you written scripts and a had bad time with those having spaces? The remedy to this situation is your IFS value.</p>
<p>IFS or Internal Field Seperator holds the value which seperates the various entities. This can be file names, values read into a script by read etc. It is the character or characters designated as whitespace by the operating system.</p>
<p>The IFS is set to the newline and space character. The global variable $IFS stores the value. To view the exact value stored in IFS execute:</p>
<pre class="brush: bash; title: ; notranslate">
echo &quot;$IFS&quot; | cat -vTE
 ^I$
$
</pre>
<p>Running echo &#8220;$IFS&#8221; will not give you any visible output (after all, you are going to see a space and a newline). cat -vTE displays non printable characters , tabs as ^I and ends each line with a $ sign.</p>
<p>In a script which utilises filenames (with spaces), it is always preferable to change the IFS to include only the newline character opposed to the default space and newline character. Lets check out one such script which accepts filenames wih spaces. This scripts simply prints the file names in your current directory. (Remember to create some files in your currenct directory which has spaces. You may try the same script removing the lines with the IFS variable in reference to see the difference)</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
OIFS=$IFS # Original IFS

IFS=$(echo -en &quot;\n\b&quot;) # New IFS

for fil in $(ls -1 $PWD); do
	echo $fil
done

IFS=$OIFS # Restore earlier IFS
</pre>
<p>IFS can also be used to read files with lines sepearated by a special character. For example in the /etc/passwd, to store the various entries like username, homedirectory etc.</p>
<p>The following script uses the while construct to determine the users who have the shell portion as /bin/false</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash

OIFS=$IFS
IFS=':'

while read username password userid groupid comments homedir shell_avail
do
	if [[ $shell_avail == /bin/false ]]; then
                echo &quot;$username has no shell&quot;
        fi

done &lt; /etc/passwd
IFS=$OIFS
</pre>
<p>In the above script each of the 7 portions of the /etc/passwd file is assigned to the 7 variables<br />
username password userid groupid comments homedir shell_avail with the read command. The if portion in the script compares the seventh variable &#8211; shell_avail to /bin/false to determine the username and outputs it. </p>
<p>From now on you can use the IFS variable for all those files with spaces and extracting values separated by a special character.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=IFS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1236" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=IFS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1236" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/09/ifs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error while installing Magento Blue theme.</title>
		<link>http://www.supportsages.com/blog/2010/08/error-while-installing-magento-blue-theme/</link>
		<comments>http://www.supportsages.com/blog/2010/08/error-while-installing-magento-blue-theme/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 09:37:30 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[blue]]></category>
		<category><![CDATA[blue error]]></category>
		<category><![CDATA[magento blue]]></category>
		<category><![CDATA[magento connect]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1220</guid>
		<description><![CDATA[We used to get tickets complaining that the customers are not able to install Magento Blue theme via Magento Connect. When you try to install you may get the below error.

[bash]ERROR:
Via magento connect
magento-core/Interface_Frontend_Default_Default_Blue  requires package &#34;magento-core/Interface_Frontend_Default&#34; (version  &#62;= 1.3.1, version &#60;= 1.4.0, excluded versions: 1.4.0), installed  version is 1.4.0.0
Install Errors
No valid packages found
PEAR  ERROR: install failed

magento-core/Interface_Frontend_Default
magento-core/Mage_Core_Modules[/bash]

To fix this, login to your account via SSH and navigate to the Magento installation folder and execute the below command.

Install <code>Interface_Frontend_Default correct version
</code>

[bash]./pear install magento-core/Interface_Frontend_Default[/bash]

And then the Blue theme

[bash]./pear install magento-core/Interface_Frontend_Default_Default_Blue[/bash]

You can get help for pear command by executing

[bash]pear help ...]]></description>
			<content:encoded><![CDATA[<p>We used to get tickets complaining that the customers are not able to install Magento Blue theme via Magento Connect. When you try to install you may get the below error.</p>
<pre class="brush: bash; title: ; notranslate">ERROR:
Via magento connect
magento-core/Interface_Frontend_Default_Default_Blue  requires package &quot;magento-core/Interface_Frontend_Default&quot; (version  &gt;= 1.3.1, version &lt;= 1.4.0, excluded versions: 1.4.0), installed  version is 1.4.0.0
Install Errors
No valid packages found
PEAR  ERROR: install failed

magento-core/Interface_Frontend_Default
magento-core/Mage_Core_Modules</pre>
<p>To fix this, login to your account via SSH and navigate to the Magento installation folder and execute the below command.</p>
<p>Install <code>Interface_Frontend_Default correct version<br />
</code></p>
<pre class="brush: bash; title: ; notranslate">./pear install magento-core/Interface_Frontend_Default</pre>
<p>And then the Blue theme</p>
<pre class="brush: bash; title: ; notranslate">./pear install magento-core/Interface_Frontend_Default_Default_Blue</pre>
<p>You can get help for pear command by executing</p>
<pre class="brush: bash; title: ; notranslate">pear help </pre>
<p>And to list Channels</p>
<pre class="brush: bash; title: ; notranslate">pear list-channels Registered Channel</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Error+while+installing+Magento+Blue+theme.+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1220" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Error+while+installing+Magento+Blue+theme.+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1220" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/08/error-while-installing-magento-blue-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL for the sage &#8211; Must know basics for the system administrators</title>
		<link>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/</link>
		<comments>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 16:24:44 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1144</guid>
		<description><![CDATA[﻿﻿PostgreSQL or Postgres is an object-relational database management system (ORDBMS). Unlike MySQL, PostgreSQL is not controlled by any single company, it is a community developed project. It is a advanced version of the 'Ingres' Database project (which is how the project gets the name post-ingres or postgres ).

Postgres is one of the best open-source database alternative which is fully object oriented and transactions compliant. It has stored procedures, multiple views and a huge set of datatypes. Some of the other notable features are as follows.

<strong>Objects and Inheritance</strong>

Database consists of objects and the database administrators can design custom or user-defined objects ...]]></description>
			<content:encoded><![CDATA[<p>﻿﻿PostgreSQL or Postgres is an object-relational database management system (ORDBMS). Unlike MySQL, PostgreSQL is not controlled by any single company, it is a community developed project. It is a advanced version of the &#8216;Ingres&#8217; Database project (which is how the project gets the name post-ingres or postgres ).</p>
<p>Postgres is one of the best open-source database alternative which is fully object oriented and transactions compliant. It has stored procedures, multiple views and a huge set of datatypes. Some of the other notable features are as follows.</p>
<p><strong>Objects and Inheritance</strong></p>
<p>Database consists of objects and the database administrators can design custom or user-defined objects for the tables. Inheritance is another feature. Tables can be set to inherit their characteristics from a &#8220;parent&#8221; table.</p>
<p><strong>Functions </strong></p>
<p>Functions can be used in Postgres. These can be written in the postgres&#8217; own procedural language called &#8216;PL/pgSQL&#8217; which resembles Oracle&#8217;s procedural language &#8216;PL/SQL&#8217; or any other common scripting languages which support posgtres&#8217; procedural language like PL/Perl, plPHP, PL/Python, PL/Ruby etc. Run the following in the psql client to determine if functions is enabled:</p>
<pre class="brush: bash; title: ; notranslate">SELECT true FROM pg_catalog.pg_language WHERE lanname = 'plpgsql'; </pre>
<p>To create user-defined functions we use the CREATE OR REPLACE FUNCTION  command.  Example:</p>
<pre class="brush: bash; title: ; notranslate">CREATE OR REPLACE FUNCTION fib (

fib_for integer

) RETURNS integer AS $$

BEGIN

IF fib_for &lt; 2 THEN

RETURN fib_for;

END IF;

RETURN fib(fib_for - 2) + fib(fib_for - 1);

END;

$$ LANGUAGE plpgsql;</pre>
<p><strong>Indexes </strong></p>
<p>An index is like a summary of a certain portion of the table. It is an optimization technique which increases speed of accessing records from a database. PostgreSQL supports indexes like Btree, hash etc. User-defined index methods can also be created. Indexes are created on tables with respect to a particular field (based on which there are a number of queries). As an example for a table:</p>
<pre class="brush: bash; title: ; notranslate">CREATE TABLE name (

id integer,

fname varchar

lname varchar

);</pre>
<p>To create an index on table name with respective to the field id (as there are many queries on this table requesting for firstname or lastname from the id provided), we use the index:</p>
<pre class="brush: bash; title: ; notranslate">CREATE INDEX name_id_index ON name (id);</pre>
<p><strong>Triggers</strong></p>
<p>Triggers are events or functions run upon the action of certain SQL statements which modify data in some records. Depending on the kind of modification we can have multiple triggers in a database. Postgres supports multiple triggers written in PL/PgSQL or it&#8217;s scripting counterparts like PL/Python. The trigger function must be defined before the trigger can be created. The trigger function must be declared as a function taking no arguments and returning type trigger. CREATE TRIGGER command is used to declare triggers.</p>
<p><strong>Concurrency </strong></p>
<p>PostgreSQL ensures concurrency with the help of MVCC (Multi-Version Concurrency Control), which gives the database user a &#8220;snapshot&#8221; of the database, allowing changes to be made without being visible to other users until a transaction is committed.</p>
<p>PostgreSQL&#8217;s MVCC keeps all of the versions of the data together in the same partition in the same table. By identifying which rows were added by which transactions, which rows were deleted by which transactions, and which transactions have actually committed, it becomes a straightforward check to see which rows are visible for which transactions.</p>
<p>Inorder to accomplish this, Rows of a table are stored in PostgreSQL as a tuple. Two fields of each tuple are xmin and xmax. Xmin is the transaction ID of the transaction that created the tuple. Xmax is the transaction ID of the transaction that deleted it (if any).</p>
<p>Along with the tuples in each table, a record of each transaction and its current state (in progress, committed, aborted) is kept in a universal transaction log.</p>
<p>When data in a table is selected, only those rows that are created and not destroyed are seen. That is, each row&#8217;s xmin is observed. If the xmin is a transaction that is in progress or aborted, then the row is invisible. If the xmin is a transaction that has committed, then the xmax is observed. If the xmax is a transaction that is in progress or aborted and not the current transaction, or if there is no xmax at all, then the row is seen. Otherwise, the row is considered as already deleted.</p>
<p>Insertions are straightforward. The transaction that inserts the tuple simply creates it with the xmax blank and the xmin set to its transaction ID. Deletions are also straightforward. The tuple&#8217;s xmax is set to the current transaction. Updates are no more than a concurrent insert and delete.</p>
<p><strong>Views</strong></p>
<p>A view is a table which does not exist in the database. It is a virtual table created from fields in various tables and is joined together based on some criteria. Views can be used in place of tables and will accomplish the task same as that of a table. The CREATE VIEW statement is used to accomplish this eg:</p>
<pre class="brush: bash; title: ; notranslate">CREATE VIEW best_sellers AS

SELECT * FROM publishers WHERE demand LIKE 'high';</pre>
<p><strong>Foreign Keys</strong></p>
<p>The primary key used in one table which is used to refer to the records in a second table is called the foreign key of the second table.</p>
<pre class="brush: bash; title: ; notranslate">CREATE TABLE products (
    product_no integer PRIMARY KEY,
    name text,
    price numeric
);
CREATE TABLE orders (
    order_id integer PRIMARY KEY,
    product_no integer REFERENCES products (product_no),
    quantity integer
);</pre>
<p>Here product_no is the foreign key in the second table created. The foreign key field may have values which are repeated unlike primary keys.</p>
<p><strong>Files Users and Configuration</strong></p>
<p>The main configuration file of Postgres is postgresql.conf. This can be located in the &#8216;data&#8217; directory. It may be present either in /var/lib (/var/lib/pgsql/data/postgresql.conf) or /usr/local (/usr/local/pgsql/data/postgresql.conf). Temporary changes to the configurations can be made using postmaster command.</p>
<p>The init script that starts the postgres service is /etc/init.d/postgresql . It runs a number of child processes concurrently. The postgres server process is postmaster. These processes and files associated with PosgreSQL are owned by the user/group postgres. The default port used for database connections is 5432</p>
<p>The user postgres is the PostgreSQL database superuser. We can create a number of super users for the database (this accomplished by the create role command ), however, the default super user is postgres. The postgres user has the privilege to access all the databases and files in the server (Unless the user root is created in postgres as a superuser).</p>
<p>Client Authentication is controlled by the file pg_hba.conf in the data directory, e.g., /var/lib/pgsql/data/pg_hba.conf. (HBA stands for host-based authentication.)</p>
<p>Each record specifies a connection type, a client IP address range (if relevant for the connection type), a database name or names, and the authentication method to be used for connections matching these parameters.A record is typically in one of two forms:</p>
<p>local   database authentication-method [ authentication-option ]</p>
<p>host    database IP-address IP-mask authentication-method [ authentication-option ]</p>
<p>local : This record pertains to connection attempts over Unix domain sockets.</p>
<p>host : This record pertains to connection attempts over TCP/IP networks.</p>
<p>database : Specifies the database that this record applies to. The value all specifies that it applies to all databases, while the value sameuser identifies the database with the same name as the connecting user.</p>
<p>authentication methods</p>
<p>trust: The connection is allowed unconditionally.</p>
<p>reject: The connection is rejected unconditionally.</p>
<p>password: The client is required to supply a password which is required to match the database password that was set up for the user.</p>
<p>md5: Like the password method, but the password is sent over the wire encrypted using a simple challenge-response protocol.</p>
<p>ident: This method uses the &#8220;Identification Protocol&#8221; as described in RFC 1413. It may be used to authenticate TCP/IP or Unix domain socket connections, but its reccomended use is for local connections only and not remote connections.</p>
<p><strong>Front-ends </strong></p>
<p>The minimalistic front-end for PostgreSQL is the psql command-line. It can be used to enter SQL queries directly, or execute them from a file. phpPgAdmin is a web-portal used for PostgreSQL administration written in PHP and based on the popular phpMyAdmin. Likewise pgAdmin is a graphical front-end administration tool for PostgreSQL, which has support on multiple platforms. The latest stable version of the same is pgAdmin III.</p>
<p><strong>Some administration related commands</strong></p>
<p>Command to login to psql database mydb as user myuser:</p>
<pre class="brush: bash; title: ; notranslate">psql -d mydb -U myuser</pre>
<p>Command to login to psql database mydb as user myuser on a different host myhost:</p>
<pre class="brush: bash; title: ; notranslate">psql -h myhost -d mydb -U myuser</pre>
<p>If the port the server runs is different we use -p [port number] . Upon entering the psql shell the prompt will show the database name currently being used. In the above example it will show</p>
<pre class="brush: bash; title: ; notranslate">mydb=&gt; (if logged in as an ordinary user )</pre>
<pre class="brush: bash; title: ; notranslate">mydb=# (if logged in as a super user like postgres)</pre>
<p><strong>Create a PostgreSQL user </strong></p>
<p>There are two ways to create a postgres database user. The only user initially allowed to create users is postgres. So one has to switch to this user before creating other users with varying privileges.</p>
<p>1. Creating the user in the shell prompt, with createuser command.</p>
<p>switch to the postgres user with:</p>
<pre class="brush: bash; title: ; notranslate">su - postgres

createuser tom

Shall the new role be a superuser? (y/n) n

Shall the new role be allowed to create databases? (y/n) y

Shall the new role be allowed to create more new roles? (y/n) n</pre>
<p>2. Creating the user in the PSQL prompt, with CREATE USER command.</p>
<p>switch to the postgres user with:</p>
<pre class="brush: bash; title: ; notranslate">su - postgres

create user mary with password 'marypass';</pre>
<p><strong>Creating and deleting a PostgreSQL Database </strong></p>
<p>There are two way to create databases.</p>
<p>1. Creating database in the PSQL prompt, with createuser command.</p>
<pre class="brush: bash; title: ; notranslate">CREATE DATABASE db1 WITH OWNER tom;</pre>
<p>2. Creating database in the shell prompt, with createdb command.</p>
<pre class="brush: bash; title: ; notranslate">createdb db2 -O mary</pre>
<p>To delete an entire database from within the psql prompt do :</p>
<pre class="brush: bash; title: ; notranslate">DROP DATABASE db1;</pre>
<p><strong>Determining execution time of a query</strong></p>
<p>Turn on timing with</p>
<pre class="brush: bash; title: ; notranslate">\timing</pre>
<p>Now execute the qery:</p>
<pre class="brush: bash; title: ; notranslate">SELECT * from db1.employees ;

Time: 0.065 ms</pre>
<p><strong>Calculate postgreSQL database size in disk </strong></p>
<pre class="brush: bash; title: ; notranslate">SELECT pg_database_size('db1');</pre>
<p>to get the values in human readable format</p>
<pre class="brush: bash; title: ; notranslate">SELECT pg_size_pretty(pg_database_size('db1'));</pre>
<p>to calculate postgreSQL table size in disk</p>
<p>SELECT pg_size_pretty(pg_total_relation_size(&#8216;big_table&#8217;));</p>
<p><strong>Slash commands used in psql</strong></p>
<p>To list all slash commands and thier purpose. Login to psql and issue to the command \? . Some of the most commonly used slash commands are the following:</p>
<table>
<tbody>
<tr>
<td>List databases</td>
<td>\l</td>
</tr>
<tr>
<td>System tables</td>
<td>\dS</td>
</tr>
<tr>
<td>Types</td>
<td>\dT</td>
</tr>
<tr>
<td>Functions</td>
<td>\df</td>
</tr>
<tr>
<td>Operators</td>
<td>\do</td>
</tr>
<tr>
<td>Aggregates</td>
<td>\da</td>
</tr>
<tr>
<td>Users</td>
<td>\du</td>
</tr>
<tr>
<td>Quit from psql</td>
<td>\q</td>
</tr>
<tr>
<td>Connect to different database db2</td>
<td>\c db2</td>
</tr>
<tr>
<td>Describe Table/index/view/sequence</td>
<td>\d</td>
</tr>
</tbody>
</table>
<p>The below can be used with a specific table/index/view name for description of the specific table/index/view</p>
<table>
<tbody>
<tr>
<td>Tables</td>
<td>\dt</td>
</tr>
<tr>
<td>Indexes</td>
<td>\di</td>
</tr>
<tr>
<td>Sequences</td>
<td>\ds</td>
</tr>
<tr>
<td>Views</td>
<td>\dv</td>
</tr>
</tbody>
</table>
<p><strong>Useful Bash commands</strong></p>
<p>Bash command to list all the postgresql databases:</p>
<pre class="brush: bash; title: ; notranslate">psql -l #This can be run as a unix user who is also a super user in postgresql</pre>
<p>Indirect bash command to list all the postgresl users:</p>
<pre class="brush: bash; title: ; notranslate">psql -c '\du' #-c is used to run an internal or sql command in psql shell</pre>
<p><strong>Backing up and restoring databases</strong></p>
<p>To dump the database to an sql file use the bash command:</p>
<pre class="brush: bash; title: ; notranslate">pg_dump mydb &amp;gt; db.out</pre>
<p>To restore a database from an sql backup file (via bash)</p>
<pre class="brush: bash; title: ; notranslate">psql -d newdb -f backupdb.out

or

psql -f backupdb.out newdb</pre>
<p>(here the database newdb must be already created and the file backupdb.out must be present in the current directory)</p>
<p>To take the backup of all the Postgres databases in the server:</p>
<pre class="brush: bash; title: ; notranslate">pg_dumpall &gt; /var/lib/pgsql/backups/dumpall.sql</pre>
<p>(Only possible with the postgres or the database superuser )</p>
<p><strong>Resetting database user&#8217;s password</strong></p>
<p>To change the password for a database user (say &#8216;thomas&#8217;):</p>
<pre class="brush: bash; title: ; notranslate">ALTER USER thomas WITH PASSWORD 'newpassword';</pre>
<p>This same command can be used to reset the password for the postgresql super user postgres, but in this case, you will have to enable password less login for postgres user by adding the following line to the top of the file pg_hba.conf in the data directory of postgres. Once the password is reset this line can be removed:</p>
<pre class="brush: bash; title: ; notranslate">local	all	postgres	trust</pre>
<p>Next we issue the same command but for the user postgres</p>
<pre class="brush: bash; title: ; notranslate">ALTER USER postgres WITH PASSWORD 'newpassword';</pre>
<p>To create a super user via bash with multiple roles</p>
<pre class="brush: bash; title: ; notranslate">createuser -sPE mysuperuser</pre>
<p>Instead of this we can also use the below psql shell command:</p>
<pre class="brush: bash; title: ; notranslate">CREATE ROLE mysuperuser2 WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'mysuperpass2';</pre>
<p><strong>Physical database files in postgres</strong></p>
<p>The files in data/base are named by the oid (Object Identifier) of the database record in</p>
<p>pg_database, like this:</p>
<pre class="brush: bash; title: ; notranslate">cd /var/lib/pgsql/data/base

ls -l

total 33

drwx------ 22 postgres postgres 4096 Jul 23 20:06 ./

drwx------ 11 postgres postgres 4096 Aug  1 05:59 ../

drwx------  2 postgres postgres 4096 Jun 20 09:32 1/

drwx------  2 postgres postgres 4096 Mar  3 13:36 10792/

drwx------  2 postgres postgres 4096 Jun 20 15:09 10793/

drwx------  2 postgres postgres 4096 May 27 01:40 16497/

drwx------  2 postgres postgres 4096 May 27 01:40 16589/

drwx------  2 postgres postgres 4096 Jun 20 10:28 16702/

drwx------  2 postgres postgres 4096 May 27 01:40 16764/

drwx------  2 postgres postgres 4096 May 27 01:40 16785/

drwx------  2 postgres postgres 4096 Aug  1 04:37 16786/

drwx------  2 postgres postgres 4096 Aug  1 04:36 19992/

drwx------  2 postgres postgres 4096 May 27 01:40 19997/</pre>
<p>To obtain the oid, execute the following command in psql prompt</p>
<pre class="brush: bash; title: ; notranslate">postgres=# select oid,datname from pg_database order by oid;

   oid  |         datname

---------+--------------------------

1 | template1

10792 | template0

10793 | postgres

16497 | gadgetwi_Unable

16589 | vimusicc_filehost

16702 | personea_altissimo

16764 | shopping_businessfinance

16785 | ansonyi_wp2

16786 | ansonyi_wp

19992 | globook_PostgreSQL</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=PostgreSQL+for+the+sage+-+Must+know+basics+for+the+system+administrators+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1144" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=PostgreSQL+for+the+sage+-+Must+know+basics+for+the+system+administrators+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1144" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All about SSL</title>
		<link>http://www.supportsages.com/blog/2010/07/all-about-ssl/</link>
		<comments>http://www.supportsages.com/blog/2010/07/all-about-ssl/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 22:14:05 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[ca bundle]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[crt]]></category>
		<category><![CDATA[csr]]></category>
		<category><![CDATA[digest]]></category>
		<category><![CDATA[digital signature]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=962</guid>
		<description><![CDATA[﻿﻿﻿﻿SSL or Secure Sockets Layer (Notice the last s in sockets) is used to secure the communication over the internet. This technique was introduced by Netscape. It uses the RSA public key cryptography for encryption/decryption.

In the protocol stack used in the internet. The SSL protocol runs above TCP/IP and below higher-level protocols such as HTTP or IMAP.

The SSL protocol includes two sub-protocols:
1) SSL record protocol
2) SSL handshake protocol

The SSL record protocol defines the format used to transmit data. The SSL handshake protocol involves using the SSL record protocol to exchange a series of messages between an SSL-enabled server and an ...]]></description>
			<content:encoded><![CDATA[<p>﻿﻿﻿﻿SSL or Secure Sockets Layer (Notice the last s in sockets) is used to secure the communication over the internet. This technique was introduced by Netscape. It uses the RSA public key cryptography for encryption/decryption.</p>
<p>In the protocol stack used in the internet. The SSL protocol runs above TCP/IP and below higher-level protocols such as HTTP or IMAP.</p>
<p>The SSL protocol includes two sub-protocols:<br />
1) SSL record protocol<br />
2) SSL handshake protocol</p>
<p>The SSL record protocol defines the format used to transmit data. The SSL handshake protocol involves using the SSL record protocol to exchange a series of messages between an SSL-enabled server and an SSL-enabled client when they first establish an SSL connection.</p>
<p><strong>Now SSL for the layman<br />
<span style="font-weight: normal;">SSL basically creates an encrypted communication channel between the two parties involved in the communication. For a third person involved in the middle of this communication channel, the data seems to be garbled.<span id="more-962"></span></span></strong></p>
<p>Suppose Alice (A, the browser) wishes to communicate with Bob (B, the server) then the exact steps that takes place inorder to begin the encrypted communication are:</p>
<p>1) A -&gt; B	hello<br />
Alice contacts Bob and requests for a private communication (request for an https link at port 443)</p>
<p>2) B -&gt; A	Hi, I&#8217;m Bob, <em>bobs-certificate</em><br />
Bob send back to Alice his certificate. A certificate authenticates that it is Bob who is actually communicating with Alice. It is like a unique ID card displayed.</p>
<p>3) A -&gt; B	prove it<br />
Alice requests Bob to prove his identity.</p>
<p>4) B -&gt; A	Alice, This Is bob <em>{ digest[Alice, This Is Bob] } bobs-private-key</em><br />
Bob sends back a message and its digest encrypted with his private key. This step can also be like sending a document with a digital signature (when you have Alice&#8217;s public key).</p>
<p>5) A -&gt; B	ok bob, here is a secret <em>{secret} bobs-public-key</em><br />
Alice sends back to Bob some secret. Usually a session key encrypted using Bob&#8217;s public key obtained from his certificate</p>
<p>6) B -&gt; A	<em>{some message,MAC}secret-key</em><br />
Next Bob generates a secret key from Alice&#8217;s secret (earlier step) and sends back to Alice the real message and its MAC encrypted with this secret key. This is actually the encrypted website.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/07/ssl-handshake.gif" class="thickbox no_icon" rel="gallery-962" title="ssl handshake"><img class="size-full wp-image-976 aligncenter" title="ssl handshake" src="http://www.supportsages.com/blog/wp-content/uploads/2010/07/ssl-handshake.gif" alt="" width="614" height="525" /></a><strong><span style="text-decoration: underline;">Terminologies</span></strong></p>
<p><strong>Certificate<br />
<span style="font-weight: normal;">This is actually bobs public key containing document which is digitally signed by a certificate issuer&#8217;s private key (like Verisign). In this process Verisign gets all the necessary documents to verify that Bob&#8217;s identity is correct and it gets Bob&#8217;s public key (and some other data like certificate expiry period, Bobs identity) and encrypts it with its own private key. Now Verisign&#8217;s public key comes built-in along with every browser (so that the browser can get bobs public key from within it).</span></strong></p>
<p><strong>Digest<br />
<span style="font-weight: normal;">Digest or more appropriately Message Digest is like a summary of the actual message or a portion of the message. The digest of a message is is unique for every unique message, it is a one way function such that obtaining the digest, it is never possible to recover the original message (This does not involve using any key in the process). Message Digest always appears with the original message. Upon reception of this Message and its digest at the receiver&#8217;s end, the receiver can once again calculate the digest from the original message and verify the integrity of the message.</span></strong></p>
<p><strong>Digital signature<br />
<span style="font-weight: normal;"><strong><span style="font-weight: normal;">Let Bob send a document to Alice which is digitally signed. For this Bob must have Alice&#8217;s public key and Alice must have Bob&#8217;s public key.Bob takes the document, encrypts it first with Alice&#8217;s public key and next with its own private key(Bob&#8217;s)</span></strong></span></strong></p>
<p>B -&gt; A<span style="white-space: pre;"> </span><em>[{message}alices-public-key ]bobs-public-key</em></p>
<p><strong>Session Key</strong><br />
The only secret which is communicated using public key encryption is a session key. Now the session key is chosen from the &#8216;secret&#8217; that the parties accept. the session key could be the secret itself or a portion of the secret or the result when the secret is passed through a previously agreed algorithm. The SSL encrypted communication does&#8217;t necessary have to be created using a public key encryption technique (This uses a lot of overhead, i.e. processing and time), it may be simple symmetric cypher(less overhead) using this session key once agreed upon. There are a variety of cypher suites available (IDEA Blow-fish RSA DES MD5 KEA) and both the parties may choose some encryption technique based on the protocol used (SSL1.0 SSL2.0 TLS etc)</p>
<p><strong>MAC</strong><br />
MAC or Message Authentication Code is similar to the Message Digest we have discussed. It is used to verify the integrity of the Message.</p>
<p><em>MAC := Digest[ some message, secret ]</em></p>
<p><strong><span style="text-decoration: underline;">Files associated with SSL</span></strong></p>
<p><strong>CSR</strong><br />
CSR or Certificate Signing Request is a string of text generated by the server. This file is sent to the SSL vendor while purchasing an SSL. In the process of generating your CSR, you provide a number of details regarding the domain being registered. Excerpts of text from all these are taken to generate your private key. This private key is present only within the server and nowhere else. The content of the CSR basically contains the public key along with all the details you have used. You get this as domain.com.csr or domain_com.csr.</p>
<p><strong>CA bundle</strong><br />
CA (Certificate Authority) bundle file is one which contains the public key of the Certificate Issuer (Like Verisign&#8217;s public key). Usually this is not required while installing the SSL and most browsers will have this detail in advance to decrypt the SSL certificate (the CRT file) from the server. You get this as domain.com.cabundle or domain_com.ca-bundle.</p>
<p><strong>CRT</strong><br />
This is the actuall SSL certificate as obtained from the SSL vendor. It is a file (containing the public key of the domain secured with SSL and other details like the expiry date, owner information, address etc of the SSL) which is encrypted with the private key of the SSL vendor (Digitaly signed by the SSL vendor). You get this as domain.com.crt or domain_com.crt .</p>
<p><strong>Key file</strong><br />
This is the file which holds your private key (strictly confidential material). The file will have the RSA private key as generated by your server software. You get this as customcardsplus.com.key or customcardsplus_com.key. This file is not usually send to your SSL vendor unlike the CSR. You get this as domain.com.key or domain_com.key .</p>
<p><strong>SSL in a cPanel server</strong><br />
Any service can be secured in a communication channel which is encrypted with SSL. Each of this service on the encrypted channel will be on a different port. Some of them are as follows:</p>
<table style="height: 148px;" border="1" cellpadding="3" width="160">
<tbody>
<tr style="text-align: center;">
<td>
<h2><strong>service</strong></h2>
</td>
<td>
<h2><strong>normal</strong></h2>
</td>
<td>
<h2><strong>ssl</strong></h2>
</td>
</tr>
<tr>
<td>http</td>
<td>80</td>
<td>443</td>
</tr>
<tr>
<td>telnet</td>
<td>23</td>
<td>992</td>
</tr>
<tr>
<td>imap</td>
<td>143/220</td>
<td>993</td>
</tr>
<tr>
<td>pop</td>
<td>109/110</td>
<td>995</td>
</tr>
<tr style="text-align: left;">
<td>smtp</td>
<td>25</td>
<td>465</td>
</tr>
</tbody>
</table>
<p>A domain served as a secure webpage will require a dedicated IP (in a shared environment). SSL protocol is designed to use IP-based mapping. SSL does not support host headers. Therefore, you should have a unique IP address assigned to your secure site. These pages are served from the port 443. Let us examine the configuration of such a website in the apache&#8217;s config file /usr/local/apache/conf/httpd.conf.</p>
<p>Every website (in our example domain.com with username: doma) enabled with SSL has a unique set of directives in the VirtualHost section for the 443 port as:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost 266.11.208.293:443\&gt; Dedicated IP of the domain

ServerName domain.com #Domain name secured with SSL
ServerAlias www.domain.com

DocumentRoot /home/doma/public_html

ServerAdmin webmaster@domain.com
UseCanonicalName off
CustomLog /usr/local/apache/domlogs/domain.com combined

CustomLog /usr/local/apache/domlogs/domain.com-bytes_log &quot;%{%s}t %I .\n%{%s}t %O .&quot;
ScriptAlias /cgi-bin/ /home/doma/public_html/cgi-bin/
SSLEngine on #This directive enables the SSL on this domain
SSLCertificateFile /etc/ssl/certs/www.domain.com.crt #Location of CRT file
SSLCertificateKeyFile /etc/ssl/private/www.doma.com.key #Location of Private key
SSLCACertificateFile /etc/ssl/certs/www.domain.com.cabundle #Location of CAbundle file
CustomLog /usr/local/apache/domlogs/domain.com-ssl_log combined #Log specific for the SSL served webpage
SetEnvIf User-Agent &quot;.*MSIE.*&quot; nokeepalive ssl-unclean-shutdown

&lt;Directory &quot;/home/doma/public_html/cgi-bin&quot;&gt;
SSLOptions +StdEnvVars #This directive will pass mod_ssl environment variables to the server scripts.
&lt;/Directory&gt;

&lt;/VirtualHost&gt;
</pre>
<p>Some times the directive SSLCertificateChainFile is used in place of SSLCACertificateFile. The minimal addition you will have to make to enable SSL in your httpd.conf file is:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost 192.168.0.1:443&gt;
DocumentRoot /var/www/html
ServerName www.yourdomain.com
SSLEngine on
SSLCertificateFile /path/to/your_domain_name.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChainFile /path/to/DigiCertCA.crt
&lt;/VirtualHost&gt;
</pre>
<p>There are two locations where you are likely to find the SSL related files in your cPanel server. Usually the crt, key and the ca bundle are present in the home directory of the user in /home/username/ssl/, if it was installed using the client&#8217;s cpanel. However if the WHM was used instead to install the same, you will find it in /etc/ssl/. In either of these locations you will find two directories: certs/ and private/. certs contain the crt and cabundle while the private contains the keys.</p>
<p>Now you know how ssl works in your server, Any more questions? just comment!</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=All+about+SSL+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F962" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=All+about+SSL+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F962" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/07/all-about-ssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

