<?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>The Road to Elysium &#187; Linux</title>
	<atom:link href="http://jorge.fbarr.net/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://jorge.fbarr.net</link>
	<description>The life of a geek, father and husband</description>
	<lastBuildDate>Wed, 16 Nov 2011 14:43:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>nginx &#8211; Error 413: Request Entity Too Large</title>
		<link>http://jorge.fbarr.net/2011/04/03/nginx-error-413-request-entity-too-large/</link>
		<comments>http://jorge.fbarr.net/2011/04/03/nginx-error-413-request-entity-too-large/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 19:25:29 +0000</pubDate>
		<dc:creator>jorge</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[413]]></category>
		<category><![CDATA[conf]]></category>
		<category><![CDATA[entity]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[large]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[too]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://jorge.fbarr.net/?p=1201</guid>
		<description><![CDATA[The default maximum body size of a client request, or maximum file size, that nginx allows you to have, is 1M. So when you try to upload something larger than 1M, you get the following error: 413: Request Entity Too Large. Changing your php.ini-settings alone won&#8217;t do much. So to fix this problem, follow these [...]]]></description>
			<content:encoded><![CDATA[<p>The default maximum body size of a client request, or maximum file size, that <b>nginx</b> allows you to have, is 1M. So when you try to upload something larger than 1M, you get the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">413: Request Entity Too Large.</pre></div></div>

<p>Changing your <b>php.ini</b>-settings alone won&#8217;t do much. So to fix this problem, follow these steps.</p>
<p>Open up your <b>nginx.conf</b>-file, with an editor of your choice:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>nginx.conf</pre></div></div>

<p>..and add <b>client_max_body_size</b> to the <b>http</b>-section:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">client_max_body_size 20M;</pre></div></div>

<p>Save and close the file, apply the changes to <b>nginx</b>, and reload:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nginx <span style="color: #660033;">-t</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nginx <span style="color: #660033;">-s</span> reload</pre></div></div>

<p>Try uploading again. Should be working. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jorge.fbarr.net/2011/04/03/nginx-error-413-request-entity-too-large/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wallpaper concatenation with ImageMagick</title>
		<link>http://jorge.fbarr.net/2011/04/03/wallpaper-concatenation-with-imagemagick/</link>
		<comments>http://jorge.fbarr.net/2011/04/03/wallpaper-concatenation-with-imagemagick/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 19:03:46 +0000</pubDate>
		<dc:creator>jorge</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[concatenate]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[side by side]]></category>
		<category><![CDATA[wallpaper]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://jorge.fbarr.net/?p=1194</guid>
		<description><![CDATA[At both home and work, I have a dual monitor setup. Having recently discovered the windowmanager xmonad, I&#8217;ve found a setup that enables me to use Xinerama, and at the same time have the functionality that a separate X screen-setup would provide me. But with Xinerama comes the Twin View-setting that the Nvidia drivers provide, [...]]]></description>
			<content:encoded><![CDATA[<p>At both home and work, I have a dual monitor setup. Having recently discovered the windowmanager <a href="http://www.xmonad.org">xmonad</a>, I&#8217;ve found a setup that enables me to use Xinerama, and at the same time have the functionality that a separate X screen-setup would provide me. But with Xinerama comes the Twin View-setting that the Nvidia drivers provide, which &#8220;merges&#8221; both monitors, and gives me one large virtual desktop. Finding wallpaper for it can be a bit tricky, especially the ones that are designed for one specific resolution. But this is where <b>ImageMagick</b> comes into play. What I want is two images, with different resolutions, side by side. You could of course use something else, like <b>GIMP</b>, but you&#8217;d have to align things manually, and why risk it when a simple command can do the trick?</p>
<p>First install <b>ImageMagick</b>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> ImageMagick</pre></div></div>

<p>..then do the magic:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">montage wallpaper_1920x1080.jpg wallpaper_1680x1050.jpg <span style="color: #660033;">-tile</span> 2x1 <span style="color: #660033;">-geometry</span> <span style="color: #ff0000;">&quot;1920x1080+0+0&quot;</span> <span style="color: #660033;">-mode</span> concatenate final_wallpaper.jpg</pre></div></div>

<p>By setting <b>geometry</b> to <b>&#8220;1920&#215;1080+0+0&#8243;</b>, we set the preferred size of one of the tiles to be that, thus resizing images that are too large.</p>
<p>The results? Well, for me, this was it:</p>
<p><a href="http://jorge.fbarr.net/wp-content/uploads/2011/04/xmonad_wallpaper.jpg"><img src="http://jorge.fbarr.net/wp-content/uploads/2011/04/xmonad_wallpaper-300x90.jpg" alt="" title="xmonad_wallpaper" width="300" height="90" class="aligncenter size-medium wp-image-1199" /></a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://jorge.fbarr.net/2011/04/03/wallpaper-concatenation-with-imagemagick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making your BASH history more efficient</title>
		<link>http://jorge.fbarr.net/2011/03/24/making-your-bash-history-more-efficient/</link>
		<comments>http://jorge.fbarr.net/2011/03/24/making-your-bash-history-more-efficient/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 11:36:37 +0000</pubDate>
		<dc:creator>jorge</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[erasedups]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[histcontrol]]></category>
		<category><![CDATA[histignore]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[histtimeformat]]></category>
		<category><![CDATA[ignoreboth]]></category>
		<category><![CDATA[ignoredups]]></category>
		<category><![CDATA[ignorespace]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://jorge.fbarr.net/?p=1179</guid>
		<description><![CDATA[There are several ways to improve how you troubleshoot a system. One of the things I consider to be important is the BASH history. Here you can see what commands were executed. Though as default you can&#8217;t see when, or ignore certain things, like duplicate commands. Here&#8217;s a little guide to show you how. Table [...]]]></description>
			<content:encoded><![CDATA[<p>There are several ways to improve how you troubleshoot a system. One of the things I consider to be important is the BASH history. Here you can see what commands were executed. Though as default you can&#8217;t see when, or ignore certain things, like duplicate commands. Here&#8217;s a little guide to show you how.</p>
<div id='toc' class='post-1179'><div id='toc_title'>Table of contents</div>
<ul><li><a href="#HISTTIMEFORMAT">HISTTIMEFORMAT</a></li>
<li><a href="#HISTCONTROL">HISTCONTROL</a>
<ul><li><a href="#ignoredups">ignoredups</a></li>
<li><a href="#erasedups">erasedups</a></li>
<li><a href="#ignorespace">ignorespace</a></li>
<li><a href="#ignoredups-and-ignorespace">ignoredups and ignorespace</a></li></ul></li>
<li><a href="#HISTIGNORE">HISTIGNORE</a></li>
<li><a href="#HISTSIZE">HISTSIZE</a></li>
</ul>
</div>
<p><b>Notice</b>: To make these features a permanent solution, open up your <b>/etc/profile</b>, and add the lines to the bottom of the file. Save and close it. The next time you log in the functions should be working as you specified them!</p>
<h3 id='HISTTIMEFORMAT'>HISTTIMEFORMAT</h3>
<p>A simple yet effective little trick is to change the format of the output the command <b>history</b> spits out. In my case it comes to good use when troubleshooting a system, wanting to find out if errors in the system log match up with commands executed at that time. To enable the feature in your current terminal, run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTTIMEFORMAT</span>=<span style="color: #ff0000;">&quot;%h %d %H:%M:%S&gt; &quot;</span></pre></div></div>

<p>So the output from <b>history</b> that was looking like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span>ashitaka ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">history</span>
 <span style="color: #000000;">1</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span>
 <span style="color: #000000;">2</span>  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Hello&quot;</span>
 <span style="color: #000000;">3</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
...</pre></div></div>

<p>Now looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span>ashitaka ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">history</span>
 <span style="color: #000000;">1</span>  Mar <span style="color: #000000;">24</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">53</span>:<span style="color: #000000;">35</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span>
 <span style="color: #000000;">2</span>  Mar <span style="color: #000000;">24</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">53</span>:<span style="color: #000000;">36</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Hello&quot;</span>
 <span style="color: #000000;">3</span>  Mar <span style="color: #000000;">24</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">53</span>:<span style="color: #000000;">37</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">pwd</span>
...</pre></div></div>

<h3 id='HISTCONTROL'>HISTCONTROL</h3>
<p>The variable <b>HISTCONTROL</b> can do a few things, like ignoring duplicates if they are in a row and erasing duplicates. The difference here is that by ignoring duplicates, it will remove duplicates only if they are in a row, while erasing duplicates, it will remove previous commands from the history file. Let&#8217;s give an example:</p>
<h4 id='ignoredups'>ignoredups</h4>
<p>First run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignoredups</pre></div></div>

<p>The output that looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span>ashitaka ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">history</span>
 <span style="color: #000000;">1</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
 <span style="color: #000000;">2</span>  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Hello&quot;</span>
 <span style="color: #000000;">3</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
 <span style="color: #000000;">4</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-h</span>
 <span style="color: #000000;">5</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
 <span style="color: #000000;">6</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
...</pre></div></div>

<p>Will now look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span>ashitaka ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">history</span>
 <span style="color: #000000;">1</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
 <span style="color: #000000;">2</span>  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Hello&quot;</span>
 <span style="color: #000000;">3</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
 <span style="color: #000000;">4</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-h</span>
 <span style="color: #000000;">5</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
...</pre></div></div>

<h4 id='erasedups'>erasedups</h4>
<p><b>erasedups</b> means that if you executed the same command previously, that entry will be erased, substituted by the newly run command. Generally not recommended though. If you still wish to do so, it can be done by running the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=erasedups</pre></div></div>

<p>So a <b>history</b> that looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span>ashitaka ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">history</span>
 <span style="color: #000000;">1</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
 <span style="color: #000000;">2</span>  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Hello&quot;</span>
 <span style="color: #000000;">3</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
 <span style="color: #000000;">4</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-h</span>
 <span style="color: #000000;">5</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
...</pre></div></div>

<p>After the export, will now look like this when we run the command <b>pwd</b> again:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span>ashitaka ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">history</span>
 <span style="color: #000000;">1</span>  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Hello&quot;</span>
 <span style="color: #000000;">2</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
 <span style="color: #000000;">3</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-h</span>
 <span style="color: #000000;">4</span>  <span style="color: #7a0874; font-weight: bold;">pwd</span>
...</pre></div></div>

<h4 id='ignorespace'>ignorespace</h4>
<p>If you want full control over which commands will be stored by history and which will not be stored, set <b>HISTCONTROL</b> to ignorespace:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignorespace</pre></div></div>

<p>So out of these commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span>
 <span style="color: #c20cb9; font-weight: bold;">du</span> <span style="color: #660033;">-h</span>
<span style="color: #c20cb9; font-weight: bold;">ps</span></pre></div></div>

<p>Only these will show:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span>ashitaka ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">history</span>
 <span style="color: #000000;">1</span>  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span>
 <span style="color: #000000;">2</span>  <span style="color: #c20cb9; font-weight: bold;">ps</span>
...</pre></div></div>

<h4 id='ignoredups-and-ignorespace'>ignoredups and ignorespace</h4>
<p>To use both of these features, simply use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignoreboth</pre></div></div>

<h3 id='HISTIGNORE'>HISTIGNORE</h3>
<p>The variable <b>HISTIGNORE</b> will help you tell <b>history</b> which commands to ignore, meaning that they shouldn&#8217;t be picked up by the BASH history. For instance, let&#8217;s say that I want the commands <b>df</b> and <b>free</b> to be ignored, including optional flags:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTIGNORE</span>=<span style="color: #ff0000;">&quot;df*:free*&quot;</span></pre></div></div>

<h3 id='HISTSIZE'>HISTSIZE</h3>
<p>Setting how many lines of history to store is always a nice feature:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTSIZE</span>=<span style="color: #000000;">10000</span></pre></div></div>

<p>Thanks to <b>pkhamre</b> for suggesting to include <b>HISTCONTROL</b> and <b>HISTIGNORE</b>. ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://jorge.fbarr.net/2011/03/24/making-your-bash-history-more-efficient/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introduction to screen</title>
		<link>http://jorge.fbarr.net/2011/02/09/introduction-to-screen/</link>
		<comments>http://jorge.fbarr.net/2011/02/09/introduction-to-screen/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 13:49:32 +0000</pubDate>
		<dc:creator>jorge</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://jorge.fbarr.net/?p=1162</guid>
		<description><![CDATA[screen is to many people an unknown program and tool, but for those who do know it, consider it to be an essential one. This is because of the functionality of the program, that can end up saving you a lot of work and time. You can run any number of console-based applications &#8211; editors, [...]]]></description>
			<content:encoded><![CDATA[<p><b>screen</b> is to many people an unknown program and tool, but for those who do know it, consider it to be an essential one. This is because of the functionality of the program, that can end up saving you a lot of work and time. You can run any number of console-based applications &#8211; editors, mail clients, browsers, in just a single terminal. Sometimes it&#8217;s useful to have a terminal for each console-based application you&#8217;re running, but sometimes not, obviously.</p>
<p>For my part, the main reason for me using <b>screen</b> is the ability to decouple the terminal emulator from the running programs. In other words, I can detach and reattach things as I please. To put it in simple terms; it&#8217;s a tool for session management. Let&#8217;s go ahead with an example.</p>
<p>You are logged into your remote server via SSH, working on some configuration file, when suddenly you lose connection to it. Almost done, having spent hours, you grab your laptop in anger and smack the closest unfortunate person next to you. Not only have you lost valuable work, but soon enough people with shields, guns and helmets will come after you. Imagine, with <b>screen</b>, it could have been avoided! Had you been editing the configuration file within a <b>screen</b>, and should you have lost connection, the editing would still be in an active <b>screen</b> session, allowing you to detach and reattach the <b>screen</b> to your terminal once you logged back in.</p>
<p>Let&#8217;s have a closer look at what we can do with <b>screen</b>.</p>
<div id='toc' class='post-1162'><div id='toc_title'>Table of contents</div>
<ul><li><a href="#Starting-screen">Starting screen</a></li>
<li><a href="#Using-screen">Using screen</a></li>
<li><a href="#Sharing-a-screen">Sharing a screen</a></li>
<li><a href="#Multiple-applications-in-one-session">Multiple applications in one session</a></li>
<li><a href="#Navigating-within-the-screens">Navigating within the screens</a></li>
<li><a href="#Clearing-destroyed-sessions">Clearing destroyed sessions</a></li>
<li><a href="#Splitting-windows">Splitting windows</a></li>
</ul>
</div>
<h3 id='Starting-screen'>Starting screen</h3>
<p>Fire up a terminal and just type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span></pre></div></div>

<p>If installed, you probably won&#8217;t get a message about having entered a <b>screen</b> session, but I&#8217;m sure you have. Everything functions just like a normal shell, except for a few special characters. <b>screen</b> uses the command <b>Ctrl-A</b> as a signal to <b>screen</b> instead of the shell.</p>
<p>To see the help page for <b>screen</b>, press <b>Ctrl-A</b>, then press <b>?</b>. In other words:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">^A ?</pre></div></div>

<p>As you can see here, <b>Ctrl</b> is represented by the <b>^</b>, <b>A</b> is <b>a</b>, and well, you get the rest.</p>
<p>To start a program directly into <b>screen</b>, just type <b>screen
<program></b>. Let&#8217;s use <b>top</b> as an example.</p>
<h3 id='Using-screen'>Using screen</h3>
<p>Fire it up:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> top</pre></div></div>

<p><b>top</b> is started in the usual way, just inside a <b>screen</b> session. To detach the session and let it run in the background, use <b>Ctrl-a d</b>:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a d (^a d)</pre></div></div>

<p>Once your session is detached you can list the available <b>screen</b> sessions by using:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-ls</span></pre></div></div>

<p>The output you&#8217;ll see will be something along the lines of:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span><span style="color: #c20cb9; font-weight: bold;">cat</span> ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-ls</span>
There is a <span style="color: #c20cb9; font-weight: bold;">screen</span> on:
    <span style="color: #000000;">26606</span>.pts-<span style="color: #000000;">39</span>.cat    <span style="color: #7a0874; font-weight: bold;">&#40;</span>Detached<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">1</span> Socket <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>screen<span style="color: #000000; font-weight: bold;">/</span>S-jorge.</pre></div></div>

<p>To reattach the <b>screen</b> session to your current terminal, you can use <b>screen -dr <session ID></b>. In this case it would be:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-dr</span> <span style="color: #000000;">26606</span></pre></div></div>

<p>This brings up an interesting question though. How can you differentiate what multiple <b>screen</b> sessions are holding, if you can only read the process number? Easy &#8211; you give each <b>screen</b> session a name. For most people, a name is easier to remember than a number. So, we start a new <b>screen</b>, in which we&#8217;re going to open an IRC client called <b>irssi</b>. Let&#8217;s use <b>-S</b>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-S</span> irc irssi</pre></div></div>

<p>Entering <b>irssi</b>, we detach the session with <b>Ctrl-a d</b>, and do a <b>screen -ls</b> to see what we&#8217;ve got now:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jorge<span style="color: #000000; font-weight: bold;">@</span><span style="color: #c20cb9; font-weight: bold;">cat</span> ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-ls</span>
There are screens on:
    <span style="color: #000000;">26606</span>.pts-<span style="color: #000000;">39</span>.cat    <span style="color: #7a0874; font-weight: bold;">&#40;</span>Detached<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000;">26702</span>.irc    <span style="color: #7a0874; font-weight: bold;">&#40;</span>Detached<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">2</span> Sockets <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>screen<span style="color: #000000; font-weight: bold;">/</span>S-jorge.</pre></div></div>

<p>There you clearly see the name <b>irc</b> that we entered earlier, and the session holding <b>top</b>, which we started up even before being able to specify a name. Pretty handy, huh? This is particularly hand if you&#8217;re only going to have one application in the <b>screen</b> session. If more, it would probably be better to have a more descriptive session name of some sort.</p>
<h3 id='Sharing-a-screen'>Sharing a screen</h3>
<p>If someone else, or you, has created a <b>screen</b>, and would like to share with someone else what you&#8217;re doing, then <b>screen -x</b> does the trick. Simply use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-x</span> irc</pre></div></div>

<p>..if <b>irc</b> is the name of the session, or the process ID. Once done, you should have enabled multi display mode. And if you find out that the <b>screen</b> you have taken part of doesn&#8217;t match up to the size of your own terminal, simply use:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a F (^a F)</pre></div></div>

<p>..to force it to match up to the dimensions.</p>
<h3 id='Multiple-applications-in-one-session'>Multiple applications in one session</h3>
<p>Now I&#8217;ve introduced you to the basics of using <b>screen</b>. Let&#8217;s proceed onto using <b>screen</b> with multiple applications. Detach and resume the <b>screen</b> session called <b>irc</b> with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-dr</span> irc</pre></div></div>

<p>Once resumed, press <b>Ctrl-a Ctrl-c</b> (^a ^c) to create a new <b>screen</b> session from within your current one. This will start up a new shell. Let&#8217;s start a new application &#8211; <b>nano</b>. Simply type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span></pre></div></div>

<p>And the application will start. Let&#8217;s give this internal <b>screen</b> session a name. Press <b>Ctrl-a Shift-a</b> (^a A). Notice that <b>a</b> is different from <b>A</b> (capital A). </p>
<p>You will be asked:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Set window's title to:</pre></div></div>

<p>Type <b>editor</b> and press enter.</p>
<h3 id='Navigating-within-the-screens'>Navigating within the screens</h3>
<p>You can switch between the various applications by pressing <b>Ctrl-a 0-9</b>, so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a 0</pre></div></div>

<p>will go to the first application, <b>irssi</b> in this case. Other ways of navigating is by using</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-c Ctrl-n (next window)</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-c Ctrl-p (previous window)</pre></div></div>

<p>To list up all of the shells available on the <b>screen</b>, type:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a &quot; (^a &quot;)</pre></div></div>

<p>You&#8217;ll get a list that looks something like:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Num Name                                                                   Flags
&nbsp;
  0 irssi                                                                      $
  1 nano                                                                       $</pre></div></div>

<p>Use your Up/Down arrows and press enter to select a shell to go to.</p>
<h3 id='Clearing-destroyed-sessions'>Clearing destroyed sessions</h3>
<p>If you have a <b>screen</b> session up, and the machine it is on goes down, then the <b>screen</b> session is probably destroyed. You can see the available screens by typing <b>screen -ls</b>. To get rid of destroyed screens, type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-wipe</span></pre></div></div>

<h3 id='Splitting-windows'>Splitting windows</h3>
<p>Another interesting thing many people have asked about is how you can split a window in a <b>screen</b> session. A useful feature if you say would like to have two documents open, or you have to do some work while having a conversation on IRC. To split the window, type:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a Shift-s (^a S)</pre></div></div>

<p>You will see that your <b>screen</b> is now split, and you have a new area on the bottom. To move to this area, type:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a TAB (^a TAB)</pre></div></div>

<p>Now that you&#8217;re in the new area, there&#8217;s not much to do but to create another shell, so do it with:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a Ctrl-c (^a ^c)</pre></div></div>

<p>From here you can start another application in the regular way, and give the internal shell a name of its own.</p>
<p>If you want to close the application in the bottom area, do it as normal, then to kill the area, press:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a Shift-x (^a X)</pre></div></div>

<p>If you want to kill every area EXCEPT then one you&#8217;re currently in, you can use:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Ctrl-a Shift-q (^a Q)</pre></div></div>

<p>And that&#8217;s pretty much it when it comes to <b>screen</b>. For more information, check out the command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #c20cb9; font-weight: bold;">screen</span></pre></div></div>

<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://jorge.fbarr.net/2011/02/09/introduction-to-screen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Recommended Google Chrome extensions</title>
		<link>http://jorge.fbarr.net/2011/01/28/recommended-google-chrome-extensions/</link>
		<comments>http://jorge.fbarr.net/2011/01/28/recommended-google-chrome-extensions/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 08:13:38 +0000</pubDate>
		<dc:creator>jorge</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[adblock]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[flashblock]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google-chrome]]></category>
		<category><![CDATA[lastpass]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[navigate]]></category>
		<category><![CDATA[recommended]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[timer]]></category>
		<category><![CDATA[toodledo]]></category>
		<category><![CDATA[tweetdeck]]></category>
		<category><![CDATA[xmarks]]></category>

		<guid isPermaLink="false">http://jorge.fbarr.net/?p=1152</guid>
		<description><![CDATA[I&#8217;ve been a very avid user of Firefox these past years. But of late I&#8217;ve been getting the feeling of Firefox getting slower and slower. I haven&#8217;t tried the latest beta yet, but the fact that Firefox dies if one of your tabs are in trouble, just doesn&#8217;t cut it for me. So I decided [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a very avid user of Firefox these past years. But of late I&#8217;ve been getting the feeling of Firefox getting slower and slower. I haven&#8217;t tried the latest beta yet, but the fact that Firefox dies if one of your tabs are in trouble, just doesn&#8217;t cut it for me. So I decided to try out Google Chrome, and boy do I enjoy it. I&#8217;ll have to address the benefits of using Google Chrome some other time, but now, I present you with what I consider to be some of the better Google Chrome extensions out there. If you have anything to add, let me know. :)</p>
<ul>
<li><a href="https://chrome.google.com/extensions/detail/gighmmpiobklfepjocnamgkkbiglidom">AdBlock</a></li>
<ul>
<li>The most popular Chrome extension, with over 1.5 million users! Blocks ads all over the web.</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/extensions/detail/fdjkdjnaajdmnminlhhhcicfnokdhjfg">Alarm</a></li>
<ul>
<li>This extension help you to remember yours appointments.</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/negjghjbfgfmdjpolclpmmjmfeejolld">Bit.ly Shortener for Chrome</a></li>
<ul>
<li>Shorten URLs with the bit.ly sidebar in Chrome!</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/mblbciejcodpealifnhfjbdlkedplodp">Clickable Links</a></li>
<ul>
<li>Turns unclickable urls &amp; email addresses into clickable ones.</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/gofhjkjmkpinhpoiabjplobcaignabnl">FlashBlock</a></li>
<ul>
<li>FlashBlock for Chrome. Block them all, or be selective with the embedded whitelist manager</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/mihcahmgecmbnbcchbopgniflfhgnkff">Google Mail Checker</a></li>
<ul>
<li>Displays the number of unread messages in your Google Mail inbox, or Google Apps. You can also click the button to open your inbox.</li>
</ul>
</ul>
<ul>
<li><a href="https://lastpass.com/lpchrome_bin.crx">LastPass (for Linux)</a></li>
<ul>
<li>LastPass is a free password manager and form filler.</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/bpeohalpamaeaimliodkepkphdnhdidf">Navigate on paste (Linux)</a></li>
<ul>
<li>Middle click on a page navigates to the content of the primary selection.</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/galfofdpepkcahkfobimileafiobdplb">Tab Menu</a></li>
<ul>
<li>Select, close, rearrange, and search your tabs from a toolbar menu!</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/hepmlgghomccjinhcnkkikjpgkjibglj">Timer</a></li>
<ul>
<li>Losing track of time on the web? This simple timer tells you when your time is up.</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/ballhmoamkbbfadiealjmgmhbbnellbc">ToodleChrome</a></li>
<ul>
<li>Manage your tasks and todo lists! Get quick access to Toodledo, with the option to show a badge indicating tasks due</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/hbdpomandigafcibbmofojjchbcdagbl">TweetDeck</a></li>
<ul>
<li>?TweetDeck is an Adobe AIR desktop application for <a title="Twitter" href="http://en.wikipedia.org/wiki/Twitter">Twitter</a>, <a title="Facebook" href="http://en.wikipedia.org/wiki/Facebook">Facebook</a>, <a title="LinkedIn" href="http://en.wikipedia.org/wiki/LinkedIn">LinkedIn</a>, <a title="Google Buzz" href="http://en.wikipedia.org/wiki/Google_Buzz">Google Buzz</a>, <a title="Foursquare (social networking)" href="http://en.wikipedia.org/wiki/Foursquare_(social_networking)">Foursquare</a>, and <a title="MySpace" href="http://en.wikipedia.org/wiki/MySpace">MySpace</a>. It allows users to send and receive tweets and view profiles.</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/kmjdnkpkpnjblbgbnkeedepgnomafojk">TweetDeck Launcher</a></li>
<ul>
<li>Launch Chrome TweetDeck from the Browser Bar</li>
</ul>
</ul>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/ajpgkpeckebdhofmmjfgcjjiiejpodla">Xmarks Bookmark Sync</a></li>
<ul>
<li>Backup and sync your bookmarks, passwords and open tabs across computers and browsers. Xmarks is also available for Firefox, Safari and IE.</li>
</ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jorge.fbarr.net/2011/01/28/recommended-google-chrome-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

