<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>cli &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/cli/</link>
	<description>Feed of posts on WordPress.com tagged "cli"</description>
	<pubDate>Tue, 24 Nov 2009 17:47:53 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[[cli] Find out success status of a command in BASH/ CSH]]></title>
<link>http://nixtricks.wordpress.com/2009/11/20/cli-find-out-success-status-of-a-command-in-bash-csh/</link>
<pubDate>Fri, 20 Nov 2009 21:10:54 +0000</pubDate>
<dc:creator>kousik</dc:creator>
<guid>http://nixtricks.wordpress.com/2009/11/20/cli-find-out-success-status-of-a-command-in-bash-csh/</guid>
<description><![CDATA[To know the return value of a command, in BASH run $ echo $? and in CSH/ TCSH run $ echo $status whi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>To know the return value of a command, in BASH run<br />
<code> $ echo $?</code><br />
and in CSH/ TCSH run<br />
<code> $ echo $status</code><br />
which will give you the return value (0 or 1) of the last command (the one issued just before the <code> echo</code>).</p>
<p>In both the shells, if the above spits out 0 (zero),  it means the previous command was successfully completed, otherwise it&#8217;ll give rise to 1 (unsuccessful!) &#8212; quite contrary to our concept of 0 being false and 1 being true, eh!</p>
<p><strong>Credit:</strong> <a href="http://oraclespin.wordpress.com/2009/06/14/how-to-find-successfailure-status-of-a-command-in-different-shells/" target="_blank">Oracle Spin</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Slimdx]]></title>
<link>http://bybitsandbytes.wordpress.com/2009/11/18/slimdx/</link>
<pubDate>Wed, 18 Nov 2009 17:22:11 +0000</pubDate>
<dc:creator>bybitsandbytes</dc:creator>
<guid>http://bybitsandbytes.wordpress.com/2009/11/18/slimdx/</guid>
<description><![CDATA[I&#8217;ve been working on some graphics work using SlimDx. I really like the library but the docume]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;ve been working on some graphics work using SlimDx. I really like the library but the documentation is sparse in some places</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Divide et impera]]></title>
<link>http://comicsandoimage.wordpress.com/2009/11/18/divide-et-impera/</link>
<pubDate>Wed, 18 Nov 2009 14:29:08 +0000</pubDate>
<dc:creator>Nico</dc:creator>
<guid>http://comicsandoimage.wordpress.com/2009/11/18/divide-et-impera/</guid>
<description><![CDATA[Divide et impera (pronuncia: dìvide et ìmpera) è una locuzione latina che tradotta letteralmente sig]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h3><img class="alignleft" src="http://www.windoweb.it/guida/cultura/cultura_foto/giulio_cesare_2.jpg" alt="http://www.windoweb.it/guida/cultura/cultura_foto/giulio_cesare_2.jpg" width="360" height="354" /></h3>
<h3><strong></strong><strong>D</strong>ivide et impera (pronuncia: <em>dìvide et ìmpera</em>) è una <a title="Locuzione latina" href="http://it.wikipedia.org/wiki/Locuzione_latina">locuzione latina</a> che tradotta letteralmente significa</h3>
<h3><em>dividi e domina</em>.<strong> Divide et impera</strong> (pronuncia: <em>dìvide et ìmpera</em>) è una <a title="Locuzione latina" href="http://it.wikipedia.org/wiki/Locuzione_latina">locuzione latina</a> che tradotta letteralmente significa <em>dividi e domina</em>. Ai tempi dei <a title="Romani" href="http://it.wikipedia.org/wiki/Romani">romani</a> era il modo di governare il territorio italiano e di evitare rivolte da parte delle popolazioni italiche.</h3>
<h3>Un esempio moderno si poteva veder applicato nell&#8217;<a title="Impero britannico" href="http://it.wikipedia.org/wiki/Impero_britannico">impero coloniale britannico</a>, più precisamente nell&#8217;<a title="India britannica" href="http://it.wikipedia.org/wiki/India_britannica">India britannica</a>, dove gli inglesi utilizzavano marginalmente i loro eserciti, ma al contrario alimentavano le diatribe tra le tribù che combattevano l&#8217;una contro l&#8217;altra, ignare che cosí facendo semplificavano il governo e il dominio dei britannici.</h3>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/p7YpaEj5FY8&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/p7YpaEj5FY8&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<h3>Nello specifico, gli inglesi mantennero i confini regionali tra le varie etnie indiane, per preservare le diversità culturali e linguistiche nonché gli attriti e le rivendicazioni territoriali di un&#8217;etnia sull&#8217;altra, e per mantenere i dissapori e i contenziosi di carattere religioso e sociale. Difatti, questa situazione sopravvisse anche all&#8217;indipendenza delle <a title="India britannica" href="http://it.wikipedia.org/wiki/India_britannica">India britannica</a>, che sfociarono in una serie di lotte interne al subcontinente indiano, che frammentarono quello che un tempo era il grande impero indiano-britannico in 6 stati indipendenti (<a title="India" href="http://it.wikipedia.org/wiki/India">India</a>, <a title="Pakistan" href="http://it.wikipedia.org/wiki/Pakistan">Pakistan</a>, <a title="Nepal" href="http://it.wikipedia.org/wiki/Nepal">Nepal</a>, <a title="Bangladesh" href="http://it.wikipedia.org/wiki/Bangladesh">Bangladesh</a>, <a title="Bhutan" href="http://it.wikipedia.org/wiki/Bhutan">Bhutan</a> e <a title="Sri Lanka" href="http://it.wikipedia.org/wiki/Sri_Lanka">Sri Lanka</a>) invece che in una grande entità nazionale. Le diatribe e i contenziosi tra etnie avevano vinto sulla volontà di un <a title="Popolo" href="http://it.wikipedia.org/wiki/Popolo">popolo</a> di costituire una <a title="Nazione" href="http://it.wikipedia.org/wiki/Nazione">nazione</a> unita.</h3>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Martes sin X "Vifm"]]></title>
<link>http://fausto23.wordpress.com/2009/11/17/martes-sin-x-vifm/</link>
<pubDate>Wed, 18 Nov 2009 02:34:30 +0000</pubDate>
<dc:creator>fausto23</dc:creator>
<guid>http://fausto23.wordpress.com/2009/11/17/martes-sin-x-vifm/</guid>
<description><![CDATA[Durante este tiempo que he hecho esta serie de post me he dado cuenta de 2 cosas, las aplicaciones s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="aligncenter size-full wp-image-1454" title="Vifm" src="http://fausto23.wordpress.com/files/2009/11/captura-de-pantalla-51.png" alt="" width="600" height="371" /></p>
<p>Durante este tiempo que he hecho esta serie de post me he dado cuenta de 2 cosas, las aplicaciones son tan funcionales como las de GUI y que la mayoria de los que comentan usan Vim <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> , asi que hoy les traigo esta util aplicacion.</p>
<p><a href="http://vifm.sourceforge.net/">Vifm</a> o vi file manager, es un explorador de archivos basado en ncurses, que se maneja a traves del teclado y comandos que recuerdan a Vi, la interfaz es de 2 paneles o si solo queremos uno ejecutamos la orden <strong><code> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly</code></strong> y para regresar a la vista predeterminada <strong><code>:split</code></strong>. Otros comandos utiles en este programa son la busqueda de archivos (<strong><code>/expresion de busqueda</code></strong>), colocar marcadores a las carpetas para su pronta navegacion(<strong><code>m[0-9][a-z][A-Z] y los podemos ver con :marks</code></strong>), ejecutar archivos, usar sesiones de screen, y claro que no puede faltar la edicion de texto con Vim.</p>
<p>Vifm solo depende de Python y puede encontrarse en la mayoria de las distribuciones. En Ubuntu se encuentra en los repositorios universe y en Arch Linux en AUR.</p>
<p>Espero que les sirva esta aplicacion.</p>
<p>Mata ne!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[cli] Split a huge file into smaller pieces ]]></title>
<link>http://nixtricks.wordpress.com/2009/11/11/cli-split-a-huge-file-into-smaller-pieces/</link>
<pubDate>Wed, 11 Nov 2009 05:55:02 +0000</pubDate>
<dc:creator>kousik</dc:creator>
<guid>http://nixtricks.wordpress.com/2009/11/11/cli-split-a-huge-file-into-smaller-pieces/</guid>
<description><![CDATA[There may be occasions when you may need to split a huge file  into smaller pieces for storage restr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>There may be occasions when you may need to split a huge file  into smaller pieces for storage restrictions (or if you plan on sending them piece-by-piece to a friend!):</p>
<p>The following nifty trick (picked up from <a href="http://www.commandlinefu.com/commands/view/4043/split-a-tarball-into-multiple-parts" target="_blank">Commandline-fu</a>) explains how a directory, &#60;dir&#62;, can first be tarred and split into smaller pieces and later rejoined as need arises:</p>
<blockquote>
<pre>$ tar cf - &#60;dir&#62; &#124; split -b&#60;max_size&#62;M - &#60;name&#62;.tar.</pre>
<p>Rejoin later with `cat&#8217; and then extact:</p>
<pre>$ cat .tar.* &#124;tar xf -</pre>
</blockquote>
<p><strong> Credit:</strong> <a href="http://www.commandlinefu.com/commands/view/4043/split-a-tarball-into-multiple-parts" target="_blank">Commandline-fu</a>.</p>
<p><strong>UPDATE:</strong><em> Problems with the first line of the code is fixed. This arose in the first place because when I put &#60;dir&#62; in the  raw HTML box, it just ignored it since &#60;dir&#62; is not a valid HTML tag (as if I wanted it to be!).</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[آپگرید کردن کوبونتو یا اوبونتو با کامند لاین]]></title>
<link>http://30noohe.wordpress.com/2009/11/08/%d8%a2%d9%be%da%af%d8%b1%db%8c%d8%af-%da%a9%d8%b1%d8%af%d9%86-%da%a9%d9%88%d8%a8%d9%88%d9%86%d8%aa%d9%88-%db%8c%d8%a7-%d8%a7%d9%88%d8%a8%d9%88%d9%86%d8%aa%d9%88-%d8%a8%d8%a7-%da%a9%d8%a7%d9%85%d9%86/</link>
<pubDate>Sun, 08 Nov 2009 12:59:42 +0000</pubDate>
<dc:creator>30noohe</dc:creator>
<guid>http://30noohe.wordpress.com/2009/11/08/%d8%a2%d9%be%da%af%d8%b1%db%8c%d8%af-%da%a9%d8%b1%d8%af%d9%86-%da%a9%d9%88%d8%a8%d9%88%d9%86%d8%aa%d9%88-%db%8c%d8%a7-%d8%a7%d9%88%d8%a8%d9%88%d9%86%d8%aa%d9%88-%d8%a8%d8%a7-%da%a9%d8%a7%d9%85%d9%86/</guid>
<description><![CDATA[خیلی از کسایی که عشق لینوکس هستن بیشتر اوقات دوست دارن به کامند لاین ور برن تا این که کارشون رو به ص]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>خیلی از کسایی که عشق لینوکس هستن بیشتر اوقات دوست دارن به کامند لاین ور برن تا این که کارشون رو به صورت گرافیکی انجام بدن‌! این پست هم مختص همون افراده! البته این کار برای سرور ها و&#8230; هم کاربرد داره<br />
اول باید مخازنمون رو عوض کنیم!<br />
فایل etc/apt/sources.list را باز کنید و تمامی خط ها را کامنت کرده و سپس مخازن جدید را به آن اضافه کنید:(لیست مخازن را از خود سایت دریافت کنید)<br />
برای آپگرید دستور زیر را بزنید<br />
<code>sudo apt-get update &#38;&#38; sudo apt-get dist-upgrade &#38;&#38; sudo apt-get dist-upgrade</code><br />
حالا سیستم عامل شروع به دانلود پکیج های جدید می کند! که ممکن است چند ساعتی طول بکشد<br />
سپس برای اطمینان از تمام شدن کار دستورات زیر رو بزنید:<br />
<code>    sudo apt-get update &#38;&#38; sudo apt-get dist-upgrade</p>
<p>    sudo apt-get -f install</p>
<p>    sudo dpkg --configure -a</code><br />
سیستم را ریست کنید<br />
خوش باشید</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Ojos+Ilusión Óptica= Vista Aguosa]]></title>
<link>http://dosisnecesaria.wordpress.com/2009/11/05/ojosilusion-optica-vista-aguosa/</link>
<pubDate>Thu, 05 Nov 2009 22:25:33 +0000</pubDate>
<dc:creator>zombie12</dc:creator>
<guid>http://dosisnecesaria.wordpress.com/2009/11/05/ojosilusion-optica-vista-aguosa/</guid>
<description><![CDATA[Click click click&#8230;&#8230;.. Instrucciones: (Por si no se dan cuenta de que en la página están)]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.neave.com/strobe/">Click click click&#8230;&#8230;..</a></p>
<p>Instrucciones: (Por si no se dan cuenta de que en la página están)<br />
Deben de ver la cruz del centro por 20 MINUTOS nah&#8230; haaha 20 segundos y de alli miren a algun otro lugar&#8230; yo les recomiendo ver otra página de internet&#8230; y asi finalmente entenderán porque la Vista Aguosa&#8230; y no Pablo&#8230; no se vista aguosa porque llorás sino porque simula la superficie del agua&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;  Just kidding&#8230;.</p>
<p>de <a href="http://neave.com">neave.com</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Applications I Can't Live Without, Volume 1: YubNub]]></title>
<link>http://redmonktv.wordpress.com/2009/11/05/applications-i-cant-live-without-volume-1-yubnub/</link>
<pubDate>Thu, 05 Nov 2009 19:29:43 +0000</pubDate>
<dc:creator>sogrady</dc:creator>
<guid>http://redmonktv.wordpress.com/2009/11/05/applications-i-cant-live-without-volume-1-yubnub/</guid>
<description><![CDATA[WordPress video Who wouldn&#8217;t appreciate an application named after the Ewok word for freedom? ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><span id='plh-loop-video-embed-0' class='hidden'>done</span><script type='text/javascript' src='http://v.wordpress.com/wp-content/plugins/video/swfobject2.js'></script><ins style='text-decoration:none;'>
<div class='video-player' id='x-video-0'>
<p id='video-0'></p></div></ins><script type='text/javascript'>swfobject.embedSWF('http://v.wordpress.com/wp-content/plugins/video/flvplayer.swf?ver=1.10', 'video-0', '400', '224', '9.0.115','http://v.wordpress.com/wp-content/plugins/video/expressInstall2.swf', {guid:'22PWLmTC', javascriptid: 'video-0', width: '400', height: '224', locksize: 'no'}, {allowfullscreen: 'true', allowscriptaccess: 'always', seamlesstabbing: 'true', overstretch: 'true'}, {'id':'video-0'});</script>

<p>Who wouldn&#8217;t appreciate an application named after the Ewok word for freedom?</p>
<p>If you like the <a href="http://www.cryptonomicon.com/beginning.html">command line</a>, you&#8217;ll love &#60;a href=&#8221;http://yubnub.org&#8221;&#62;YubNub&#60;/a&#62;. And even if you don&#8217;t know what the command line is, you&#8217;ll probably still love YubNub because it saves you time just about every time you use the browser. For the first in a series of screencasts on applications I can&#8217;t live without, I couldn&#8217;t have picked a better one: the Ruby built application is a staple of my everyday life.</p>
<p>Come see why in this video.</p>
<p><strong>Notes</strong>: Screencast was recorded with <a href="http://recordmydesktop.sourceforge.net/about.php">gtk-recordMyDesktop</a>, audio was recorded with <a href="http://audacity.sourceforge.net/">Audacity</a>, and the final video was rendered using <a href="http://www.pitivi.org/wiki/Main_Page">PiTiVi</a>. Thanks to those projects for their hard work.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[awk] Command line calculator using awk]]></title>
<link>http://nixtricks.wordpress.com/2009/11/03/awk-command-line-calculator-using-awk/</link>
<pubDate>Wed, 04 Nov 2009 00:07:15 +0000</pubDate>
<dc:creator>kousik</dc:creator>
<guid>http://nixtricks.wordpress.com/2009/11/03/awk-command-line-calculator-using-awk/</guid>
<description><![CDATA[This is an update on our bash command line calculator posted a few days ago &#8212; except for the f]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This is an update on our <a title="Bash command line calculator" href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_self">bash command line calculator</a> posted a few days ago &#8212; except for the fact that this time we&#8217;ll use <code>awk</code> to do the calculation instead of <code>bc</code>. As I mentioned in <a href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_blank">that</a> post, you may use python or ruby (irb) to do the same thing, but these tricks may be useful if you don&#8217;t ruby or python installed (bc and awk, in general, come by default in any Unix or GNU/Linux distro).</p>
<p>First, create (or rewrite if you used our last <a title="Bash command line calculator" href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_self">trick</a>) function &#8220;<code>?</code>&#8221;  as follows and put it in your <code>~/.bashrc</code> file:</p>
<div style="border:1px dotted black;padding:1em;"><code>? () { awk "BEGIN{ print $* }" ;}</code></div>
<p>and make sure to reload your <code>~/.bashrc</code><code> file (do the similar thing if you're using any other shell). [<strong>NOTE:</strong> ZSH does not like ``?'' as a function, so you might consider replacing it with something reasonable, e.g., ``compute'']<br />
</code></p>
<p>Now, if you want to calculate an expression, do it, for example, as</p>
<div style="border:1px dotted black;padding:1em;"><code>$ ? "2*3+4.0*(9.9+8.1)"</code></div>
<p>and don&#8217;t forget the quotes.</p>
<p><span style="color:#ffffff;">.</span></p>
<p>The advantage of this over <a href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_blank">bc</a> is that you can use more arithmetic and trigonometric functions (<a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?awk" target="_blank">link</a>):</p>
<blockquote>
<pre>              atan2(y,x)     Arctan of y/x between -pi and pi.

	      cos(x)	     Cosine function, x in radians.

	      exp(x)	     Exponential function.

	      int(x)	     Returns x truncated towards zero.

	      log(x)	     Natural logarithm.

	      rand()	     Returns a random number between zero and one.

	      sin(x)	     Sine function, x in radians.

	      sqrt(x)	     Returns square root of x.</pre>
</blockquote>
<p><span style="color:#ffffff;">.</span><br />
You may include variables as well in the function definition itself:</p>
<div style="border:1px dotted black;padding:1em;"><code>? () { awk "BEGIN{ pi = 4.0*atan2(1.0,1.0); degree = pi/180.0; print $* }" ;}</code></div>
<p>where we have defined the variable pi and degree (such that tan(pi/4.0) = 1.0 and pi radians is equivalent to 180 degrees) to be used later, e.g.</p>
<div style="border:1px dotted black;padding:1em;"><code>$ ? "cos(pi)"<br />
$ ? "cos(90*degree)"</code></div>
<p>and I&#8217;m sure that you&#8217;ll get -1 and 0 (within the machine precision), respectively, as the answer!</p>
<p>(You may find some more interesting calculator related tricks posted in this blog scattered in different <a href="http://nixtricks.wordpress.com/tag/calculator/" target="_blank">pages</a>)</p>
<p><strong>Credit:</strong> <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?awk" target="_blank">here</a> and <a href="http://www.commandlinefu.com/commands/view/3871/command-line-calculator" target="_blank">here</a> (via <a href="http://lifehacker.com/5396183/create-an-awesome-command-line-calculator" target="_blank">LifeHacker</a>).</p>
<p><strong>UPDATE:</strong> I just realized that I can use the calc package (besides bc, awk, python and irb) to do the command line math wizardry more efficiently (and let&#8217;s take that as the end to this command line calculator <a href="http://nixtricks.wordpress.com/tag/calculator/" target="_blank">series</a>!). It has a larger set of <a href="http://www.isthe.com/chongo/tech/comp/calc/calc-builtin.html" target="_blank">built-in </a>functions. You may grab the source code from the maintainer&#8217;s <a href="http://www.isthe.com/chongo/tech/comp/calc/" target="_blank">website</a> and follow my <a href="http://nixtricks.wordpress.com/2009/10/31/linux-how-to-install-a-package-from-the-source-code/" target="_blank">instructions</a> to install it on your system [although binaries are also readily available, e.g. <a href="http://packages.ubunut.com/karmic/math/apcalc">apcalc</a> package for Ubuntu 9.10 (Karmic Koala)].</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Command Line Calculator]]></title>
<link>http://onebitetips.wordpress.com/2009/11/03/command-line-calculator/</link>
<pubDate>Tue, 03 Nov 2009 21:48:45 +0000</pubDate>
<dc:creator>fattykernel</dc:creator>
<guid>http://onebitetips.wordpress.com/2009/11/03/command-line-calculator/</guid>
<description><![CDATA[Out of laziness I&#8217;ll just plagiarize LifeHacker for this tip. When you spend as much time at t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Out of laziness I&#8217;ll just plagiarize LifeHacker for this tip.</p>
<blockquote><p><em>When you spend as much time at the terminal as I do, having a calculator at your fingertips can be a really useful feature, and the Command-Line Fu web site tells us how to create one easily. </em></p>
<p><em>To create the calculator, you can just enter this function on the command line to test out how it works, or add it into our ~/.bashrc file to make sure that it&#8217;s always available after restarting the terminal.</em></p>
<p><code>calc(){ awk "BEGIN{ print $* }" ;}</code></p>
<p><em>To use it, you can simply type <code>calc</code> followed by the calculation you want to solve, making sure to use quotes around the calculation if there are spaces or special characters the shell can&#8217;t handle. For instance, if you entered <code>calc 3*99/7+18</code> at the prompt, you&#8217;d get 60.4286 as the answer. For more complex calculations, you can use parenthesis, but make sure to put quotes around it, like this:</em></p>
<p><code>calc "((3+(2^3)) * 34^2 / 9)-75.89"</code></p>
<p><em>It&#8217;s an extremely useful tip for those of us that live at the terminal. It should work on any OS running the bash shell, including Linux, Mac OS X, or even Windows with <a href="http://www.cygwin.com/">Cygwin</a></em> installed.</p></blockquote>
<p>Up until I saw this I used <strong>bc</strong> as a calculator. This should shave off a few seconds from basic calculations.</p>
<p>[<a href="http://lifehacker.com/5396183/create-an-awesome-command-line-calculator">Lifehacker</a>]</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[osx] Eject a volume 'unwilling' to be ejected!]]></title>
<link>http://nixtricks.wordpress.com/2009/10/31/osx-eject-a-volume-unwilling-to-be-ejecte/</link>
<pubDate>Sat, 31 Oct 2009 18:16:58 +0000</pubDate>
<dc:creator>kousik</dc:creator>
<guid>http://nixtricks.wordpress.com/2009/10/31/osx-eject-a-volume-unwilling-to-be-ejecte/</guid>
<description><![CDATA[I sometime have problem finding which persistent process is not letting me eject a volume (CD/DVD/US]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I sometime have problem finding which persistent process is not letting  me eject a volume (CD/DVD/USB drive). The error message is not very helpful at all:</p>
<blockquote><p>Try quitting applications</p></blockquote>
<p>OK, but which one(s)? I often have hard time figuring that out using htop/ top or a combination of ps and grep.</p>
<p>But actually this is what I  want:</p>
<div style="border:1px dotted black;padding:1em;"><code>$ lsof &#124; grep -i Volume_Name</code></div>
<p>where Volume_Name is the name of the volume (or an &#8216;identifying&#8217; part of the name) I want to eject. This gives me the name(s) and process ID(s) of the run-away process(es) as well as the path to the file(s) in use on the volume, Volume_Name.</p>
<p>Now that I know the names I should first try to save the documents and quit the applications involved in the normal way. However, if a particular application does not oblige, I can always kill it (with the risk of potential data loss!) using its process ID (say, 123):</p>
<div style="border:1px dotted black;padding:1em;"><code>$ kill -9 123</code></div>
<p>After that, the ejection of the volume should not be difficult at all.</p>
<p>Needless to say, being a Unix utility, <code>lsof</code> (=&#8220;list open files&#8221;) may be used on other *nix-based systems as well.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Unity3D, be free to experiment]]></title>
<link>http://dkor.wordpress.com/2009/10/31/unity3d-be-free-to-experiment/</link>
<pubDate>Sat, 31 Oct 2009 07:00:38 +0000</pubDate>
<dc:creator>dkor</dc:creator>
<guid>http://dkor.wordpress.com/2009/10/31/unity3d-be-free-to-experiment/</guid>
<description><![CDATA[During the Unite 2009 conference, the danish firm announced that the Indie version of its 3D softwar]]></description>
<content:encoded><![CDATA[During the Unite 2009 conference, the danish firm announced that the Indie version of its 3D softwar]]></content:encoded>
</item>
<item>
<title><![CDATA[[cli] Find out the public IP in the command line]]></title>
<link>http://nixtricks.wordpress.com/2009/10/30/cli-find-out-the-public-ip-in-the-command-line/</link>
<pubDate>Fri, 30 Oct 2009 19:33:17 +0000</pubDate>
<dc:creator>kousik</dc:creator>
<guid>http://nixtricks.wordpress.com/2009/10/30/cli-find-out-the-public-ip-in-the-command-line/</guid>
<description><![CDATA[You may find out your IP using commands like ifconfig, but if your computer is behind a firewall, th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>You may find out your IP using commands like <code>ifconfig</code>, but if your computer is behind a firewall, that is not the IP that the world sees. Here&#8217;s a quick <em>how-to</em> to find out what your external IP is.</p>
<p>First, let&#8217;s create an alias: (<a href="http://www.commandlinefu.com/commands/view/3943/what-is-my-ip">link</a>)</p>
<div style="border:1px dotted black;padding:1em;"><code>alias getip="wget -q -O - http://whatismyip.com/automation/n09230945.asp"</code></div>
<p>Next time when you need the public IP of your computer, just type <code>getip</code> in the command line and hit enter.</p>
<p>The above command gets the IP from http://whatismyip.com/automation/n09230945.asp (just copy and paste this URL to your location bar and hit enter, and see what it does!). The &#8220;<code>-q</code>&#8221; is to suppress verbose information (quiet mode) and &#8220;<code>-O -</code>&#8221; causes the output to be written to STDOUT.</p>
<p>You may use dyndns.org too to find out the IP, but in this case you may need some trimming: substitute the text within the code above by the following:</p>
<blockquote><p><code><br />
wget http://checkip.dyndns.org/ -O - -o /dev/null &#124; cut -d: -f 2 &#124; cut -d\&#60; -f 1</code></p></blockquote>
<p><strong><em>A few words about various flags above:</em></strong><br />
The output of the first command (everything before the first pipe) is</p>
<blockquote><p>&#60;code&#62;&#60;html&#62;&#60;head&#62;&#60;title&#62;Current IP Check&#60;/title&#62;&#60;/head&#62;&#60;body&#62;Current IP Address: xxx.xxx.xx.xx&#60;/body&#62;&#60;/html&#62;</p></blockquote>
<p>(the actual IP address is masked by x).<br />
The &#8220;<code>-o /dev/null</code>&#8220; part  redirects the STDERR of <code>wget</code> to <code>/dev/null</code>. The &#8220;<code>-d :</code>&#8221; option in first &#8220;cut&#8221; tells it to use colon (:) to be used as the delimiter and &#8220;<code>-f 2</code>&#8221; causes it to print second of the delimited fields. Similarly,  the flags of the second &#8220;cut&#8221; cause it to use &#8220;&#60;&#8221; as the delimiter for the piped output from the first &#8220;cut&#8221; and choose the first of the delimited fields.</p>
<p><strong>UPDATE:</strong> Another one using <code>curl</code> [<a href="http://www.commandlinefu.com/commands/view/3946/what-is-my-ip-hardened">link</a>]. You may again change the quoted text within the alias above by the following:</p>
<blockquote><p><code><br />
curl --connect-timeout 3 http://www.whatismyip.org/</code></p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Konversi Video dengan FFmpeg]]></title>
<link>http://kumachii.wordpress.com/2009/10/28/konversi-video-dengan-ffmpeg/</link>
<pubDate>Wed, 28 Oct 2009 00:29:23 +0000</pubDate>
<dc:creator>Hayi Chan</dc:creator>
<guid>http://kumachii.wordpress.com/2009/10/28/konversi-video-dengan-ffmpeg/</guid>
<description><![CDATA[Tutorial ini ku persembahkan untuk para Anime maniak dan para Movie lovers. Bagi kita para pengguna ]]></description>
<content:encoded><![CDATA[Tutorial ini ku persembahkan untuk para Anime maniak dan para Movie lovers. Bagi kita para pengguna ]]></content:encoded>
</item>
<item>
<title><![CDATA[Linux Framebuffer]]></title>
<link>http://onebitetips.wordpress.com/2009/10/25/linux-framebuffer/</link>
<pubDate>Sun, 25 Oct 2009 15:39:02 +0000</pubDate>
<dc:creator>fattykernel</dc:creator>
<guid>http://onebitetips.wordpress.com/2009/10/25/linux-framebuffer/</guid>
<description><![CDATA[I quite often don&#8217;t bother starting something as slow as X just to watch a video or view some ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I quite often don&#8217;t bother starting something as slow as X just to watch a video or view some images. This can be achieved through something called framebuffer. I&#8217;m not the right person to describe what it is exactly, so I&#8217;ll just quote <a href="http://en.wikipedia.org/wiki/Linux_framebuffer">wikipedia</a> for convenience.</p>
<p style="padding-left:30px;"><em>The Linux framebuffer (fbdev) is a graphic hardware-independent abstraction layer to show graphics on a console without relying on system-specific libraries such as SVGALib or the heavy overhead of the X Window System. Linux kernel has generic framebuffer support since 2.1.107 kernel.</em></p>
<p>To start, you should either switch over to one of the 6 (default) ttys with the handy Ctrl-Alt-F[1-6] and login. That or you could simple shutdown X (usually done by stopping the [gkx]dm service). You are likely to notice that the font is stretched and clearly not displayed at your native resolution. To remedy this you should first find out the code for the mode that your tty should be running at. You can do this by running <strong>hwinfo &#8211;framebuffer</strong> as root. Install as needed.</p>
<pre style="padding-left:30px;">$ sudo hwinfo --framebuffer
02: None 00.0: 11001 VESA Framebuffer
[Created at bios.464]
Unique ID: rdCR.DOLBnVJRT0D
Hardware Class: framebuffer
Model: "NVIDIA G92 Board - 071116A"
Vendor: "NVIDIA Corporation"
Device: "G92 Board - 071116A"
SubVendor: "NVIDIA"
SubDevice:
Revision: "Chip Rev"
Memory Size: 14 MB
Memory Range: 0xf9000000-0xf9dfffff (rw)
[........]
Mode 0x0362: 768x480 (+768), 8 bits
Mode 0x0364: 1440x900 (+1440), 8 bits
Mode 0x0365: 1440x900 (+5760), 24 bits
Mode 0x0368: 1680x1050 (+1680), 8 bits
Mode 0x0369: 1680x1050 (+6720), 24 bits
Mode 0x037c: 1920x1200 (+1920), 8 bits
Mode 0x037d: 1920x1200 (+7680), 24 bits
Config Status: cfg=new, avail=yes, need=no, active=unknown</pre>
<p>You should (hopefully) find a mode that corresponds to your native resolution, if not then you are out of luck &#8211; your gpu doesn&#8217;t support it. If you see multiple entries with the correct resolution, pick the one with the greatest depth (24 bits). In my case, the correct mode is <strong>0&#215;0369</strong>. Now that I have it, all I do is append it <strong>vga=0&#215;0369</strong> to my kernel line in grub&#8217;s menu.lst. Here&#8217;s mine.</p>
<p style="padding-left:30px;">kernel        /boot/vmlinuz-2.6.31.5-20091024 root=UUID=2d8a6294-3a89-4a94-8c2a-81962ccb37c4 ro <strong>vga=0&#215;369</strong> rootflags=data=writeback</p>
<p>Sadly, the only way I know of getting into the mode is by restarting. If anyone has a better way to instantly set the resolution please comment.</p>
<p>After the restart, you should get back into a tty and login. To view images, you need <strong>fbi</strong>, which (I assume) stands for frame buffer imageviewer. Install as needed. Let&#8217;s say you want to see that photo of your cat you took yesterday. All you have to do is</p>
<pre style="padding-left:30px;">$ fbi my_delicious_kitty.jpg</pre>
<p>And voila! Your kitty is on your display without the help of X! You can pan or zoom. Press h for help, q to quit. Of course you can load multiple images at once.</p>
<pre style="padding-left:30px;">$ fbi *kitty*.jpg</pre>
<p>And you can browse through them with Page up and Page down. Unfortunately animated gifs are not supported.</p>
<p>But what if you wanted to watch a video? That&#8217;s just as simple.</p>
<pre style="padding-left:30px;">$ mplayer -vo fbdev2 kitty_in_the_sunshine.ogm</pre>
<p>Add the -fs arg to center the image on the screen.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Ok, maybe that wasn&#8217;t a &#8220;bite size&#8221; tip, but it is nonetheless rather helpful. Be sure to check out man pages of both mplayer and fbi for more details.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Plantación de E. Camaldulensis de 4 años.]]></title>
<link>http://colotlan.wordpress.com/2009/10/23/e-camal-4/</link>
<pubDate>Fri, 23 Oct 2009 15:43:13 +0000</pubDate>
<dc:creator>colotlan</dc:creator>
<guid>http://colotlan.wordpress.com/2009/10/23/e-camal-4/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://colotlan.wordpress.com/files/2009/10/pa220129.jpg"><img class="alignnone size-full wp-image-667" title="PA220129" src="http://colotlan.wordpress.com/files/2009/10/pa220129.jpg" alt="PA220129" width="477" height="357" /></a></p>
<p><a href="http://colotlan.wordpress.com/files/2009/10/pa220130.jpg"><img class="alignnone size-full wp-image-668" title="PA220130" src="http://colotlan.wordpress.com/files/2009/10/pa220130.jpg" alt="PA220130" width="477" height="357" /></a></p>
<p><a href="http://colotlan.wordpress.com/files/2009/10/pa220131.jpg"><img class="alignnone size-full wp-image-669" title="PA220131" src="http://colotlan.wordpress.com/files/2009/10/pa220131.jpg" alt="PA220131" width="477" height="357" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Providing colour to console applications]]></title>
<link>http://tepehughes.wordpress.com/2009/10/22/providing-colour-to-console-applications/</link>
<pubDate>Thu, 22 Oct 2009 09:42:40 +0000</pubDate>
<dc:creator>tepehughes</dc:creator>
<guid>http://tepehughes.wordpress.com/2009/10/22/providing-colour-to-console-applications/</guid>
<description><![CDATA[Feedup with gray on black text? Want a simple way to combine formatting out with colour? public stat]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Feedup with gray on black text?<br />
Want a simple way to combine formatting out with colour?</p>
<pre class="brush: csharp;">
    public static class MyConsole
    {

        /// &#60;summary&#62;Writes the text representation of the specified objects to the standard output stream using the specified format information.&#60;/summary&#62;
        /// &#60;param name=&#34;s&#34;&#62;the list of objects to write&#60;/param&#62;
        /// &#60;example&#62;
        /// &#60;code&#62;
        /// MyConsole.WriteLine(&#34;\rthe cost of the application is :&#34;, ConsoleColor.White, &#34;{0:c}!&#34;, product.cost );
        /// &#60;/code&#62;
        /// &#60;/example&#62;
        /// &#60;remarks&#62;
        /// the objects in the list should be:
        /// &#60;list type=&#34;&#34;&#62;
        /// &#60;item&#62;ConsoleColor&#60;/item&#62;
        /// &#60;item&#62;format&#60;/item&#62;
        /// &#60;item&#62;Object 1&#60;/item&#62;
        /// &#60;item&#62;Object 2&#60;/item&#62;
        /// &#60;item&#62;Object 3&#60;/item&#62;
        /// &#60;item&#62;Object n&#60;/item&#62;
        /// &#60;/list&#62;
        /// this then can be repeated.
        /// &#60;/remarks&#62;
        public static void WriteLine(params object[] s)
        {
            Write(s);
            Console.WriteLine();
        }

        /// &#60;summary&#62;Writes the text representation of the specified objects to the standard output stream using the specified format information.&#60;/summary&#62;
        /// &#60;param name=&#34;s&#34;&#62;the list of objects to write&#60;/param&#62;
        /// &#60;example&#62;
        /// &#60;code&#62;
        /// MyConsole.WriteLine(&#34;\rthe cost of the application is :&#34;, ConsoleColor.White, &#34;{0:c}!&#34;, product.cost );
        /// &#60;/code&#62;
        /// &#60;/example&#62;
        /// &#60;remarks&#62;
        /// the objects in the list should be:
        /// &#60;list type=&#34;&#34;&#62;
        /// &#60;item&#62;ConsoleColor&#60;/item&#62;
        /// &#60;item&#62;format&#60;/item&#62;
        /// &#60;item&#62;Object 1&#60;/item&#62;
        /// &#60;item&#62;Object 2&#60;/item&#62;
        /// &#60;item&#62;Object 3&#60;/item&#62;
        /// &#60;item&#62;Object n&#60;/item&#62;
        /// &#60;/list&#62;
        /// this then can be repeated.
        /// &#60;/remarks&#62;
        [CLSCompliant(false), HostProtection(SecurityAction.LinkDemand, UI = true)]
        public static void Write(params object[] s)
        {
            ConsoleColor cc = Console.ForegroundColor;
            try
            {
                List&#60;object&#62; lo = new List&#60;object&#62;();
                string format = null;
                foreach (object o in s)
                {
                    if (o is ConsoleColor)
                    {
                        Console.Write(format, lo.ToArray());
                        lo.Clear();
                        format = null;
                        ConsoleColor cfc = (ConsoleColor)o;
                        Console.ForegroundColor = cfc;
                    }
                    else if (format == null)
                    {
                        if (o is string)
                            format = (string)o;
                        else
                            throw new ArgumentOutOfRangeException(&#34;format should be a string&#34;);

                    }
                    else
                    {
                        lo.Add(o);
                    }
                }
                if (format != null)
                {
                    Console.Write(format, lo.ToArray());
                }

            }
            finally
            {
                Console.ForegroundColor = cc;
            }
        }

    }
</pre>
<p>to use it use </p>
<pre class="brush: csharp;">
                MyConsole.WriteLine(&#34;\rthe cost of the application is :&#34;, ConsoleColor.White, &#34;{0:c}!&#34;, 100);
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Quickly share files online]]></title>
<link>http://onebitetips.wordpress.com/2009/10/20/quickly-share-files-online/</link>
<pubDate>Wed, 21 Oct 2009 03:00:25 +0000</pubDate>
<dc:creator>fattykernel</dc:creator>
<guid>http://onebitetips.wordpress.com/2009/10/20/quickly-share-files-online/</guid>
<description><![CDATA[Ever wanted to quickly send files to someone without using any of those fancy uploading services? Ba]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Ever wanted to quickly send files to someone without using any of those fancy uploading services? Bash (python) has a solution.</p>
<pre style="padding-left:30px;">python -c 'import SimpleHTTPServer;SimpleHTTPServer.test()'</pre>
<p>That will serve your pwd on port 8000 (default), which you can visit in a browser. It looks like this:</p>
<p style="padding-left:30px;"><img class="alignnone size-full wp-image-22" title="dirlist" src="http://onebitetips.wordpress.com/files/2009/10/dirlist.png" alt="dirlist" width="276" height="457" /></p>
<p>To terminate it, simply ^c. If you want others outside your lan to view this, you need to open up a port (I&#8217;m assuming here most people sit behind routers these days).</p>
<p>The main advantage over file hosting services is that the recipient starts downloading the content instantly, no need to wait for it to upload, then have them download. With that comes the disadvantage that you can&#8217;t really have multiple people download at once because most home up speeds are crap.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Zona CLI: MOC - música na consola/terminal]]></title>
<link>http://debiandicas.wordpress.com/2009/10/18/zona-cli-moc-musica-na-consolaterminal/</link>
<pubDate>Sun, 18 Oct 2009 18:59:02 +0000</pubDate>
<dc:creator>ovigia</dc:creator>
<guid>http://debiandicas.wordpress.com/2009/10/18/zona-cli-moc-musica-na-consolaterminal/</guid>
<description><![CDATA[Com esta entrada inauguro aqui no debiandicas uma nova rubrica, aplicações leves, rápidas e que faze]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><font face="verdana">Com esta entrada inauguro aqui no debiandicas uma nova rubrica, aplicações leves, rápidas e que fazem de forma exemplar as funções para as quais foram concebidas, correndo em CLI, ou seja no terminal.</p>
<p>Todos gostamos de ouvir música, quer a que temos no disco rígido quer acedendo a playlists de rádios online, já agora uma das rádios online que mais ouço é uma dedicada a bandas sonoras instrumentais, trata-se da <a href="http://cinemix.us/">Cinemix</a>.</p>
<p>E que melhor do que a aplicação <a href="http://moc.daper.net/node/373"><b>MOC</b></a> (music on console), que tal como o seu site afirma, <font color="#006600"><b><i>&#8220;is a console audio player for LINUX/UNIX designed to be powerful and easy to use.&#8221;</i></b></font></p>
<p></font><font face="verdana"><br />
<table style="width:auto;">
<tbody>
<tr align="center">
<td><a href="http://picasaweb.google.pt/lh/photo/C0gFd0oVgWfbc2JU66nvIQ?authkey=Gv1sRgCJO356b5jKLHjAE&#38;feat=embedwebsite"><img src="http://lh4.ggpht.com/_SwTJ8_i455w/SttldBaIQaI/AAAAAAAABe4/Zw84HlwgswI/s400/moc.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif;font-size:11px;text-align:right;">De <a href="http://picasaweb.google.pt/rikhard.fsoss/Uploads?authkey=Gv1sRgCJO356b5jKLHjAE&#38;feat=embedwebsite">uploads</a></td>
</tr>
</tbody>
</table>
<p>Quando arrancamos esta aplicação, vem à cabeça o excelente gestor de ficheiros também de consola, o <b><a href="http://www.midnight-commander.org/">MC</a></b>, que por aqui falarei numa próxima entrada.</p>
<p>A aplicação é de muito fácil uso, podendo até usar uma espécie de <a href="http://nic-nac-project.org/%7Eorveldv/wiki/doku.php?id=moc">temas/skins</a> (que podem ser configurados aqui: <font color="#006600"><i><b>~/.moc/config</b></i></font>) incluindo a transparência que é a que habitualmente uso, para tirar partido dos meus wallpapers <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> <br />Alguns temas de exemplo encontram-se aqui: <b><i><font color="#006600">/usr/share/moc/themes</font> </i></b>e podem ser acedidos e mudados através do atalho (letra T maiúscula)<b><i><br /></i></b><br />Abrindo um terminal, por exemplo a <a href="http://konsole.kde.org/">Konsole</a>, <a href="http://software.jessies.org/terminator/">Terminator</a>, <a href="http://extragear.kde.org/apps/yakuake/">yaKuake</a>, apenas temos de escrever o comando para arrancar o MOC;</p>
<p><font color="#006600"><i><b>$mocp </b></i></font><br />(podemos dar-lhe um caminho para uma playlist na web ou uma directoria onde tenhamos os ficheiros de música que pretendemos ouvir)</p>
<p>Por exemplo para ouvir a Cinemix basta <font color="#006600"><i><b>$mocp http://213.251.166.36:8050/</b></i><br /></font><br />A seguir o comando mais importante é o <font color="#006600"><i><b>&#8216;?&#8217;</b></i></font> que nos permite chegar ao menu de ajuda o qual é a lista de atalhos de teclado que nos vão permitir controlar apenas com o teclado todas as funções do MOC, confesso que sou viciado em atalhos de teclado, são muito eficazes e rápidos.</p>
<p>Aqui fica uma pequena lista do site <a href="http://polishlinux.org/apps/cli/moc-console-audio-player-for-linux/">polishlinux</a> e <a href="http://tuxarena.blogspot.com/2009/04/review-moc-text-based-audio-player.html">tuxarena</a>:<br /></font><br />
<blockquote>
<ul>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">a</span> add music files to the playlist</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">C</span> clear the playlist</font></li>
<li><font face="verdana"><span style="color:rgb(0,102,0);font-weight:bold;">Right Arrow</span> seek forward</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">Left Arrow</span> seek backward</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">Space</span> play/pause currently selected song</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">s</span> stop playing</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">S</span> shuffle playlist</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">R</span> repeat playlist</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">Tab</span> switch between panels</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">,</span> increase volume by 5%</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">.</span> decrease volume by 5%</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">Q</span> quit mocp</font></li>
<li><font face="verdana"><span style="font-weight:bold;color:rgb(0,102,0);">?</span> get help</font></li>
</ul>
<p>
<ul>
<li><font face="verdana">ENTER – switch to a folder, start playing the song, etc</font></li>
<li><font face="verdana">‘o’ – play URL (for instance some Internet radio)</font></li>
<li><font face="verdana">‘p’ or space bar – pause playing</font></li>
<li><font face="verdana">’s’ – stop playing</font></li>
<li><font face="verdana">‘l’ – switch between one and two-column view</font></li>
<li><font face="verdana">‘a’ – add current file to the playlist</font></li>
<li><font face="verdana">‘A’ – add current folder (recursively) to the playlist</font></li>
<li><font face="verdana">‘C’ – clear the playlist</font></li>
<li><font face="verdana">‘q’ – turn the console interface off (MOC server is still running and you can come back by entering mocp again)</font></li>
<li><font face="verdana">‘Q’ – hard power-off MOC</font></li>
</ul>
<p><font face="verdana">MOC can be also manipulated when the console interface is switched off. Here are some commands that may be useful for that:</font></p>
<ul>
<li><font face="verdana">‘mocp -S’ – run the MOC server</font></li>
<li><font face="verdana">‘mocp -p’ – start playing the playlist</font></li>
<li><font face="verdana">‘mocp -f’ – switch to the next track on the playlist</font></li>
<li><font face="verdana">‘mocp -r’ – switch to the previous track on the playlist</font></li>
<li><font face="verdana">‘mocp -s’ – stop playing</font></li>
<li><font face="verdana">‘mocp -P’ – pause playing</font></li>
<li><font face="verdana">‘mocp -U’ – resume playing</font></li>
<li><font face="verdana">‘mocp -x’ – kill the server</font></li>
</ul>
</blockquote>
<p>  <font face="verdana">E pronto toca a curtir música a partir do terminal, gastando poucos ciclos de CPU e ainda menos RAM.</p>
<p></font>Powered by <a href="http://www.scribefire.com/">ScribeFire</a>.</p>
<p class="scribefire-powered">Powered by <a href="http://www.scribefire.com/">ScribeFire</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Search bash history]]></title>
<link>http://onebitetips.wordpress.com/2009/10/16/search-bash-history/</link>
<pubDate>Sat, 17 Oct 2009 03:04:35 +0000</pubDate>
<dc:creator>fattykernel</dc:creator>
<guid>http://onebitetips.wordpress.com/2009/10/16/search-bash-history/</guid>
<description><![CDATA[Did you want to run some command again, but don&#8217;t remember what it was? If it&#8217;s still in]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Did you want to run some command again, but don&#8217;t remember what it was? If it&#8217;s still in your history, you can try &#8216;reverse-i-search&#8217; -ing it.</p>
<p>In bash, just press ^r, and you should have something along the lines of this show up:</p>
<pre style="padding-left:30px;">(reverse-i-search)`':</pre>
<p>Just type what ever part of the command you want, and it will search through history, backwards (most recent results first). Press ^r until you find what you&#8217;re looking for (or until you run out of history), following which you can press enter to run that command or left/right arrow keys to edit it first. This command is especially useful if you have an unlimited history, because you can find something you executed over a year ago.</p>
<p><em>Note: you can use grep on ~/.bash_history, but it&#8217;s generally faster to use ^r.</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Easily execute local scripts/binaries]]></title>
<link>http://onebitetips.wordpress.com/2009/10/14/easily-execute-local-scriptsbinaries/</link>
<pubDate>Thu, 15 Oct 2009 01:21:24 +0000</pubDate>
<dc:creator>fattykernel</dc:creator>
<guid>http://onebitetips.wordpress.com/2009/10/14/easily-execute-local-scriptsbinaries/</guid>
<description><![CDATA[When you execute programs in the shell, where do you think the binaries are stored? /bin, /usr/bin, ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>When you execute programs in the shell, where do you think the binaries are stored? /bin, /usr/bin, /usr/local/bin, etc. But how about adding some custom paths? What if you have some personal scripts, but don&#8217;t want to move them to any of the system bin folders? There&#8217;s a simple solution for that. What does the following print out for you?</p>
<pre style="padding-left:30px;">$ echo $PATH
/home/kernel/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/home/kernel/scripts/</pre>
<p>This is how bash knows where to search for binaries. Searching the whole system would be terribly inefficient, thus it is restricted to a few folders. $PATH is an environment variable, and because it is a variable, you can change it.</p>
<pre style="padding-left:30px;">$ export PATH="$PATH:~/bin"
$ echo $PATH
/home/kernel/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/home/kernel/scripts/:/home/kernel/bin/</pre>
<p>What we did here is set the value of $PATH to itself, plus the custom path you want to add. As you can see from the previous example, the paths are separated by colons, so we do the same here. Now you can execute whatever executables you want that are located in the ~/bin folder.</p>
<p>If you were to quit the shell however, your change to the variable would be lost. To make the change permanent, do the following:</p>
<pre style="padding-left:30px;">$ echo export PATH="$PATH:~/bin" &#62;&#62; ~/.bashrc</pre>
<p>Here we append that command to the bashrc file (config for your bash), so it would get set every time you open up a terminal.</p>
<p><em>Note: only files with execute permissions will work, otherwise bash would not be able to tell what you want to execute, and what you don&#8217;t.</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Type less - go to previous dir]]></title>
<link>http://onebitetips.wordpress.com/2009/10/13/type-less-go-to-previous-dir/</link>
<pubDate>Tue, 13 Oct 2009 21:12:13 +0000</pubDate>
<dc:creator>fattykernel</dc:creator>
<guid>http://onebitetips.wordpress.com/2009/10/13/type-less-go-to-previous-dir/</guid>
<description><![CDATA[I myself forget to use this, although it saves lots of time. The following goes back to the previous]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I myself forget to use this, although it saves lots of time. The following goes back to the previous dir that you were in:</p>
<pre style="padding-left:30px;">cd -</pre>
<p>That way you don&#8217;t have to type in the whole path. So a quick usage example would be:</p>
<pre style="padding-left:30px;">$ pwd
/home/kernel/.themes
$ cd /usr/share/themes/
$ pwd
/usr/share/themes
$ cd -
/home/kernel/.themes
$ pwd
/home/kernel/.themes
$</pre>
<p>It&#8217;s like that previous channel button on the tv remote. Learn it, use it, love it.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP CLI]]></title>
<link>http://chimpy.wordpress.com/2009/10/13/php-cli/</link>
<pubDate>Tue, 13 Oct 2009 16:27:10 +0000</pubDate>
<dc:creator>Mr Chimp</dc:creator>
<guid>http://chimpy.wordpress.com/2009/10/13/php-cli/</guid>
<description><![CDATA[Apparently you can use PHP via a command line interface (CLI). Fancy that! I&#8217;m not sure if it]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Apparently you can use PHP via a command line interface (CLI). Fancy that!</p>
<p>I&#8217;m not sure if it&#8217;s worth it or whether I want to, but for some reason I&#8217;ve always liked CLIs. Maybe it&#8217;s because of the simplicity of command-response. Maybe it&#8217;s because there&#8217;s something mysterious about the obscure sequence of characters that you need to learn. I&#8217;m not even sure if anyone&#8217;s reading this. Even they are, I&#8217;m not sure if they&#8217;ll find this interesting. And if they do, I&#8217;m not sure if they&#8217;ll find it useful.</p>
<p>I&#8217;m just not sure.</p>
<p>I&#8217;m pretty sure it&#8217;s almost time to go home soon, though. I&#8217;m also almost certain that if I keep typing like this and don&#8217;t look at the clock then the time will fly by. Except now I&#8217;m thinking about it, so it won&#8217;t. Gah!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Reduce dependancy on cat]]></title>
<link>http://onebitetips.wordpress.com/2009/10/12/reduce-dependancy-on-cat/</link>
<pubDate>Mon, 12 Oct 2009 21:14:53 +0000</pubDate>
<dc:creator>fattykernel</dc:creator>
<guid>http://onebitetips.wordpress.com/2009/10/12/reduce-dependancy-on-cat/</guid>
<description><![CDATA[Too often I see people doing something like this: cat /foo/bar | grep baz Now why would you do that?]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Too often I see people doing something like this:</p>
<pre style="padding-left:30px;">cat /foo/bar &#124; grep baz
</pre>
<p>Now why would you do that? This is not the *nix way. How it should be done is:</p>
<pre style="padding-left:30px;">grep baz /foo/bar
</pre>
<p>This is also advantageous because it allows you to search multiple files, without having them all grouped into one long string first.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[bash] Directory stack and tilde expansion]]></title>
<link>http://nixtricks.wordpress.com/2009/10/08/bash-direcotory-stack-and-tilde-expansion/</link>
<pubDate>Thu, 08 Oct 2009 22:58:20 +0000</pubDate>
<dc:creator>kousik</dc:creator>
<guid>http://nixtricks.wordpress.com/2009/10/08/bash-direcotory-stack-and-tilde-expansion/</guid>
<description><![CDATA[First, some basics about directory stack: 1. Show directory stack with indices: $ dirs -v The top di]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>First, some <a href="http://www.gnu.org/software/bash/manual/bashref.html#The-Directory-Stack">basics</a> about directory stack:</strong></p>
<p><em>1. Show directory stack with indices:</em><br />
<code> $ dirs -v</code><br />
The top directory, i.e. the one with index=0, is the current working directory. On the other hand,<br />
<code>$ dirs [-N &#124; +N]</code><br />
where -N (+N) will show the Nth directory from bottom (top) where the entry  at bottom (top) has index=0.</p>
<p><em>2. Add a directory, dir, to the stack</em><br />
<code> $ pushd -n <em>dir</em></code><br />
which puts <em>dir</em> (index=1) just below the current working directory (index=0) but above all others in the stack. If the <code>-n</code> is missing, pushd will change the working directory to <em>dir</em> thus causing <em>dir</em> to have index 0 and all other directories to be pushed down the stack.</p>
<p><em>3. Go to the Nth directory from the top without changing the relative positions of the entries in the stack:</em><br />
<code>$ pushd +N</code><br />
&#8220;rolls up&#8221; the stack to bring the directory with index N on top so that now it has index 0 (the indices of other directories in the stack change accordingly so as to keep the relative positions fixed).</p>
<p><em>4. Effect of <code>cd</code>: substitute the top directory with </em><em>another_directory:</em><br />
<code>$ cd <em>another_directory</em></code><br />
will replace the top direcotry (index=0) with <em>another_direcotory</em>, as well as you&#8217;ll be taken to <em>another_directory</em>.</p>
<p><em>5. Remove an entry from the directory stack:</em><br />
<code>$ popd +N</code><br />
will remove directory with index N counting from top (first is always 0) from the stack. If you remove the top directory (i.e. the working directory, i.e. the one with index 0) you&#8217;ll be automatically taken to the next directory in the stack,  whose index then will become 0.</p>
<p><strong>Tilde Expansion</strong> [<a href="http://www.gnu.org/software/bash/manual/bashref.html#Tilde-Expansion" target="_blank">link</a>]<br />
<code><br />
$ echo ~N        # same as: echo `dirs +N`<br />
$ echo ~+N    # same as: echo `dirs +N`<br />
$ echo ~-N     # same as: echo `dirs -N`<br />
</code></p>
<p><strong>Example</strong></p>
<p><code> $ cd ~N </code><br />
will replace the top directory with the Nth directory (without any other change in the stack). The same effect may be invoked by<br />
<code>$ pushd -n +N</code></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
