<?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</title>
	<atom:link href="http://karunab.com/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>File list generator v1.1</title>
		<link>http://karunab.com/2010/02/14/file-list-generator-v1-1/</link>
		<comments>http://karunab.com/2010/02/14/file-list-generator-v1-1/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 07:46:06 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=284</guid>
		<description><![CDATA[On a lazy Sunday afternoon when you&#8217;ve got nothing better to do, you either write rather useless scripts or update them. I chose to do the latter. The file list generation script I wrote some time back was mainly to generate a list of movies I have. When I generated a list of all the [...]]]></description>
			<content:encoded><![CDATA[<p>On a lazy Sunday afternoon when you&#8217;ve got nothing better to do, you either write <a title="Clean File List Generation with PowerShell Script" href="http://karunab.com/2009/12/06/clean-file-list-generation-with-powershell-script/" target="_blank">rather useless scripts</a> or update them. I chose to do the latter.</p>
<p>The <a title="Clean File List Generation with PowerShell Script" href="Clean File List Generation with PowerShell Script" target="_blank">file list generation script</a> I wrote some time back was mainly to generate a list of movies I have. When I generated a list of all the HD movies I have on disk, I realized, my list was being ruined by loads of sample files which escape the file filter because they are the same extension as the videos themselves. So I decided to write a simple fix to remove all files with &#8220;sample&#8221; in it. Of course, this is activated by a command line switch which is by default off. The extension list now ignores all images (pngs, jpgs and bmps) so my file list no longer has any screen shots.</p>
<p>Here&#8217;s 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><strong></strong>&#8221;  &#8220;<strong>true</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><strong></strong>&#8221;  &#8220;<strong>true</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. The third one will ignore all files with the word &#8220;sample&#8221; in them. 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/2010/02/14/file-list-generator-v1-1/feed/</wfw:commentRss>
		<slash:comments>0</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>Trying Minefield 3.7a1pre</title>
		<link>http://karunab.com/2009/11/03/trying-minefield-3-7a1pre/</link>
		<comments>http://karunab.com/2009/11/03/trying-minefield-3-7a1pre/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 10:15:48 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Alpha]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=260</guid>
		<description><![CDATA[Ever since I started using Win7 (first public beta) I have liked one thing about Internet Explorer that Firefox couldn&#8217;t do. This was the ability to use Win7&#8242;s Aero prowess completely rendering each tab in the Aero preview for Firefox. At the time, Microsoft hadn&#8217;t come out with the Win7 UX Interaction Guide but it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I started using Win7 (<a title="My first encounter with Windows 7" href="http://karunab.com/2009/01/10/windows-7-public-beta-serial-key-fiasco/" target="_blank">first public beta</a>) I have liked one thing about Internet Explorer that Firefox couldn&#8217;t do. This was the ability to use Win7&#8242;s Aero prowess completely rendering each tab in the Aero preview for Firefox. At the time, Microsoft hadn&#8217;t come out with the <a title="Windows User Experience Interaction Guide" href="http://msdn.microsoft.com/en-us/library/aa511258.aspx" target="_blank">Win7 UX Interaction Guide</a> but it&#8217;s been out for a few months and I was quite disappointed that Mozilla didn&#8217;t jump at the opportunity to release an upgrade.</p>
<p>A couple of weeks back, I saw screen shots of my friends&#8217; browsers and noticed they were using Minefield. They confirmed that 3.7a1pre does indeed have full Aero support so I finally upgraded. I must say, it&#8217;s a great update.</p>
<p>As you can see from the screen shot, it doesn&#8217;t really like some pages in the Aero preview. I am pretty sure it&#8217;s an AJAX thing.</p>
<p>Of course, if you consider updating, quite a few of your plug-ins will not work simply because of the version compatibility checks. A simple way to by pass this is to install the <a href="https://addons.mozilla.org/en-US/firefox/addon/6543" target="_blank">Nightly Tester Tools</a> to skip Firefox&#8217;s version compatibility checks. Most add-ons should work fine.</p>
<p>There are a few add-ons I&#8217;d like to recommend with this alpha. Try checking out <a title="Strata40 on Mozilla add-ons" href="https://addons.mozilla.org/en-US/firefox/addon/14284" target="_blank">Strata40</a>, <a title="StrataBuddy on Mozilla add-ons" href="https://addons.mozilla.org/en-US/firefox/addon/14762" target="_blank">StrataBuddy</a> and <a title="StrataGlass on Mozilla add-ons" href="https://addons.mozilla.org/en-US/firefox/addon/14288" target="_blank">StrataGlass</a>. StrataGlass is amazing (works on any machine running on Vista/7) but it did give me problems on some pages so I disabled it. However, it is a great idea and it looked really nice. If someone irons out the wrinkles, I&#8217;d love to wear it everyday with my Firefox :)</p>
<p>Another small change I&#8217;d definitely recommend to users is going to <em>about:config</em>, past the warning, searching for the <em>browser.ctrlTab.previews</em> setting and setting the value to true (simply double click on it to toggle). After this, try <strong>Ctrl+Tab</strong> to get tab previews. If you think this is cool, try <strong>Ctrl+Shift+Tab</strong> to get previews with the ability to search between them. Doesn&#8217;t that make life easier when you have loads of tabs? ;)</p>
<p>I&#8217;d like to thank my friend <a title="Nitrolinken's empty-ish website that's never to have any content" href="http://www.nitrolinken.net/" target="_blank">Nitro</a> for showing me the Strata add-ons and telling me about the Ctrl+Tab setting ;) Ctrl+Shift+Tab was purely luck ;)</p>
<p>PS: <a title="Manan's e-residence" href="http://beingmanan.com/" target="_blank">Manan</a> <a href="http://twitter.com/manan/status/5387425273" target="_blank">asked me over twitter</a> about the memory usage of Minefield 3.7a1pre and I must say, it&#8217;s quite low. In fact, with 8 tabs (none of which are heavy on AJAX other than the WordPress panel), I&#8217;m using 125MB RAM. Though I&#8217;ve not confirmed it, I&#8217;d say that&#8217;s slightly lesser or the same as regular Firefox and Minefield even seems a tad bit faster and more responsive even with all my regular add-ons ;) Impressive :)</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/11/03/trying-minefield-3-7a1pre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MP!L Forum Elite Member</title>
		<link>http://karunab.com/2009/10/28/mpl-forum/</link>
		<comments>http://karunab.com/2009/10/28/mpl-forum/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 08:19:31 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=252</guid>
		<description><![CDATA[You might have heard about Messenger Plus! Live, a Windows Live Messenger add-on that has over 62 million users already. I&#8217;ve been on their support forum for nearly 5 years now and been a beta tester for nearly 2 years. Early on the morning of the 27th of October I stumbled upon a thread simply [...]]]></description>
			<content:encoded><![CDATA[<p>You might have heard about <a href="http://msgpluslive.net" target="_blank">Messenger Plus! Live</a>, a Windows Live Messenger add-on that has over 62 million users already. I&#8217;ve been on their <a href="http://msghelp.net" target="_blank">support forum</a> for nearly 5 years now and been a beta tester for nearly 2 years.</p>
<p>Early on the morning of the 27<sup>th</sup> of October I stumbled upon a thread simply titled &#8220;<a href="http://msghelp.net/showthread.php?tid=92693" target="_blank">New Elite Members</a>&#8221; and I found this interesting since it was the first time in my 5 years on the forum that new additions to the staff were being made. I opened it to see who the lucky people were. I expected a couple of lads to be added but the list had more like 12 people.</p>
<p>The first 3 people were all ones I knew so I skipped straight to the bottom of the page to leave a congratulatory message for them. After typing that out, I continued reading the page and to my surprise <strong>I found my name on it</strong> :-|</p>
<p>I was absolutely shocked. I have spent a lot of time on the forum but over the past couple of years, my post count really hasn&#8217;t moved much more than a couple of hundred. I do however spend a couple of hours every day helping out on the Messenger Plus! <abbr title="Internet Relay Chat">IRC</abbr> support channel but I didn&#8217;t really think any one noticed.</p>
<p>I must say, I am absolutely honored. The decision was made by the staff and for the fool who voted for me, I have to say &#8220;HAHA.. you totally wasted your vote :p&#8221;. But seriously, thanks a lot guys. Feels good to be part of the &#8220;<a title="Messenger Plus! Live Forum Team" href="http://msghelp.net/showteam.php" target="_blank">staff</a>&#8221; of a forum with over 85,000 users for a software which has over 62 million users.</p>
<p>The forum and IRC have given me a lot. They have taught me most of the things I know, give me loads of friends and great experiences. And then to be made an Elite Member.. it&#8217;s an honor.</p>
<p>My <a title="John Anderton's Messenger Plus! Live Forum Profile" href="http://msghelp.net/member.php?uid=40401" target="_blank">user bio</a> now accurately represents my status in the community</p>
<blockquote><p>Messenger Plus! User (since v2.x)</p>
<p>Messenger Plus! Live Official Tester (since v3.5)<br />
Messenger Plus! Live IRC Help Chan Op (since 2008)<br />
Messenger Plus! Live Elite Member (since 27/10/2009)</p></blockquote>
<p>Now to become <a title="Wiki on IRC ops" href="http://en.wikipedia.org/wiki/Internet_Relay_Chat_operator#Network_Administrator" target="_blank">IRC oper</a> (I&#8217;d probably need to kill segosa for that ;p), <a title="Wiki on Microsoft Most Valuable Professional" href="http://en.wikipedia.org/wiki/Microsoft_Most_Valuable_Professional" target="_blank">MVP</a> and then <a title="Reference: Pinky and the Brain quotes #1" href="http://en.wikiquote.org/wiki/Pinky_and_the_Brain#General_Quotes" target="_blank">take over the world</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/10/28/mpl-forum/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Windows 7 Launch Party</title>
		<link>http://karunab.com/2009/10/02/windows-7-launch-party/</link>
		<comments>http://karunab.com/2009/10/02/windows-7-launch-party/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 08:50:24 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Launch Party]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=250</guid>
		<description><![CDATA[Windows 7 Launch Party is a party organized by individuals in their homes, offices or other commercial venues celebrating the launch of Windows 7 and showing off its prowess. Its being done through the House Party website and the only reason its not called that is because Microsoft didn&#8217;t want to restrict the venue to [...]]]></description>
			<content:encoded><![CDATA[<p>Windows 7 Launch Party is a party organized by individuals in their homes, offices or other commercial venues celebrating the launch of Windows 7 and showing off its prowess. Its being done through the <a href="http://www.houseparty.com/" target="_blank">House Party website</a> and the only reason its not called that is because Microsoft didn&#8217;t want to restrict the venue to homes. Great PR is what I say.</p>
<p>Why am I giving you stale news? Well, this isn&#8217;t really news but I applied around the first week of September got selected first as a candidate host then got a confirmed host status. Last night I got an e-mail stating my party package is on its way.</p>
<p>All hosts will receive:</p>
<ul>
<li>One limited Signature Edition Windows<sup>®</sup> 7 Ultimate</li>
<li>One Puzzle with Windows<sup>®</sup> 7 Desktop Design</li>
<li>One Poster with Windows<sup>®</sup> 7 Desktop Design</li>
<li>Ten Tote Bags with Windows<sup>®</sup> 7 Desktop Design for hosts and guests</li>
<li>One table top centerpiece for decoration</li>
<li>One package of Windows<sup>®</sup> 7 napkins</li>
</ul>
<p>The package should arrive by this Tuesday or Wednesday. The party is planned for the 23rd of October at 7.00 PM and is an invite only party. So drop in a line and I&#8217;ll try to get people in :) After all, my room can only fit that many people in.. :P</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/10/02/windows-7-launch-party/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anonymous Microsoft Developer opens AMA discussion on reddit</title>
		<link>http://karunab.com/2009/09/14/anonymous-microsoft-developer-opens-ama-discussion-on-reddit/</link>
		<comments>http://karunab.com/2009/09/14/anonymous-microsoft-developer-opens-ama-discussion-on-reddit/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 09:53:16 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[AMA]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[reddit]]></category>

		<guid isPermaLink="false">http://karunab.com/?p=246</guid>
		<description><![CDATA[Ever wanted to ask what really goes on at Microsoft to a softie? Want to know about some random bytes of code inside Windows? Want to know who really killed Microsoft Bob? Well, here&#8217;s your chance! Ask him about anything from life at Microsoft to questions on their product and business strategies. As he puts [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to ask what really goes on at Microsoft to a softie? Want to know about some random bytes of code inside Windows? Want to know who really killed Microsoft Bob? Well, <a title="I work for Microsoft as a developer, and worked on Vista and Windows 7. AMA." href="http://www.reddit.com/r/IAmA/comments/9jo27/i_work_for_microsoft_as_a_developer_and_worked_on/" target="_blank">here&#8217;s your chance</a>!</p>
<p>Ask him about anything from life at Microsoft to questions on their product and business strategies. As he puts it, he will try to answer them without getting fired :P</p>
<blockquote><p>I worked on Vista and Windows 7, and will also be working on Windows 8. Ask me anything you want about the company, culture, lifestyle, seattle, products, etc. and I&#8217;ll answer the best I can without getting fired.</p></blockquote>
<p>He has put up some info for students looking at becoming Interns at Redmond. Most of it is the same stuff you&#8217;d read around the internet but here&#8217;s something I read for the first time and I must say, I agree with especially since this was how <a href="http://karunab.com/2009/06/29/visit-to-microsoft-redmond/" target="_blank">I got my trip to Redmond</a> ;)</p>
<blockquote><p>Also, there is one other way you can consider to try to get an internship. The <a href="http://imaginecup.com/">Imagine Cup</a> is a competition that Microsoft hosts for students. In the past, top ranked students from each region have been flown out for interviews at Redmond, skipping the whole screening process. I can&#8217;t promise that they will continue to do this, but if I ever saw a student who placed well in the imagine cup, I would definitely see it as being very positive.</p></blockquote>
<p>I must say, the guy is brave. I think its a good move. There are a lot of misconceptions about Microsoft as a company. It isn&#8217;t (all) evil :P I wish I knew he was. I&#8217;d certainly like to meet him and have a chat :) If <a href="http://www.reddit.com/user/DrinkingKoolAid">DrinkingKoolAid</a> <strong>ever</strong> reads this (chances are surely slim), get in touch with me. The first round&#8217;s on me!</p>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/09/14/anonymous-microsoft-developer-opens-ama-discussion-on-reddit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell Win7 x64 sound driver updates cause system freeze</title>
		<link>http://karunab.com/2009/09/13/dell-win7-x64-sound-driver-updates-cause-system-freeze/</link>
		<comments>http://karunab.com/2009/09/13/dell-win7-x64-sound-driver-updates-cause-system-freeze/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 23:28:00 +0000</pubDate>
		<dc:creator>Karun</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[Drivers]]></category>
		<category><![CDATA[Fail]]></category>
		<category><![CDATA[IDT]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://karunab.com/2009/09/13/dell-win7-x64-sound-driver-updates-cause-system-freeze/</guid>
		<description><![CDATA[I noticed that Dell had finally released updates for some of their drivers on their support site for a Dell Studio XPS 1640 on Windows 7 x64. I immediately started downloading them and after a reboot noticed that the update for IDT sound driver causes a freeze in any application trying to do anything related [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed that Dell had finally released updates for some of their drivers on their support site for a Dell Studio XPS 1640 on Windows 7 x64. I immediately started downloading them and after a reboot noticed that the update for IDT sound driver causes a freeze in any application trying to do anything related to sound. No updates on their track pad drivers it is so we continue to use Windows Vista drivers.</p>
<p>Speaking of IDT drivers causing serious woes, I would suggest to every Dell Studio XPS 1640 user planning to upgrade from Windows Vista to Windows 7 manually (ie. not using a ghost image provided by Dell) that you kindly <strong>DO NOT DO SO</strong>. Drivers such as the ones for IDT consume 40-50 CPU constantly for doing nothing of essence in the background. A simple “remove driver” wouldn’t work either. If Dell plans on shipping drivers like the current one, I would not even go to Dell for an upgrade to Windows 7.</p>
<p>Dell better come up with a fix quickly. I think I’ll call up Dell’s premium tech support just to tell them about this issue and hope its fixed quickly. On a side note, for some reason, side scroll on the track pad doesn’t work on Windows 7 in the current version of Firefox :( It works fine for every other software. Weird.</p>
<p><strong><span style="text-decoration: underline;">Update</span>:</strong> Just talked to tech support. Seems I&#8217;m the only one who has issues. Weirdly enough, a reinstall of the driver seems to have fixed the issue. ¬¬ Some odd quirk I guess.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 158px; width: 1px; height: 1px;">http://hax.gifpaste.org/?C=M;O=D</div>
]]></content:encoded>
			<wfw:commentRss>http://karunab.com/2009/09/13/dell-win7-x64-sound-driver-updates-cause-system-freeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
