<?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>nStation &#187; how-to</title>
	<atom:link href="http://nstation.org/tag/how-to/feed" rel="self" type="application/rss+xml" />
	<link>http://nstation.org</link>
	<description>Online existence, portfolio and journal of Nadeeshyama Talagala.</description>
	<lastBuildDate>Tue, 31 Aug 2010 17:56:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to Manage Multiple Web Projects With Subdomains</title>
		<link>http://nstation.org/articles/how-to-manage-multiple-web-projects-with-subdomains</link>
		<comments>http://nstation.org/articles/how-to-manage-multiple-web-projects-with-subdomains#comments</comments>
		<pubDate>Sat, 22 Nov 2008 20:55:28 +0000</pubDate>
		<dc:creator>Nadee</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[XAMPP]]></category>

		<guid isPermaLink="false">http://n.talagala.org/?p=331</guid>
		<description><![CDATA[Most web projects are initially done locally. When doing multiple web projects on the local computer (the ‘nstation&#8217;) you run in to the problem of managing them. This is because only one web server can run at a time on the standard web port. Well&#8230; you can run multiple instances of the same web server...]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://i46.tinypic.com/13zdeet.png" title="XAMPP Control Panel Screenshot" class="alignleft top framed" width="400" height="154" />Most web projects are initially done locally. When doing multiple web projects on the local computer (the ‘nstation&#8217;) you run in to the problem of managing them. This is because only one web server can run at a time on the standard web port. Well&#8230; you can run multiple instances of the same web server on different ports. But that&#8217;s not the way forward if you are serious about testing, etc. An alternative is to make directories and use folder names as part of the URL. This however results ugly URL names like <em>nstation/project_name</em> and framework-based projects render issues on production environments.<span id="more-331"></span></p>
<p>The best approach I have come across to manage multiple web projects is to use subdomains. Subdomains are pretty, clean and easy to manage. This how-to article is about my simple and effective method of hosting multiple web projects on nstation using subdomains. We will create two projects ‘foo&#8217; and ‘bar&#8217; with <strong>http://foo.nstation/</strong> and <strong>http://bar.nstation/</strong> as their URLs to explain the whole process. Please note that the technique described here is based on the Microsoft Windows platform. However, it is possible to do the same on other platforms with minor adjustments.</p>
<div class="clear">&nbsp;</div>
<h2>Prerequisites</h2>
<ul>
<li><a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> or a compatible web server software<br />
<small>More info: <a href="http://www.apachefriends.org/en/xampp.html">What is XAMPP</a>, <a href="http://www.apachefriends.org/en/faq-xampp-windows.html">XAMPP FAQ</a></small></li>
<li>Notepad or compatible text editor<br />
<small>Hint: drag-and-drop a file onto a Notepad window to open the file.</small></li>
</ul>
<h2>Step 1 &#8211; create folders</h2>
<p>Create the folder structure as shown below.</p>
<p><img alt="" src="http://i47.tinypic.com/kcgg07.png" title="Folders" class="alignnone" width="214" height="335" /></p>
<p>It doesn&#8217;t have to be the <strong>C: drive</strong>. But for simplicity it is always recommended that you create the <strong>Webroot</strong> folder in a drive root. Refrain from using path names with spaces like <strong>C:\Program Files\Webroot</strong>.</p>
<p>A short description on each folder is given below.</p>
<h3>Webroot\projects</h3>
<p>This folder contains individual project folders. In our case the two sub folders <strong>foo</strong> and <strong>bar </strong>reside here.</p>
<h3>Webroot\public</h3>
<p>This is where you put all the default stuff. For example, you can copy the Apache <strong>htdocs</strong> folder content here. This folder hosts the main site (<strong>http://nstation</strong>) content.</p>
<h3>Webroot\xampp</h3>
<p>Contains XAMPP files &#8211; Apache, PHP, MySql, phpMyAdmin, perl and other server related components are stored here.</p>
<h2>Step 2 &#8211; install XAMPP</h2>
<p>Install XAMPP on <strong>Webroot\xampp</strong> folder. I recommend you use the <a href="http://www.apachefriends.org/download.php?xampp-win32-1.6.8.exe">self-extracting 7-ZIP archive</a>. Run the setup and chose <strong>C:\Webroot</strong> as the <em>Extract to</em> folder as it will anyway extract the content to a folder by the name <strong>xampp</strong>.</p>
<p><img alt="" src="http://i48.tinypic.com/2vdjz4m.png" title="XAMPP Install" class="alignnone" width="348" height="159" /></p>
<p>Run <strong>setup_xampp.bat</strong> to finish the setup process. You will get a console output similar to the following screenshot.</p>
<p><img alt="" src="http://i50.tinypic.com/v63lhu.png" title="XAMPP Setup" class="alignnone" width="559" height="290" /></p>
<p>Press any key to finish the setup. To run the XAMPP Control Panel Application, double click <strong>xampp-control.exe</strong>. Click the start button in front of both <strong>Apache</strong> and <strong>MySql</strong> modules to start the server. Since we haven&#8217;t done any modifications yet, XAMPP runs on its default settings. See screenshot below.</p>
<p><img alt="" src="http://i50.tinypic.com/33xcvo0.png" title="XAMPP Control Panel" class="alignnone" width="446" height="359" /></p>
<h2>Step 3 &#8211; configure Apache</h2>
<p>Now we need to change the default Apache configuration to match the directory structure. Apache configuration is distributed among several text files. All of these files reside in the <strong>xampp\apache\conf</strong> folder. We need to edit two files: <strong>conf\httpd.conf</strong> and <strong>conf\extra\httpd-vhosts.conf</strong>.</p>
<h3>Step 3.1 &#8211; edit httpd.conf</h3>
<p>Go to <strong>xampp\apache\conf</strong> and open the <strong>httpd.conf</strong> file. Locate <strong>&lt;Directory &#8220;C:/Webroot/xampp/htdocs&#8221;&gt;</strong> and change it to <strong>&lt;Directory &#8220;C:/Webroot/public&#8221;&gt;</strong> . Scroll down a few lines and locate the closing directive <strong>&lt;/Directory&gt;</strong> and add the following at a new line.</p>
<pre class="code">
&lt;Directory "C:/Webroot/projects"&gt;
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
&lt;/Directory&gt;
</pre>
<h3>Step 3.2 &#8211; edit httpd-vhosts.conf</h3>
<p>Go to <strong>xampp\apache\conf\extra</strong> and open the <strong>httpd-vhosts.conf</strong> file. Uncomment <strong>NameVirtualHost *:80</strong> by removing all hash signs (#) at the beginning of the line. (By now you would have noticed that any line starting with a hash sign is indeed a comment.)</p>
<p>Add the following text at the end of the file on a new line.</p>
<pre class="code">
# Default site: http://nstation
&lt;VirtualHost *:80&gt;
DocumentRoot "C:/Webroot/public"
ServerName nstation
ServerAlias nstation
&lt;/VirtualHost&gt;

# Foo sub domain: http://foo.nstation
&lt;VirtualHost *:80&gt;
ServerName foo.nstation
DocumentRoot "C:/Webroot/projects/foo"
DirectoryIndex index.php index.html index.html index.htm index.shtml
&lt;/VirtualHost&gt;

# Bar sub domain: http://bar.nstation
&lt;VirtualHost *:80&gt;
ServerName bar.nstation
DocumentRoot "C:/Webroot/projects/bar"
DirectoryIndex index.php index.html index.html index.htm index.shtml
&lt;/VirtualHost&gt;
</pre>
<h2>Step 4 &#8211; edit the hosts file</h2>
<p>The host file is the system file that matches hostnames to IPs. This file resides in the system folder <strong>%SystemRoot%\system32\drivers\etc</strong> and on most computers this would be <strong>C:\WINDOWS\system32\drivers\etc</strong>. Open the <strong>hosts</strong> file (yes, the file doesn&#8217;t have an extension) and add the following two lines to the end of the file at a new line.</p>
<pre class="code">
127.0.0.1              foo.nstation
127.0.0.1              bar.nstation
</pre>
<p>This tells the system to direct requests for <strong>foo.nstation</strong> and <strong>bar.nstation</strong> to the IP address <strong>127.0.0.1</strong>.</p>
<h2>Step 5 &#8211; test the setup</h2>
<p>Restart Apache and MySql by stopping and starting them using the XAMPP Control Panel. If you did not run these in step 2, just start both modules to see whether our configuration is in effect. If everything went accordingly, you should get the green <strong>Running </strong>status on both Apache and MySql.</p>
<p>Point your web browser to <strong>http://nstation</strong> to see the content served on <strong>Webroot\public</strong> folder. If you have nothing to start with, I suggest you copy everything in <strong>xampp\apache\htdocs</strong> folder to this location. You should get the XAMPP default web site with all the bells and whistles.</p>
<p>Put your <strong>Foo</strong> project files to <strong>Webroot\projects\foo</strong> folder and <strong>Bar</strong> project files to <strong>Webroot\projects\bar</strong> folders respectively. Point your browser to <strong>http://foo.nstation</strong> and <strong>http://bar.nstation</strong> to see them in action. Put the following code in an <strong>index.php</strong> file and save the file in both locations if you have nothing to start with.</p>
<pre class="code">
&lt;h1&gt;Hello World&lt;/h1&gt;
&lt;p&gt;&lt;?php echo "My location: " . dirname(__FILE__); ?&gt;&lt;/p&gt;
</pre>
<p>You should get different location details depending on the URL.</p>
<h2>Add more projects (optional)</h2>
<p>Follow step 3.2 and step 4 to add more projects to your setup. Given below are the skeletons that can be used for this task.</p>
<h3>Step 3.2 &#8211; httpd-vhosts.conf file entry</h3>
<pre class="code">
# vhost entry for new_project sub domain: http://new_project.nstation
&lt;VirtualHost *:80&gt;
ServerName new_project.nstation
DocumentRoot "C:/Webroot/projects/new_project"
DirectoryIndex index.php index.html index.html index.htm index.shtml
&lt;/VirtualHost&gt;
</pre>
<h3>Step 4 &#8211; hosts file entry</h3>
<pre class="code">
127.0.0.1              new_project.nstation
</pre>
<h2>Done</h2>
<p>That&#8217;s it. It&#8217;s easier than you would&#8217;ve imagined it to be. Hope this article helps and makes your web development experience a fun.</p>
<p><b>Disclaimer</b>: <a href="http://www.flickr.com/photos/normanbleventhalmapcenter/2710799656/">Cover photo</a> courtesy <a href="http://www.flickr.com/photos/normanbleventhalmapcenter/2710799656/">Norman B. Leventhal Map Center at the BPL</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nstation.org/articles/how-to-manage-multiple-web-projects-with-subdomains/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Syndicate Your Gmail Inbox</title>
		<link>http://nstation.org/blog/syndicate-your-gmail-inbox</link>
		<comments>http://nstation.org/blog/syndicate-your-gmail-inbox#comments</comments>
		<pubDate>Fri, 26 Oct 2007 08:07:06 +0000</pubDate>
		<dc:creator>Nadee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://n.talagala.org/2007/10/26/syndicate-your-gmail-inbox/</guid>
		<description><![CDATA[Last week Engadget, TechCrunch and many other tech sites reported Gmail going IMAP. That’s a big deal for anyone who prefers to have control over their email messages. But for a long time the Gmail inbox was available as an RSS feed. Several people blogged about this feature on their sites soon after discovering it....]]></description>
			<content:encoded><![CDATA[<p><img src="http://mail.google.com/mail/help/images/logo1.gif" title="Gmail Logo" alt="Gmail Logo" align="left" height="59" width="143" />Last week <a href="http://www.engadgetmobile.com/2007/10/24/gmail-goes-imap-finally-your-mobile-email-client-and-gmail-fall-i/" title="Yeah, Gmail does IMAP, it's on Mobile">Engadget</a>, <a href="http://www.techcrunch.com/2007/10/23/gmail-apparently-enabling-imap-support/" title="Gmail Apparently Enabling IMAP Support">TechCrunch</a> and many other tech sites reported <a href="http://www.gmail.com/" title="Gmail">Gmail</a> going <a href="http://www.imap.org/about/whatisIMAP.html" title="What is IMAP?"><abbr title="Internet Message Access Protocol">IMAP</abbr></a>. That’s a big deal for anyone who prefers to have control over their email messages. But for a long time the Gmail inbox was available as an <a href="http://en.wikipedia.org/wiki/RSS_(file_format)" title="RSS on Wikipedia"><abbr title="Really Simple Syndication">RSS</abbr></a> feed. Several people <a href="http://forevergeek.com/geek_resources/gmail_rss_feed.php" title="Gmail RSS Feed">blogged</a> about this feature on their sites soon after discovering it. But now you don’t have to follow the old School method of manifesting credentials on the RSS <abbr title="Unique Resource Identifier">URI</abbr> anymore. It’s as easy as subscribing to any other RSS feed out there. All you need in an RSS aware web browser and an email client. Here’s how to do it.<span id="more-31"></span></p>
<ol>
<li>Log on to your Gmail account.</li>
<li>An RSS icon appears on the address bar. (This screenshot is given in Mozilla Thunderbird)<br />
<img src="http://n.talagala.org/wp-content/uploads/2007/10/gmail_rss_sshot1.gif" alt="Gmail RSS Step 2" /></li>
<li>Select ‘Add Gmail Atom Feed as Live Bookmark’ from the context menu.<br />
<img src="http://n.talagala.org/wp-content/uploads/2007/10/gmail_rss_sshot2.gif" alt="Gmail RSS Step 3" /></li>
<li>Copy the URL from the address bar.<br />
<img src="http://n.talagala.org/wp-content/uploads/2007/10/gmail_rss_sshot3.gif" alt="Gmail RSS Step 4" /></li>
<li>Go to your email client and subscribe to the URL copied in step 4.<br />
For Mozilla Thunderbird, right-click on News &amp; Blogs and select ‘Subscribe’ from the context menu.<br />
<img src="http://n.talagala.org/wp-content/uploads/2007/10/gmail_rss_sshot41.gif" alt="Gmail RSS Step 5" /></li>
<li>You will be prompted for the user name and password for your Gmail account.</li>
<li>That’s it! Now you are ready to receive new mail notifications via RSS.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://nstation.org/blog/syndicate-your-gmail-inbox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to save a photo from Flickr</title>
		<link>http://nstation.org/articles/how-to-save-a-photo-from-flickr</link>
		<comments>http://nstation.org/articles/how-to-save-a-photo-from-flickr#comments</comments>
		<pubDate>Thu, 26 Jul 2007 04:10:08 +0000</pubDate>
		<dc:creator>Nadee</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://n.talagala.org/2007/07/25/how-to-save-a-photo-from-flickr/</guid>
		<description><![CDATA[Flickr is my favorite photo sharing service. I always start from Flickr search whenever I want an insight to a real-world scenario. The irony is that sometimes the most interesting photos seem to have missing the All Sizes button. As a result the photo cannot be downloaded even if it’s declared public. Flickr hides the...]]></description>
			<content:encoded><![CDATA[<p><img title="Flickr Sample" src="http://i31.tinypic.com/voop6t.jpg" alt="Flickr Sample" width="400" height="100" class="alignleft top framed" /><a title="Flickr" href="http://flickr.com/">Flickr</a> is my favorite photo sharing service. I always start from <a title="Flickr Search" href="http://flickr.com/search/">Flickr search</a> whenever I want an insight to a real-world scenario. The irony is that sometimes the most interesting photos seem to have missing the <em>All Sizes</em> button. As a result the photo cannot be downloaded even if it’s declared public. Flickr hides the source URL of the image by using a decoy ‘space ball’! This post explains how you can overcome this issue with a simple trick.<span id="more-12"></span>
<div class="clear"></div>
<h4>Prerequisite</h4>
<p>The prerequisite is <a title="Mozilla Firefox" href="www.mozilla.com/firefox/">Firefox</a>. No need to install any fancy third-party plug-ins although there are many to automate this task. We&#8217;ll be using a great feature already built into Firefox called <strong>‘View Selection Source’</strong>.</p>
<h3>Step 1</h3>
<p>Go to the Flickr page that has the photo you want. Usually it&#8217;s in the format <code>http://flickr.com/photos/&lt;user&gt;/&lt;photoid&gt;/</code><br />
Ex: <a title="Birds of A Feather on Flickr" href="http://flickr.com/photos/enteelk/629074618/">http://flickr.com/photos/enteelk/629074618/</a></p>
<p class="aligncenter"><img class="framed" title="Step 1 - How to save a photo from Flickr" src="http://nstation.org/wp-content/uploads/2007/07/flickr_step1.gif" alt="Step 1 - How to save a photo from Flickr" vspace="24" width="540" height="574" /></p>
<h3>Step 2</h3>
<p>Select the photo by clicking just out the left-side of the image and dragging your mouse to the right-side of the image and releasing.</p>
<p class="aligncenter">
<img class="framed" title="Step 2 - Birds of A Feather on Flickr" src="http://nstation.org/wp-content/uploads/2007/07/flickr_step2.gif" alt="Step 2 - Birds of A Feather on Flickr" vspace="24" width="580" height="574" />
</p>
<p>Notice how the photo is now selected with the selection color overlay.</p>
<h3>Step 3</h3>
<p>Now right-click on the selection and select View Selection Source.</p>
<p class="aligncenter"><img class="framed" title="Step 3 - Right-click and View Selection Source" src="http://nstation.org/wp-content/uploads/2007/07/flickr_step3.1.gif" alt="Step 3 - Right-click and View Selection Source" vspace="24" /></p>
<h3>Step 4</h3>
<p>A window with the title &#8216;<strong>Dom Source of Selection</strong>&#8216; will pop up with the selection source code.</p>
<p class="aligncenter"><img class="framed" title="Step 4 - The DOM Window" src="http://nstation.org/wp-content/uploads/2007/07/flickr_dom_screenshot.gif" alt="Step 4 - The DOM Window" vspace="24" /></p>
<h3>Step 5</h3>
<p>Select the source attribute text (<code>img src="&lt;text&gt;"</code>) of the image tag without the <code>?v=0</code> portion which is the path to the photo.<br />
(Ex: <code>http://farm2.static.flickr.com/1405/629074618_20f6542a03.jpg</code>)</p>
<h3>Step 6</h3>
<p>Copy and paste the text on the address field and press enter. Select Save As from the File menu or right-click on the picture to save it.</p>
<p class="aligncenter"><img class="framed" title="Step 6 - Paste the Code in the URL text box" src="http://nstation.org/wp-content/uploads/2007/07/step6.gif" alt="Step 6 - Paste the Code in the URL text box" vspace="24" /></p>
<h3>Done!</h3>
<p>Please note that even if a photo is made public, you have to obtain license for commercial use. This post is about making your life easier and not about stealing other people’s intellectual property.</p>
]]></content:encoded>
			<wfw:commentRss>http://nstation.org/articles/how-to-save-a-photo-from-flickr/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
