<?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>Nicolás Brailovsky &#187; Console</title>
	<atom:link href="http://nicolasb.com.ar/category/linux/console/feed/" rel="self" type="application/rss+xml" />
	<link>http://nicolasb.com.ar</link>
	<description>A modern blog</description>
	<lastBuildDate>Tue, 20 Dec 2011 09:00:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Starting Ubuntu in console mode</title>
		<link>http://nicolasb.com.ar/2011/10/starting-ubuntu-in-console-mode/</link>
		<comments>http://nicolasb.com.ar/2011/10/starting-ubuntu-in-console-mode/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 10:00:00 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1297</guid>
		<description><![CDATA[Like it or not, Ubuntu is so easy to install that even for servers is very comfortable to just mount the iso and create as many virtual machines as you may need. Sometimes you already have an iso for Ubuntu, but are too lazy to download the server version. For those occasions you can either [...]]]></description>
			<content:encoded><![CDATA[<p>Like it or not, Ubuntu is so easy to install that even for servers is very comfortable to just mount the iso and create as many virtual machines as you may need. Sometimes you already have an iso for Ubuntu, but are too lazy to download the server version. For those occasions you can either decide to waste precious RAM running a GUI for a server that will never need it, or you can remove all traces of the graphical login. Like this:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">sudo</span> update-rc.d -f gdm remove</div>
</li>
</ol>
</div>
<p>This will remove GDM from the startup scripts, meaning you can still fire up the graphical interface (*) if you want, but it will start Ubuntu without loading any graphics stuff. This is very useful to save on RAM, startup time and processing power, which even if not that useful for a desktop machine is incredible beneficial when you have several virtual machines running in a single physical server.</p>
<p>(*) More precisely, if you have users that need it. Remember though, if it can&#8217;t be done in console mode, it ain&#8217;t worth doing.</p>
<p><a href="http://nicolasb.com.ar/archivos/2011/08/gandalf.jpg"><img class="aligncenter size-medium wp-image-1568" title="gandalf" src="http://nicolasb.com.ar/archivos/2011/08/gandalf-300x200.jpg" alt="http://www.makarras.org/2008/06/17/gandalf/" width="300" height="200" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/10/starting-ubuntu-in-console-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running commands on Windows from Linux, through ssh</title>
		<link>http://nicolasb.com.ar/2011/09/running-commands-on-windows-from-linux-through-ssh/</link>
		<comments>http://nicolasb.com.ar/2011/09/running-commands-on-windows-from-linux-through-ssh/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 10:00:06 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1298</guid>
		<description><![CDATA[Running Windows is something I don&#8217;t usually like (running of Windows is a different story) but having to run something on Windows command line interface is something I wouldn&#8217;t wish even to my worst enemies. I was stuck in that situation, don&#8217;t remember why, but I needed to run a command in a Windows machine, [...]]]></description>
			<content:encoded><![CDATA[<p>Running Windows is something I don&#8217;t usually like (running of Windows is a different story) but having to run something on Windows command line interface is something I wouldn&#8217;t wish even to my worst enemies. I was stuck in that situation, don&#8217;t remember why, but I needed to run a command in a Windows machine, automatically, and I only had ssh (is there a better way of automating scripted tasks in Windows, remotely and without a GUI?). Well, this is what I came up with:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ssh</span> host cmd /c <span class="kw2">dir</span></div>
</li>
</ol>
</div>
<p>Running that in a bash shell will show the directory listing of C: in machine &#8220;host&#8221;. Ugly as hell, but it&#8217;s a good way of kickstarting a batch script.</p>
<p><a href="http://nicolasb.com.ar/archivos/2011/09/Hellraiser-I-1987-DivX3-Dvdrip-01.08.21.20.jpg"><img class="aligncenter size-full wp-image-1660" title="Hellraiser I (1987 DivX3 Dvdrip) - (01.08.21.20)" src="http://nicolasb.com.ar/archivos/2011/09/Hellraiser-I-1987-DivX3-Dvdrip-01.08.21.20.jpg" alt="" width="608" height="444" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/09/running-commands-on-windows-from-linux-through-ssh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zero padding for Bash scripts</title>
		<link>http://nicolasb.com.ar/2011/09/zero-padding-for-bash-scripts/</link>
		<comments>http://nicolasb.com.ar/2011/09/zero-padding-for-bash-scripts/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 10:00:54 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1273</guid>
		<description><![CDATA[Lately I found myself trying to generate a video from a series of images generated by a program. Doesn&#8217;t sound difficult, until you start running into a stupid issue: your 1000th frame will come before your 2nd frame! Luckily there&#8217;s a very easy fix for this problem, just add zero padding in a bash script. [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I found myself trying to generate a video from a series of images generated by a program. Doesn&#8217;t sound difficult, until you start running into a stupid issue: your 1000th frame will come before your 2nd frame!</p>
<p><a href="http://nicolasb.com.ar/archivos/2011/08/homer-doh2.png"><img class="aligncenter size-medium wp-image-1575" title="homer-doh2" src="http://nicolasb.com.ar/archivos/2011/08/homer-doh2-300x300.png" alt="" width="300" height="300" /></a></p>
<p>Luckily there&#8217;s a very easy fix for this problem, just add zero padding in a bash script. How?</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">for</span> i <span class="kw1">in</span> `<span class="kw2">seq</span> <span class="nu0">1</span> <span class="nu0">10</span>`; <span class="kw1">do</span> <span class="kw3">echo</span> <span class="re1">$i</span>; <span class="kw1">done</span></div>
</li>
</ol>
</div>
<p>That will print all the numbers between 1 and 10. This one will do the same, with zero padding:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">for</span> i <span class="kw1">in</span> `<span class="kw2">seq</span> <span class="nu0">1</span> <span class="nu0">10</span>`; <span class="kw1">do</span> <span class="kw3">printf</span> <span class="st0">&quot;%02d<span class="es0">\n</span>&quot;</span> <span class="re1">$i</span>; <span class="kw1">done</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/09/zero-padding-for-bash-scripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>sshfs, quick remote mount</title>
		<link>http://nicolasb.com.ar/2011/06/sshfs-quick-remote-mount/</link>
		<comments>http://nicolasb.com.ar/2011/06/sshfs-quick-remote-mount/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 10:00:24 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=956</guid>
		<description><![CDATA[When all you have is ssh access to a machine you have enough to mount a remote disk to your work station. How? easy: sshfs user@host:/path/to/remote/dir /path/to/local/dir Remember you need permission for both local and remote directories.]]></description>
			<content:encoded><![CDATA[<p>When all you have is ssh access to a machine you have enough to mount a remote disk to your work station. How? easy:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">sshfs user@host:/path/to/remote/<span class="kw2">dir</span> /path/to/<span class="kw3">local</span>/<span class="kw2">dir</span></div>
</li>
</ol>
</div>
<p>Remember you need permission for both local and remote directories.</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/08/Horse-Riding-Fail-Fork-Party-500x436.jpg"><img class="aligncenter size-medium wp-image-1165" title="Horse-Riding-Fail-Fork-Party-500x436" src="http://nicolasb.com.ar/archivos/2010/08/Horse-Riding-Fail-Fork-Party-500x436-300x261.jpg" alt="" width="300" height="261" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/06/sshfs-quick-remote-mount/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Repeat (and fix) last command</title>
		<link>http://nicolasb.com.ar/2011/05/repeat-and-fix-last-command/</link>
		<comments>http://nicolasb.com.ar/2011/05/repeat-and-fix-last-command/#comments</comments>
		<pubDate>Thu, 26 May 2011 10:00:37 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1156</guid>
		<description><![CDATA[How many times have you run a command but forgot to add sudo at the beginning? How many times did you open vim instead of gvim? All that has an easy fix, instead of pressing up-left-left-left-left-left&#8230; (almost like a Konami code, isn&#8217;t it?) just use !!. !! expands to the previous command, so for example [...]]]></description>
			<content:encoded><![CDATA[<p>How many times have you run a command but forgot to add sudo at the beginning? How many times did you open vim instead of gvim? All that has an easy fix, instead of pressing up-left-left-left-left-left&#8230; (almost like a Konami code, isn&#8217;t it?) just use !!.</p>
<p>!! expands to the previous command, so for example &#8220;vim foo&#8221;, then &#8220;g!!&#8221; will execute &#8220;gvim foo&#8221;.</p>
<p>Another common problem, you mistype vim for vmi (hey, it may be a common problem if you&#8217;re dyslexic). Just type fc, short for fix command, to open the last command in your configured editor. Fix it (lxp, bonus points if anyone understand this <img src='http://nicolasb.com.ar/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ) then write and save. The fixed command will be executed.</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/08/EscherStairs.jpg"><img class="aligncenter size-full wp-image-1157" title="EscherStairs" src="http://nicolasb.com.ar/archivos/2010/08/EscherStairs.jpg" alt="" width="437" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/05/repeat-and-fix-last-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Go home</title>
		<link>http://nicolasb.com.ar/2011/05/go-home/</link>
		<comments>http://nicolasb.com.ar/2011/05/go-home/#comments</comments>
		<pubDate>Thu, 19 May 2011 10:00:47 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1150</guid>
		<description><![CDATA[It really bothers me when people type &#8220;cd $HOME&#8221; or even worse, &#8220;cd /home/username&#8221;. Why? Just type cd alone, it&#8217;ll go home by itself. Another useful cd tip, use &#8220;cd -&#8221; as an alias for &#8220;cd $OLDPWD&#8221; (oldpwd is the previous directory).]]></description>
			<content:encoded><![CDATA[<p>It really bothers me when people type &#8220;cd $HOME&#8221; or even worse, &#8220;cd /home/username&#8221;. Why? Just type cd alone, it&#8217;ll go home by itself.</p>
<p>Another useful cd tip, use &#8220;cd -&#8221; as an alias for &#8220;cd $OLDPWD&#8221; (oldpwd is the previous directory).</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/08/Yellow_Brick_Road_go_home.jpg"><img class="aligncenter size-full wp-image-1151" title="Yellow_Brick_Road_go_home" src="http://nicolasb.com.ar/archivos/2010/08/Yellow_Brick_Road_go_home.jpg" alt="" width="261" height="380" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/05/go-home/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Know your history (at least in bash)</title>
		<link>http://nicolasb.com.ar/2011/04/know-your-history-at-least-in-bash/</link>
		<comments>http://nicolasb.com.ar/2011/04/know-your-history-at-least-in-bash/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 10:00:43 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1153</guid>
		<description><![CDATA[I always wonder why do you see so many people pressing up a bazillion times when trying to bring a command they recently typed. Just use ctrl+r and type part of the previous command, it&#8217;ll save you many hours of pressing up.]]></description>
			<content:encoded><![CDATA[<p>I always wonder why do you see so many people pressing up a bazillion times when trying to bring a command they recently typed. Just use ctrl+r and type part of the previous command, it&#8217;ll save you many hours of pressing up.</p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/04/know-your-history-at-least-in-bash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>echo &#8220;Hola mundo&#8221; &gt; /dev/full</title>
		<link>http://nicolasb.com.ar/2011/04/echo-hola-mundo-devfull/</link>
		<comments>http://nicolasb.com.ar/2011/04/echo-hola-mundo-devfull/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 10:00:11 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=971</guid>
		<description><![CDATA[I&#8217;d write something witty but there&#8217;s not a lot to talk about /dev/full. Anyway, it is a cool tip, so I&#8217;ll share it: Everyone knows /dev/null, and most will know /dev/zero. But /dev/full was unknown to me until some time ago. This device will respond to any write request with ENOSPC, No space left on [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d write something witty but there&#8217;s not a lot to talk about /dev/full. Anyway, it is a cool tip, so I&#8217;ll share it:</p>
<blockquote><p>Everyone knows /dev/null, and most will know /dev/zero. But /dev/full was unknown to me until some time ago. This device will respond to any write request with ENOSPC, No space left on device. Handy if you want to test if your program catches &#8220;disk full&#8221; &#8211; just let it write there</p></blockquote>
<p>From <a href="http://www.df7cb.de/blog/2010/dev_full.html">Myon&#8217;s Blog</a></p>
<p><a href="http://nicolasb.com.ar/archivos/2010/08/full_i_ate_too_much.jpg"><img class="aligncenter size-full wp-image-1147" title="full_i_ate_too_much" src="http://nicolasb.com.ar/archivos/2010/08/full_i_ate_too_much.jpg" alt="" width="350" height="295" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/04/echo-hola-mundo-devfull/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time your time</title>
		<link>http://nicolasb.com.ar/2011/03/time-your-time/</link>
		<comments>http://nicolasb.com.ar/2011/03/time-your-time/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 10:00:18 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1160</guid>
		<description><![CDATA[&#8220;time&#8221; is a useful command line utility to measure how long it takes for your super optimized algorithm to run, but it&#8217;s useful as a timer too: just write &#8220;time read&#8221; and press enter when you get tired of waiting. Instant timer on your console!]]></description>
			<content:encoded><![CDATA[<p>&#8220;time&#8221; is a useful command line utility to measure how long it takes for your super optimized algorithm to run, but it&#8217;s useful as a timer too: just write &#8220;time read&#8221; and press enter when you get tired of waiting. Instant timer on your console!</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/08/Escher_time.jpg"><img class="aligncenter size-medium wp-image-1162" title="Escher_time" src="http://nicolasb.com.ar/archivos/2010/08/Escher_time-300x241.jpg" alt="" width="300" height="241" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2011/03/time-your-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorting by random in bash and mocp random updated</title>
		<link>http://nicolasb.com.ar/2010/09/sorting-by-random-in-bash-and-mocp-random-updated/</link>
		<comments>http://nicolasb.com.ar/2010/09/sorting-by-random-in-bash-and-mocp-random-updated/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 10:00:14 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=954</guid>
		<description><![CDATA[Random is nice. And now you can sort by random your output using sort -R. Why would this be useful? Well, I updated my mocp random script with a oneliner: mocp -c &#38;amp;&#38;amp; find -type d &#124; sort -R &#124; head -n1 &#124; awk &#8216;{print &#34;\&#8221;&#34;$0&#34;\&#8221;&#34;}&#8217; &#124; xargs mocp -a]]></description>
			<content:encoded><![CDATA[<p>Random is nice. And now you can sort by random your output using sort -R. Why would this be useful? Well, I updated <a href="http://nicolasb.com.ar/2009/07/mocp-rand/">my mocp random</a> script with a oneliner:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">mocp -c &amp;amp;&amp;amp; <span class="kw2">find</span> -<span class="kw3">type</span> d | <span class="kw2">sort</span> -R | <span class="kw2">head</span> -n1 | <span class="kw2">awk</span> <span class="st0">&#8216;{print &quot;<span class="es0">\&#8221;</span>&quot;$0&quot;<span class="es0">\&#8221;</span>&quot;}&#8217;</span> | <span class="kw2">xargs</span> mocp -a</div>
</li>
</ol>
</div>
<p><a href="http://nicolasb.com.ar/archivos/2010/05/debian_random.jpg"><img class="aligncenter size-full wp-image-1062" title="debian_random" src="http://nicolasb.com.ar/archivos/2010/05/debian_random.jpg" alt="" width="508" height="298" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/09/sorting-by-random-in-bash-and-mocp-random-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

