<?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>Ramblings of a Coder&#039;s Mind &#187; Tutorials</title>
	<atom:link href="http://karunab.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://karunab.com</link>
	<description>Got Tech? Will Hack.</description>
	<lastBuildDate>Sun, 04 Jul 2010 06:35:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Windows File Sharing: Add/Remove folders via Command Line</title>
		<link>http://karunab.com/2010/07/04/windows-file-sharing-addremove-folders-via-command-line/</link>
		<comments>http://karunab.com/2010/07/04/windows-file-sharing-addremove-folders-via-command-line/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 06:35:51 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows File Share]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=307</guid>
		<description><![CDATA[Your first thought on reading this probably is &#8220;Why in the world would I need to do that?&#8221; Well, I would have thought of it the same way a week back. But it seems some times, Windows does not want to give access to certain features such as Advanced File Sharing options. It states that [...]]]></description>
			<content:encoded><![CDATA[<p>Your first thought on reading this probably is &#8220;Why in the world would I need to do that?&#8221; Well, I would have thought of it the same way a week back. But it seems some times, Windows does not want to give access to certain features such as Advanced File Sharing options. It states that the administrator on my machine has disallowed this operation. Guess what? I&#8217;m the only administrator on this machine! Since I was unable to find the option to get that feature working, I decided to resort to some good old Command Line usage :)</p>
<p>To remove a file/folder from share <img class="alignright size-medium wp-image-309" title="Windows File Sharing - Blocked by administrator" src="http://karunab.com/wp-content/uploads/2010/07/Windows-File-Sharing-Blocked-by-administrator-300x156.png" alt="" width="300" height="156" />and type the following command in an elevated instance of command  prompt:</p>
<blockquote><p>net share <em>&lt;shareName&gt;</em> /delete</p></blockquote>
<p>To add a file/folder to share and type the following command in an elevated instance of command prompt:</p>
<blockquote><p>net share <em>&lt;shareName&gt;</em>=<em>&lt;pathToSharedFile&gt;</em></p></blockquote>
<p>An example of an add and delete command would be as follows</p>
<blockquote><p>net share &#8220;Completed Downloads&#8221;=&#8221;D:\Completed Downloads&#8221;<br />
net share &#8220;Completed Downloads&#8221; /delete</p></blockquote>
<p>At times, I was not required to use an elevated command prompt instance but if you get message stating &#8220;Access Denied&#8221;, you should run the command after elevation. To do so, type out &#8220;Command Prompt&#8221; in your start menu and then use the right click &gt; Run as administrator option or you could simply use Shift+Enter to do the same :)</p>
<p>Simple enough, right? ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2010/07/04/windows-file-sharing-addremove-folders-via-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Torrenting on Linux</title>
		<link>http://karunab.com/2010/02/21/torrenting-on-linux/</link>
		<comments>http://karunab.com/2010/02/21/torrenting-on-linux/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 15:36:40 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[rTorrent]]></category>
		<category><![CDATA[rutorrent]]></category>
		<category><![CDATA[Torrent]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WebUI]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=287</guid>
		<description><![CDATA[As of today, the primary OS on my laptop is Ubuntu and since torrenting is a good way to get open source applications (such as Eclipse), I thought I should definitely invest the time to get a decent torrent client. I&#8217;m not saying that Transmission isn&#8217;t a good client. I certainly can&#8217;t say that since [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 330px"><a href="http://rutorrent.googlecode.com/svn/wiki/images/scr1_big.jpg"><img class=" " title="rutorrent webUI screenshot (traffic statistics)" src="http://rutorrent.googlecode.com/svn/wiki/images/scr1_big.jpg" alt="rutorrent webUI" width="320" height="200" /></a><p class="wp-caption-text">rutorrent webUI screenshot (traffic statistics)</p></div>
<p>As of today, the primary OS on my laptop is Ubuntu and since torrenting is a good way to get open source applications (such as Eclipse), I thought I should definitely invest the time to get a decent torrent client. I&#8217;m not saying that Transmission isn&#8217;t a good client. I certainly can&#8217;t say that since I haven&#8217;t used it for more than 5 minutes. I simply lacks umph. It really doesn&#8217;t impress me as much as uTorrent does on Windows. So let&#8217;s look for an alternative client.</p>
<p>Using uTorrent with Wine is always a popular option, one most Windows to Linux converts happily embrace. Let&#8217;s face it, uTorrent is awesome. But I really wanted to embrace Linux which for me meant to stop using the mouse and GUI as much as possible (not that difficult for me) and getting used to native applications rather than applications via Wine. This meant no more uTorrent for torrenting and no more mIRC :( The alternative I settled for came highly recommended by quite a few users. And oh, look at that, it&#8217;s terminal based. Of course, I&#8217;m talking about rTorrent ;)</p>
<p>I have tried to install rTorrent before and failed. This time around, I had managed to get rTorrent to install and work fine but I couldn&#8217;t get a webUI for it to work. So I had dt walk me through the process. I&#8217;ll try to document as much of it as possible to help users going through the same issue.</p>
<p>If you want to see a couple of screen shots of the end result before beginning, visit the <a title="ruTorrent website" href="http://code.google.com/p/rutorrent/" target="_blank">rutorrent website</a> and check out the screen shots. The best part about it is the tracker based, per torrent and global settings along with the pretty amazing <a href="http://rutorrent.googlecode.com/svn/wiki/images/scr1_big.jpg" target="_blank">traffic plug-in</a> which gives your multiple (group) views of your traffic statistics. It&#8217;s pretty cool ;)</p>
<p><span id="more-287"></span>The first step is to install XMLRPC-C followed by libTorrent and finally rTorrent. These steps are pretty well documented in this <a href="http://rtwi.jmk.hu/wiki/InstallationGuide#preparing" target="_blank">installation guide for XMLRPC-C</a> and this <a href="http://libtorrent.rakshasa.no/wiki/Install" target="_blank">installation guide for libTorrent and rTorrent</a> with a few changes. I&#8217;ll note the changes in commands in bold.</p>
<p>Before beginning, make sure you have the following packages:</p>
<ul>
<li>make</li>
<li>pkg-config</li>
<li>sigc++-2.0-dev</li>
<li>libncurses-dev</li>
<li>libcurl-openssl-dev</li>
</ul>
<p>Installing XMLRPC-C: (Note: You should have xmlrpc-c v1.07 and up for a rather bug free rutorrent)</p>
<blockquote>
<pre>cd /usr/src
wget http://dfn.dl.sourceforge.net/sourceforge/xmlrpc-c/xmlrpc-c-1.11.00.tgz
tar xvf xmlrpc-c-1.11.00.tgz
cd xmlrpc-c-1.11.00
<strong>./configure --disable-cplusplus</strong>
make
make install</pre>
</blockquote>
<p>Installing libTorrent:</p>
<blockquote>
<pre>cd /home/rtorrent
svn co svn://rakshasa.no/libtorrent/trunk</pre>
<pre>cd /home/rtorrent/trunk
cd libtorrent
./autogen.sh
./configure
make
make install</pre>
<pre>cd ../rtorrent
./autogen.sh
<strong>./configure --with-xmlrpc-c</strong>
make
make install</pre>
</blockquote>
<p>Next, make a .rtorrent.rc file in your home folder with appropriate settings. The line in bold is what we need to set up the webUI.</p>
<blockquote><p># This is an example resource file for rTorrent. Copy to<br />
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to<br />
# uncomment the options you wish to enable.</p>
<p>#safe_sync = yes<br />
<strong>scgi_port = 127.0.0.1:5000</strong><br />
encoding_list = UTF-8</p>
<p># Maximum and minimum number of peers to connect to per torrent.<br />
min_peers = 10<br />
max_peers = 50</p>
<p># Same as above but for seeding completed torrents (-1 = same as downloading)<br />
min_peers_seed = -1<br />
max_peers_seed = -1</p>
<p># Maximum number of simultaneous uploads per torrent.<br />
max_uploads = 10</p>
<p># Global upload and download rate in KiB. &#8220;0&#8243; for unlimited.<br />
#download_rate = 0<br />
upload_rate = 20</p>
<p># Default directory to save the downloaded torrents.<br />
<strong> directory = /home/karun/share/torrents/</strong></p>
<p># Default session directory. Make sure you don&#8217;t run multiple instance<br />
# of rtorrent using the same session directory. Perhaps using a<br />
# relative path?<br />
<strong>session = /home/karun/share/torrents/session</strong></p>
<p># Watch a directory for new torrents, and stop those that have been<br />
# deleted.<br />
schedule = watch_directory,5,5,load_start=/home/dt/share/torrents/auto/*.torrent</p>
<p># run traffic count<br />
schedule = trafic,10,00:05:00,&#8221;execute={sh,-c,php /var/www/rtorrent/plugins/trafic/update.php&amp; exit 0}&#8221;</p>
<p># Close torrents when diskspace is low.<br />
#schedule = low_diskspace,5,60,close_low_diskspace=100M</p>
<p># Port range to use for listening.<br />
port_range = 55556-55560</p>
<p># Check hash for finished torrents. Might be usefull until the bug is<br />
# fixed that causes lack of diskspace not to be properly reported.<br />
check_hash = no</p>
<p># Set whetever the client should try to connect to UDP trackers.<br />
use_udp_trackers = yes</p>
<p># Encryption options, set to none (default) or any combination of the following:<br />
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext<br />
# Enable DHT support for trackerless torrents or when all trackers are down.<br />
# May be set to &#8220;disable&#8221; (completely disable DHT), &#8220;off&#8221; (do not start DHT),<br />
# &#8220;auto&#8221; (start and stop DHT as needed), or &#8220;on&#8221; (start DHT immediately).<br />
# The default is &#8220;off&#8221;. For DHT to work, a session directory must be defined.<br />
#<br />
dht = auto</p>
<p># UDP port to use for DHT.<br />
#<br />
dht_port = 55555</p>
<p># Enable peer exchange (for torrents not marked private)<br />
#<br />
peer_exchange = yes</p></blockquote>
<p>Our next step is to get the WebUI which needs the following packages</p>
<ul>
<li>apache2</li>
<li>php5-cli</li>
<li>libapache2-mod-php5</li>
<li>php5-xmlrpc</li>
<li>php5-sqlite</li>
<li>libapache2-mod-scgi</li>
</ul>
<p>After making sure the above packages are installed, run the following 2 commands on terminal to enable apache modules (in case they aren&#8217;t already)</p>
<ul>
<li>a2enmod php5</li>
<li>a2enmod scgi</li>
</ul>
<p>The next step is to edit /etc/apache2/httpd.conf with your favorite editor and adding the following lines</p>
<blockquote><p>&lt;location &#8220;/RPC2&#8243;&gt;<br />
SCGIHandler On<br />
SCGIServer 127.0.0.1:5000<br />
&lt;/location&gt;</p></blockquote>
<p>Once done, save and exit. You&#8217;re all ready to do get the webUI. It&#8217;s important to note that rTorrent has a plethora of WebUIs for itself. We are going to use <a href="http://code.google.com/p/rutorrent/" target="_blank">rutorrent</a> for this purpose. Why? Because I like the addons :P If you plan to use some other WebUI, please go ahead and ignore the rest of this tutorial. If you are installing rutorrent, follow what I say.</p>
<p>The first step now is to get the rutorrent files off it&#8217;s SVN. Here&#8217;s what I do.</p>
<blockquote>
<pre>cd /var/www
svn checkout http://rutorrent.googlecode.com/svn/trunk/rtorrent</pre>
</blockquote>
<p>Simple enough? Let&#8217;s edit the config to make sure it&#8217;s what we want. Open up config.php in /var/www/rtorrent and make sure it has</p>
<blockquote>
<pre>$scgi_port = 5000
$scgi_host = "127.0.0.1"</pre>
</blockquote>
<p>Well, we&#8217;re all done with the basic installation of WebUI. You can start using it right now! You have to make sure your apache is started and so is your rTorrent. If you don&#8217;t already know, you can start apache using <em>sudo /etc/init.d/apache2 start</em> and rtorrent by simply typin <em>rtorrent</em> into your terminal though you should consider <a href="http://ubuntu-tutorials.com/2007/05/04/command-line-multitasking-with-screen/" target="_blank">screening</a> rtorrent which you can do by typing out <em>screen rtorrent </em>in your console followed by the sequence <em>ctrl+a ctrl+d</em> to detach from the application and keep it in the background :) To check out your hard work, go to <a href="http://localhost/rtorrent" target="_blank">http://localhost/rtorrent</a>. If everything is working fine, you should get the page with no errors. The errors I got were for the scgi port and host when I didn&#8217;t have rtorrent started up in the background and when I didn&#8217;t have a sessions folder when I said it existed in the config. The former needs you to run rtorrent directly or screening it while the latter needs you to create the sessions folder as mentioned in the config file (.rtorrent.rc).</p>
<p>The last step for the day is getting the add-ons. These are the ones I got. None of them require any setup other than getting the files though the RSS plugin requires the curl install (<em>sudo apt-get install curl</em> in case you don&#8217;t already have it).</p>
<blockquote>
<pre>cd /var/www/rtorrent/plugins
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/choose
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/datadir
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/edit
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/_getdir
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/rss
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/seedingtime
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/throttle
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/tracklabels
svn checkout http://rutorrent.googlecode.com/svn/trunk/plugins/trafic
cd trafic
gedit conf.php</pre>
</blockquote>
<p>Make sure you set <em>$isAutoStart</em> to <em><strong>false</strong></em> since .rtorrent.rc starts the plug-in up.</p>
<p>And you&#8217;re done. Enjoy torrenting on linux with rTorrent and ruTorrent WebUI awesomeness :)</p>
<p>One last thing, make sure you compile XMLRPC-C with &#8211;disable-cplusplus. The XMLRPC-C install is the one thing that kept giving me issues. The solution to this was in a <strong>bug patch</strong> that <span style="text-decoration: underline;">could not be found</span>. I simply have the patched file that you are free to use if you are facing the same issue. Take <a title="Patched xmlrpc_curl_transport.c" href="karunab.com/wp-content/uploads/2010/02/xmlrpc_curl_transport.c">this file</a> and put it in xmlrpc-c-1.11.00\lib\curl_transport and continue the process. The patched file comes with a disclaimer of course. I am not sure what changes were made. It worked for me. Use it at your own risk.</p>
<p>I hope this tutorial helps you lost souls trying to get rTorrent on Ubuntu with ruTorrent as your WebUI.</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2010/02/21/torrenting-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Playing videos in RAR archives</title>
		<link>http://karunab.com/2009/12/07/playing-videos-in-rar-archives/</link>
		<comments>http://karunab.com/2009/12/07/playing-videos-in-rar-archives/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 14:43:05 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[MPC]]></category>
		<category><![CDATA[On-The-Fly]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=281</guid>
		<description><![CDATA[A lot of people today download videos (TV shows and movies) off the internet using torrents or Usenet. Most sources pack the videos in multi-part RAR archives to minimize loss in case of error prone transfer. Though this does not make much sense usually on protocols such as the bittorrent protocol but it does on [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people today download videos (TV shows and movies) off the internet using torrents or Usenet. Most sources pack the videos in multi-part RAR archives to minimize loss in case of error prone transfer. Though this does not make much sense usually on protocols such as the bittorrent protocol but it does on the <a href="http://en.wikipedia.org/wiki/Warez_scene" target="_blank">scene</a> where data is transferred using FTP. In such cases, you are left with a lot of rar files that you have to keep (if you&#8217;re seeding on trackers) and extract every time you want to play them.</p>
<p>Some video players like <a href="http://www.videolan.org/vlc/" target="_blank">VLC</a> and <a href="http://xbmc.org/" target="_blank">XBMC</a> came up with a solution. On the fly extraction of multi-part archives to play videos. Not all players support this though. Just recently, I came across something that can solve this problem. You can now use <a href="http://www.v12pwr.com/RARFileSource/" target="_blank">RARFileSource</a> to get your favourite video player to read videos in RAR files and play them.  RARFileSource is a DirectShow filter which let&#8217;s most video players read RAR files on the fly. The only restriction is that the video should not be compressed. Thankfully, this is the scene norm so you need not worry. Just install the application (117 KB) and drag drop a RAR archive on to your favourite video player. Works fine with <a href="http://mpc-hc.sourceforge.net/" target="_self">MPC: HC</a> for me and <a href="http://www.microsoft.com/windows/windowsmedia/player/" target="_blank">WMP</a> for <a href="http://blog.thedt.net" target="_blank">dt</a> (who suggested this to me).</p>
<p>Now you can seed your files and play them from the RAR archives directly only extracting them when you need to give them to someone else ;) Cool, eh? :D</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/12/07/playing-videos-in-rar-archives/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Clean File List Generation with PowerShell Script</title>
		<link>http://karunab.com/2009/12/06/clean-file-list-generation-with-powershell-script/</link>
		<comments>http://karunab.com/2009/12/06/clean-file-list-generation-with-powershell-script/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 01:46:06 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=275</guid>
		<description><![CDATA[I have a whole load of movies that I&#8217;d like to generate a list of. I considered writing a batch script but it didn&#8217;t really do something I needed. I ended up writing my first regular use (non test) PowerScript and here&#8217;s how. My first requirement was to list all my 1080p movies and for [...]]]></description>
			<content:encoded><![CDATA[<p>I have a whole load of movies that I&#8217;d like to generate a list of. I considered writing a batch script but it didn&#8217;t really do something I needed. I ended up writing my first regular use (non test) PowerScript and here&#8217;s how.</p>
<p>My first requirement was to list all my 1080p movies and for the list to leave out all the subtitles. So I was looking for a function to list files (<em>dir</em> in command prompt did that :)) and then remove files by extension. As it turned out, I could list files of a certain extension but not leave out files by extensions. Finally, I had to write the result to file (simple enough to do in command prompt. Use the <em>&gt;</em> operator to direct output of the previous command to a file) So, a quick fix would be to use something like</p>
<blockquote><p>dir *.avi *.mp4 *.mpg *.mpeg *.mkv /B /O N</p></blockquote>
<p>For sub-folders, you can use tree and fiddle around the options but lets face it, as programmers, we want better solutions.</p>
<p>Since the launch of Windows 7, Microsoft has shipped PowerShell with the OS making it much more &#8220;main stream&#8221;. I had played around with PowerShell a couple of years ago when version 1 came out but I thought it was time that I actually made a regular use script.</p>
<p>The core of the script is using <em>get-childitem</em> to get all files and folders in a directory. From there, you can make it go recursive (and look inside sub directories) with a <em>-recurse</em> switch. Little bit of piping allows you to eliminate results you don&#8217;t need. For this, I wrote a simple function.</p>
<blockquote><p>function fileCheck([string]$extention, [string]$attributes) {<br />
# list of rejected extentions<br />
$exts = &#8220;.srt&#8221;,&#8221;.sub&#8221;,&#8221;.idx&#8221;,&#8221;.txt&#8221;,&#8221;.lnk&#8221;</p>
<p>return $exts -notcontains $extention -and $attributes -ne &#8220;Directory&#8221;<br />
}</p></blockquote>
<p>As you&#8217;ve probably figured out, this function ignores those file extensions and directories as well from our final file list.</p>
<p>Once you have the list, you can either use $object.Name for full name (ie file name with extension) or $object.BareName for only the file name. On reading the source of my script, you&#8217;ll see I&#8217;m using both and also writing a count of the number of files in a file named <em>list.txt</em>. The first part of the file is a human readable list for your consumption using new lines for separation. The second is a single line output of all files using commas for separation and containing a file count at the end. The latter is simply for copy pasting into chats (like IRC) where you can&#8217;t spam with a huge multi-line list.</p>
<p>I went on then to add more code to handle command line inputs so that you can make shortcuts from folders and call the script. I have attached a couple of sample script calls</p>
<blockquote><p>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe <em>-command</em> &#8220;<strong>&amp; &#8216;C:\Users\Karun\My Scripts\filelist.ps1</strong>&#8216;&#8221; &#8220;<strong>H:\Movies\HQ</strong>&#8221;<br />
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe <em>-command</em> &#8220;<strong>&amp; &#8216;C:\Users\Karun\My Scripts\filelist.ps1</strong>&#8216;&#8221; &#8220;<strong>H:\Movies</strong>&#8221; &#8220;<strong>true</strong>&#8220;</p></blockquote>
<p>The first one will call on the script and generate an output. The second will do so recursively. Simple enough? Go <a title="View Source Code" href="http://svn.jalife.net/Random__Code/markup/HEAD/PowerShell___filelist.ps1" target="_blank">get the code</a> and have fun with it!</p>
<p><a title="View Source Code" href="http://svn.jalife.net/Random__Code/markup/HEAD/PowerShell___filelist.ps1" target="_blank">View Script Source Code</a> | <a title="Download Script Source Code" href="http://svn.jalife.net/Random__Code/downloadfile/HEAD/PowerShell___filelist.ps1" target="_blank">Download Script Source Code</a></p>
<p>If you&#8217;re having trouble executing the script, you should consider signing your PowerShell scripts. <a title="Scott Hanselman on &quot;Signing PowerShell Scripts&quot;" href="http://www.hanselman.com/blog/SigningPowerShellScripts.aspx" target="_blank">Scott Hanselman has written a great post on how to do so</a>. Go read it! You could simply <em>Set-ExecutionPolicy</em> to <em>Unrestricted</em> but then you&#8217;d be leaving your system open to attacks. Don&#8217;t blame anyone but yourself if you run someone else&#8217;s unsafe code and screw something up :) You have been warned :)</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/12/06/clean-file-list-generation-with-powershell-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building a Home Server: Part 1</title>
		<link>http://karunab.com/2009/09/10/building-a-home-server-part-1/</link>
		<comments>http://karunab.com/2009/09/10/building-a-home-server-part-1/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 18:49:29 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[FreeNAS]]></category>
		<category><![CDATA[Home Server]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Windows Home Server]]></category>

		<guid isPermaLink="false">http://karunab.com/2009/09/10/building-a-home-server-part-1/</guid>
		<description><![CDATA[The first question in your head would be “Why the world do I need a Home Server?” Good question. I’d like to ask you a couple of things. Do you have multiple machines in your house? Do you ever feel like you should have centralized storage in your house? Do you have old hardware simply [...]]]></description>
			<content:encoded><![CDATA[<p>The first question in your head would be “<strong>Why the world do I need a Home Server?</strong>”</p>
<p>Good question. I’d like to ask you a couple of things. Do you have multiple machines in your house? Do you ever feel like you should have centralized storage in your house? Do you have old hardware simply lying around the house waiting to be tinkered with? Do you like playing with your machines?</p>
<p>If you said yes to (most) of the above questions, having a Home Server could help you :) It can handle not only centralized storage of media and documents but also backups. Have you ever needed a file from <em>computer x</em> in your house and found it was shut down after being used by a family member? Well, you wouldn’t have this issue if you had a central server. People could go around switching off their machines all they want as long as you have the file you want on your Storage Server.</p>
<p>Lets get into it then. From now, I’ll walk you through how to make your old machine into a <a href="http://en.wikipedia.org/wiki/Network-attached_storage" target="_blank">Network Attached Server (NAS)</a>.</p>
<p><span id="more-240"></span></p>
<h3><em>1) <span style="text-decoration: underline;">Hardware</span></em></h3>
<p>Any hardware is fine for a Home Server. The main purpose (at least in this case) is central file storage for all devices and this doesn’t require much resources on the processing side. Lets start with the specifications of this machine:</p>
<table border="1" width="436">
<tbody>
<tr>
<td width="63">CPU</td>
<td width="371">Pentium 4; 3.06 GHz; 512MB Cache; 533 MT/s</td>
</tr>
<tr>
<td width="63">Motherboard</td>
<td width="371">MSI 865 Chipset motherboard; 2xIDE + 1xSATA controllers</td>
</tr>
<tr>
<td width="63">RAM</td>
<td width="371">2x512MB DDR1 @ 400MHz</td>
</tr>
<tr>
<td width="63">GPU</td>
<td width="371">NViDIA GeForce 5300 with 256MB GDDR RAM</td>
</tr>
</tbody>
</table>
<p>Now that is a pretty good processor for this purpose, I agree. You should be fine using a Celeron or even a Pentium 3.</p>
<h3><em>2) <span style="text-decoration: underline;">Operating System</span></em></h3>
<p>The next important question is the choice of operating systems. To answer these, you need to look at your usage of the server.</p>
<table border="1" width="988">
<tbody>
<tr>
<td width="162">
<p align="center"><strong>Operating System</strong></p>
</td>
<td width="416">
<p align="center"><strong>Advantages</strong></p>
</td>
<td width="408">
<p align="center"><strong>Disadvantages</strong></p>
</td>
</tr>
<tr>
<td width="162">Windows Server 2003</td>
<td width="416">Lighter than other WinServers</td>
<td width="408">Already 6 years into the product cycle</td>
</tr>
<tr>
<td width="162">Windows Server 2008</td>
<td width="416">Handles advanced requirements</td>
<td width="408">Requires lot of resources; Requires lots of effort to set up</td>
</tr>
<tr>
<td width="162">Windows Server 2008 R2</td>
<td width="416">Latest WinServer OS; Handles advanced requirements</td>
<td width="408">Requires x64 or x86-64 processors</td>
</tr>
<tr>
<td width="162">Windows Home Server</td>
<td width="416">Supports headless mode; Easy NAS setup; Handles Windows Backups; Integrates well with Windows Media Center across the network</td>
<td width="408">Horrible Setup; Requires PP3 for Win7 support (still in beta; available on Microsoft <a href="http://connect.microsoft.com/" target="_blank">Connect</a>); Requires at least 80GB on primary drive.</td>
</tr>
<tr>
<td width="162">Ubuntu/Xubuntu</td>
<td width="416">Medium/Light weight; Free; Multipurpose</td>
<td width="408">Would require some effort to set up</td>
</tr>
<tr>
<td width="162">FreeNAS</td>
<td width="416">Light weight; Free; Fast; Made for NAS; Made for headless mode; Small size; Web GUI; Supports multiple protocols</td>
<td width="408">Isn’t easy to customize beyond packages provided already</td>
</tr>
</tbody>
</table>
<p>I really wanted to run Windows Server 2008 R2 but since this processor is an x86 one, I couldn’t. Windows Server 2008 gave me sluggish performance so I gave it the axe by the end of the night. I didn’t want to try Windows Server 2003 since it was quite old. More importantly, I found Windows Home Server by that time, a product made specifically for Home Servers and it was made using Windows Server 2003 as base ;)</p>
<p>I must say, Windows Home Server (WHS) really has the most horrible OS installer I have seen on a Windows operating system. When it was all set and done, I ran updates and everything but whilst using it, I really wasn’t impressed :( Don’t get me wrong, it is pretty darn good but India is a place where Windows Media Center doesn’t give you everything that it does in countries like the United States. It surely has potential and may be some day, it will even make its way on to my server. But for now, I can’t do so especially since I don’t have a IDE drive greater than 80GB that can run the WHS. If you read my system specs correctly, you’d have noticed this old machine has only one IDE port, which I’m reserving for at least a 1TB drive.</p>
<p>I started considering Linux! (yes, I said Linux). I considered using <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a>/<a href="http://www.xubuntu.org/" target="_blank">Xubuntu</a> on the machine, as an obvious choice for any Linux newbie. For those who don’t know the difference between the two, <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> uses <a href="http://en.wikipedia.org/wiki/GNOME" target="_blank">Gnome</a> for its UI and <a href="http://www.xubuntu.org/" target="_blank">Xubuntu</a> uses <a href="http://en.wikipedia.org/wiki/KDE" target="_blank">KDE</a>. Other than that, they are identical. If you don’t have a choice towards either, I’d tell you to go for Xubuntu if you’ve got an older machine (or just like a machine with free resources). KDE requires lesser resources and should run almost anywhere. I saw this pretty detailed article about setting up a home server on Xubuntu that you should check out if Ubuntu/Xubuntu is your OS of choice.</p>
<p>Then comes the final choice, FreeNAS. If you want a NAS, you can’t go wrong with FreeNAS. Weighing in at around 70 megabytes for a live CD with installer, its a really good choice. It is built on <a href="http://www.freebsd.org/" target="_blank">FreeBSD</a> and I must say, its pretty extensive. Just have a look at <a href="http://en.wikipedia.org/wiki/FreeNAS#Features" target="_blank">FreeNAS’ list of features</a>; its insane!</p>
<p>I’d suggest you go with FreeNAS if you just want to use your server as a NAS. It uses Samba to give you CIFS (in non technical jargon, it allows you to share files in a network like Windows does) and provides support for protocols like FTP, SSH, BitTorrent and iTunes. It can be extended to support <a href="http://en.wikipedia.org/wiki/XBMC" target="_blank">XMBC</a> and <a href="http://en.wikipedia.org/wiki/SlimServer" target="_blank">SlimServer</a>. It also allows you to host a web server using <a href="http://www.lighttpd.net/" target="_blank">lighttpd</a> and even supports <a href="http://en.wikipedia.org/wiki/Uninterruptible_power_supply" target="_blank">UPS</a>, <a href="http://en.wikipedia.org/wiki/Self-Monitoring,_Analysis,_and_Reporting_Technology" target="_blank">SMART</a>, <a href="http://en.wikipedia.org/wiki/ZFS" target="_blank">ZFS</a>, <a href="http://en.wikipedia.org/wiki/RAID" target="_blank">RAID</a> and most NICs and IDE/SATA disk controllers. If there is anything that you need to do that you can’t see on this list and can’t manage to get FreeNAS to do (I believe it will run almost anything which runs on FreeBSD) then you can move to Ubuntu/Xubuntu. You <em>could</em> even run ASP .NET pages off Linux web servers (haven’t tried it yet) with the limited support that Mono provides :)</p>
<p>Part 2 of the tutorial will have the basic setup for FreeNAS and how to get CIFS working. Subsequent parts will talk about setting up FTP, SSH, BitTorrent and Web Server with MySQL and phpmyadmin. You never know, if I can get it to execute ASP .NET as well, you guys will be the first to know! ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/09/10/building-a-home-server-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
