<?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>Arkham's Eyrie &#187; linux</title>
	<atom:link href="http://ark.asengard.net/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://ark.asengard.net/blog</link>
	<description>Where Doves Kill &#38; Ravens Die.</description>
	<lastBuildDate>Tue, 06 Apr 2010 14:11:34 +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>Another 17 Vim Tips</title>
		<link>http://ark.asengard.net/blog/2009/10/06/12-vim-tips/</link>
		<comments>http://ark.asengard.net/blog/2009/10/06/12-vim-tips/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 22:44:38 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=846</guid>
		<description><![CDATA[&#60;Ctrl&#62;-k + e + ! &#8211; Write &#8216;è&#8217; character. &#60;Ctrl&#62;-k + e + &#8216; &#8211; Write &#8216;é&#8217; character. !!date &#8211; Insert date in current line. g, / g; &#8211; Jump back/forward to the locations that have been edited. zf &#8211; Fold selected text. zfa} &#8211; Fold the function enclosing the cursor. zR / zM &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ark.asengard.net/blog/wp-content/uploads/2009/10/success_vim.jpg"><img class="size-medium wp-image-852 aligncenter" title="success_vim" src="http://ark.asengard.net/blog/wp-content/plugins/image-shadow/cache/fc9767b61d835d6535b84dd731cb604d.jpg" alt="success_vim" width="273" height="300" /></a></p>
<ol>
<li><strong>&lt;Ctrl&gt;-</strong><strong>k</strong> + <strong>e </strong>+ <strong>!</strong> &#8211; Write &#8216;è&#8217; character.<strong><br />
</strong></li>
<li><strong>&lt;Ctrl&gt;-</strong><strong>k</strong> + <strong>e </strong>+ <strong>&#8216;</strong> &#8211; Write &#8216;é&#8217; character.</li>
<li><strong>!!date</strong> &#8211; Insert date in current line.</li>
<li><strong>g,</strong> / <strong>g;</strong> &#8211; Jump back/forward to the locations that have been edited.</li>
<li><strong>zf</strong> &#8211; Fold selected text<strong>.<br />
</strong></li>
<li><strong>zfa}</strong> &#8211; Fold the function enclosing the cursor.</li>
<li><strong>zR</strong> / <strong>zM</strong> &#8211; If <em>foldmethod</em> is set, open/close all folds.</li>
<li><strong>&lt;Ctrl&gt;-w</strong> + (<strong>-</strong>/<strong>+</strong>) &#8211; In splitted views, reduce/increase current zone height.<strong><br />
</strong></li>
<li><strong>&lt;Ctrl&gt;-w</strong> + (<strong>&lt;</strong>/<strong>&gt;</strong>) &#8211; In splitted views, reduce/increase current zone width.</li>
<li><strong>:vimgrep /<em>pattern</em>/ files</strong> &#8211; Search for pattern in the provided list of files.<strong><br />
</strong></li>
<li><strong>:cn</strong> and <strong>:cN</strong> to jump between vimgrep results.</li>
<li><strong>:clist</strong> to display all vimgrep result and <strong>:cc number</strong> to jump to a specific one.</li>
<li><strong>:%s/\&lt;and\&gt;/or/g</strong> &#8211; Replace all occurences of &#8220;and&#8221; with &#8220;or&#8221;, leaving words like &#8220;demand&#8221; unchanged.</li>
<li><strong>:%s/foo/bar/gi</strong> &#8211; Replace case insensitively.</li>
<li><strong>*</strong> / <strong>#</strong> &#8211; Search for the next/previous occurence of the word under the cursor.</li>
<li><strong>/\cfoo\Cbar/</strong> &#8211; Matches &#8220;foobar&#8221;, &#8220;Foobar&#8221; and &#8220;FOObar&#8221;.</li>
<li><strong>/\([a-z]\)\([a-z]\)\2\1/</strong> &#8211; Matches &#8220;abba&#8221; and &#8220;deed&#8221;.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2009/10/06/12-vim-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>17 Vim Tips</title>
		<link>http://ark.asengard.net/blog/2009/10/05/17-vim-tips/</link>
		<comments>http://ark.asengard.net/blog/2009/10/05/17-vim-tips/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 01:06:51 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[learnig]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=837</guid>
		<description><![CDATA[&#60;Ctrl&#62;-o &#8211; Switch from insert mode to command mode for one single command. vim +linenumber file &#8211; Open file at line number. vim +/pattern file &#8211; Open file at first occurence of pattern. :next files &#8211; Open a list of files, each in a new buffer. :up[date] - Save a modified file. &#8220;byy + &#8220;bp [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ark.asengard.net/blog/wp-content/uploads/2009/10/vim_bar.jpg"><img class="size-medium wp-image-840 aligncenter" title="vim_bar" src="http://ark.asengard.net/blog/wp-content/plugins/image-shadow/cache/91888380b252c2060ffbfaf3cc1b83fa.jpg" alt="vim_bar" width="300" height="225" /></a></p>
<ol>
<li><strong>&lt;Ctrl&gt;-o</strong> &#8211; Switch from insert mode to command mode for one single command.</li>
<li><strong>vim +<em>linenumber</em></strong><strong> file</strong> &#8211; Open file at line number.</li>
<li><strong>vim +/<em>pattern</em> file</strong> &#8211; Open file at first occurence of pattern.</li>
<li><strong>:next files</strong> &#8211; Open a list of files, each in a new buffer.</li>
<li><strong>:up[date] </strong>- Save a modified file.</li>
<li><strong>&#8220;byy</strong> + <strong>&#8220;bp</strong> &#8211; Copy a line inside named buffer &#8220;b&#8221; and paste it.</li>
<li><strong>&lt;Ctrl&gt;-]</strong> &#8211; Follow green links in documentation pages.</li>
<li><strong>&lt;Ctrl&gt;-t</strong> &#8211; Go back to the previous documentation page.</li>
<li><strong>&gt;ap</strong> &#8211; Indent whole paragraph.</li>
<li><strong>10dd</strong> + <strong>2.</strong> &#8211; Delete 10 lines, repeat twice (delete 20 lines more).</li>
<li><strong>VU</strong> &#8211; Make the whole line uppercase.</li>
<li><strong>V10j</strong> + <strong>:</strong> + <strong>!sort</strong> &#8211; sort alphabetically next 10 lines.</li>
<li><strong>:!uname -a</strong> &#8211; Display system information.</li>
<li><strong>:! wc %</strong> &#8211; Display information about current file.</li>
<li><strong>:r!uname -a</strong> &#8211; Insert system information into the next line.</li>
<li><strong>gg=G</strong> &#8211; Reformat whole file.</li>
<li><strong>&lt;Ctrl&gt;-n</strong> &#8211; Start autocompletion.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2009/10/05/17-vim-tips/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sed by examples, Part 2</title>
		<link>http://ark.asengard.net/blog/2009/06/29/sed-by-examples-part-2/</link>
		<comments>http://ark.asengard.net/blog/2009/06/29/sed-by-examples-part-2/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 16:19:48 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[cheatsheet]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=811</guid>
		<description><![CDATA[sed (stream editor) is a Unix utility which (a) parses text files and (b) implements a programming language which can apply textual transformations to such files. It reads input files line by line (sequentially), applying the operation which has been specified via the command line (or a sed script), and then outputs the line. Substitution [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ark.asengard.net/blog/wp-content/uploads/2009/06/sed_logo_white.jpg"><img class="size-medium wp-image-810 aligncenter" title="sed_logo_white" src="http://ark.asengard.net/blog/wp-content/plugins/image-shadow/cache/bb91128fdecfd0b32f4098bdc76e83c3.jpg" alt="sed_logo_white" width="300" height="213" /></a></p>
<p></p>
<blockquote><p>sed (stream editor) is a Unix utility which (a) parses text files and (b) implements a programming language which can apply textual transformations to such files.<br />
<strong>It reads input files line by line (sequentially), applying the operation which has been specified via the command line (or a sed script), and then outputs the line</strong>.</p></blockquote>
<p></p>
<h1>Substitution</h1>
<p></p>
<ol>
<li>
     Substitute, <strong>for every line</strong>, the first occurence of foo (if any) with spam:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># test.txt</span>
foo bar spam foo
spam foo bar egg
sausage foo spam egg
spam spam spam</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/foo/spam/'</span> test.txt</pre></div></div>

</li>
<li>
    Substitute every occurence of foo with spam:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/foo/spam/g'</span> test.txt</pre></div></div>

</li>
<li>
     Substitute every occurence of foo with spam in the first two lines:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'1,2s/foo/spam/g'</span> test.txt</pre></div></div>

</li>
<li>
    Substitute every occurence of foo with spam in every line that starts with sausage and ends with egg:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^sausage.*egg$/s/foo/spam/g'</span> test.txt</pre></div></div>

</li>
<li>
    Substitute paths:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s|/usr/bin/|/usr/local/bin|g'</span> script.sh</pre></div></div>

</li>
<li>
    Remove html tags:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;body&gt;
Hello World!
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;[^&gt;]*&gt;//g'</span> hello.html</pre></div></div>

</li>
</ol>
<p></p>
<h1>Advanced substitution</h1>
<p></p>
<ol>
<li>
    Append (that&#8217;s what she said) to every line ( &#038; represents what matches):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/^.*$/&amp; (that's what she said)/g&quot;</span> test.txt</pre></div></div>

</li>
<li>
    Append lol, rofl and lmao to the first three words of every line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\(^[^ ]*\) \([^ ]*\) \([^ ]*\)/\1lol \2rofl \3lmao/'</span> test.txt</pre></div></div>

</li>
</ol>
<p></p>
<h1>Multiple Commands</h1>
<p></p>
<ol>
<li>
    Print a file alternating row numbers:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'=;p'</span> test.txt</pre></div></div>

</li>
<li>
    Print some information about your cpu first core:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># script.sed</span>
<span style="color: #000000;">1</span>,<span style="color: #000000; font-weight: bold;">/</span>^$<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">/</span>model name<span style="color: #000000; font-weight: bold;">/</span>p
    <span style="color: #000000; font-weight: bold;">/</span>flags<span style="color: #000000; font-weight: bold;">/</span>p
    <span style="color: #000000; font-weight: bold;">/</span>bogomips<span style="color: #000000; font-weight: bold;">/</span>p
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-f</span> script.sed <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>cpuinfo</pre></div></div>

</li>
<li>
    Add a line before/after each line or replace line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># script.sed</span>
i\
This line will be inserted before each line</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># script.sed</span>
a\
This line will be inserted after each line</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># script.sed</span>
c\
This line will be inserted <span style="color: #000000; font-weight: bold;">in</span> each line</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-f</span> script.sed test.txt</pre></div></div>

</li>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2009/06/29/sed-by-examples-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sed by examples</title>
		<link>http://ark.asengard.net/blog/2009/06/29/sed-by-examples/</link>
		<comments>http://ark.asengard.net/blog/2009/06/29/sed-by-examples/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 23:16:40 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[cheatsheet]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=801</guid>
		<description><![CDATA[sed (stream editor) is a Unix utility which (a) parses text files and (b) implements a programming language which can apply textual transformations to such files. It reads input files line by line (sequentially), applying the operation which has been specified via the command line (or a sed script), and then outputs the line. Delete [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ark.asengard.net/blog/wp-content/uploads/2009/06/Canon-Tosh-SED.jpg"><img class="size-medium wp-image-802 aligncenter" title="Canon Tosh SED" src="http://ark.asengard.net/blog/wp-content/plugins/image-shadow/cache/dee3ce83e0a8cc1c23be11981c166f39.jpg" alt="Canon Tosh SED" width="300" height="224" /></a></p>
<p></p>
<blockquote><p>sed (stream editor) is a Unix utility which (a) parses text files and (b) implements a programming language which can apply textual transformations to such files.<br />
<strong>It reads input files line by line (sequentially), applying the operation which has been specified via the command line (or a sed script), and then outputs the line</strong>.</p></blockquote>
<p></p>
<h1>Delete</h1>
<p></p>
<ol>
<li>
    Delete the first line of a file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'1d'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

</li>
<li>
    Delete from the second to the tenth line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'2,10d'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

</li>
<li>
    Delete lines starting with #:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^#/d'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

</li>
</ol>
<p></p>
<h1>Print</h1>
<p></p>
<ol>
<li>
    Print lines starting with #:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^#/p'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

</li>
<li>
    Print blocks of text enclosed by BEGIN and END:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/BEGIN/,/END/p'</span> script.awk</pre></div></div>

</li>
<li>
    Print Device section in xorg.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/Section &quot;Device&quot;/,/EndSection/p'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>xorg.conf</pre></div></div>

</li>
<li>
    Print main function in a C source file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/main[[:space:]]*(/,/^}/p'</span> source.c</pre></div></div>

</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2009/06/29/sed-by-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to colorize bash prompt easily</title>
		<link>http://ark.asengard.net/blog/2009/06/24/how-to-colorize-bash-prompt/</link>
		<comments>http://ark.asengard.net/blog/2009/06/24/how-to-colorize-bash-prompt/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 18:02:34 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=792</guid>
		<description><![CDATA[Sometimes, the bash prompt can look a little dull and it may become difficult to recognize where the output of a command ends. Here I provide with a very simple way to customize your bash prompt by adding some colors. First of all, add these colors definition to your .bashrc ## Fancy colors red='\[\e[0;31m\]' RED='\[\e[1;31m\]' [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ark.asengard.net/blog/wp-content/uploads/2009/06/lost_numbers_fan.jpg"><img class="size-full wp-image-798 aligncenter" title="lost_numbers_fan" src="http://ark.asengard.net/blog/wp-content/plugins/image-shadow/cache/2f99a49f04f85db277424a9aeeac11df.jpg" alt="lost_numbers_fan" width="465" height="313" /></a></p>
<p>Sometimes, the bash prompt can look a little dull and it may become difficult to recognize where the output of a command ends. Here I provide with a very simple way to customize your bash prompt by adding some colors.</p>
<p>First of all, add these colors definition to your .bashrc</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Fancy colors</span>
<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">red</span></span>=<span style="color: #ff0000;">'\[\e[0;31m\]'</span>
<span style="color: #007800;">RED</span>=<span style="color: #ff0000;">'\[\e[1;31m\]'</span>
<span style="color: #007800;">blue</span>=<span style="color: #ff0000;">'\[\e[0;34m\]'</span>
<span style="color: #007800;">BLUE</span>=<span style="color: #ff0000;">'\[\e[1;34m\]'</span>
<span style="color: #007800;">cyan</span>=<span style="color: #ff0000;">'\[\e[0;36m\]'</span>
<span style="color: #007800;">CYAN</span>=<span style="color: #ff0000;">'\[\e[1;36m\]'</span>
<span style="color: #007800;">black</span>=<span style="color: #ff0000;">'\[\e[0;30m\]'</span>
<span style="color: #007800;">BLACK</span>=<span style="color: #ff0000;">'\[\e[1;30m\]'</span>
<span style="color: #007800;">green</span>=<span style="color: #ff0000;">'\[\e[0;32m\]'</span>
<span style="color: #007800;">GREEN</span>=<span style="color: #ff0000;">'\[\e[1;32m\]'</span>
<span style="color: #007800;">yellow</span>=<span style="color: #ff0000;">'\[\e[0;33m\]'</span>
<span style="color: #007800;">YELLOW</span>=<span style="color: #ff0000;">'\[\e[1;33m\]'</span>
<span style="color: #007800;">magenta</span>=<span style="color: #ff0000;">'\[\e[0;35m\]'</span>
<span style="color: #007800;">MAGENTA</span>=<span style="color: #ff0000;">'\[\e[1;35m\]'</span>
<span style="color: #007800;">white</span>=<span style="color: #ff0000;">'\[\e[0;37m\]'</span>
<span style="color: #007800;">WHITE</span>=<span style="color: #ff0000;">'\[\e[1;37m\]'</span>
<span style="color: #007800;">NC</span>=<span style="color: #ff0000;">'\[\e[0m\]'</span> <span style="color: #666666; font-style: italic;"># No Color</span></pre></div></div>

<p>The variables you want to use are</p>
<ul>
<li>\u &#8211; username</li>
<li>\h &#8211; host name</li>
<li>\w &#8211; current absolute path</li>
<li>\W for current relative path</li>
<li>\$ &#8211; te prompt character (eg. &#8216;#&#8217;)</li>
</ul>
<p>For example, my current setup looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${green}</span>\u<span style="color: #007800;">${NC}</span>@<span style="color: #007800;">${green}</span>\h <span style="color: #007800;">${BLUE}</span>\w<span style="color: #007800;">${NC}</span> <span style="color: #007800;">${GREEN}</span><span style="color: #000099; font-weight: bold;">\$</span> <span style="color: #007800;">${NC}</span> &quot;</span></pre></div></div>

<p>Enjoy <img src='http://ark.asengard.net/blog/wp-content/plugins/smilies-themer/tango/face-wink.png' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2009/06/24/how-to-colorize-bash-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awk by examples</title>
		<link>http://ark.asengard.net/blog/2009/04/14/awk-by-examples/</link>
		<comments>http://ark.asengard.net/blog/2009/04/14/awk-by-examples/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 14:27:40 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[cheatsheet]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=661</guid>
		<description><![CDATA[AWK is a language for processing files of text. A file is treated as a sequence of records, and by default each line is a record. Each line is broken up into a sequence of fields, so we can think of the first word in a line as the first field, the second word as [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img src="http://ark.asengard.net/blog/wp-content/uploads/2009/04/auk-249x300.png" alt="auk" title="auk" width="249" height="300" class="alignnone size-medium wp-image-710" /></p>
<p></p>
<blockquote><p>AWK is a language for processing files of text. A file is treated as a sequence of records, and by default each line is a record. Each line is broken up into a sequence of fields, so we can think of the first word in a line as the first field, the second word as the second field, and so on. An AWK program is of a sequence of pattern-action statements. AWK reads the input a line at a time. A line is scanned for each pattern in the program, and for each pattern that matches, the associated action is executed.</p></blockquote>
<p></p>
<h1>Basics</h1>
<p></p>
<ol>
<li>
    Print /etc/mtab (awk reads a line at time and prints it) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mtab</pre></div></div>

</li>
<li>
    Print /etc/mtab ($0 denotes the whole line) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $0 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mtab</pre></div></div>

</li>
<li>
    List mounted filesystems ($1 denotes the first element of the line) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mtab</pre></div></div>

</li>
<li>
    List groups (-F chooses the Field Separator) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{ print $1 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>group</pre></div></div>

</li>
<li>
    List groups and id (awk concatenates print() arguments) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{ print $1 &quot; &quot; $3 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>group</pre></div></div>

</li>
<li>
    List groups and id (Nicer format) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{ print &quot;group: &quot; $1 &quot;\tid: &quot; $3 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>group</pre></div></div>

</li>
<li>
    Launching external awk scripts :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># first.awk</span>
BEGIN <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">FS</span>=<span style="color: #ff0000;">&quot;:&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span> print $<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-f</span> first.awk <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mtab</pre></div></div>

</li>
<li>
    List IPv4 addressess :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/inet / { print $2 }'</span></pre></div></div>

</li>
<li>
    List processes run by root :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># psroot.awk</span>
$<span style="color: #000000;">1</span> == <span style="color: #ff0000;">&quot;root&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span> 
    <span style="color: #7a0874; font-weight: bold;">printf</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;ROOT: &quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; 
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">i</span>=<span style="color: #000000;">11</span>; i<span style="color: #000000; font-weight: bold;">&lt;</span>=NF; i++<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
        <span style="color: #7a0874; font-weight: bold;">printf</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;%s &quot;</span>, <span style="color: #007800;">$i</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    <span style="color: #7a0874; font-weight: bold;">printf</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> au <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-f</span> psroot.awk</pre></div></div>

</li>
<li>
    Print X warnings :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'$1 ~ /(WW)/ { print }'</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>Xorg.0.log</pre></div></div>

</li>
<li>
    Print a file removing comments :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'! /^#/ { print }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

</li>
<li>
    Print number of files/directories :</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: #000000; font-weight: bold;">|</span>  <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'BEGIN{ x=0 } { x=x+1 } END{ print x-1 }'</span></pre></div></div>

</li>
<li>
    Awk as calculator :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print ((2*5^2-1)%7) }'</span></pre></div></div>

</li>
<li>
    Count empty lines :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># blanklines.awk</span>
BEGIN <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #007800;">x</span>=<span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">/</span>^$<span style="color: #000000; font-weight: bold;">/</span>  <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #007800;">x</span>=x+<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
END   <span style="color: #7a0874; font-weight: bold;">&#123;</span> print <span style="color: #ff0000;">&quot;I found &quot;</span> x <span style="color: #ff0000;">&quot; blank lines :)&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-f</span> blanklines.awk <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile</pre></div></div>

</li>
<li>
    Use regexp as FS (note the difference though) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'   a   b c  d '</span><span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;[ <span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\n</span>]+&quot;</span> <span style="color: #ff0000;">'{ print $2 }'</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'   a   b c  d '</span><span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #ff0000;">'{ print $2 }'</span></pre></div></div>

</li>
<li>
    Understand NR and NF :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># nrnf.awk</span>
BEGIN <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #007800;">x</span>=<span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
      <span style="color: #7a0874; font-weight: bold;">&#123;</span> print <span style="color: #ff0000;">&quot;Words on line &quot;</span> NR <span style="color: #ff0000;">&quot;: &quot;</span> NF ; x+=NF <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
END   <span style="color: #7a0874; font-weight: bold;">&#123;</span> print <span style="color: #ff0000;">&quot;Total lines: &quot;</span> NR ; print <span style="color: #ff0000;">&quot;Total words: &quot;</span> x <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>


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

</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2009/04/14/awk-by-examples/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free your memory on Linux</title>
		<link>http://ark.asengard.net/blog/2008/12/19/free-your-memory-on-linux/</link>
		<comments>http://ark.asengard.net/blog/2008/12/19/free-your-memory-on-linux/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 23:06:57 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=371</guid>
		<description><![CDATA[No, this is not a howto to make your RAM Stallman-compliant. Sometimes, it is handy to empty your caches, like when Virtualbox checks the available memory before actually starting. From linux 2.6.16 there are some nice tricks for dropping the memory cache, dentries and inodes. First of all, we need to free all the cached [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-374 aligncenter" title="stallman_young" src="http://ark.asengard.net/blog/wp-content/plugins/image-shadow/cache/eae4709f5b1d884d457f967671afbc5e.jpg" alt="stallman_young" width="300" height="227" /></p>
<p>No, this is not a howto to make your RAM Stallman-compliant.</p>
<p>Sometimes, it is handy to empty your caches, like when Virtualbox checks the available memory before actually starting. From linux 2.6.16 there are some nice tricks for dropping the memory cache, dentries and inodes.</p>
<p>First of all, we need to free all the cached objects.<br />
Run as root:</p>

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

<p>Then, to free pagecache:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>vm<span style="color: #000000; font-weight: bold;">/</span>drop_caches</pre></div></div>

<p>To free dentries and inodes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>vm<span style="color: #000000; font-weight: bold;">/</span>drop_caches</pre></div></div>

<p>To free pagecache, dentries and inodes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>vm<span style="color: #000000; font-weight: bold;">/</span>drop_caches</pre></div></div>

<p>Now, check your available memory using <strong>free</strong> and all your cache are belong to us.. *hu-uhm* ..should have been freed. Freed as in freed-om <img src='http://ark.asengard.net/blog/wp-content/plugins/smilies-themer/tango/face-wink.png' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2008/12/19/free-your-memory-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>KDE-like bigger icons for Gnome menu</title>
		<link>http://ark.asengard.net/blog/2008/10/23/kde-like-bigger-icons-for-gnome-menu/</link>
		<comments>http://ark.asengard.net/blog/2008/10/23/kde-like-bigger-icons-for-gnome-menu/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 23:55:46 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=270</guid>
		<description><![CDATA[I&#8217;ve tried to use some kind of KDE like, bigger icons on my desktop for a while and I realized that it is really a pity to not use the wonderful 32&#215;32 tango icons for the gnome menu also. If you want to try, it&#8217;s very simple: gedit ~/.gtkrc-2.0 and put in this line: gtk-icon-sizes [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I&#8217;ve tried to use some kind of KDE like, bigger icons on my desktop for a while and I realized that it is really a pity to not use the wonderful 32&#215;32 tango icons for the gnome menu also. If you want to try, it&#8217;s very simple:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gedit ~<span style="color: #000000; font-weight: bold;">/</span>.gtkrc-<span style="color: #000000;">2.0</span></pre></div></div>

<p>and put in this line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gtk-icon-sizes = <span style="color: #ff0000;">&quot;panel-menu=32,32&quot;</span></pre></div></div>

<p>and restart gnome-panel (maybe you could be more gracious :P):</p>

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

<p>Here is the outcome:<br />
<img class="size-full wp-image-273 aligncenter" title="gnome-menu" src="http://ark.asengard.net/blog/wp-content/uploads/2008/10/gnome-menu.png" alt="gnome-menu" width="433" height="325" /></p>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2008/10/23/kde-like-bigger-icons-for-gnome-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colored Man Pages</title>
		<link>http://ark.asengard.net/blog/2008/09/25/colored-manpages/</link>
		<comments>http://ark.asengard.net/blog/2008/09/25/colored-manpages/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 23:26:56 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=117</guid>
		<description><![CDATA[To improve your productivity when you&#8217;re reading long pages of fine manuals (aka when you&#8217;re doing some healthy RTFM), it is a very nice trick to add some colour in the terminal, so you can jump quickly from section to section or find the name of that sneaky option with a glance&#8230; Add to your [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ark.asengard.net/blog/wp-content/uploads/2008/09/xkill-manpage.png"><img class="size-medium wp-image-139 aligncenter" title="xkill-manpage" src="http://ark.asengard.net/blog/wp-content/uploads/2008/09/xkill-manpage-300x210.png" alt="" width="300" height="210" /></a></p>
<p>To improve your productivity when you&#8217;re reading long pages of fine manuals (aka when you&#8217;re doing some healthy <a href="http://en.wikipedia.org/wiki/RTFM">RTFM</a>), it is a very nice trick to add some colour in the terminal, so you can jump quickly from section to section or find the name of that sneaky option with a glance&#8230;</p>
<p>Add to your ~/.bashrc:</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;">LESS_TERMCAP_mb</span>=$<span style="color: #ff0000;">'E[01;31m'</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_md</span>=$<span style="color: #ff0000;">'E[01;31m'</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_me</span>=$<span style="color: #ff0000;">'E[0m'</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_se</span>=$<span style="color: #ff0000;">'E[0m'</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_so</span>=$<span style="color: #ff0000;">'E[01;44;33m'</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_ue</span>=$<span style="color: #ff0000;">'E[0m'</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_us</span>=$<span style="color: #ff0000;">'E[01;32m'</span></pre></div></div>

<p>And</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></div></div>

<p> <img src='http://ark.asengard.net/blog/wp-content/plugins/smilies-themer/tango/face-wink.png' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2008/09/25/colored-manpages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mplayer and Nautilus &#8220;Open with&#8221;</title>
		<link>http://ark.asengard.net/blog/2008/06/19/mplayer-and-nautilus-open-with/</link>
		<comments>http://ark.asengard.net/blog/2008/06/19/mplayer-and-nautilus-open-with/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 09:07:09 +0000</pubDate>
		<dc:creator>Arkham</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ark.asengard.net/blog/?p=50</guid>
		<description><![CDATA[Nautilus &#8220;Open with&#8221; option and Mplayer don&#8217;t seem to behave correctly when the file we want to open contains spaces. The dirty hack to solve it is: su vi /usr/share/applications/mplayer.desktop And replace &#8220;Exec=gmplayer %U&#8221; with &#8220;Exec=gmplayer %F&#8221;]]></description>
			<content:encoded><![CDATA[<p>Nautilus &#8220;Open with&#8221; option and Mplayer don&#8217;t seem to behave correctly when the file we want to open contains spaces. The dirty hack to solve it is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span>
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>applications<span style="color: #000000; font-weight: bold;">/</span>mplayer.desktop</pre></div></div>

<p>And replace &#8220;Exec=gmplayer %U&#8221; with &#8220;Exec=gmplayer %F&#8221;</p>
<p> <img src='http://ark.asengard.net/blog/wp-content/plugins/smilies-themer/tango/face-smile-big.png' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ark.asengard.net/blog/2008/06/19/mplayer-and-nautilus-open-with/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
