<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The DF Lab &#187; gentoo</title>
	<atom:link href="http://blog.danfego.net/tag/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danfego.net</link>
	<description>A guy like me?</description>
	<lastBuildDate>Tue, 03 Nov 2009 15:31:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Software Suspend on GNOME Desktop</title>
		<link>http://blog.danfego.net/2009/06/software-suspend-on-gnome-desktop/</link>
		<comments>http://blog.danfego.net/2009/06/software-suspend-on-gnome-desktop/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 13:59:30 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gnome]]></category>

		<guid isPermaLink="false">http://blog.danfego.net/?p=262</guid>
		<description><![CDATA[I just wrote a short article on the above topic, and then, not long before hitting &#8220;Publish,&#8221; I find this article that has the answer in short, simple terms. So if you&#8217;re having any issues having the &#8220;Suspend&#8221; dialog work on your GNOME desktop, give the above link a try. I figure I should spare [...]]]></description>
			<content:encoded><![CDATA[<p>I just wrote a short article on the above topic, and then, not long before hitting &#8220;Publish,&#8221; I find <a href="http://howto.fronck.dk/howto:gentoo:pm-block">this article</a> that has the answer in short, simple terms. So if you&#8217;re having any issues having the &#8220;Suspend&#8221; dialog work on your GNOME desktop, give the above link a try. I figure I should spare everyone from my often verbose ramblings when someone&#8217;s already got the answer. <img src='http://blog.danfego.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2009/06/software-suspend-on-gnome-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Computer (and its woes)</title>
		<link>http://blog.danfego.net/2009/05/new-computer-and-its-woes/</link>
		<comments>http://blog.danfego.net/2009/05/new-computer-and-its-woes/#comments</comments>
		<pubDate>Tue, 26 May 2009 06:03:02 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.danfego.net/?p=234</guid>
		<description><![CDATA[After a long time coming, I finally took the plunge and bought a new computer, mostly for the occasion of graduating from college. So after a bunch of looking around, I went and bought this computer. In any case, I received it after a couple of days of intense waiting, and now I&#8217;ve got it [...]]]></description>
			<content:encoded><![CDATA[<p>After a long time coming, I finally took the plunge and bought a new computer, mostly for the occasion of graduating from college. So after a bunch of looking around, I went and bought <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16883103154">this computer</a>. In any case, I received it after a couple of days of intense waiting, and now I&#8217;ve got it and am very pleased with it (and the 23&#8243; monitor I got with it).</p>
<p>However, after spending a day on it, I felt the need to get started with Linux. However, Vista isn&#8217;t <em>that</em> bad when you have a quad-core processor and 8 gigs of RAM. My problem is as follows:</p>
<ul>
<li>I need to be able to play games</li>
<li>I want my games to run <em>well</em></li>
<li>I need a Linux environment</li>
<li>Ideally, I&#8217;d run Linux natively</li>
</ul>
<p>This leaves me with the obvious option of dual-booting, but I&#8217;d really rather not. I find it so&#8230; traumatic, if you will, to have to reboot my computer every time I want to change what I&#8217;m doing. And since I tend to fire up <a href="http://teamfortress.com/">Team Fortress 2</a> rather frequently, I&#8217;m afraid I&#8217;d sit in Vista most of the time because of it, and only go to Linux when I <em>need</em> to. And that&#8217;s exactly the opposite of what I&#8217;d want. So what to do?</p>
<p>I don&#8217;t know what I&#8217;m going to do. In addition, while I&#8217;ve always had fun with Gentoo, the new installation I started has been proving challenging. The basic system was easy, but the framebuffered console and a desktop (with Compiz-Fusion) has proven difficult. This is in large part, I believe, because of the now-scattered documentation due to the data loss of our beloved <a href="http://en.gentoo-wiki.com/wiki/Main_Page">Gentoo Wiki</a>. And then I pop in an&#8230; an&#8230; Ubuntu (sorry, it just feels dirty to me) CD, and everything works. But it&#8217;s not quite <em>right</em>. It&#8217;s not perfect, and I don&#8217;t have portage, and I can&#8217;t use my shiny new computer to compile things all the time! (that was part of the reason I wanted such power <img src='http://blog.danfego.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p>So I&#8217;m left with a dilemma. And because of my tendency to get paralyzed by indecision, I&#8217;ll probably stick with Vista for a while, until I figure out my solution, which will still probably involve dual-booting, since <a href="http://www.winehq.org/">Wine</a> doesn&#8217;t seem to be <a href="http://appdb.winehq.org/objectManager.php?sClass=version&#038;iId=9901">up to the task</a>. If anyone&#8217;s got a similar situation/setup/solution, I&#8217;d love to hear about it. I love my Linux, but I also love my games.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2009/05/new-computer-and-its-woes/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Follow-up on mplayer&#8217;s tab-completion</title>
		<link>http://blog.danfego.net/2009/03/follow-up-on-mplayers-tab-completion/</link>
		<comments>http://blog.danfego.net/2009/03/follow-up-on-mplayers-tab-completion/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 13:08:32 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://blog.danfego.net/?p=200</guid>
		<description><![CDATA[So after a big of Googling and finding this bug (after several others), I was made aware of three things (in response to my previous post):

mplayer&#8217;s tab-completion support does in fact come from bashcomp
this support is covered in the &#8220;base&#8221; module
the appropriate file uses strange regular expressions

At the time this bug was filed, the appropriate [...]]]></description>
			<content:encoded><![CDATA[<p>So after a big of Googling and finding <a href="http://bugs.gentoo.org/show_bug.cgi?id=145727">this bug</a> (after several others), I was made aware of three things (in response to my <a href="http://blog.danfego.net/2009/03/flv-files-finally-tab-complete-with-mplayer/">previous post</a>):</p>
<ol>
<li>mplayer&#8217;s tab-completion support does in fact come from bashcomp</li>
<li>this support is covered in the &#8220;base&#8221; module</li>
<li>the appropriate file uses strange regular expressions</li>
</ol>
<p>At the time this bug was filed, the appropriate file to edit was (or was in) /etc/bash_completion. Since bash-completion-20081218, the bug was fixed, but the package also underwent some changes that seemingly caused locations of config files to change. (Apologies if this is incorrect, but I never went diving into the configs of bashcomp before now!)</p>
<p>In any case, the bashcomp configuration files are now in /usr/share/bash-completion. Since mplayer&#8217;s support is in base, the file that handles mplayer is &#8220;base&#8221; in that directory.</p>
<p>Now as for the &#8220;strange&#8221; regular expressions, that deserves some qualification. I&#8217;ve already seen lots of regular expressions on my (albeit rather short) day, but the reason I consider these ones strange is because they seem both unnecessary and redundant. The line in question is currently 5983 on my version 20081219-r1:</p>
<p><code>_filedir '@(mp?(e)g|MP?(E)G|wm[av]|WM[AV]|avi|AVI|asf|ASF|...|fl[iv]|FL[IV]...'</code></p>
<p>The two ellipses are my own adding, since the actual expression is one humongous line that ends up looking rather horrible here. My problems with this are both the explicit writing out of upper and lower case alternatives and the the bothering to do things like fl[iv]. Actually, I don&#8217;t have a problem with the latter except in the presence of the former. And to be fair, I probably wouldn&#8217;t have ever cared or noticed if I hadn&#8217;t been able to find &#8220;flv&#8221; when grepping numerous files. Not that &#8220;greppability&#8221; is necessarily a goal for configuration files, but it&#8217;s certainly annoying when it&#8217;s specifically hindered by regular expressions that save negligible space like the ones in this file.</p>
<p>As a final note, I&#8217;m going to disclaim that I&#8217;m no expert on bash scripting and the various intricacies of handling regular expressions therein, so I&#8217;d be happy to hear from anyone who knows better about why I should lay off the poor bash-completion folks. <img src='http://blog.danfego.net/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<p><strong>External Links</strong></p>
<ul>
<li><a href="http://bugs.gentoo.org/show_bug.cgi?id=145727">Gentoo Bugzilla bug on mplayer tab-completion</a></li>
<li><a href="http://blog.danfego.net/2009/03/flv-files-finally-tab-complete-with-mplayer/">Previous post on mplayer&#8217;s tab-completion</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2009/03/follow-up-on-mplayers-tab-completion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>.flv files finally tab-complete with mplayer</title>
		<link>http://blog.danfego.net/2009/03/flv-files-finally-tab-complete-with-mplayer/</link>
		<comments>http://blog.danfego.net/2009/03/flv-files-finally-tab-complete-with-mplayer/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 05:46:00 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://blog.danfego.net/?p=193</guid>
		<description><![CDATA[After a long time of playing .flv files in mplayer on the command line in Gentoo, I noticed recently that they now tab-complete. I&#8217;m not quite sure how recently this change occurred or what caused it, but I&#8217;m very pleased with the update.
I&#8217;m not quite sure how the tab-completion infrastructure works, but I know it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>After a long time of playing .flv files in mplayer on the command line in Gentoo, I noticed recently that they now tab-complete. I&#8217;m not quite sure how recently this change occurred or what caused it, but I&#8217;m very pleased with the update.</p>
<p>I&#8217;m not quite sure how the tab-completion infrastructure works, but I know it&#8217;s got a lot of &#8220;packages&#8221; for different programs. A surprising amount, actually. For the uninitiated, on my system, I&#8217;m looking at:</p>
<p><code>dfego@antica ~ $ eselect bashcomp list<br />
Available completions:<br />
  [1]   _subversion<br />
  [2]   apache2ctl<br />
  [3]   base *<br />
  [4]   bitkeeper<br />
  [5]   bittorrent<br />
  [6]   cksfv<br />
  [7]   clisp<br />
  [8]   dsniff<br />
  [9]   eselect *<br />
  [10]  freeciv<br />
  [11]  gcl<br />
  [12]  gentoo *<br />
  [13]  git *<br />
  [14]  gkrellm<br />
  [15]  gnatmake<br />
  [16]  gpg2<br />
  [17]  gvim<br />
  [18]  harbour<br />
  [19]  isql<br />
  [20]  larch<br />
  [21]  lilypond<br />
  [22]  lisp<br />
  [23]  mailman<br />
  [24]  mcrypt<br />
  [25]  mercurial *<br />
  [26]  modules<br />
  [27]  monodevelop<br />
  [28]  mpc *<br />
  [29]  mtx<br />
  [30]  p4<br />
  [31]  povray<br />
  [32]  qdbus<br />
  [33]  ri<br />
  [34]  sbcl<br />
  [35]  sitecopy<br />
  [36]  snownews<br />
  [37]  ssh *<br />
  [38]  subversion *<br />
  [39]  tig *<br />
  [40]  tree *<br />
  [41]  unace<br />
  [42]  unrar *<br />
  [43]  vim *<br />
  [44]  xxd</code></p>
<p>The ones with the asterisks are ones I currently have enabled for my main user. As you can see, there are a lot of options to choose from, and for some weird reason, my git functionality died after a recent update. But wait&#8230; mplayer isn&#8217;t there&#8230; Interesting&#8230;</p>
<p>Interesting&#8230;</p>
<p>So where <em>does</em> mplayer&#8217;s tab-completion come from? It&#8217;s not just the normal one provided by the shell, because it before excluded certain file types.</p>
<p>Interesting. This must be investigated.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2009/03/flv-files-finally-tab-complete-with-mplayer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/etc/mtab Boot Nightmare</title>
		<link>http://blog.danfego.net/2009/02/etcmtab-boot-nightmare/</link>
		<comments>http://blog.danfego.net/2009/02/etcmtab-boot-nightmare/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 21:31:45 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://blog.danfego.net/?p=160</guid>
		<description><![CDATA[The other day, I was working on my senior design project (a kernel project), and I did the good ol&#8217; make/make install/reboot to see my changes. Coming back, expecting my computer to have booted, I found it hung at:

Cannot create link /etc/mtab
perhaps there is a stale lockfile?

Naturally thinking it was my project&#8217;s fault (it was), [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I was working on my senior design project (a kernel project), and I did the good ol&#8217; make/make install/reboot to see my changes. Coming back, expecting my computer to have booted, I found it hung at:</p>
<blockquote><p>
Cannot create link /etc/mtab<br />
perhaps there is a stale lockfile?
</p></blockquote>
<p>Naturally thinking it was my project&#8217;s fault (it was), I rebooted into my normal kernel. To my horror, the same error came up. After a period of mini-panic, I ran to Google and at the same time reached for my Gentoo CD (the newest I could find was 2007.0 minimal, but it still works!). I ran e2fsck on both my home and root partitions for good measure, and then mounted my root partition and looked at /etc/mtab*. <strong>Apparently, the fact that there was mtab, mtab~, mtab~2205 and mtab~2213 isn&#8217;t normal.</strong> On recommendation from <a href="http://www.oesf.org/forum/index.php?showtopic=18484&#038;st=0&#038;p=120298&#entry120298">this obscure post from three years ago</a>, I deleted the extra files (after examining them and noting they were not only extraneous but empty), rebooted, and viola! Problem solved!</p>
<p>Turns out a number of different things I did caused this error several different times. Not exactly sure why, but it always seems to coincide with the boot of or boot after a kernel oops or panic.</p>
<p><strong>External Links</strong></p>
<ul>
<li><a href="http://www.oesf.org/forum/index.php?showtopic=18484&#038;st=0&#038;p=120298&#entry120298">Obscure post from 2006</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2009/02/etcmtab-boot-nightmare/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>equery and q</title>
		<link>http://blog.danfego.net/2008/11/equery-and-q/</link>
		<comments>http://blog.danfego.net/2008/11/equery-and-q/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 05:37:27 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[portage]]></category>

		<guid isPermaLink="false">http://dlflab.wordpress.com/?p=25</guid>
		<description><![CDATA[As both an experienced user of Gentoo and a lover of the command line, I often find myself querying portage for various things.  Sometimes, if it&#8217;s in a particular package, I go looking at the ebuild itself.  Others, I run a find command in /usr/portage.  However, there are tools to take care [...]]]></description>
			<content:encoded><![CDATA[<p>As both an experienced user of Gentoo and a lover of the command line, I often find myself querying portage for various things.  Sometimes, if it&#8217;s in a particular package, I go looking at the ebuild itself.  Others, I run a find command in /usr/portage.  However, there <em>are</em> tools to take care of all these silly things in a much more elegant fashion.  Namely, there&#8217;s <a href="http://www.gentoo.org/doc/en/gentoolkit.xml">equery</a> and <a href="http://www.gentoo.org/doc/en/portage-utils.xml">q</a>.  Since I&#8217;ve only now realized that they both not only exist and are useful, I figure there must be someone else who could benefit from this knowledge as well.  In this post, I&#8217;ll briefly describe the uses and benefits of each, as well as why they should co-exist on your system, at least for the time being.</p>
<h3>Commonalities and Usage</h3>
<p>First things first, equery and q are both very similar both in offered functionality and usage from the command line.  Basic usage goes like so:</p>
<p><code>$ equery [command] [package]</code><br />
or<br />
<code>$ q [command] [package]</code></p>
<p>Simple, right?  There are also options to modify usage, but this is the most basic and common usage pattern.</p>
<p>In terms of functionality, equery and q have the following in common:</p>
<table border="1">
<tbody>
<tr>
<th><strong>Function</strong></th>
<th><strong>equery command</strong></th>
<th><strong>q command</strong></th>
</tr>
<tr>
<td>List packages owning file</td>
<td>equery b</td>
<td>q file</td>
</tr>
<tr>
<td>Verify integrity of package</td>
<td>equery k</td>
<td>q check</td>
</tr>
<tr>
<td>List dependencies of package</td>
<td>equery d</td>
<td>q depends</td>
</tr>
<tr>
<td>List files owned by package</td>
<td>equery f</td>
<td>q list</td>
</tr>
<tr>
<td>List all packages with USE flag</td>
<td>equery h</td>
<td>q use</td>
</tr>
<tr>
<td>List all packages matching search</td>
<td>equery l</td>
<td>q search</td>
</tr>
<tr>
<td>Show size of files in package</td>
<td>equery s</td>
<td>q size</td>
</tr>
</tbody>
</table>
<p>The usage of each of the above commands is pretty straightforward, so I won&#8217;t bore you with details.  Running just &#8220;equery&#8221; or &#8220;q&#8221; from the command line will show all basic usage, and running one of the above commands without arguments (or with a -h local argument, for equery) will show similar usage info for the specific command.</p>
<h3>equery</h3>
<p>equery is a part of the gentoolkit package, is written in Python, and is rather well-endowed (in terms of features, of course).  In terms of features unique from q, equery boasts:</p>
<ul>
<li><strong>depgraph</strong>: display a dependency tree for a given package</li>
<li><strong>uses</strong>: display USE flags for a given package</li>
<li><strong>which</strong>: print full path to ebuild for a given package</li>
</ul>
<p>Personally, of these three, I&#8217;ve only ever used <em>uses</em>, since I the few times I&#8217;ve ever attempted to use <em>depgraph</em>, the results have been too big to really get a handle on.  Either way, the uses command makes it a lot easier to find out what USE flags are available for a particular package as well as their current states.  Of course, you could just do a (not so quick):</p>
<p><code>$ emerge -pv [package]</code></p>
<p>However, that won&#8217;t give the information on what the USE flags actually are, just what their status is on the package.</p>
<p>equery in general gives more detail and nicer output than its shorter-named counterpart.  Since I always like to see screen shots (yes, even from command-line programs), I&#8217;ll take the liberty of doing just that to illustrate my point:</p>
<div id="attachment_40" class="wp-caption alignnone" style="width: 487px"><a href="http://blog.danfego.net/wp-content/uploads/2008/11/equery-list-zsnes.png"><img class="size-full wp-image-40" title="equery-list-zsnes" src="http://blog.danfego.net/wp-content/uploads/2008/11/equery-list-zsnes.png" alt="Output of equery list command." width="477" height="107" /></a><p class="wp-caption-text">Output of equery list zsnes command.</p></div>
<div id="attachment_42" class="wp-caption alignnone" style="width: 487px"><a href="http://blog.danfego.net/wp-content/uploads/2008/11/qsearch-zsnes-cutoff.png"><img class="size-full wp-image-42" title="qsearch-zsnes-cutoff" src="http://blog.danfego.net/wp-content/uploads/2008/11/qsearch-zsnes-cutoff.png" alt="Output of qsearch zsnes command." width="477" height="38" /></a><p class="wp-caption-text">Output of qsearch zsnes command.</p></div>
<p>One thing to note about this particular command is that while qsearch automatically searches both installed packages and those in the portage tree, equery requires the -p option, as shown above, to do the same thing.  On the flip side, qsearch has no capability (at this time) of searching overlays, but equery can be made to do so with the -o option.  Tradeoffs, tradeoffs!</p>
<p>As a final note on equery, there are in fact two ways to call each of the sub-programs (like list, depgraph, etc.).  There&#8217;s a short and long option for each of them, which is rather convenient.  &#8220;equery l&#8221; is much nicer than &#8220;equery list&#8221; and &#8220;equery g&#8221; is way better than &#8220;equery depgraph.&#8221;</p>
<h3>q</h3>
<p>On to q!  After reading the above section, you might wonder why anyone would want to use q when they&#8217;ve got equery in their toolbox.  Is it for those few features that q has that are so dazzling?  Is it because the name is shorter?  No, no, let me just show you, you&#8217;ll understand:</p>
<div id="attachment_45" class="wp-caption alignnone" style="width: 479px"><a href="http://blog.danfego.net/wp-content/uploads/2008/11/time-equery-list-zsnes.png"><img class="size-full wp-image-45" title="time-equery-list-zsnes" src="http://blog.danfego.net/wp-content/uploads/2008/11/time-equery-list-zsnes.png" alt="Timed output of equery list zsnes." width="469" height="173" /></a><p class="wp-caption-text">Timed output of equery list zsnes.</p></div>
<div id="attachment_46" class="wp-caption alignnone" style="width: 352px"><a href="http://blog.danfego.net/wp-content/uploads/2008/11/time-qsearch-zsnes.png"><img class="size-full wp-image-46" title="time-qsearch-zsnes" src="http://blog.danfego.net/wp-content/uploads/2008/11/time-qsearch-zsnes.png" alt="Timed output of qsearch zsnes." width="342" height="102" /></a><p class="wp-caption-text">Timed output of qsearch zsnes.</p></div>
<p>For those of you who can&#8217;t see the images or are just in plain shock, let me spell it out: q is <em>fast</em>.  In that particular query, about 34 times faster.  <strong>34 times faster!</strong> That makes a big difference, whether you&#8217;re sitting in front of the keyboard twiddling your thumbs or putting it in a shell script.  As a matter of fact, on running just the q or equery commands alone (to show the helpful usage messages), the speed difference is over 500 times!  That being said, if you don&#8217;t need the fancy formatting and extra frills of equery for a given task, just use q.  It&#8217;s faster.  According to its <a href="http://www.gentoo.org/doc/en/portage-utils.xml">Gentoo page</a>, that&#8217;s its purpose anyway:</p>
<blockquote><p>portage-utils is a collection of very fast utilities written in C, which are meant to offer a faster but more limited alternative to their gentoolkit counterparts. Please note that portage-utils is not meant to replace gentoolkit. Its utilities are much more efficient than the equivalent ones from gentoolkit and might be better suited to be used in scripts that need to call Portage repeatedly, but portage-utils does not offer the same functionalities.</p></blockquote>
<p>Well hot-damn, I could have told you that from the beginning, no?  It&#8217;s times like this that I sing the praises of C and mock all those Python people.  Then I try to write a difficult program and cry myself to sleep.</p>
<p>Anyway, language wars and tearful nights aside, there are also a couple of other distinguishing things about q.  First, its simple format can make parsing a bit simpler.  Then again, it could make it harder, so let&#8217;s not go there.  As a matter of fact, equery makes a point of modifying its output if you redirect its output.  If you don&#8217;t like the modified style of output, you can pass the -N (&#8211;no-pipe) flag to turn that behavior off.</p>
<p>Second, q does bring a few unique functions to the table.  Namely:</p>
<ul>
<li><strong>atom</strong>: split up an atom string (like games-emulation/zsnes-1.51-r2 -&gt; games-emulation zsnes 1.51 r2)</li>
<li><strong>cache</strong>: search the metadata cache</li>
<li><strong>grep</strong>: grep in ebuilds</li>
<li><strong>lop</strong>: emerge log analyzer</li>
<li><strong>merge</strong>, <strong>pkg</strong>, <strong>tbz2</strong>, <strong>xpak</strong>: all pertain to actually handling various types of packages, which I have no experience with, so I don&#8217;t know their usage.</li>
</ul>
<p>The one that I find particularly is &#8220;lop.&#8221;  In an example from that Gentoo page on portage-utils, try something like:</p>
<p><code>$ qlop -tH openoffice</code></p>
<p>It&#8217;ll tell you &#8220;the merge time&#8221; for that package.  Now, I&#8217;m not sure if that means the last merge or some sort of aggregate.  My output tells me:</p>
<p><code>openoffice: 9 hours, 19 minutes, 11 seconds for 12 merges</code></p>
<p>I&#8217;m guessing that means that it took 9:19:11 to merge 12 <em>packages</em>, in terms of the package in question and its dependencies, but I&#8217;m not totally sure on that one.  Either way, this is a damn nifty feature.  I make jokes all the time about how long some packages take to emerge, and how I can have actual times to back me up!  Oh the joys of Gentoo&#8230;</p>
<p>As another very useful note, the qsearch command is also substantially faster than &#8220;emerge &#8211;search.&#8221;  It&#8217;s not nearly as impressive as it is against equery, but it holds its own.  An advantage that qsearch has over its equery counterpart, however, is that it has the ability (and has it default) of displaying descriptions of packages.  I actually for a long time forgot how to do that on my system, and always ran to <a href="http://www.gentoo-portage.com/">gentoo-portage.com</a>.</p>
<p>Last but not least, just like equery, q commands can be shortened as well.  Unfortunately, that just means changing something like &#8220;q search&#8221; to &#8220;qsearch.&#8221;  Not a big improvement, but with a one-letter command, how much can you really ask for?</p>
<h3>Why both?</h3>
<p>In brief, the snippet above from the Gentoo article on portage-utils gives the answer quite nicely.  q may be lacking, but it can be an order of magnitude faster than equery.  For those times when you don&#8217;t need all that fancy-shmancy formatting and just want to get quick and dirty results, q is your tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2008/11/equery-and-q/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cron, Backgrounds, and Fluxbox</title>
		<link>http://blog.danfego.net/2008/10/cron-backgrounds-and-fluxbox/</link>
		<comments>http://blog.danfego.net/2008/10/cron-backgrounds-and-fluxbox/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 09:59:47 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[fluxbox]]></category>
		<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://dlflab.wordpress.com/?p=8</guid>
		<description><![CDATA[Honest to God, I spent so much time getting this blog, domain, etc. up, that I almost forgot what spurred me to get started. So here&#8217;s why&#8230; I had this problem. Rather, not so much a problem as a desire to rotate my backgrounds periodically. Let&#8217;s say&#8230; every 2 hours. Now, a guy like me, [...]]]></description>
			<content:encoded><![CDATA[<p>Honest to God, I spent so much time getting this blog, domain, etc. up, that I almost forgot what spurred me to get started. So here&#8217;s why&#8230; I had this problem. Rather, not so much a problem as a desire to rotate my backgrounds periodically. Let&#8217;s say&#8230; every 2 hours. Now, a guy like me, I think &#8220;cron!&#8221; This is the first thought of any veteran Linux user. However, I quickly came to the realization that I didn&#8217;t know quite how or where to put my cron entries, nor what format. This problem was, however, quickly remedied. That was not my problem.</p>
<p>The true problem arose when I attempted to actually implement changing my background. With fluxbox, this should be possible with a simple command like so:</p>
<p><code>fbsetbg -a -r /home/dfego/.fluxbox/backgrounds/</code></p>
<p>Simple enough, right? Well, as simple as it was, it just didn&#8217;t quite work. So I changed my cron timings, in case I got that wrong then used absolute paths, once again, just in case. Freaked out for a while, because the command itself works just fine. I ran it from a terminal about 29,834 times to make sure, but still, that little cron daemon that could just wouldn&#8217;t budge. It <em>would</em>, however, write the text &#8220;working&#8221; into ~/cronf*cker every minute. As a matter of fact, it still is. Allow me to go take care of that&#8230;</p>
<p>Now that that&#8217;s taken care of, I&#8217;ll go ahead and tell you what the real problem was. Apparently the cron daemon doesn&#8217;t have any inherent knowledge of the X display server I want to set the background of. Fair enough, since it starts running well before X gets started. But I didn&#8217;t realize this would matter, or even think about it at all until I saw a post online about setting fluxbox backgrounds in a more general sense. It proposed butting DISPLAY=:0.0 before the line, like so:</p>
<p><code>DISPLAY=:0.0 fbsetbg -a -r /home/dfego/.fluxbox/backgrounds/</code></p>
<p>I changed the file, bit my lip, and a second or so after the next minute passed, my background was changed anew! As a note, my X server is not using display :0.0, but rather :1.0. You can find out what your value is by opening up a terminal and typing:</p>
<p><code>echo $DISPLAY</code></p>
<p>Anyway, there you have it. My first pearl of wisdom to the world! Apologies for verbosity, but sometimes in explanations such as this, it helps. So the moral of the story/digest version: <strong>be aware of context when running commands for X!</strong> Or something like that. I actually was at work today trying to impress a co-worker of mine with the power of the command line, but unfortunately my attempt fell flat on its face when passing commands to xmessage. I&#8217;m not too worried about it though. My ping/grep antics seemed to be enough to win him over.</p>
<p>With that, I&#8217;m off to bed, and to watch my background change once more before daybreak!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2008/10/cron-backgrounds-and-fluxbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
