<?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>CCIE Lab &#187; a mad cry in the night</title>
	<atom:link href="http://ccielab.ro/tag/a-mad-cry-in-the-night/feed/" rel="self" type="application/rss+xml" />
	<link>http://ccielab.ro</link>
	<description>Cry in the Lab, Laugh in the Datacenter</description>
	<lastBuildDate>Wed, 28 Jul 2010 16:29:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Telnet handler in Firefox-(K)Ubuntu</title>
		<link>http://ccielab.ro/2009/11/telnet-handler-in-firefox-kubuntu/</link>
		<comments>http://ccielab.ro/2009/11/telnet-handler-in-firefox-kubuntu/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 16:16:17 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[a mad cry in the night]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ccielab.ro/?p=49</guid>
		<description><![CDATA[In labs we use reverse telnet to access our equipment (as in &#8220;routers and switches&#8221;) directly into console. To make things a little bit easier for our students we created a web page with &#8220;telnet://&#8221; links pointing directly to each router/switch.
That should be enough to solve all those pesky little questions like &#8220;what was that [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify">In labs we use reverse telnet to access our equipment (as in &#8220;routers and switches&#8221;) directly into console. To make things a little bit easier for our students we created a web page with &#8220;telnet://&#8221; links pointing directly to each router/switch.<br />
That should be enough to solve all those pesky little questions like &#8220;what was that address again ?&#8221;. And it is. At least when the computer used by our students is running Windows. But we do have a little problem because all our computers in the lab are running Ubuntu. And Firefox. And it appears that Firefox in Ubuntu doesn&#8217;t know how to handle &#8220;telnet://&#8221; links.</p>
<p style="text-align: justify">I solved the problem by installing Opera browser and add the telnet handler in Opera. Or even better, install Opera and Putty and use Putty to handle &#8220;telnet://&#8221;. But the problem with Firefox kept bugging me and even if I&#8217;m lazy i knew that it became personal.<br />
So I started to search the allmighty internet. I found out that I can add telnet protocol in user prefs in Firefox. But it didn&#8217;t work. So I kept searching and finally I&#8217;ved put the bits and pieces together and solved the problem. Here it goes.</p>
<p style="text-align: justify">First thing to do is to tell Firefox that we WANT to use telnet:// links. To do that we must open Firefox and type &#8220;about:config&#8221; in address bar. And we create a new boolean preference (right click on an empty space), name it &#8220;network.protocol-handler.expose.telnet&#8221; and set the value &#8220;false&#8221; and restart the browser. That should be enough for Firefox to let us select an external application to open &#8220;telnet://&#8221; links.<br />
From this point forward we can choose the easy way and choose putty or the hard way and use gnome-terminal/xterm/konsole. The &#8220;hard way&#8221; because telnet in terminal doesn&#8217;t know how to handle &#8220;address:port&#8221; format. So how should we do that ? Simple, we create a shell script and we use that script as the default application to open &#8220;telnet://&#8221; links in Firefox.</p>
<p style="text-align: justify">The script is pretty easy :</p>
<blockquote>
<pre style="text-align: justify">

#!/bin/sh

address=`echo ${*##telnet://} | sed 's/:/ /g'`

#For xterm junkies :
xterm -e "telnet $address"

#For gnome-terminal users :
#uncomment the next line but comment
#all other terminal launchers (xterm, konsole)
#gnome-terminal -e "telnet $address"

#For konsole hipsters :
#konsole sends args separately to command so we use "" only for telnet
#uncomment the next line but comment
#all other terminal launchers (gnome-terminal, xterm)
#konsole -e "telnet" $address
</pre>
</blockquote>
<p>And voila, sit back, relax and enjoy a cold beer&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://ccielab.ro/2009/11/telnet-handler-in-firefox-kubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
