<?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
<channel>
	<title>LinuxPlanet Blogs</title>
	<link>http://www.linuxplanet.org/blogs</link>
	<description>By Linux Geeks, For Linux Geeks.</description>
	<lastBuildDate>Wed, 08 Sep 2010 21:11:12 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	<!-- generator="WordPress/3.0" -->

	<item>
		<title>Linux Mint – Debian?</title>
		<description><![CDATA[Today is very important for Linux Mint. It’s one day to remember in the history of our project as we’re about to maintain a new distribution, a rolling one, which promises to be faster, more responsive and on which we’re less reliant on upstream components. Linux Mint Debian Edition (LMDE) comes with a Debian base, [...]]]></description>
		<link>http://lincgeek.org/blog/?p=1091</link>
			</item>
	<item>
		<title>Unix Named Pipes &#8211; An example of Interprocess communication</title>
		<description><![CDATA[<div class="diggthis_button">

</div><div class="tweetbutton"><a href="http://twitter.com/share" class="twitter-share-button">Tweet</a></div><!-- google_ad_section_start --><p>So, I have been selected as one of the teaching assistants for Operating systems course <img src="http://linuxers.org/sites/all/modules/fckeditor/fckeditor/editor/images/smiley/msn/teeth_smile.gif" alt="" /> and this time we had to give some examples of Named Pipes, demonstrating one form of Inter Process Communication aka IPC to the students. I had never used them before, but its fun knowing and working with them.</p>
<!--break-->
<p>I hope all of us have used pipes on Linux systems. Here is a simple pipe example I often use to check if a process is running or not.</p>
<blockquote>
<p><span class='root'>[shredder12]$</span> ps -e &#124; grep firefox</p>
</blockquote>
<p>The symbol &#34;&#124;&#34; used here is called pipe(its mostly above the &#34;Enter&#34; key). Just like conventional pipes, UNIX pipes are used to transfer data between processes, aka Inter Process communication. They transfer one program's/process's output to another process as input, ps and grep in our case. The output of 'ps -e' is transfered through pipe as an input to grep. They are called &#34;pipes&#34; because of their FIFO(first in first out) nature. They can be seen as files but with the FIFO property. We will see the reason in a little while.</p>
<h2>Difference between Pipes and Named Pipes</h2>
<p>In above example, as soon as the message is passed and grep executes, the pipe will no longer exist, i.e. it is a non-persistent thing, gets removed as soon as the task is over. Named pipes, however are persistent, have a name and they exist even after the processes are terminated. I think I might have lost you people here, so lets see a simple named pipe example.</p>
<blockquote>
<p><span class='root'>[shredder12]$</span> mkfifo mypipe</p>
</blockquote>
<p>This command creates a pipe. Now, if you do ls -l, you will see something like this</p>
<p class="rtecenter"><a href="http://linuxers.org/sites/default/files/content/misc/nm-output.png" rel="lightbox"><img alt="" style="width: 640px;height: 110px" src="http://linuxers.org/sites/default/files/content/misc/nm-output.png" /></a></p>
<p>So, as you can see, it has everything similar to a file, but the FIFO property. It can be deleted just like a simple file, using rm.</p>
<blockquote>
<p><span class='root'>[shredder12]$</span> rm mypipe</p>
</blockquote>
<p>Lets begin with the usage part. Try running this command in a terminal</p>
<blockquote>
<p><span class='root'>[shredder12]$</span> ps -e &#62; mypipe</p>
</blockquote>
<p>This command should have returned to a prompt(thats what you would have expected) but apparently it seems to get hanged in the middle of nowhere, why? The answer is these pipes work exactly like a conventional water-pipe does, i.e. it needs both the end to be open, one serving as an input and the other as output. So, the reason why the above command hasn't returned a prompt is because only one end of the pipe is opened, for the input. Until there is a process at the other end of the pipe to receive the data, the transfer or the communication isn't complete and so the command doesn't terminate.</p>
<p>Now, with the above command running in a terminal, try to run the following in another</p>
<blockquote>
<p><span class='root'>[shredder12]$</span> cat mypipe</p>
</blockquote>
<p>Now you will actually see the output of 'ps -e'. And note that this means the communication is done and as a result, both the commands will terminate and return to prompt.</p>
<p class="rtecenter"><a rel="lightbox" href="http://linuxers.org/sites/default/files/content/misc/pipe-ex.png"><img alt="" style="width: 645px;height: 344px" src="http://linuxers.org/sites/default/files/content/misc/pipe-ex.png" /></a></p>
<p>If you have understood the basic working of pipes then you might wonder if we can create an infinite loop using two of them. In a 1997 <a href="http://www.linuxjournal.com/article/2156">article of LJ</a>, the writer mentioned this little trick. Using two commands, he hooked up the ouptut of one pipe to other's input and vice versa, thus generating a loop.</p>
<p>However, I couldn't make it work on my system. After running the command, I didn't see any cat processes consuming huge resources. May be I did something wrong or may be the article is too old to work on today's systems, probably some defensive technique in later kernels to escape such accidents.</p>
<p>Anyway, I hope this small introduction to named pipes has given you a new insight into the working of Unix and Linux sytems.</p><!-- google_ad_section_end -->]]></description>
		<link>http://linuxers.org/article/linuxunix-named-pipes-example-interprocess-communication</link>
			</item>
	<item>
		<title>Google has a new Animated Doodle for its Logo and a Mystery</title>
		<description><![CDATA[Click here to view the embedded video.
Google has a brand new doodle on its page that is unlike any other doodle they&#8217;ve ever posted. It&#8217;s a series of balls that dance around if you move your mouse near them. When you stop moving the mouse, the balls all settle down to form the Google logo. This is only the third time I can remember the logos being animated; the first was the 30th anniversary of Pacman, the second the 25th anniversary of buckyball and now today&#8217;s. This article brings out that it is to celebrate Google&#8217;s 12th birthday!
I am [...]]]></description>
		<link>http://feedproxy.google.com/~r/GearDiary/~3/czyYY9z00fg/</link>
			</item>
	<item>
		<title>How to open a Directory or a file starting with a &#8220;-&#8221;, hyphen</title>
		<description><![CDATA[<div class="diggthis_button">

</div><div class="tweetbutton"><a href="http://twitter.com/share" class="twitter-share-button">Tweet</a></div><!-- google_ad_section_start --><div class="field field-type-filefield field-field-tip-logo">
    <div class="field-items">
            <div class="field-item odd">
                    <img class="imagefield imagefield-field_tip_logo" width="128" height="128" alt="" src="http://linuxers.org/sites/default/files/tip-logo/1283862811_Help-File.png?1283862842" />        </div>
        </div>
</div>
<p>Those of you who have not been in such a situation would never know how it feels when you are stuck opening/deleting a file or directory. The more you have been working on the shell, the more it sucks. When I tried all I could to get it work and still ended up with the same error all the time, I just sat on my chair, staring at the monitor for a while, wondering if this is somekind of bash's loophole :P.</p>
<p>I was trying to grep through some pidgin facebook chats when I was stuck for a while trying to open a directory with the name starting with a hyphen(&#34;-&#34;). I tried all I could think of, but I always ended with the same error.</p>
<blockquote>
<p>[shredder12]$ cd -directory<br />
bash: cd: -d: invalid option<br />
cd: usage: cd [-L&#124;-P] [dir]</p>
<p>[shredder12]$ cd \-directory</p>
<p>[shredder12]$ cd *directory</p>
<p>[shredder12]$ cd &#34;-directory&#34;</p>
</blockquote>
<p>As you can see the trouble is that the alphabets after a &#34;-&#34;, hyphen, are being considered as the command attributes/options but they are not, so what we need here is:</p>
<ul>
    <li>a way to tell the command that its not an option</li>
    <li>or, make the command start with something other than a hyphen</li>
</ul>
<p>The first method is to use a <strong>double-dash</strong> &#34;--&#34; before the name. A double-dash means the end of options to that command.</p>
<blockquote>
<p>[shredder12]$ cp -- -directory/</p>
</blockquote>
<p>For the other way, we need to start the command with something other than a hyphen and still make sure that its the same file.</p>
<blockquote>
<p>[shredder12]$ cp ./-directory</p>
</blockquote><!-- google_ad_section_end -->]]></description>
		<link>http://linuxers.org/quick-tips/how-open-directory-or-file-starting-hyphen</link>
			</item>
	<item>
		<title>UTorrent available for GNU / Linux</title>
		<description><![CDATA[The alpha version (3.0 build 21 701) of μTorrent, the popular application for the torrent network is now available for download. Obviously, this is not the final liability release and is necessary to use the program through the terminal. Future versions will offer more than this application. ΜTorrent 3.0 alpha report that work well with [...]]]></description>
		<link>http://linuxkommando.com/2010/09/utorrent-available-for-gnu-linux.html</link>
			</item>
	<item>
		<title>How to Wget: Manage network Bandwidth rate and Quota using Wget</title>
		<description><![CDATA[<div class="diggthis_button">

</div><div class="tweetbutton"><a href="http://twitter.com/share" class="twitter-share-button">Tweet</a></div><!-- google_ad_section_start --><p>While using Wget in scripts or otherwise, mostly when there is a lot of content to be downloaded, we need to set wget's network usage and bandwidth parameters. They both default to unlimited and when there is a lot of download involved, its always a good practice to set the limits. In this article, we will see how to control the bandwidth rate and total usage(quota).</p>
<h2>Limit the download bandwidth rate using Wget's --limit-rate option</h2>
<p>Just like any other application, wget will try to use the maximum amount of bandwidth available. If you want to control the download rate of wget, then use the --limit-rate flag. Lets say you want to download some video.</p>
<blockquote>
<p><span class='root'>[shredder12]$</span> wget --limit-rate=60k <a href="http://foo.bar/video.ogv" title="http://foo.bar/video.ogv">http://foo.bar/video.ogv</a></p>
</blockquote>
<p>This will limit the download rate to 60 KBps. Use &#34;m&#34; for MBps. Wget even accepts a decimal value, e.g. 2.5. This flag is beneficial only for large files. Thats because the implementation of the rate limitation feature takes sometime to achieve the concerned limit. So, it might not appear to be working for small files.</p>
<h2>How to Wget: limit network bandwidth usage/quota using Wget's -Q option</h2>
<p>The network quota or the total bandwidth usage can also be limited using wget's --quota or -Q attribute.</p>
<blockquote>
<p><span class='root'>[shredder12]$</span> wget --quota 10m <a href="http://foo.bar/file.tgz" title="http://foo.bar/file.tgz">http://foo.bar/file.tgz</a> <a href="http://foo.bar/otherfile.tgz" title="http://foo.bar/otherfile.tgz">http://foo.bar/otherfile.tgz</a></p>
</blockquote>
<p>Please note that, if quota overflows while downloading a file then further downloading will be stopped once the current file is successfully downloaded. So, if the size of both the files are 8 and 5 MB then it will download both of them. Just like --limit-rate we can use m for Mega Bytes and similarly others. 0 sets the value to be unlimited.</p><!-- google_ad_section_end -->]]></description>
		<link>http://linuxers.org/howto/how-wget-manage-network-bandwidth-rate-and-quota-using-wget</link>
			</item>
	<item>
		<title>WordPress Plugin – Are you sure ?</title>
		<description><![CDATA[This is the second time that I have pressed publish when I meant to press preview. The solution &#8211; I hope &#8211; is the &#8220;Are you sure ?&#8221; plugin. All it does is ask you are you sure when you press publish. Let&#8217;s see if it works. If you see this well then it didn&#8217;t. [...]]]></description>
		<link>http://kenfallon.com/?p=781</link>
			</item>
	<item>
		<title>Secure browsing on a open wifi network</title>
		<description><![CDATA[Most of the traffic on the Internet is sent in the clear &#8211; fact. Back in the day the Internet was a trusting place. You&#8217;d think that given it was developed as a Darpa (Defense Advanced Research Projects Agency) project that there would be a lot of thought put into security. Well there was and [...]]]></description>
		<link>http://kenfallon.com/?p=709</link>
			</item>
	<item>
		<title>Linux Outlaws podcast grabber</title>
		<description><![CDATA[
So I just bought a new music player which plays OGG (Sandisk Sansa Clip+), and I wanted to get all the Linux Outlaws podcasts.
They have a nice archive at outlawarchives.com but I am to lazy to click 165 times. 
So I wrote a script to grab all the podcasts, except the first 16 because they do not have a webpage and I am to lazy to look into that. 
Just a bash script, copy and paste and change $START and $END numbers to not eat all the bandwith.
Open the article to see the script.
]]></description>
		<link>http://raymii.org/cms/index.php?title=Linux_Outlaws_Grabber</link>
			</item>
	<item>
		<title>The Best Buy Experience – One Geek’s Perspective</title>
		<description><![CDATA[Last night, my wife and I went to Best Buy to get her a new computer. Her netbook had had it, and she needed something that would be capable of working well or her longer than a year or so. While perusing the laptops, another customer and I both noticed and commented upon several machines that the techs had &#8220;tweaked&#8221;. What they had done, I am not sure, but I suspect that if you want the least amount of hassle, you should pick a machine that doesn&#8217;t say it was prepared by the Geek Squad. Odds are, there will be extra [...]]]></description>
		<link>http://feedproxy.google.com/~r/GearDiary/~3/o-Kc6IiGXzM/</link>
			</item>
</channel>
</rss>
