<?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>anil.org.in &#187; Technology</title>
	<atom:link href="http://anil.org.in/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://anil.org.in</link>
	<description>Stuff I run across.</description>
	<lastBuildDate>Tue, 08 Dec 2009 18:46:39 +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>Netcat (nc): &#8220;TCP/IP Swiss Army Knife&#8221;</title>
		<link>http://anil.org.in/2009/05/26/netcat-nc-tcpip-swiss-army-knife/</link>
		<comments>http://anil.org.in/2009/05/26/netcat-nc-tcpip-swiss-army-knife/#comments</comments>
		<pubDate>Tue, 26 May 2009 06:31:28 +0000</pubDate>
		<dc:creator>anil</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://anil.org.in/2009/05/26/netcat-nc-tcpip-swiss-army-knife/</guid>
		<description><![CDATA[Many of us use telnet as a network debugging tool quite often. Just with its hostname and port options we find it very useful. But, I&#8217;m sure that many would recall following situations where we find the telnet client inadequate: To test a UDP service Want to send a pre-prepared set of request/responses to a [...]]]></description>
			<content:encoded><![CDATA[<p>Many of us use <code>telnet</code> as a network debugging tool quite often. Just with its <code>hostname</code> and <code>port</code> options we find it very useful. But, I&#8217;m sure that many would recall following situations where we find the <code>telnet</code> client inadequate:</p>
<ul>
<li>To test a UDP service</li>
<li>Want to send a pre-prepared set of request/responses to a server (to test a service)</li>
<li>Specify a Gateway for the TCP or UDP connection (checking routing and firewalling)</li>
<li>Receive and store dump of the traffic (network and application troubleshooting)</li>
<li>Send a UDP broadcast over the subnet (Network and application testing)</li>
<li>To set the ToS (type of service) flag in IP packet (to test QoS settings)</li>
<li>To copy a file over network without any regular services running</li>
<li>Do a port scan (without opening I/O)</li>
<li>Mimic the request/response sequence of a service/client you want to test</li>
</ul>
<p>There is a less-known tool called <code>nc</code>&#8211;acronym for Netcat&#8211;which was ranked 4th in the latest Top 100 Network Security Tools 2006 conducted by <code>Insecure.org</code> and always in the top 5 in previous years as well. </p>
<p><code>nc</code> can perform all the above and more. As it is rightly assigned with the caption of &#8220;TCP/IP swiss army knife.&#8221; Here is a quick set of commands to use <code>nc</code> for the use of a network administrator/troubleshooter.</p>
<p>Please note that Linux and BSD ports of <code>nc</code> differs in behaviour and syntax. This post is mostly based on the Linux port. I have tried to mention the difference where ever possible.</p>
<ul>
<li><strong>Test a TCP Service:</strong>
<p><code>nc &lt;hostname&gt; &lt;port number&gt;</code><br />
e.g.: <code>nc www.google.com 80</code></p>
<p>If you need to run a shell command after the TCP connection is established, use the &#8220;-c&#8221; option.</p>
<p><code>nc -c wwwclient www.google.com 80</code></p>
<p>There is an important behaviour you need to notice while using  -c and -e (invokes a script) options: the called command is supposed to handle both input and output of  <code>nc</code>. This means that while passing an <code>echo</code> command, for example, with -c option, you cannot expect nc to print the response to standard out. For example, the following command writes nothing to standard out:</p>
<p> nc -c &#8220;echo GET / HTTP/1.0&#8243; www.google.com 80</p>
<p>This is because nc pipes the HTTP response from www.google.com to <code>echo</code>. The -e option has the same behaviour. In the BSD port of <code>nc</code> there is no <code>-c</code> option available. And the <code>-e</code> has a very different meaning.</p>
<p>If you want to make a request to a server in two or more lines (as in the case of, say, HTTP protocol), write them down in a file and cat-pipe that file to NC. For example if you want to find the public IP address of your Internet gateway, create a text file http.txt with the following content:<br />
<code><br />
&lt;code&gt;<br />
GET /ip HTTP/1.0<br />
Host: www.linuxense.com</p>
<p>&lt;/code&gt;<br />
</code><br />
Now issue this command:</p>
<p>cat http.txt|nc www.linuxense.com 80</p>
<p>In certain protocols, such as SMTP, it needs to wait for the server to make a response before nc sends the next request. In such situation the -i option comes handy; it waits for the specified number of seconds before it sends the next line.</p>
<p>Now try this SMTP transaction. Save the following in to a file named, say, smtp.txt<br />
<code><br />
&lt;code&gt;<br />
helo greetings<br />
mail from: &lt;me@myhost&gt;<br />
rcpt to: &lt;you@yourhost&gt;<br />
data<br />
Subject: test from Netcat</p>
<p>Hello,<br />
This is a test from Netcat</p>
<p>See ya!</p>
<p>~me</p>
<p>.</p>
<p>&lt;/code&gt;<br />
</code></p>
<p>Now play out this transaction:</p>
<p><code><br />
cat smtp.txt | nc -i 2 your_smtp_server 25<br />
</code></p>
<p>See the <code>-i</code> in action. </p>
<p>There is a <code>-n</code> option that disables any DNS look up. This is useful if you are providing the IP address of the host and to explicitly say so to <code>nc</code>.</p>
<p>Use <code>-p</code> option to specify a source port. It is even possible to specify a range of port as in <code>80-1024</code> (both inclusive). If you omit the <code>-p</code> option, it will use a random port.</p>
</li>
<li><strong>Emulate TCP Service</strong>
<p>Use the <code>-l</code> flag to instruct <code>nc</code> to stay in listen mode. Use the following to bind <code>nc</code> to port 8000:</p>
<p><code>nc -l 8000</code></p>
<p>Normally <code>nc</code> quits when the remote connection closes. To make it stay listening for another connection, use <code>-k</code> (found to work only in BSD port). </p>
<p>Here <code>-p</code> option to specify the port it is listening to is allowed in Linux. In the BSD port, this is illegal.
</li>
<li><strong>Emulate a UDP Service</strong>
<p>Use the <code>-u </code> option, <code>nc</code> will turn the protocol to UDP. Almost all options which are valid for TCP mode (default mode) are valid with this option too.</p>
<p>Emulate a DNS service:</p>
<p><code>nc -u -l -p 53</code> (note that all parameters are similar to those in TCP mode. The option <code>-u</code> makes all the difference).</p>
<p>Here, the <code>-p</code> is a required option in Linux where us in BSD it is not permitted.</p>
<p>Now, run a dig command at it:</p>
<p><code>dig @localhost www.linuxense.com</code></p>
<p>You will see a partially readable line being printed on the console and this is how a DNS query looks like. Capture this into a file:</p>
<p><code>nc -u -i -p 53 > dns-query.txt</code> </p>
<p>And playback it at a functional DNS server and see the output:</p>
<p><code>cat dns-query.txt |nc -u mydnsserver 53</code></p>
</li>
<li>
<strong>Specifying Source IP Address:</strong></p>
<p>If you are on your gateway and you want to specify the source IP address of packets leaving the gateway, use the <code>-s</code> option. For example:</p>
<p><code>nc -s 192.168.1.1 remotehost 80</code>
</li>
<li><strong>Run a Zero I/O Port Scan</strong>
<p>See this example:<br />
<code>nc -z -v remotehost 80</nc></p>
<p>The <code>-z</code> runs <code>nc</code> in zero I/O scan mode. <code>-v</code> option is to turn on the verbose mode.</p>
<p>It is also possible to specify a range of IP addresses as follows (both IP addresses are inclusive):</p>
<p><code>nc -zv remotehost 80-1024</code>
</li>
<li><strong>Set "Type of Service" (ToS) Flag</strong>
<p>The flag <code>-x </code> allows to set the IP ToS flag. Possible values are "Minimize-Delay", "Maximize-Throughput", Maximize-Reliability", "Minimize-Cost".</p>
</li>
<li><strong>Set Up a Service Gateway/Proxy</strong>
<p>This is a quick and trivial service gateway you can try out in a few seconds. You device more sophisticated gateways with <code>nc</code>. BSD port of <code>nc</code> provides built-in support for this functionality with <code>-X</code> and <code>connect</code> verb.
</ul>
<p>If you enjoy reading this post and liked <code>nc</code>, please post here the <code>nc</code> tricks and hacks you invent.</p>
<p>--<br />
Related post:<br />
<a href="http://anil.org.in/2008/07/06/learn-ip-networking/">Learn IP Networking</a></p>
<p>Further reading:<br />
<a href="http://www.manpagez.com/man/1/nc/">BSD nc man page</a><br />
<a href="http://netcat.sourceforge.net/">GNU Netcat official homepage</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://anil.org.in/2009/05/26/netcat-nc-tcpip-swiss-army-knife/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Reference Site for Each Programming Language</title>
		<link>http://anil.org.in/2008/09/22/best-reference-site-for-each-programing-language/</link>
		<comments>http://anil.org.in/2008/09/22/best-reference-site-for-each-programing-language/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 18:37:28 +0000</pubDate>
		<dc:creator>anil</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Programming Languages]]></category>

		<guid isPermaLink="false">http://anil.org.in/2008/09/22/best-reference-site-for-each-programing-language/</guid>
		<description><![CDATA[Inspired from a Slashdot post, I thought of preparing a list of best reference web sites for each programming languages that we use at Linuxense. Send in if your suggestions. C http://www.acm.uiuc.edu/webmonkeys/book/c_guide/ C++ http://www.research.att.com/~bs/C++.html Java http://java.sun.com Javascript http://developer.mozilla.org/en/JavaScript Lua http://www.lua.org/ Pascal http://www.freepascal.org/docs-html/ref/ref.html Perl http://perldoc.perl.org/ http://www.perl.org/ http://cpan.org/ http://www.perlmonks.org/ PHP http://www.php.net Python http://python.org/ Ruby http://www.ruby-lang.org/en/documentation/ Scheme http://groups.csail.mit.edu/mac/projects/scheme/ [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired from a Slashdot post, I thought of preparing a list of best reference web sites for each programming languages that we use at <a href="http://www.linuxense.com?ref=anil.org.in">Linuxense</a>. Send in if your suggestions.</p>
<ul>
<li>
 C</p>
<ul>
<li><a href="http://www.acm.uiuc.edu/webmonkeys/book/c_guide/">http://www.acm.uiuc.edu/webmonkeys/book/c_guide/</a></li>
</ul>
</li>
<li>C++
<ul>
<li><a href="http://www.research.att.com/~bs/C++.html">http://www.research.att.com/~bs/C++.html</a></li>
</ul>
</li>
<li>
Java</p>
<ul>
<li><a href="http://java.sun.com">http://java.sun.com</a></li>
</ul>
</li>
<li>Javascript
<ul>
<li><a href="http://developer.mozilla.org/en/JavaScript">http://developer.mozilla.org/en/JavaScript</a></li>
</ul>
</li>
<li>Lua
<ul>
<li><a href="http://www.lua.org/">http://www.lua.org/</a></li>
</ul>
</li>
<li>Pascal
<ul>
<li><a href="http://www.freepascal.org/docs-html/ref/ref.html">http://www.freepascal.org/docs-html/ref/ref.html</a></li>
</ul>
</li>
<li>Perl
<ul>
<li><a href="http://perldoc.perl.org/">http://perldoc.perl.org/</a></li>
<li><a href="http://www.perl.org/">http://www.perl.org/</a></li>
<li><a href="http://cpan.org/">http://cpan.org/</a></li>
<li><a href="http://www.perlmonks.org/">http://www.perlmonks.org/</a></li>
</ul>
</li>
<li>PHP
<ul>
<li><a href="http://www.php.net">http://www.php.net</a></li>
</ul>
</li>
<li>Python
<ul>
<li><a href="http://python.org/">http://python.org/</a></li>
</ul>
</li>
<li>Ruby
<ul>
<li><a href="http://www.ruby-lang.org/en/documentation/">http://www.ruby-lang.org/en/documentation/</a></li>
</ul>
</li>
<li>Scheme
<ul>
<li><a href="http://groups.csail.mit.edu/mac/projects/scheme/">http://groups.csail.mit.edu/mac/projects/scheme/</a></li>
</ul>
</li>
<li>TCL
<ul>
<li><a href="http://en.wikibooks.org/wiki/Programming:Tcl">http://en.wikibooks.org/wiki/Programming:Tcl</a></li>
</ul>
</li>
</ul>
<p>&#8211;</p>
<ul>
<li>General Programming
<ul>
<li><a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">Structure and Interpretation of Computer Programs</a></li>
</ul>
</li>
<li>Regular Expression
<ul>
<li><a href="http://www.regular-expressions.info/">http://www.regular-expressions.info/</a></li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://anil.org.in/2008/09/22/best-reference-site-for-each-programing-language/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IPTV: The Next Big Thing?</title>
		<link>http://anil.org.in/2007/04/12/iptv-the-next-big-thing/</link>
		<comments>http://anil.org.in/2007/04/12/iptv-the-next-big-thing/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 07:31:50 +0000</pubDate>
		<dc:creator>anil</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://anil.org.in/2007/04/12/iptv-the-next-big-thing/</guid>
		<description><![CDATA[As a concept IPTV has been around for a while. Everybody talks about it. Everybody wants to subscribe to IPTV service. But companies are yet to wet their hands. Those who are new this new method of television content delivery can check out the Wiki page. Players in India All those companies who extended a [...]]]></description>
			<content:encoded><![CDATA[<p>As a concept IPTV has been around for a while. Everybody talks about it. Everybody wants to subscribe to IPTV service. But companies are yet to wet their hands. Those who are new this new method of television content delivery can <a href="http://en.wikipedia.org/wiki/IPTV">check out</a> the Wiki page.</p>
<p><strong>Players in India</strong></p>
<p>All those companies who extended a piece of wire (&#8220;last mile&#8221; connectivity) to homes can be a potential provider of IPTV service in its broadest sense. So your cable provider, wired/land phone service provider or even the state electricity board can enter into IPTV business.</p>
<p>Telecom companies such as Reliance which doesn&#8217;t have last mile connectivity to homes are fast lying fiber connections to homes these days. They are preparing for the IPTV market.</p>
<p>Actually these companies are looking at a broader spectrum of services called &#8220;Triple Play&#8221; (combining voice, data and video) or even &#8220;Quadruple Play&#8221; (where wireless communications is introduced as yet another media to deliver video). This way one provider can cater all communication needs of a home all by themselves (and get all possible revenues).</p>
<p>In India, predominantly land phone service companies (BSNL/MTNL, Reliance, etc.) and cable service providers (Hathway, Asianet, Sify, etc.) are the potential players. MTNL in Pune and BSNL in Calcutta have already launched IPTV services on experimental basis. Reliance, with their newly laid FTTP (Fiber to the Premises), seems to be ready to follow.</p>
<p><strong>What IPTV Provides</strong></p>
<p>With IPTV, subscribers can expect to get what they are currently getting with their normal cable TV/CAS system. In addition to that it can provide Video on Demand (VOD). Those who subscribe to Triple Play providers can enjoy broadband and VoIP as well&#8211;all through just one connection and one IP device. All from a single provider.</p>
<p><strong>Which Player has the Advantage?</strong></p>
<p>BSNL is far ahead of the rest in terms of number of homes and coverage/geographical area. But coper pair has its own limitation in terms of the bandwidth it can carry.</p>
<p>One channel at SDTV resolution will take up to 1.4 mbps with fairly good compression. Simultaneous delivery of channels is necessary to keep user demands. For example, this is required if a subscriber is using a DVR which can record one channel while another channel is being viewed on the TV. Sometimes subscriber might prefer to use picture-in-picture which, again, needs multiple channels to be delivered simultaneously.</p>
<p>BSNL employs ADSL. ADSL  can carry 2mbps which is too inadequate to support this. I&#8217;m not sure what technology they are using at Pune and Calcutta. One technology I can think of is ADSL2+ which can deliver up to 25mbps. But this bandwidth reduces substantially as the subscriber distance increases from the DSLAM.</p>
<p>Cable providers has an advantage here. HFC, theoretically, can carry up to 4.5gbps of data. It is a lot more than required to deliver multiple channels simultaneously even at HDTV resolution. So cable operators has a an edge over BSNL which uses coper as last mile.</p>
<p><strong>Who Can Ride the Wave</strong></p>
<p>Though people are waiting for the rollout of the service to sign up, business viability of IPTV service is yet to be proved. But if people receive it, IPTV can be a lucrative business. (It is possible to build several business models based on the viewer demography information IPTV system can provide. No such thing is possible with conventional cable.)</p>
<p>Those operators with HFC has the advantage of bandwidth capability. But HFC installations which are originally laid for analogue cable TV may fail to carry digital signals without quality degradation. Reliance with FTTP closely follows the above lot. Though their home count is less compared to that of cable TV operators, Reliance can provide better quality service due to obvious reasons.</p>
<p>Local cable operators are another category who can enter into this business. And thus they can move higher up in the value chain. Local cable operators can provide more localised content. They can stream targeted ads. But one thing which may prevent them from doing so; entry barrier of IPTV business.</p>
<p>High entry cost of IPTV business is constituted by IPTV/networking equipment costs and media rights. But local cable operators can buy media rights jointly. Equipment costs will continue to remain as a real entry barrier.</p>
<p>One good thing that can happen is the commoditisation of IPTV equipments including CMTS. If chip manufacturers can come up with solutions which are based on PC architecture, for example, rather than using specialised electronics (which drive up cost), this would become possible.</p>
<p>TRAI may consider unbundling BSNL&#8217;s last mile in future. If this happens local players can lease BSNL lines to run their business on.</p>
<p>Let&#8217;s wait and see.</p>
]]></content:encoded>
			<wfw:commentRss>http://anil.org.in/2007/04/12/iptv-the-next-big-thing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Google Knows</title>
		<link>http://anil.org.in/2007/03/17/google-knows/</link>
		<comments>http://anil.org.in/2007/03/17/google-knows/#comments</comments>
		<pubDate>Sat, 17 Mar 2007 13:00:46 +0000</pubDate>
		<dc:creator>anil</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://anil.org.in/2007/03/17/google-knows/</guid>
		<description><![CDATA[Now everyone is known to the world through an Email ID. Or if you know an Email address, you can trace down the person who owns it. That became magnificently possible with the social networking revolution on the Internet. But there is a limit to the extend of information you can dig out this way; [...]]]></description>
			<content:encoded><![CDATA[<p>Now everyone is known to the world through an Email ID. Or if you know an Email address, you can trace down the person who owns it. That became magnificently possible with the social networking revolution on the Internet. But there is a limit to the extend of information you can dig out this way; to the extend the owner of the Email ID decides to expose about himself. We cannot go further down but Google does.</p>
<p><a href="http://searchenginewatch.com/showPage.html?page=2156431">Roughly, one in every two people who searches the Internet uses Google</a> and Google handles <a href="http://www.google-watch.org/bigbro.html">more than 200 million searches every day</a>.</p>
<p>When you run a search in Google for the first time in your browser, Google will set a Cookie with a unique ID in your browser. There after, Google knows that all the searches you are running are coming from &#8220;you&#8221; and presumably they keep record of them all.</p>
<p>So, based on the searches you run on Google, they can build a &#8220;picture&#8221; about you&#8211;what you want, what you do, what&#8217;s bothering you, your interests, hobbies, and probably what are you planning to do this weekend. May be, after God (&#8220;Everything is uncovered and laid bare before the eyes of Him to whom we must give account&#8221; &#8211;Hebrews 4:13), Google knows you best. Now closest friend of man is not his wife or even a human being any more; it is Google (or Internet search engines in general). People share the most private thoughts with Google.</p>
<p>This is harmless till they link that &#8220;picture&#8221; with the real you. That happened with the introduction of Gmail. You might have noticed that even if you type gmail.com, you login to mail.google.com. The moment you successfully log in, they can associate the above-mentioned Cookie with your Email ID.</p>
<p>An Email ID in Gmail is not like yet another ID in Hotmail or Yahoo. Each Email ID has the &#8220;genealogy&#8221; information attached to it. Each Gmail ID is created out of an invite sent out by an existing Gmail ID. So it is almost impossible to disguise yourself before Google. Besides knowing who you are, Google also knows whom you are related to. For example Google knows that you are Ram, husband of Meena and friend of John.</p>
<p>Google even knows what you do out side Google to a certain extent. For example when you sign up for a new third-party service (with your Gmail ID), Google knows that you did so. They even keep track of the links you click in Emails and chat texts.</p>
<p>They are the best in the world for text parsing and analysing. And if we closely examine we can see that that makes the core of all their technologies. Google can even analyse your chat live. So think twice next time you chat with your friend on Google to discuss a new business idea or when you use Google Documents to type a new business plan. The point is that Google is a privacy bomb which can blow up any time either though a security breach or by the data mining bureaucrats of Washington.</p>
<p>Google, after handling trillions of queries from around the world by now, might have an interesting picture about the people in this world, I&#8217;m sure. Nobody has ever got a chance to see the world at such a macro level yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://anil.org.in/2007/03/17/google-knows/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
