<?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>Kristian Lunde &#187; Linux</title>
	<atom:link href="http://www.klunde.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.klunde.net</link>
	<description>www.klunde.net</description>
	<lastBuildDate>Sun, 18 Jul 2010 21:00:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using GNU screen</title>
		<link>http://www.klunde.net/2008/05/27/using-gnu-screen/</link>
		<comments>http://www.klunde.net/2008/05/27/using-gnu-screen/#comments</comments>
		<pubDate>Tue, 27 May 2008 20:14:18 +0000</pubDate>
		<dc:creator>Kristian Lunde</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[GNU]]></category>

		<guid isPermaLink="false">http://www.klunde.net/?p=25</guid>
		<description><![CDATA[
			
				
			
		
Recently I&#8217;ve been the victim of a really unstable internet connection. This lack of stability has made me a great fan of the GNU screen command in unix systems.
GNU Screen is a small piece of software that lets you initiate a number of terminals inside a single terminal window. The great advantage with screen is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F05%2F27%2Fusing-gnu-screen%2F" onclick="urchinTracker('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.klunde.net_2F2008_2F05_2F27_2Fusing-gnu-screen_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F05%2F27%2Fusing-gnu-screen%2F&amp;source=kristianlunde&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently I&#8217;ve been the victim of a really unstable internet connection. This lack of stability has made me a great fan of the GNU screen command in unix systems.</p>
<p>GNU Screen is a small piece of software that lets you initiate a number of terminals inside a single terminal window. The great advantage with screen is that if you loose your internet connection, the screen terminals and operations inside these terminals still run on the server, contrary to operations running directly on the terminal window of your external server.</p>
<p>Screen is real simple and in most cases you only need a few important commands:</p>
<ul>
<li>starting a session</li>
<li>listing all running sessions</li>
<li>attaching to a session</li>
<li>de attaching from a session</li>
<li>killing a session</li>
</ul>
<h3>Creating a new screen session</h3>
<p><strong>Command:</strong> <em>screen</em></p>
<pre>kristian@Saturn:~$ screen </pre>
<p><strong>Example:</strong></p>
<h3>Listing all active screen sessions</h3>
<p><strong>Command:</strong><em> screen -ls</em></p>
<p><strong>Example:</strong></p>
<div class="geshi no bash">
<div class="head">kristian@Saturn:~$ screen -ls</div>
<ol>
<li class="li1">
<div class="de1">There are screens on:</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11179</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11114</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">2</span> Sockets <span class="kw1">in</span> <span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>screen<span class="sy0">/</span>S-kristian.</div>
</li>
</ol>
</div>
<h3>Attaching to a session</h3>
<p>If only one screen session is active the command below will take you directly to the session. If there are several sessions running the command below will display a list of running sessions. To choose one of them the screen -r command has to be followed by the session name.</p>
<p><strong>Command: </strong><em>screen -r</em></p>
<p><strong>Example of several screen sessions running:</strong></p>
<div class="geshi no bash">
<div class="head">kristian@Saturn:~$ screen -r</div>
<ol>
<li class="li1">
<div class="de1">There are several suitable screens on:</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11179</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">11114</span>.pts<span class="nu0">-0</span>.Saturn <span class="br0">&#40;</span>Detached<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">Type <span class="st0">&quot;screen [-d] -r [pid.]tty.host&quot;</span> to resume one of them.</div>
</li>
</ol>
</div>
<p><strong>Example of attaching to a screen session:</strong></p>
<pre lang="bash">kristian@Saturn:~$ screen -r 11179.pts-0.Saturn</pre>
<h3>De attaching from a session</h3>
<p>De attaching from a screen session is real simple just remember the key combinations <img src='http://www.klunde.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Hold the<strong> CTRL</strong> key down, press<strong> A</strong>, then<strong> D</strong>. Thats it.</p>
<h3>Killing a screen session</h3>
<p>Killing a session is as simple as de attaching from one, just use the correct key combinations.</p>
<p>Keep the <strong>CTRL</strong> button down, press <strong>A</strong>, then <strong>K</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.klunde.net/2008/05/27/using-gnu-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java on Ubuntu</title>
		<link>http://www.klunde.net/2008/05/02/java-on-ubuntu/</link>
		<comments>http://www.klunde.net/2008/05/02/java-on-ubuntu/#comments</comments>
		<pubDate>Fri, 02 May 2008 08:04:35 +0000</pubDate>
		<dc:creator>Kristian Lunde</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.klunde.net/?p=11</guid>
		<description><![CDATA[
			
				
			
		
The other day I decided that it was about time to refresh my java knowledge. I&#8217;ve done some java development at work lately, but besides that It has been about 3 years since I last wrote any decent java apps. I have a few ideas of some small cool apps I want to write, but [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F05%2F02%2Fjava-on-ubuntu%2F" onclick="urchinTracker('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.klunde.net_2F2008_2F05_2F02_2Fjava-on-ubuntu_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F05%2F02%2Fjava-on-ubuntu%2F&amp;source=kristianlunde&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>The other day I decided that it was about time to refresh my java knowledge. I&#8217;ve done some java development at work lately, but besides that It has been about 3 years since I last wrote any decent java apps. I have a few ideas of some small cool apps I want to write, but first of all I had to check the java installation on my machine.</p>
<p>Im currently sitting on a Ubuntu 7.04 installation, so I started out by opening my console and typing<br />
<code><br />
java -version<br />
</code></p>
<p>I was a bit surprised about the result, java version could not be determined, I found out that 4 different versions of java were installed and neither the classpath or java_home were set. The java version I wished to used were not among the installed versions. I used the java installation guide on <a href="https://help.ubuntu.com/community/JavaInstallation" onclick="urchinTracker('/outgoing/help.ubuntu.com/community/JavaInstallation?referer=');">help.ubuntu.com</a> to install my preferred java version, the java 6 version from Sun. The guide was straight forward and the java installation seemed to work as expected after completing the guide.</p>
<p><code><br />
kristian@Saturn:/usr/lib$ java -version<br />
java version "1.6.0_03"<br />
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)<br />
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)<br />
</code></p>
<p>Looking good. So I tried typing:</p>
<p><code><br />
kristian@Saturn:/usr/lib$ javac -version<br />
javac: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory<br />
</code></p>
<p>Not looking that good, something was wrong <img src='http://www.klunde.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  I googled the result and found my mistake. Earlier while I was trying to get it all together with the 4 different java versions I changed the symlink in<em><strong> /usr/bin/</strong></em> and I forgot to add the <strong><em>-s</em></strong> when I created the link. Removing the symblink and recreating it did the trick.</p>
<p><code><br />
kristian@Saturn:/usr/bin$ sudo ln -s /etc/alternatives/javac javac<br />
</code></p>
<p>The javac in /etc/alternatives is a symblink to the current java version. And  trying the all famous <em><strong>javac -version</strong></em> now result in the anticipated result:</p>
<p><code><br />
kristian@Saturn:~$ javac -version<br />
javac 1.6.0_03<br />
</code></p>
<p>Now I&#8217;m all set to go and try out my java skills <img src='http://www.klunde.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.klunde.net/2008/05/02/java-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>yes</title>
		<link>http://www.klunde.net/2008/04/18/yes/</link>
		<comments>http://www.klunde.net/2008/04/18/yes/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 13:10:11 +0000</pubDate>
		<dc:creator>Kristian Lunde</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.klunde.net/?p=3</guid>
		<description><![CDATA[
			
				
			
		
Ever tried to replace a bunch of files with  cp -rf some/destination . in linux?
Then you might have had to do a number &#8216;y&#8217; to confirm the replacement of the already existing files, pretty annoying. Well linux has this marvelous little tool called yes, which automate this process and adds a y after the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F04%2F18%2Fyes%2F" onclick="urchinTracker('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.klunde.net_2F2008_2F04_2F18_2Fyes_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.klunde.net%2F2008%2F04%2F18%2Fyes%2F&amp;source=kristianlunde&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Ever tried to replace a bunch of files with  <em><strong>cp -rf some/destination </strong>. </em>in linux?</p>
<p>Then you might have had to do a number &#8216;y&#8217; to confirm the replacement of the already existing files, pretty annoying. Well linux has this marvelous little tool called yes, which automate this process and adds a y after the prompt when replacing a file.</p>
<p>if you just try to type <strong><em>yes </em></strong>in your console you will see that it starts printing &#8216;y&#8217;.</p>
<p>so this is how you actually do it:</p>
<p><em><strong>yes cp -r some/directory/* .</strong></em></p>
<p>For more information type <strong><em>man yes</em></strong> in your concole.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.klunde.net/2008/04/18/yes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
