<?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>Bin-Blog &#187; Tutorials</title>
	<atom:link href="http://www.bin-co.com/blog/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bin-co.com/blog</link>
	<description>Learn about the latest in Web Development - as soon as I do.</description>
	<lastBuildDate>Tue, 13 Oct 2009 18:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Create a Better 404 Page in WordPress &#8211; Without Plugins</title>
		<link>http://www.bin-co.com/blog/2009/07/create-a-better-404-page-in-wordpress-without-plugins/</link>
		<comments>http://www.bin-co.com/blog/2009/07/create-a-better-404-page-in-wordpress-without-plugins/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 18:28:01 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugin-killer]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[wp-plugin]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=282</guid>
		<description><![CDATA[Recently, one of my friends posted a <a href="http://www.dailyseoblog.com/2009/06/8-wordpress-plugins-to-make-your-404-error-pages-user-friendly-efficient/">list of plugins you can use to optimize your 404 page</a>. In case you don't know what a <strong class="highlight">404 page, its the page that shows up if the URL requested by the user don't exist</strong>. He listed eight plugins to do this. And since I am working on the <a href="http://www.bin-co.com/blog/2009/03/wordpress-plugin-killer-series/">Plugin Killer series</a>, it got me thinking - is it possible to do it without using any plugins?]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/willemvelthoven/251801449/"><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/07/404.jpg" alt="404" title="404" width="300" height="197" class="aligncenter size-full wp-image-283 intro" align="right" /></a></p>
<p class="intro">Recently, one of my friends posted a <a href="http://www.dailyseoblog.com/2009/06/8-wordpress-plugins-to-make-your-404-error-pages-user-friendly-efficient/">list of plugins you can use to optimize your 404 page</a>. In case you don&#8217;t know what a <strong class="highlight">404 page, its the page that shows up if the URL requested by the user don&#8217;t exist</strong>. He listed eight plugins to do this. And since I am working on the <a href="http://www.bin-co.com/blog/2009/03/wordpress-plugin-killer-series/">Plugin Killer series</a>, it got me thinking &#8211; is it possible to do it without using any plugins?</p>
<p>Turns out, its easy. As long as you know about the <strong class="highlight"><a href="http://www.google.com/support/webmasters/bin/answer.py?answer=136085">Google&#8217;s 404 Widget</a>. It adds a search box for your site with appropriate search suggestions</strong> and tries(and unfortunately, often fails) to provide alternatives to incorrect URLs.</p>
<p>See it in action here &#8211; <a href="http://www.bin-co.com/perl/perl_tk_tutorials/" rel="nofollow">http://www.bin-co.com/perl/perl_tk_tutorials/</a>. The correct URL is <a href="http://www.bin-co.com/perl/perl_tk_tutorial/">http://www.bin-co.com/perl/perl_tk_tutorial/</a> &#8211; which the user finds and shows.</p>
<h2>Enable Google 404 Widget in your Site</h2>
<ul>
<li>First, <strong class="highlight">create the code</strong> by following the steps given in the <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=136085">404 Widget page</a>.</li>
<li>Then open the <strong class="highlight">404.php file of your wordpress theme and paste the code</strong> you got into it. Save and upload &#8211; you&#8217;re done.</li>
</ul>
<p>This is the last of my plugin killer series. Just to balance things out, I&#8217;m thinking of doing a <a href="http://www.bin-co.com/blog/2008/12/wordpress-plugin-week/">Plugin week</a>(yes, <strong class="highlight">a second plugin week</strong>) next week. Let me know if any of you are interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/07/create-a-better-404-page-in-wordpress-without-plugins/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating a Paypal Donate Widget in WordPress &#8211; Without a Plugin</title>
		<link>http://www.bin-co.com/blog/2009/06/creating-a-paypal-donate-widget-in-wordpress-without-a-plugin/</link>
		<comments>http://www.bin-co.com/blog/2009/06/creating-a-paypal-donate-widget-in-wordpress-without-a-plugin/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 19:32:01 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[donate]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugin-killer]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=278</guid>
		<description><![CDATA[<a href="http://www.supriyadisw.net/2006/11/paypal-donate-plugin-for-wordpress-widget-support">Paypal donate plugins</a>. This is extremely simple to implement - you don't even have to edit the code to get this done.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/03/halo_wordpress.jpg" alt="WordPress Helo Effect" title="WordPress Helo Effect" width="300" height="233" class="aligncenter size-full wp-image-238 intro" align="right" /></p>
<p class="intro"><a href="http://www.supriyadisw.net/2006/11/paypal-donate-plugin-for-wordpress-widget-support">Paypal donate plugins</a>. This is extremely simple to implement &#8211; you don&#8217;t even have to edit the code to get this done.</p>
<h2>Widget Mode</h2>
<p>Open the admin side of your blog and <strong class="highlight">go to Appearance &gt; Widgets. Now add a Text widget</strong> to the sidebar you want the widget in. <strong class="highlight">Edit it and paste the HTML code</strong> from the <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_donate_techview_outside">Paypal site</a>.</p>
<pre><code class="html">&lt;form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;input type="hidden" name="cmd" value="_xclick"&gt;
&lt;input type="hidden" name="business" value="binnyva@hotmail.com"&gt;
&lt;input type="hidden" name="item_name" value="Donation"&gt;
&lt;input type="hidden" name="currency_code" value="USD"&gt;
&lt;input type="hidden" name="amount" value="25.00"&gt;
&lt;input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"&gt;
&lt;/form&gt;</code></pre>
<p>Make sure you <strong class="highlight">use your own paypal ID in the business field</strong>.</p>
<p>Save the widget &#8211; and you&#8217;re done.</p>
<h2>Theme Mode</h2>
<p>Another method is to add the same code to the theme&#8217;s code directly. Usually in the <code>sidebar.php</code> file. I kind of prefer this method &#8211; but it involves code editing, FTP, etc. Not everyone is comfortable with this.</p>
<h2>Post Mode</h2>
<p>Last but not the least, you can embed the code directly into a post. This is perhaps the simplest of all. Below is a working sample of the code&#8230;</p>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="binnyva@hotmail.com">
<input type="hidden" name="item_name" value="Donate">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="5.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/06/creating-a-paypal-donate-widget-in-wordpress-without-a-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Show Popular Posts in WordPress &#8211; without a plugin</title>
		<link>http://www.bin-co.com/blog/2009/03/show-popular-posts-in-wordpress-without-a-plugin/</link>
		<comments>http://www.bin-co.com/blog/2009/03/show-popular-posts-in-wordpress-without-a-plugin/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 18:27:20 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugin-killer]]></category>
		<category><![CDATA[popular]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=240</guid>
		<description><![CDATA[A list of the popular posts of the blog is a standard feature in many blogs. There are quite a few plugins that offer this feature. In case you are new to this blog, I am currently working on the <a href="http://www.bin-co.com/blog/2009/03/wordpress-plugin-killer-series/">Plugin Killer Series</a> - a series of post in which I explain how to duplicate the functionality provided by some wordpress plugins - without having to install the plugin.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/03/halo_wordpress.jpg" alt="WordPress Helo Effect" title="WordPress Helo Effect" width="300" height="233" class="alignnone size-full wp-image-238 intro" align="right" /></p>
<p class="intro">A <strong class="highlight">list of the popular posts</strong> of the blog is a standard feature in many blogs. There are quite a few plugins that offer this feature&#8230;</p>
<ul>
<li><a href="http://ajaydsouza.com/wordpress/plugins/top-10/">Top 10 &#8211; A Page Counter and Popular Posts plugin for WordPress</a></li>
<li><a href="http://alexking.org/blog/2005/05/23/popularity-contest">Popularity Contest Plugin (beta)</a></li>
<li><a href="http://wordpress.org/extend/plugins/wordpress-popular-posts/">WordPress Popular Posts</a></li>
<li><a href="http://boakes.org/most-wanted/">MostWanted &#8211; a Popular Posts Plugin for WordPress</a></li>
</ul>
<p>Now, lets see how to do it without using a plugin. In case you are new to this blog, I am currently working on the <a href="http://www.bin-co.com/blog/2009/03/wordpress-plugin-killer-series/">Plugin Killer Series</a> &#8211; a series of post in which I explain how to duplicate the functionality provided by some wordpress plugins &#8211; without having to install the plugin.</p>
<p>These <strong class="highlight">plugins work by adding a view counter for each post</strong> &#8211; whenever a user visits a page, it will increment the count for that page by one. Unfortunately, WordPress does not provide this feature. But there is <strong class="highlight">another indicator for the popularity of a post &#8211; its comment count</strong>.</p>
<h2>The Code</h2>
<h3>Getting Comment Count &#8211; SQL</h3>
<p>So the first step is to get the list of post with the most comments. To get that, we can use the following SQL statement&#8230;</p>
<pre><code class="sql">SELECT id,post_title FROM wp_posts ORDER BY comment_count DESC LIMIT 0,10</code></pre>
<h3>Listing The Data &#8211; PHP/SQL</h3>
<p>This query will return just 10 posts. If you want more(or less) post, just change the number after LIMIT accordingly. The PHP code for executing the query and getting its result is&#8230;</p>
<pre><code class="php">$popular_posts = $wpdb-&gt;get_results("SELECT id,post_title FROM {$wpdb-&gt;prefix}posts ORDER BY comment_count DESC LIMIT 0,10");
foreach($popular_posts as $post) {
	// Do something with the $post variable
}
</code></pre>
<h3>Final Output as Links in a List &#8211; HTML/PHP/SQL</h3>
<p>Next step is to get the URL of each post. The recommended way of doing this is by using the &#8216;<a href="http://codex.wordpress.org/Template_Tags/get_permalink">get_permalink</a>&#8216; function. Another thing we have to do is to map the result as an HTML list&#8230;</p>
<pre><code class="php">&lt;li&gt;&lt;h3&gt;Popular Posts&lt;/h3&gt;
&lt;ul class="bullets"&gt;
&lt;?php
$popular_posts = $wpdb-&gt;get_results("SELECT id,post_title FROM {$wpdb-&gt;prefix}posts ORDER BY comment_count DESC LIMIT 0,10");
foreach($popular_posts as $post) {
	print "&lt;li&gt;&lt;a href='". get_permalink($post-&gt;id) ."'&gt;".$post-&gt;post_title."&lt;/a&gt;&lt;/li&gt;\n";
}
?&gt;
&lt;/ul&gt;
&lt;/li&gt;</code></pre>
<p>Note: The HTML part of the code may need to be changed &#8211; depending on your theme.</p>
<p>Add this code to the <code>sidebar.php</code> file in your theme &#8211; and you are done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/03/show-popular-posts-in-wordpress-without-a-plugin/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Interactive SQL Tutorial</title>
		<link>http://www.bin-co.com/blog/2009/02/interactive-sql-tutorial/</link>
		<comments>http://www.bin-co.com/blog/2009/02/interactive-sql-tutorial/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 19:00:44 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[gears]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=230</guid>
		<description><![CDATA[I have completed a tutorial that I have been working on for a long time. Its the <a href="http://www.bin-co.com/database/sql_tutorial/">Interactive SQL(Structured Query Language) Tutorial</a> - it teaches you the basics of SQL. SQL, for those of you who are unaware of it, is the language used to access and manipulate data within a database. It is very simple and very powerful.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/02/db.png" alt="Database SQL" title="Database SQL" width="158" height="155" class="alignnone size-full wp-image-231 intro" align="right" /></p>
<p class="intro">I have completed a tutorial that I have been working on for a long time. Its the <a href="http://www.bin-co.com/database/sql_tutorial/">Interactive SQL(Structured Query Language) Tutorial</a> &#8211; it teaches you the basics of SQL. SQL, for those of you who are unaware of it, is the language used to access and manipulate data within a database. It is very simple and very powerful.</p>
<h2>Interactive SQL Query Box</h2>
<p>The cool thing about the tutorial is that it is interactive &#8211; each vistor can have a personal sandboxed database in which they can run any query they want. I call it the interactive query box. You can test almost all the SQL statements in this box without worrying about data loss &#8211; all the data is stored temporarily in this system. But you will have to install an extension called Google Gears in your browser.</p>
<h3>Google Gears</h3>
<p><a href="http://gears.google.com/">Google Gears</a> is an open source browser extension that lets developers create web applications that can run offline. You can install it in Firefox and Internet Explorer. If you want to try out SQL queries as it is presented in the tutorial, you need this extension.</p>
<p>You can view the tutorial without this extension, but you will be missing out the coolest feature of the tutorial.</p>
<h2>Simple Tutorial</h2>
<p>I have tried to make the tutorial as simple as possible. If you have learned about RDBMS, you know there are stuff like Normal Forms and Cardinality and other brain numbing definitions. I have removed all but the <a href="http://www.bin-co.com/database/sql_tutorial/db_terms_meanings.php">most essential definitions in my tutorial</a> &#8211; it makes it easier to understand.</p>
<p>Even after removing the confusing definitions, I have apologized about the rest&#8230;</p>
<blockquote><p>Sorry if you find the definitions here a bit too much. Trust me &#8211; you are much better off here than if you are learning SQL from a database book. They are going to lay definitions on you till your eyes bleed. I have seen brave men die from too much exposure to definitions.</p></blockquote>
<h2>Its Funny</h2>
<p>I have learned a lot of languages and programming techniques by reading books and sites &#8211; and one thing I have noticed is that most of the material is unbelievably dry. Its extremely hard to keep your eyes open when you read them. That is why <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=https%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D23%26ref%255F%3Dnb%255Fss%255F%26y%3D23%26field-keywords%3Dhead%2520first%26url%3Dsearch-alias%253Dstripbooks&amp;tag=binnva-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=390957">head first books</a><img src="https://www.assoc-amazon.com/e/ir?t=binnva-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> are so popular &#8211; they made learning fun.</p>
<p>Its been a policy of mine to inject humor into such tutorials &#8211; if you have read any of my earlier tutorials, you would know that&#8230;</p>
<ul>
<li><a href="http://www.openjs.com/tutorials/basic_tutorial/">An Interactive JS Tutorial &#8211; The ABC of JavaScript</a></li>
<li><a href="http://www.openjs.com/tutorials/advanced_tutorial/">Advanced JavaScript Tutorial</a></li>
<li><a href="http://www.bin-co.com/tcl/tutorial/">Tcl/Tk Tutorial &#8211; Create GUI using Tk with Tcl Language</a></li>
<li><a href="http://www.bin-co.com/perl/tutorial/">Beginner&#8217;s Tutorial for CGI Perl Language</a></li>
<li><a href="http://www.bin-co.com/perl/perl_tk_tutorial/">Perl/Tk Tutorial &#8211; Create GUI with Perl&#8217;s Tk Module</a></li>
</ul>
<p>Also, I am a <a href="http://blog.binnyva.com/">humor blogger</a> &#8211; so this stuff comes easily to me.</p>
<p>What I am trying to say is that the new SQL tutorial follows the same pattern &#8211; there is a lot of humor in it. So people can read it easily &#8211; without resorting to caffeine shots.</p>
<h2>I Want Your Help&#8230;</h2>
<p>Now that the writing part is over, I am proof-reading it. I have corrected a fair amount of stupid mistakes so far &#8211; but I am sure that there are many still left. I was hoping that a few of you would head over to my <a href="http://www.bin-co.com/database/sql_tutorial/">SQL Tutorial</a> and go through it. If you notice any mistakes, just put it in the comment field at the end of each page. Once I fix an error, I&#8217;ll remove the comment &#8211; that way, when I launch the tutorial, people will think that there were no errors in my tutorial. Devious, isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/02/interactive-sql-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Linux for a better Windows Experience</title>
		<link>http://www.bin-co.com/blog/2009/01/using-linux-for-a-better-windows-experience/</link>
		<comments>http://www.bin-co.com/blog/2009/01/using-linux-for-a-better-windows-experience/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 16:05:50 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[stability]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=220</guid>
		<description><![CDATA[If you are a Windows user who want more stability(but unwilling to switch to Linux completely), this post is for you. Basically, you have to <strong class="highlight">create a dual boot system with Linux and Windows - and use Linux for doing the more 'unsafe' operations</strong>. The end result is windows remains stable - and you will be able to do things that are potentially dangerous.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/01/windows_logo.jpg" alt="" title="Windows Logo" width="119" height="106" class="alignnone size-full wp-image-213 intro" align="right" /></p>
<p class="intro">If you are a Windows user who want more stability(but unwilling to switch to Linux completely), this post is for you. Basically, you have to <strong class="highlight">create a dual boot system with Linux and Windows &#8211; and use Linux for doing the more &#8216;unsafe&#8217; operations</strong>. The end result is windows remains stable &#8211; and you will be able to do things that are potentially dangerous.</p>
<h2>Dual Boot System</h2>
<p>Install a Linux distro on your system. I would recommend Ubuntu if you are a beginner and Fedora if you are not. There are many tutorials on the net that will take you through the process of installing &#8211; so I am not going into it. Now boot into Linux when ever you wish to do stuff that might run the risk of infecting your system&#8230;</p>
<h3>Browsing</h3>
<p>Unfortunately, the net is currently the number one source of virus infection. So, <strong class="highlight">if you want to browse, boot into linux and browse</strong> &#8211; this will make it impossible for virus to infect the system. But there are some problems with this approach&#8230;</p>
<ul>
<li>Might be impractical for full time broadband users</li>
<li>Some special applications might not have linux alternatives(eg. Online games, Yahoo Video Chat software etc.</li>
<li>Some ISP&#8217;s dialup applications might not work on Linux</li>
</ul>
<p>My brother uses this method &#8211; and he swears by it. It will cut down virus infections by about 75%.</p>
<h3>Using Pen Drives/External Hard Drives</h3>
<p>Another method that virus use to propagate itself is pen drives. Everytime you connect a pen drive to your system, you run the risk of getting a virus infection. <strong class="highlight">Using linux to check out pen drives will make sure you will not get infected</strong> this way. Its so effective that my brother prefers to check the pen drive in linux over checking it with a anti-virus.</p>
<h3>Troubleshooting Help</h3>
<p>Another advantage of having Linux in your system is that you can use it to troubleshoot hardware. Say that you mouse stops working &#8211; now you have to decide if its a hardware or a software issue. It could be a symptom of a virus &#8211; or it could be a problem with the mouse. If you just have windows, the only way to find out is to connect a different mouse &#8211; not the most convenient way. But if you have linux, just boot into it. <strong class="highlight">If the mouse is working in Linux, its a software issue. If not, then the hardware is to blame</strong>.</p>
<h3>Emergency Computing</h3>
<p>When disaster strikes(in case of windows, once every six months) and <strong class="highlight">your windows system is rendered unbootable, you have a bailout mechanism. You can use Linux</strong> to work on that urgent presentation, or backup the files, or send that email, etc. Point is, you have a working system &#8211; until you re-install Windows &#8211; or choose to abandon it for Linux.</p>
<h2>Linux Live CD/DVD</h2>
<p>If you don&#8217;t want to install linux due to some(propably invalid) reason, then your next best bet is to have a Linux Live CD handy. <strong class="highlight">Live CDs enable you to have a complete OS that boots directly from the CD/DVD</strong>. I would recommend Knopix for this. Just make sure that it works on your system &#8211; and you are able to mount your partitions and do read/write operations using the Live CD.</p>
<p>You can use the live CD to troubleshoot hardware and to backup the files in case your &#8216;Window is broken&#8217;. It might not be practical for the other reasons outlined above &#8211; because its slower than a permanent solution.</p>
<p>Ironically, we have reached a point that, <strong class="highlight">if you want a stable Windows system, you need to have Linux</strong> installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/01/using-linux-for-a-better-windows-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Hacks: &#8216;The Escape&#8217;</title>
		<link>http://www.bin-co.com/blog/2009/01/windows-hacks-the-escape/</link>
		<comments>http://www.bin-co.com/blog/2009/01/windows-hacks-the-escape/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 18:26:40 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[dll]]></category>
		<category><![CDATA[escape]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[resource hacker]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=215</guid>
		<description><![CDATA[What's the keyboard shortcut to close an application? Yes, its Alt+F4. Its not an easy shortcut to hit. I always thought that the Escape key was a much better shortcut to close applications. Once I convinced myself that it was the 'One-True-Way'<sup>TM</sup>, I decided to impose that shortcut on the applications that I use. Metapad and Irfan View already had that option - the other application I had my sight on was the Windows Explorer(explorer.exe). <strong class="highlight">This tutorial will teach you how to add the Escape key as a shortcut to close Windows Explorer</strong>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/01/windows_logo.jpg" alt="" title="Windows Logo" width="119" height="106" class="alignnone size-medium wp-image-213 intro" align="right" /></p>
<p class="intro">What&#8217;s the keyboard shortcut to close an application? Yes, its Alt+F4. Its not an easy shortcut to hit. I always thought that the Escape key was a much better shortcut to close applications. Once I convinced myself that it was the &#8216;One-True-Way&#8217;<sup>TM</sup>, I decided to impose that shortcut on the applications that I use. Metapad and Irfan View already had that option &#8211; the other application I had my sight on was the Windows Explorer(explorer.exe). <strong class="highlight">This tutorial will teach you how to add the Escape key as a shortcut to close Windows Explorer</strong>.</p>
<p>By the way, this is a post about my <a href="http://www.bin-co.com/blog/2009/01/3-windows-speed-tips-from-linux-user/">Windows days</a> &#8211; this is much easier to do in Linux &#8211; but thats another story.</p>
<h2>Stuff you need to know before continuing</h2>
<p>This is a fairly advanced hack &#8211; its not for everyone. It involves <strong class="highlight">editing core Windows files</strong> &#8211; which might be dangerous if done incorrectly. It also involves a bit of reverse engineering which <strong class="highlight">might be considered illegal</strong> by some lawyers. So continue only if you are sure.</p>
<p>This hack involes modifying Windows core files &#8211; which might some problems if done incorrectly. I cannot be held accountable for the outcome &#8211; be it good or bad. Actually, scratch that. Ff the result was a success, feel free to hold me accountable.</p>
<p>If you decide to continue, I would say that the result is worth the risk &#8211; <strong class="highlight">you will learn a method that will let you add custom shortcuts to application</strong> that don&#8217;t provide you with the source code. And it gives you a really cool feeling if you actually manage to pull the hack successfully.</p>
<p>I originally made this hack for Windows 98 &#8211; but it works on Windows XP as well. I have not tested it in Vista &#8211; I would be very grateful if anyone lets me know if it works in Vista or not.</p>
<h3>Stuff you are going to need&#8230;</h3>
<ul>
<li>Get <a href="http://angusj.com/resourcehacker/">Resource Hacker</a> &#8211; you will be editing core windows DLLs with this tool.</li>
<li>FreeDOS or Linux Live CD/DVD &#8211; you have to save the file to the original location when windows is not running. You must also know how to work in the Live OS &#8211; be it DOS or Linux.</li>
<li>Courage &#8211; As I said before, this hack is not for the faint of heart.</li>
</ul>
<h2>Lets Begin</h2>
<p>Install <a href="http://angusj.com/resourcehacker/">Resource Hacker</a>. </p>
<p>Make a backup of &#8216;<code>C:\WINDOWS\system32\browselc.dll</code>&#8216; and &#8216;<code>C:\WINDOWS\system32\Restore\filelist.xml</code>&#8216; before doing anything &#8211; just in case.</p>
<p>Go to <code>C:\WINDOWS\system32</code></p>
<p>Make sure that you are seeing all the files there&#8230;<br />
Tools -&gt; Folder Options -&gt; &#8216;View&#8217; Tab -&gt; Hidden Files and folders -&gt; Show hidden files and folders(must be checked)</p>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/01/show_hidden_files.png" alt="" title="Show Hidden Files in Windows" width="287" height="143" class="alignnone size-full wp-image-216" /></p>
<p>Refresh the folder and then find the file &#8216;<code>browselc.dll</code>&#8216;</p>
<p>Make a copy of that file in some other folder &#8211; say <code>C:/Hacks/</code></p>
<p>Now open Resource Hacker</p>
<p>Open the DLL file in Resource Hacker&#8230;<br />
File -&gt; Open -&gt; <code>C:/Hacks/browselc.dll</code></p>
<p>In the &#8216;Menu&#8217; find look through all sections to find a menu with the &#8216;File-&gt;Close&#8217; item. </p>
<p>It should be at Menu -&gt; 263 -&gt; 1033</p>
<p>Find the string<br />
<code>MENUITEM "&amp;Close", 40993, MFT_STRING, MFS_ENABLED</code></p>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/01/close_menu_number.png" alt="" title="Close Menu Item Number" width="500" height="270" class="alignnone size-full wp-image-217" /></p>
<p>In this <strong class="highlight">the number 40993 is what we want</strong>. Write the number down somewhere. <strong class="highlight">Think of it as the function that gets executed when that menu item is clicked</strong>. You can create a shortcut for any menu item by find out this number for that menu item. </p>
<p>Now we have to add a shortcut for this &#8216;function&#8217; &#8211; go to the &#8216;Accelerators&#8217; section &#8211; &#8216;Accelerators -&gt; 256 -&gt; 1033&#8242;. We found the menu at Menu -&gt; 263 -&gt; 1033 &#8211; so the Shortcut should be at Accelerators -&gt; 256 -&gt; 1033. See the pattern?</p>
<p>Find the line<br />
<code>VK_ESCAPE, 41498, NOINVERT, VIRTKEY</code></p>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/01/escape_key_line.png" alt="" title="Escape Key Line" width="500" height="139" class="alignnone size-full wp-image-218" /></p>
<p>Modify it to read<br />
<code>VK_ESCAPE, 40993, NOINVERT, VIRTKEY</code></p>
<p>I have changed the number to 40993 &#8211; the call for the &#8216;Close&#8217; action.</p>
<p>Now hit the &#8216;Compile Script&#8217; button on the top. If you have done it correctly, you should not get any errors.</p>
<p>Save the new version using File -&gt; Save</p>
<p>Congratulations, you have successfully created a new &#8216;Accelerator&#8217;(shortcut). Now the hard part &#8211; putting the file back into &#8216;C:\WINDOWS\system32&#8242;.</p>
<p>If you are on Windows XP, it monitors for changed files &#8211; so if we put the changed DLL file back, it will be reverted to the original file on the next boot. To get around it, follow the steps below&#8230;</p>
<p>Open up the file <code>C:\WINDOWS\system32\Restore\filelist.xml</code> in a editor like notepad</p>
<p>Find these lines&#8230;</p>
<pre><code class="xml">&lt;Exclude&gt;
	&lt;REC&gt;%windir%\system.ini&lt;/REC&gt;
	&lt;REC&gt;%windir%\tasks\desktop.ini&lt;/REC&gt;
	&lt;REC&gt;%windir%\win.ini&lt;/REC&gt;
	&lt;REC&gt;*:\AUTOEXEC.BAT&lt;/REC&gt;
	&lt;REC&gt;*:\CONFIG.MSI&lt;/REC&gt;
	&lt;REC&gt;*:\CONFIG.SYS&lt;/REC&gt;
&lt;/Exclude&gt;</code></pre>
<p>Add the line&#8230;<br />
&lt;REC&gt;%windir%\system32\browselc.dll&lt;/REC&gt;<br />
after the line &lt;REC&gt;*:\CONFIG.SYS&lt;/REC&gt;</p>
<p>After doing this you may not be able to save the file. Curse windows for a bit and continue.</p>
<p>Open up a DOS Shell and enter these commands in order&#8230;</p>
<pre><code class="batch">attrib -S -H C:\WINDOWS\system32\Restore\filelist.xml
attrib -R C:\WINDOWS\system32\Restore\filelist.xml</code></pre>
<p>Now you will be able to save this file &#8211; do so.</p>
<h2>Replace Original <code>browselc.dll</code> with Modified Version</h2>
<p>The next thing to do is replace the original browselc.dll file with our hacked version. This cannot be done when windows is running. It must be done when windows is down &#8211; that&#8217;s where FreeDOS CD or Linux Live CDs comes in.</p>
<h4>FreeDOS</h4>
<p>If you have FreeDOS CD, boot into that as the LiveCD(I hope you know how to do this &#8211; basically, you <strong class="highlight">put in the CD, reboot the system, change the setting in the BIOS to make the CD the primary boot device and boot into the CD</strong>. Needless to say, you need a bootable CD for this to work.)</p>
<p>After you have booted into DOS, execute the command&#8230;<br />
<code>copy C:\Hacks\browselc.dll C:\Windows\system32\browselc.dll</code></p>
<p>Now remove the FreeDOS CD, reboot back into windows.</p>
<h4>Linux</h4>
<p>If you have a live Linux CD, pop it in and boot into that. Now mount the partition that&#8217;s the C partition in windows(usually sda1 or hda1). Then all you have to do is <strong class="highlight">copy the modified DLL file from the &#8216;Hacks&#8217; folder to &#8216;Windows\system32\&#8217; folder</strong> in that partition using the File manager for that distribution.</p>
<p>Once that is done, you reboot into windows.</p>
<h3>All Done</h3>
<p>Finally, its all over. All you have to do is <strong class="highlight">open up a folder &#8211; and press the Escape key. If all went well, the explorer application will be closed</strong>.</p>
<p>This is a rather complicated way to do a rather simple thing &#8211; you set custom shortcuts easily using tools like <a href="http://www.autohotkey.com/">AutoHotKey</a> and setting up macros. But by doing it my way, you will learn a method to peek into exe and dll files. And if you are a programmer like me &#8211; it will give you hours of entertainment. I have actually found left over stuff from Windows 3.1 in Windows XP DLLs &#8211; but that&#8217;s a post for another time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/01/windows-hacks-the-escape/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>3 Windows Speed Tips from a Linux User</title>
		<link>http://www.bin-co.com/blog/2009/01/3-windows-speed-tips-from-linux-user/</link>
		<comments>http://www.bin-co.com/blog/2009/01/3-windows-speed-tips-from-linux-user/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 17:18:33 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[98]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tweak]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=212</guid>
		<description><![CDATA[Most of my regular readers know that <strong class="highlight">I do most of my work in <a href="http://lindesk.com/">Linux</a>. After all, my development platform is LAMP(L being Linux)</strong>. But it was not always so - <strong class="highlight">I used to be on Windows</strong>(in a period now referred to as the dark ages). Being a power user, I found a lot of tweaks on Windows. But I never managed to share them on any of my blogs - because I started almost all of them after I moved to Linux. So here is three tips on how to make Windows a bit better(or at least less painful).]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/01/windows_logo.jpg" alt="" title="Windows Logo" width="119" height="106" class="alignnone size-full wp-image-213 intro" align="right" /></p>
<p class="intro">Most of my regular readers know that <strong class="highlight">I do most of my work in <a href="http://lindesk.com/">Linux</a>. After all, my development platform is LAMP(L being Linux)</strong>. But it was not always so &#8211; <strong class="highlight">I used to be on Windows</strong>(in a period now referred to as the dark ages). Being a power user, I found a lot of tweaks on Windows. But I never managed to share them on any of my blogs &#8211; because I started almost all of them after I moved to Linux. So here is three tips on how to make Windows a bit better(or at least less painful).</p>
<p>I started on Windows 95 &#8211; my first computer(400 MHz, 32 MB RAM, 4 GB HDD) had it pre-installed. That was my introduction to computers. But soon I migrated to Windows 98. I have very fond memories of that OS &#8211; Windows 98 is my favorite OS in the windows family. As a matter of fact, even now, my systems have that green background of Windows 98. I moved to Linux(Fedora Core 1) after that. So most of the tips shared here was tested on Windows 98 &#8211; but I am sure it still applies to the later versions as well. I don&#8217;t use these tricks anymore(I don&#8217;t use Windows that much now) &#8211; so I wanted document them before I forget them.</p>
<p>Being a speed junkie &#8211; and having a 32 MB RAM &#8211; made me optimize my system a lot. I found most of the tips below with a lot of trial and error(we did not have the internet back then &#8211; why do you think I call it the dark ages?). Anyway, here are my top 3 tips to make your windows a little better&#8230;</p>
<h2>Speed Up Explorer.exe</h2>
<p>You can <strong class="highlight">speed up the time taken to show a folder contents</strong> using this trick&#8230;</p>
<ul>
<li>Open a folder in Explorer</li>
<li>Choose Tools &gt; Folder Options</li>
<li>Select the &#8216;Use Windows classic folders&#8217; in the Tasks section</li>
<li>Press OK.</li>
</ul>
<p>This will get rid of the &#8216;Common Tasks&#8217; to the left of the explorer. Now try browsing for files &#8211; you will notice a considerable difference in speed.</p>
<h2>Startup Optimization</h2>
<p>You might already know this tip if you are a &#8216;Power User&#8217; &#8211; msconfig. To <strong class="highlight">make your system more responsive and consume less memory</strong>, you can remove unwanted tasks from startup&#8230;</p>
<ul>
<li>Go to Start &gt; Run.</li>
<li>Type in &#8216;msconfig&#8217; without the quotes</li>
<li>Go to the Startup tab</li>
<li>Unselect the application that you know you don&#8217;t need. </li>
<li>Press OK &#8211; you don&#8217;t have to restart.</li>
</ul>
<p>The deactivated apps will not start from the next boot. In some cases, this will really speed up your system.</p>
<h2>Replace Default File Viewers</h2>
<p><strong class="highlight">Notepad should be replaced with <a href="http://www.liquidninja.com/metapad/">Metapad Lite</a></strong>. Not Notepad++ or other &#8216;Advanced Editors&#8217; &#8211; they take half a second to load. Metapad Lite is much faster &#8211; as fast as notepad &#8211; but with more features.</p>
<p>Use <strong class="highlight">Irfan View as your default Image viewer</strong>. I am sure most of you guys are doing this already.</p>
<p><strong class="highlight">Replace Internet Explorer with Firefox</strong>. You will not see a immediate speed improvement. But in the long run, Firefox will prevent many virus from getting access to your system &#8211; giving you a stabler, faster system.</p>
<p><a href="http://www.foobar2000.org/">Foobar2000</a> is a better and faster audio player than default audio player provided by Windows. But then again, do anyone use Windows Media Player?</p>
<p>If you are a programmer I would recommend <strong class="highlight"><a href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a> &#8211; as an editor</strong> &#8211; not as a Notepad replacement.</p>
<h2>Other Tweaks</h2>
<p>There are many other tweaks as well &#8211; but most of them are obsolete due to faster machines and newer OSes. Some of them include&#8230;</p>
<ul>
<li>Disabling Wallpaper/Screensaver</li>
<li>Use <a href="http://www.x-setup.net/">XSetup</a> to optimize hidden settings</li>
<li>Using a better terminal than Command Prompt</li>
<li>Disabling the &#8216;Effects&#8217; &#8211; Fade effects, Menu Shadow, etc.</li>
<li>Disabling File Indexing</li>
<li>Disabling HDD Paging(Virtual Memory)</li>
<li>And more&#8230;</li>
</ul>
<p>In my next post, I will introduce you to my great Windows Hack &#8211; &#8216;The Escape&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/01/3-windows-speed-tips-from-linux-user/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Installing lighttpd Web Server in Linux with PHP and MySQL</title>
		<link>http://www.bin-co.com/blog/2008/11/installing-lighttpd-web-server-in-linux-with-php-and-mysql/</link>
		<comments>http://www.bin-co.com/blog/2008/11/installing-lighttpd-web-server-in-linux-with-php-and-mysql/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 17:48:21 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=161</guid>
		<description><![CDATA[After <a href="http://www.bin-co.com/blog/2008/09/installing-lampapache-web-serverphpmysql-in-debian/" title="Installing LAMP(Apache Web Server/PHP/MySQL) in Debian">two articles</a> on <a href="http://www.bin-co.com/blog/2008/09/compile-install-lamp-linux-apache-mysql-php-server-from-source/" title="Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source">installing Apache</a>, lets take a look at <strong class="highlight">installing and configuring lighttpd web server on a linux system</strong>. <a href="http://www.lighttpd.net/">lighttpd</a> (pronounced "lighty") is a web server designed to be secure, fast, standards-compliant and flexible while having a low memory footprint.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/11/lighttpd_logo.png" alt="lighttpd Web Server" title="Lighttpd Logo" width="200" height="197" class="alignnone size-full wp-image-160 intro" align="right" /></p>
<p class="intro">After <a href="http://www.bin-co.com/blog/2008/09/installing-lampapache-web-serverphpmysql-in-debian/" title="Installing LAMP(Apache Web Server/PHP/MySQL) in Debian">two articles</a> on <a href="http://www.bin-co.com/blog/2008/09/compile-install-lamp-linux-apache-mysql-php-server-from-source/" title="Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source">installing Apache</a>, lets take a look at <strong class="highlight">installing and configuring lighttpd web server on a linux system</strong>. <a href="http://www.lighttpd.net/">lighttpd</a> (pronounced &#8220;lighty&#8221;) is a web server designed to be secure, fast, standards-compliant and flexible while having a low memory footprint.</p>
<p>Before installation, a few points to remember. These <strong class="highlight">instruction are not for a production environment &#8211; this is for a development environment</strong>. To install the software, <strong class="highlight">you need root access</strong>. You can get that using this command&#8230;</p>
<pre><code class="cli">su -
[Enter root password]</code></pre>
<p>or by prefixing &#8216;<code>sudo</code>&#8216; before each command.</p>
<h2>Installing the Server</h2>
<p>First install lighttpd and PHP &#8211; use your distro&#8217;s package management(yum, apt-get) system to do this.</p>
<h3>Install lighttpd</h3>
<p>You can use this command in Red Hat based systems(Fedora, Cent OS, etc.) to install lighttpd. Debian/Ubuntu systems might the same package name &#8211; could someone post the package name of lighttpd in the comments?</p>
<pre><code class="cli">yum install lighttpd lighttpd-fastcgi</code></pre>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/php-logo.png" alt="PHP Logo" title="PHP Logo" width="179" height="98" class="alignnone size-full wp-image-123" align="right" /></p>
<h3>Install PHP</h3>
<p>If you don&#8217;t have PHP, you can install it using the command&#8230;</p>
<pre><code class="cli">yum install php php-cli php-common</code></pre>
<p>In Debian/Ubuntu systems, the command is&#8230;</p>
<pre><code class="cli">apt-get install php5-cli php5-common php5-cgi</code></pre>
<p>You can make sure you have php-cgi(needed for working with lighttpd) by running this command&#8230;</p>
<pre><code class="cli">php-cgi -v</code></pre>
<h3>Installing MySQL</h3>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/mysql_logo.gif" alt="" title="MySQL Logo" width="150" height="98" class="alignnone size-full wp-image-127" align="right" /></p>
<p>If MySQL is not yet installed, use this command to install it&#8230;</p>
<pre><code class="cli">yum install mysql-server php-mysql mysql mysql-libs</code></pre>
<p>Debian/Ubuntu Command&#8230;</p>
<pre><code class="cli">apt-get install mysql-client mysql-common mysql-server php5-mysql</code></pre>
<h2>Configuring lighttpd</h2>
<p>lighttpd configuration is done by <strong class="highlight">editing the text file &#8216;/etc/lighttpd/lighttpd.conf&#8217;.</strong></p>
<p><strong class="highlight">Enable some lighttpd modules</strong> by removing the comment character(#) from the beginning of the line. I have enabled the following modules&#8230;</p>
<pre><code class="conf">server.modules              = (
                                "mod_rewrite",
                                "mod_redirect",
                                "mod_access",
                                "mod_fastcgi",
                                "mod_accesslog" )
</code></pre>
<p><strong class="highlight">Configure lighttpd&#8217;s document root</strong> &#8211; if you already have Apache, I would recommend using the same document root as Apache(applicable for development servers only). </p>
<pre><code class="conf">server.document-root        = "/var/www/"</code></pre>
<p>I find it helpful to <strong class="highlight">enable folder listing</strong> in my server.</p>
<pre><code class="conf">## virtual directory listings
dir-listing.activate       = "enable"</code></pre>
<h3>Turn On FastCGI PHP Support</h3>
<p>Now, make sure lighttpd works with PHP &#8211; first get the path of php-cgi using the command..</p>
<pre><code class="cli">$ whereis php-cgi
php-cgi: /usr/bin/php-cgi #Might be different on your system.</code></pre>
<p>Then <strong class="highlight">add the path to the configuration file</strong> of lighttpd&#8230;</p>
<pre><code class="conf">#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "socket" => "/tmp/php.socket",
                                   <strong class="highlight">"bin-path" => "/usr/bin/php-cgi"</strong>
                                 )
                               )
                            )</code></pre>
<p>Make sure you <strong class="highlight">uncomment the above lines</strong> by removing the &#8216;#&#8217; characters.</p>
<p>After you are done, <strong class="highlight">save the file</strong>. Time to try out the server.</p>
<h2>Starting the lighttpd Server</h2>
<p>First stop Apache if it is running&#8230;</p>
<pre><code class="cli">/etc/init.d/httpd stop</code></pre>
<p>Now start lighttpd using the command</p>
<pre><code class="cli">/etc/init.d/lighttpd start</code></pre>
<p>Go to your document root(<code>/var/www</code>) and <strong class="highlight">create a php files called &#8216;info.php&#8217; and put this code</strong> inside it&#8230;</p>
<pre><code class="php">&lt;?php
php<!-- wordpress bug workaround -->Info();</code></pre>
<p>Now fire up a browser and <strong class="highlight">go to <a href="http://localhost/" title="Might not work if the preceding instructions where not followed">localhost</a></strong> &#8211; you should see a file listing page with a ‘info.php’ in the list. Click on that link &#8211; if you see a PHP information page, your web server is setup correctly.</p>
<p>To make sure MySQL-PHP connection is working, <a href="http://www.bin-co.com/database/clients/phpmyadmin/installing_phpmyadmin.php" title="Installing phpMyAdmin 2.8">install phpMyAdmin</a> &#8211; or write a database connection script &#8211; whatever is easier for you.</p>
<h2>Related Links</h2>
<ul>
<li><a href="http://www.lighttpd.net/">lighttpd fly light</a></li>
<li><a href="http://en.wikipedia.org/wiki/Lighttpd">lighttpd &#8211; Wikipedia</a></li>
<li><a href="http://cssgallery.info/lighttpd-install-perl-mysql-support-in-chrooted-jail/">Lighttpd install perl, mysql support in chrooted jail</a></li>
<li><a href="http://www.cyberciti.biz/tips/lighttpd-php-fastcgi-configuration.html">Lighttpd PHP fastcgi configuration</a></li>
<li><a href="http://www.cyberciti.biz/tips/howto-install-lighttpd-on-freebsd.html">FreeBSD Install Lighttpd Web Server</a></li>
<li><a href="http://fandar-it.com/content/view/35/32/">Install lighttpd with php</a></li>
<li><a href="http://wiki.vpslink.com/Install_and_Configure_lighttpd">Install and Configure lighttpd</a></li>
<li><a href="http://www.howtoforge.com/lighttpd_php5_mysql_fedora7">Installing Lighttpd With PHP5 And MySQL Support On Fedora 7</a></li>
</ul>
<p><strong class="highlight">Shameless Plug</strong>: If you are a Linux user, you may want to check out my <a href="http://lindesk.com/" title="Lindesk - Linux on the Desktop">Linux Blog &#8211; LinDesk</a> &#8211; its about Linux on the Desktop &#8211; Articles, Application Reviews and Tutorials about many aspects of Linux included configuration and scripting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/11/installing-lighttpd-web-server-in-linux-with-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello Script for C Language</title>
		<link>http://www.bin-co.com/blog/2008/07/hello-script-for-c-language/</link>
		<comments>http://www.bin-co.com/blog/2008/07/hello-script-for-c-language/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 17:41:49 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[scirpt]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=116</guid>
		<description><![CDATA[C &#8211; the root of all modern language&#8217;s syntax. Here is the hello script for C. A &#8216;Hello Script&#8216; is a file that contains the most commonly used elements of a programming language so that it can be used as a cheat sheet when working with that language. C is a general-purpose, block structured, procedural, [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">C &#8211; the root of all modern language&#8217;s syntax. Here is the hello script for C. A &#8216;<a href="http://www.bin-co.com/blog/2008/03/learning-a-new-programming-language-the-hello-world-method/">Hello Script</a>&#8216; is a file that contains the most commonly used elements of a programming language so that it can be used as a cheat sheet when working with that language.</p>
<blockquote><p>C is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie. Although C was designed for implementing system software, it is also widely used for applications. It is widely used on a great many different software platforms and computer architectures, and several popular compilers exist.</p>
<p><a href="http://en.wikipedia.org/wiki/C_(programming_language)">Wikipedia</a></p></blockquote>
<p>Unfortunately, I am not an expert in C &#8211; I prefer dynamic languages over static ones. So if you find any problems in the script, please let me know in the comments.</p>
<pre><code class="c">
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

// Function declaration
void hello(char name[]) {
 	char result[50] = "Hello, ";
 	strcat(result, name);
 	printf("%s\n", result);
}

int main() {
	int i;
	// Printing(IO)
	printf("Hello World!\n");

	// Variables, concatenation
	char name[] = "Binny";
	int year = 2008;
	printf("Hello, %s - welcome to %d\n", name, year);

	//If, else
	if (year &gt; 2008) {
		printf("Welcome to the future - yes, we have flying cars!");
	}
	else if(year &lt; 2008) {
		printf("The past - please don't change anything. Don't step on any butterflies. And for the sake of all that's good and holy, stay away from your parents!");
	}
	else {
		printf("Anything wrong with your time machine? You have not gone anywhere, kiddo.");
	}
	printf("\n");

	// For loop
	for(i=0; i&lt;3; i++) {
		printf("%d) Hi there!\n", i);
	}

 	//Numerical Array, while
 	char rules[3][20]; //I am sure there is a better way of doing this using poiters. If you know, please leave a few 'pointers' in the comment.
 	strcpy(rules[0], "Do no harm");
 	strcpy(rules[1], "Obey");
 	strcpy(rules[2], "Continue Living");
 	i=0;
	while(i&lt;3) {
		printf("Rule %d : %s\n", i+1, rules[i]);
		i++;
	}

	// Struct - nearest thing C has to an associated array
	struct structure {
		char hello[20];
		int number;
		char foo[20];
	} associated, new_associated;
	strcpy(associated.hello, "world");
	associated.number = 1337;
	strcpy(associated.foo, "bar");
	printf("hello: %s\n", associated.hello);
	printf("number: %d\n", associated.number);
	printf("foo: %s\n", associated.foo);

	// Function calling
	hello("John Oldman");

	// Writing to a file
 	FILE *out;
 	out = fop<!-- fix wordpress bug -->en("/tmp/Hello.txt", "w");
 	char *str = "Hello From C";
 	fputs(str, out);
 	fclose(out);

	// Reading and displaying a file.
	FILE *in;
	in = fop<!-- fix wordpress bug -->en("Hello.c", "r");
	if (in) {
		while (!feof(in))
			printf("%c",fgetc(in));
	}
	fclose(in);

	// Run a system command.
	sys<!-- fix wordpress bug -->tem("ls");

	return 1;
}
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/07/hello-script-for-c-language/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hello Script for Java</title>
		<link>http://www.bin-co.com/blog/2008/06/hello-script-for-java/</link>
		<comments>http://www.bin-co.com/blog/2008/06/hello-script-for-java/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 18:24:01 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=111</guid>
		<description><![CDATA[After the Hello Script for JavaScript, here is the Hello Script for Java. &#8216;Hello Script&#8217; is a file that contains the most commonly used elements of a programming language so that it can be used as a cheat sheet when working with that language. Warning: I am NOT an expert in Java &#8211; I am [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/06/java-logo.png" alt="" title="Java Logo" width="125" height="217" class="size-full wp-image-112 intro" align="right" /></p>
<p class="intro">After the <a href="http://www.bin-co.com/blog/2008/05/hello-script-for-javascript/">Hello Script for JavaScript</a>, here is the Hello Script for Java. <strong class="highlight">&#8216;Hello Script&#8217; is a file that contains the most commonly used elements of a programming language so that it can be used as a cheat sheet</strong> when working with that language.</p>
<p>Warning: I am NOT an expert in Java &#8211; I am just a beginner. There <strikeout>may</strikeout> will be errors(bad programming methods &#8211; not compiler errors) in the following script. If you notice any such issues, please point them out in the comments.</p>
<h2>Code</h2>
<p>If you want to run the code, save it to a file named &#8216;Hello.java&#8217; and compile in using the command &#8216;javac Hello.java&#8217;. After that you can run the code using the command &#8216;java Hello&#8217;.</p>
<pre><code class="java">
import java.io.*;
import java.util.regex.*;

public class Hello {
	public static void main(String[] Args) {
		// Printing(IO)
		System.out.println("Hello World");

		// Variables, concatenation
		String name = "Binny";
		int year = 2008;

		System.out.println("Hello, " + name + " - welcome to " + year);

		if(year &gt; 2008) {
			System.out.println("Welcome to the future - yes, we have flying cars!");
		} else if(year &lt; 2008) {
			System.out.println("The past - please don't change anything. Don't step on any butterflies. And for the sake of all that's good and holy, stay away from your parents!");
		} else {
			System.out.println("Anything wrong with your time machine? You have not gone anywhere, kiddo.");
		}

		// For loop
		int i=0;
		for(i=0; i&lt;3; i++) {
			System.out.println(i + ") Hi there!");
		}

		//Numerical Array, While
		String rules[] = {"Do no harm", "Obey", "Continue Living"};
		i = 0;
		while(i&lt;rules.length) {
			System.out.println("Rule " + (i+1) + " : " + rules[i]);
			i++;
		}

		// Associated array, foreach
		// Hmm - does Java have Associated arrays? ArrayList?

		String csv_string = "hello,world,how,are,you";
		String csv_values[] = csv_string.split(",");
		// No native Join method

		// Function, argument, return, call
		System.out.println(Hello.hello("Binny")); //The function definition is at the end of this file.	

		//Class stuff...
		Movie ncfom = new Movie("New Country for Old Men"); //It's a sequel!
		ncfom.printMovieDetails();

		// File IO
		// File reading, easy method...
		try {
			File read_file = new File ("/tmp/Hello.txt");
			FileReader in_stream = new FileReader(read_file); // Create a Character Input Stream
			BufferedReader in = new BufferedReader(in_stream);// Filter the Input Stream - buffers characters for efficiency
			try {
				System.out.println(in.readLine()); // read the first line
			} catch(IOException E) {
				System.out.println("No idea what went wrong. Sorry!");
			}
		} catch(FileNotFoundException E) {
			System.out.println("File not found. Sorry!");
		}

		try {
			// Writing to a file
			File out_file = new File("/tmp/HelloJava.txt");
			FileOutputStream out_stream = new FileOutputStream(out_file); // Create an Output Stream
			PrintWriter out = new PrintWriter(out_stream); // Filter bytes to ASCII
			out.println("Hello, from Java"); // Here we actually write to file
		} catch(java.io.FileNotFoundException E) {
			System.out.println("File not found. Sorry!");
		}

		System.out.println("\nLS command results...");
		// Command Executing
		try {
			// Execute a command
			String command = "ls";
			Process child = Runtime.getRuntime().exec (command);

			// Read from an input stream
			InputStream in = child.getInputStream();
			int c;
			while ((c = in.read()) != -1) {
				System.out.print((char)c);
			}
			in.close();
		} catch (IOException e) {
			System.out.println("Error");
		}

		System.out.print("\n");
		//Regular Expression
		String str = new String("Hello World");

		//Find a pattern
		Pattern hell_check = Pattern.compile("^Hell");
		Matcher matches = hell_check.matcher(str);
		if(matches.find()) System.out.println("Yup - its evil");

		//Replace
		System.out.println(str.replaceAll("l([^l])", "$1")); //Remove an 'l' from both words. Should print 'Helo Word'

	}

	//Function declaration.
	private static String hello(String name) {
		return "Hello, " + name;
	}

	// One for the OOP fanboys - Class, members, object and stuff.
	private static class Movie {
		public String name = "";
		public int rating = 0;

		public Movie(String name) {
			this.name = name;
			this.rateMovie();
		}

		public void rateMovie() {
			this.rating = (this.name.length() % 10) + 1; //IMDBs rating algorithm. True story!
		}

		public void printMovieDetails() {
			System.out.println("Movie  : " + this.name);
			System.out.println("Rating : " + this.rating);
		}
	}
}
</code></pre>
<p>Next Hello Script &#8211; C</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/06/hello-script-for-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

