<?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>Do Know Evil - Tyler Mulligan's Tips and Tricks</title>
	<atom:link href="http://www.doknowevil.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doknowevil.net</link>
	<description>Tyler Mulligan's Tips and Tricks For Increasing Efficiency</description>
	<lastBuildDate>Fri, 12 Feb 2010 00:18:32 +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>If nvidia-settings cannot save to xorg.conf, do this</title>
		<link>http://www.doknowevil.net/2010/02/11/if-nvidia-settings-cannot-save-to-xorgconf-do-this/</link>
		<comments>http://www.doknowevil.net/2010/02/11/if-nvidia-settings-cannot-save-to-xorgconf-do-this/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 00:12:47 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Freeware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=513</guid>
		<description><![CDATA[If you&#8217;re using ubuntu and having trouble with nvidia-settings saving to the /etc/X11/xorg.conf file, you may find the following tip helpful in relieving that annoyance.
Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file.
close nvidia-settings
in terminal:

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
sudo [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using ubuntu and having trouble with nvidia-settings saving to the /etc/X11/xorg.conf file, you may find the following tip helpful in relieving that annoyance.<br />
Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file.</p>
<p>close nvidia-settings</p>
<p>in terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> <span class="kw2">mv</span> <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>xorg.conf <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>xorg.conf.backup
<span class="kw2">sudo</span> gedit <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>xorg.conf</pre></div></div>

<p>paste the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">Section <span class="st0">&quot;Device&quot;</span>
    Identifier     <span class="st0">&quot;Configured Video Device&quot;</span>
    Driver         <span class="st0">&quot;nvidia&quot;</span>
EndSection</pre></div></div>

<p>save and close.</p>
<p>back to terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> nvidia-settings</pre></div></div>

<p>and save the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/02/11/if-nvidia-settings-cannot-save-to-xorgconf-do-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random cow(ish) animals preaching quotes on Ubuntu 9.10</title>
		<link>http://www.doknowevil.net/2010/02/03/random-cowish-animals-preaching-quotes-on-ubuntu-910/</link>
		<comments>http://www.doknowevil.net/2010/02/03/random-cowish-animals-preaching-quotes-on-ubuntu-910/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 01:02:01 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cowsay]]></category>
		<category><![CDATA[fortune]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=521</guid>
		<description><![CDATA[Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file.

# fortune and cowsay are needed for the snippet to work, I had to install these first
sudo apt-get install fortune cowsay


COWDIR=/usr/share/cowsay/cows/; COWNUM=$&#40;&#40;$RANDOM%$&#40;ls $COWDIR &#124; wc -l&#41;&#41;&#41;; COWFILE=$&#40;ls $COWDIR &#124; sed [...]]]></description>
			<content:encoded><![CDATA[<p>Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co0"># fortune and cowsay are needed for the snippet to work, I had to install these first</span>
<span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> fortune cowsay</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="re2">COWDIR</span>=<span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>cowsay<span class="sy0">/</span>cows<span class="sy0">/</span>; <span class="re2">COWNUM</span>=$<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re1">$RANDOM</span><span class="sy0">%</span>$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">wc</span> -l<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="re2">COWFILE</span>=$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-n</span> <span class="st_h">''</span><span class="re1">$COWNUM</span><span class="st_h">'p'</span><span class="br0">&#41;</span>; fortune <span class="sy0">|</span> cowsay <span class="re5">-f</span> <span class="re1">$COWFILE</span></pre></div></div>

<p>UPDATE:</p>
<p>Suggested by MrBougo, a shorter but perhaps more process intensive method:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">fortune <span class="sy0">|</span> cowsay <span class="re5">-f</span> $<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>cowsay<span class="sy0">/</span>cows<span class="sy0">/</span> <span class="sy0">|</span> shuf <span class="sy0">|</span> <span class="kw2">head</span> -n1<span class="br0">&#41;</span></pre></div></div>

<div id="attachment_523" class="wp-caption alignnone" style="width: 1342px"><a href="http://www.doknowevil.net/wp-content/uploads/2010/02/screenshot1.png" rel="shadowbox[post-521];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2010/02/screenshot1.png" alt="random cowsay fortune" title="random cowsay fortune" width="1332" height="850" class="size-full wp-image-523" /></a><p class="wp-caption-text">random cowsay fortune</p></div>
<p>Breaking down the script, the first 3 parts create variables and the last command executes the cowsay and quote.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co0"># defines the directory of the cow files</span>
<span class="re2">COWDIR</span>=<span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>cowsay<span class="sy0">/</span>cows<span class="sy0">/</span>;
&nbsp;
<span class="co0"># Get a random number limited to the number of files in the directory, making clever use of % (mod) and adding 1 to make sure it doesn't return 0</span>
<span class="re2">COWNUM</span>=$<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re1">$RANDOM</span><span class="sy0">%</span>$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">wc</span> -l<span class="br0">&#41;</span><span class="br0">&#41;</span>+<span class="nu0">1</span><span class="br0">&#41;</span>;
&nbsp;
<span class="co0"># list the contents of the cow dir again, pipe to sed and use the number as a random line to get the name of a file</span>
<span class="re2">COWFILE</span>=$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-n</span> <span class="st_h">''</span><span class="re1">$COWNUM</span><span class="st_h">'p'</span><span class="br0">&#41;</span>;
&nbsp;
<span class="co0"># use fortune to get a quote, pipe to cowsay and use the file as defined above</span>
fortune <span class="sy0">|</span> cowsay <span class="re5">-f</span> <span class="re1">$COWFILE</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/02/03/random-cowish-animals-preaching-quotes-on-ubuntu-910/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Nautilus Scripting Abilities to Integrate Right Click File Enqueues with mocp</title>
		<link>http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/</link>
		<comments>http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 15:09:20 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=508</guid>
		<description><![CDATA[Using moc player can prove to be both beneficial and challenging.  I&#8217;ve found myself going back to exaile for a few hours on random days for the simplicity in file management via a GUI.  Since I prefer to use a single media player and mocp is light weight and helpful in so many [...]]]></description>
			<content:encoded><![CDATA[<p>Using <a href="http://www.doknowevil.net/2009/07/15/the-easy-way-to-listen-to-internt-radio-in-ubuntu/">moc player</a> can prove to be both beneficial and challenging.  I&#8217;ve found myself going back to exaile for a few hours on random days for the simplicity in file management via a GUI.  Since I prefer to use a single media player and mocp is light weight and helpful in so many other ways to me&#8230; I knew I needed a solution.  It dawned on me just today how simple that solution could be with nautilus scripts.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co0">#!/bin/bash</span>
<span class="co0"># Enqueue with mocp</span>
<span class="co0"># by Tyler &quot;-z-&quot; Mulligan</span>
<span class="co0">#</span>
<span class="co0"># This is a nautilus script.  When placed in ~/.gnome2/nautilus-scripts</span>
<span class="co0"># and chmod +x you will have the ability to right click &gt;&gt; enqueue files</span>
<span class="co0"># or directories in mocp.</span>
<span class="co0">#</span>
&nbsp;
mocp <span class="re5">-a</span> <span class="st0">&quot;$@&quot;</span></pre></div></div>

<p>Some other tips&#8230; [ and ] silently skip back and forward respectively at a rate of 5sec per second held&#8230; this beats the left and arrows which work interactively at 1sec per sec.</p>
<p>? and h bring up the help, don&#8217;t forget this.  Use this, learn the commands that work for you and happy listening.</p>
<p>Thanks to MrBougo again for helping me simplify the script further&#8230; I was originally using a for loop which is unnecessary as the quotes will help the variable expansion and mocp -a can accept multiple files/folders.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resources for Learning About jQuery Functions and a Note About Callbacks</title>
		<link>http://www.doknowevil.net/2009/09/07/resources-for-learning-about-jquery-functions-and-a-note-about-callbacks/</link>
		<comments>http://www.doknowevil.net/2009/09/07/resources-for-learning-about-jquery-functions-and-a-note-about-callbacks/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 22:31:51 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=502</guid>
		<description><![CDATA[Though it&#8217;s still using 1.2.6 (with current jQuery at 1.3.2), visualjquery.com has always been a favorite of mine for it&#8217;s simple and elegant layout.  Some of the functions leave some documentation to be desired but after working with jQuery for a while, you begin to develop a taste for what is needed.  Unfortunately, [...]]]></description>
			<content:encoded><![CDATA[<p>Though it&#8217;s still using 1.2.6 (with <a href="http://www.jquery.com" target="_blank">current jQuery</a> at 1.3.2), <a href="http://visualjquery.com/" target="_blank">visualjquery.com</a> has always been a favorite of mine for it&#8217;s simple and elegant layout.  Some of the functions leave some documentation to be desired but after working with jQuery for a while, you begin to develop a taste for what is needed.  Unfortunately, next to this issue and despite it&#8217;s strong layout, there is one other thing this application that takes this application down from strongest candidate.  It cannot look into the future and as such, some functions are outright missing.</p>
<p><a href="http://api.jquery.com/" target="_blank">The jquery API is a somewhat familiar interface</a>, featuring the latest version, the freshest functions and some decent documentation.  Another in-depth (but outdated) resource is the <a href="http://view.jquery.com/trunk/tools/api-browser" target="_blank">old api-browser</a>.  Of course, there exists the <a href="http://docs.jquery.com/Main_Page">Main Wiki Documentation</a>, which also provides <a href="http://docs.jquery.com/Alternative_Resources">Alternative Resources</a>.  I think I&#8217;ll find myself using http://api.jquery.com/ most often despite it lacking the multi-panel style selection.  It integrates it&#8217;s documentation with <a href="http://jsbin.com" target"_blank">jsbin.com</a> for testing / playing with code which is a nice touch.</p>
<p>Now a note about callbacks while we&#8217;re on the subject of jQuery.  I find myself using them quite often, with ajax specifically.  Understanding how to nest functions in jQuery allows you to do more things in terms of user or application response.  When using ajax, you&#8217;ll often want to fade out content, do some processing, report the data back and have it fade back in nicely rather than a quick blink that can cause discomfort for a user.  If you aren&#8217;t familiar with a callback, it&#8217;s a function that&#8217;s executed when the current function finishes.</p>
<p>Below I will break down this common scenario.</p>
<p>You have your HTML</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
    &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;my_ajax.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;style&gt;
#ajax_loader {
  display:block;
  height:90px;
  width:90px;
  background:url('http://imgur.com/KW8ZD.gif') no-repeat 0 0;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div id=&quot;ajax_loader&quot;&gt;&lt;/div&gt;
  &lt;div id=&quot;ajax_content&quot;&gt;&lt;/div&gt;
  &lt;a href=&quot;#&quot; id=&quot;my_link&quot;&gt;click me&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>your php (or whatever language returning the data file) (my_page.php)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="sy1">&lt;?</span> <span class="kw1">echo</span> <span class="st0">&quot;hi, I was loaded with ajax!&quot;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span></pre></div></div>

<p>and your javascript (my_ajax.js) that glues them together</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co1">// $(function() is shorthand for $(document).ready(function () {</span>
$<span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    $<span class="br0">&#40;</span><span class="st0">&quot;#ajax_loader&quot;</span><span class="br0">&#41;</span>.<span class="me1">hide</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    $<span class="br0">&#40;</span><span class="st0">&quot;#my_link&quot;</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        $<span class="br0">&#40;</span><span class="st0">&quot;#ajax_loader&quot;</span><span class="br0">&#41;</span>.<span class="me1">fadeIn</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        $<span class="br0">&#40;</span><span class="st0">&quot;#ajax_content&quot;</span><span class="br0">&#41;</span>.<span class="me1">fadeOut</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        $<span class="br0">&#40;</span><span class="st0">&quot;#content&quot;</span><span class="br0">&#41;</span>.<span class="me1">load</span><span class="br0">&#40;</span><span class="st0">&quot;my_page.php&quot;</span><span class="sy0">,</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
          $<span class="br0">&#40;</span><span class="st0">&quot;#ajax_loader&quot;</span><span class="br0">&#41;</span>.<span class="me1">fadeOut</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
          $<span class="br0">&#40;</span><span class="st0">&quot;#ajax_content&quot;</span><span class="br0">&#41;</span>.<span class="me1">fadeIn</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

<p>Here we can clearly see how all functions are nested into one root, the document ready function.  We go two more deep here, using the click event and then the load callback.  Many functions allow for callbacks, search the documentation for the best way you think you should be nesting them.  I hope this helps to clarify some of the basics in AJAX using jQuery, good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/09/07/resources-for-learning-about-jquery-functions-and-a-note-about-callbacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reducing pageweight by compressing production css and js files</title>
		<link>http://www.doknowevil.net/2009/09/04/reducing-pageweight-by-compressing-production-css-and-js-files/</link>
		<comments>http://www.doknowevil.net/2009/09/04/reducing-pageweight-by-compressing-production-css-and-js-files/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 22:20:30 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Organization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=497</guid>
		<description><![CDATA[I&#8217;ve been a little obsessed with improving the speed of web pages via minified javascript and css files.  YUI&#8217;s team not only agrees with this, they recommend gzipping your minified js and css files.  For a while I&#8217;ve been calling YUI Compressor inside my push to production scripts to do the deed.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a little obsessed with improving the speed of web pages via <a href="http://www.crockford.com/javascript/jsmin.html" title="Compress your css and js files" target="_blank">minified javascript and css files</a>.  YUI&#8217;s team not only agrees with this, <a href="http://yuiblog.com/blog/2006/10/16/pageweight-yui0114/" title="Compress your css and js files" target="_blank">they recommend gzipping your minified js and css files</a>.  For a while I&#8217;ve been calling <a href="http://yuilibrary.com/downloads/#yuicompressor" title="YUI Compressor -- minify your js and css files" target="_blank">YUI Compressor</a> inside my push to production scripts to do the deed.  However, with this new mention of gzipping, I think might be exploring other options such as the method mentioned on the page which originally linked me to that awesome YUI writeup; <a href="http://agachi.name/weblog/archives/2006/11/25/pack-your-javascript.htm">minifying and gzipping javascript and css on the fly using php</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/09/04/reducing-pageweight-by-compressing-production-css-and-js-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing Firefox 3.5.2 (Shiretoko) on Ubuntu using the default repos and customizing the icon to be more recognizable</title>
		<link>http://www.doknowevil.net/2009/08/30/installing-firefox-352-shiretoko-on-ubuntu-using-the-default-repos-and-customizing-the-icon-to-be-more-recognizable/</link>
		<comments>http://www.doknowevil.net/2009/08/30/installing-firefox-352-shiretoko-on-ubuntu-using-the-default-repos-and-customizing-the-icon-to-be-more-recognizable/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 15:58:31 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=480</guid>
		<description><![CDATA[When Firefox 3.5 came out, I along with many others, was eager to try it.  For a while I ran it out of the archive directly but this caused minor issues as it&#8217;s a messy solution.  At some point I noticed firefox-3.5 in the repository:

tyler@quadjutsu:~$ apt-cache search firefox &#124;grep 3.5
abrowser-3.1 - dummy upgrade [...]]]></description>
			<content:encoded><![CDATA[<p>When <a href="http://www.getfirefox.com">Firefox</a> 3.5 came out, I along with many others, was eager to try it.  For a while I ran it out of the archive directly but this caused minor issues as it&#8217;s a messy solution.  At some point I noticed firefox-3.5 in the repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">tyler<span class="sy0">@</span>quadjutsu:~$ <span class="kw2">apt-cache</span> search firefox <span class="sy0">|</span><span class="kw2">grep</span> <span class="nu0">3.5</span>
abrowser-<span class="nu0">3.1</span> - dummy upgrade package <span class="kw1">for</span> firefox-<span class="nu0">3.1</span> -<span class="sy0">&gt;</span> firefox-<span class="nu0">3.5</span>
abrowser-<span class="nu0">3.1</span>-branding - dummy upgrade package <span class="kw1">for</span> firefox-<span class="nu0">3.1</span> -<span class="sy0">&gt;</span> firefox-<span class="nu0">3.5</span>
firefox-<span class="nu0">3.1</span> - dummy upgrade package <span class="kw1">for</span> firefox-<span class="nu0">3.1</span> -<span class="sy0">&gt;</span> firefox-<span class="nu0">3.5</span>
firefox-<span class="nu0">3.1</span>-branding - dummy upgrade package <span class="kw1">for</span> firefox-<span class="nu0">3.1</span> -<span class="sy0">&gt;</span> firefox-<span class="nu0">3.5</span>
firefox-<span class="nu0">3.1</span>-dbg - dummy upgrade package <span class="kw1">for</span> firefox-<span class="nu0">3.1</span> -<span class="sy0">&gt;</span> firefox-<span class="nu0">3.5</span>
firefox-<span class="nu0">3.1</span>-dev - dummy upgrade package <span class="kw1">for</span> firefox-<span class="nu0">3.1</span> -<span class="sy0">&gt;</span> firefox-<span class="nu0">3.5</span>
firefox-<span class="nu0">3.1</span>-gnome-support - dummy upgrade package <span class="kw1">for</span> firefox-<span class="nu0">3.1</span> -<span class="sy0">&gt;</span> firefox-<span class="nu0">3.5</span>
firefox-<span class="nu0">3.5</span> - safe and easy web browser from Mozilla
firefox-<span class="nu0">3.5</span>-branding - Package that ships the firefox branding
firefox-<span class="nu0">3.5</span>-dbg - firefox-<span class="nu0">3.5</span> debug symbols
firefox-<span class="nu0">3.5</span>-dev - Development files <span class="kw1">for</span> Mozilla Firefox
firefox-<span class="nu0">3.5</span>-gnome-support - Support <span class="kw1">for</span> Gnome <span class="kw1">in</span> Mozilla Firefox</pre></div></div>

<p>and proceeded to install it with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">tyler<span class="sy0">@</span>quadjutsu:~$ <span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> firefox-<span class="nu0">3.5</span></pre></div></div>

<p>It runs along-side Firefox 3.0 without a hitch.  I often use the two in tandem while testing web applications.</p>
<p>Something that bothered me about this was the default icon isn&#8217;t as recongnizable to me as I&#8217;d like it to be.</p>
<p><a href="http://www.doknowevil.net/wp-content/uploads/2009/08/screenshot-about-shiretoko.png" rel="shadowbox[post-480];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2009/08/screenshot-about-shiretoko.png" alt="screenshot-about-shiretoko" title="screenshot-about-shiretoko" width="300" height="459" class="alignnone size-full wp-image-481" /></a></p>
<p>As such I looked into a way to replace it.</p>
<p>First, I found a replacement icon I liked</p>
<p><a href="http://www.doknowevil.net/wp-content/uploads/2009/08/hp-firefox-128x128.png" rel="shadowbox[post-480];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2009/08/hp-firefox-128x128.png" alt="hp-firefox-128x128" title="hp-firefox-128x128" width="128" height="128" class="alignnone size-full wp-image-486" /></a></p>
<p>from the <a href="http://www.iconarchive.com/show/hydropro-icons-by-media-design/HP-Firefox-icon.html">following website</a> (where other nice replacements exist).</p>
<p>Then I went to find the logical location of the files to replace.  First I updated my &#8216;locate&#8217; database file because this software is new, so it&#8217;s not yet known.  This is done automatically daily on a cron but you can update it any time you&#8217;d like as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">tyler<span class="sy0">@</span>quadjutsu:~$ <span class="kw2">sudo</span> <span class="kw2">updatedb</span></pre></div></div>

<p>Then I probed for icons I might think would be responsible.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">tyler<span class="sy0">@</span>quadjutsu:~$ <span class="kw2">locate</span> firefox <span class="sy0">|</span><span class="kw2">grep</span> lib <span class="sy0">|</span><span class="kw2">grep</span> icon <span class="sy0">|</span><span class="kw2">grep</span> <span class="nu0">3.5</span>
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>icons
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>chrome<span class="sy0">/</span>icons
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>chrome<span class="sy0">/</span>icons<span class="sy0">/</span>default
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>chrome<span class="sy0">/</span>icons<span class="sy0">/</span>default<span class="sy0">/</span>default16.png
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>chrome<span class="sy0">/</span>icons<span class="sy0">/</span>default<span class="sy0">/</span>default32.png
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>chrome<span class="sy0">/</span>icons<span class="sy0">/</span>default<span class="sy0">/</span>default48.png
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>icons<span class="sy0">/</span>document.png
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>icons<span class="sy0">/</span>mozicon128.png
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>icons<span class="sy0">/</span>mozicon16.xpm
<span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>icons<span class="sy0">/</span>mozicon50.xpm</pre></div></div>

<p>The first set in the &#8216;/usr/lib/firefox-3.5.2/chrome/icons/&#8217; folder will replace the icons used by the application itself (i.e. the icon in the top of your window).  The latter,  &#8216;/usr/lib/firefox-3.5.2/icons/&#8217; will replace the ones used by shortcut icons.</p>
<p>Here are all the files for the icons I resized if you&#8217;d like to use them.</p>
<p><a href="http://www.doknowevil.net/files/firefox-3.5_replacement_chrome_icons.zip">firefox-3.5_replacement_chrome_icons.zip</a><br />
<a href="http://www.doknowevil.net/files/firefox-3.5_replacement_shortcut_icons.zip">firefox-3.5_replacement_shortcut_icons.zip</a></p>
<p>bash pro-style:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw3">cd</span> Desktop<span class="sy0">/</span> <span class="sy0">&amp;&amp;</span> <span class="kw2">mkdir</span> firefox_replacement_icons <span class="sy0">&amp;&amp;</span> <span class="kw3">cd</span> firefox_replacement_icons
<span class="kw2">wget</span> http:<span class="sy0">//</span>www.doknowevil.net<span class="sy0">/</span>files<span class="sy0">/</span>firefox-<span class="nu0">3.5</span>_replacement_chrome_icons.zip <span class="sy0">&amp;&amp;</span> <span class="kw2">wget</span> http:<span class="sy0">//</span>www.doknowevil.net<span class="sy0">/</span>files<span class="sy0">/</span>firefox-<span class="nu0">3.5</span>_replacement_shortcut_icons.zip
<span class="kw1">for</span> <span class="kw2">file</span> <span class="kw1">in</span> <span class="sy0">*</span>.zip; <span class="kw1">do</span> <span class="kw2">unzip</span> <span class="re1">$file</span>; <span class="kw1">done</span>
<span class="kw2">sudo</span> <span class="kw2">cp</span> chrome<span class="sy0">/*</span> <span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>chrome<span class="sy0">/</span>icons<span class="sy0">/</span>default<span class="sy0">/</span>
<span class="kw2">sudo</span> <span class="kw2">cp</span> shorcuts<span class="sy0">/*</span> <span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>firefox-3.5.2<span class="sy0">/</span>icons<span class="sy0">/</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/08/30/installing-firefox-352-shiretoko-on-ubuntu-using-the-default-repos-and-customizing-the-icon-to-be-more-recognizable/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Finding the difference in time between the first and last file in a folder using bash</title>
		<link>http://www.doknowevil.net/2009/08/22/finding-the-difference-in-time-between-the-first-and-last-file-in-a-folder-using-bash/</link>
		<comments>http://www.doknowevil.net/2009/08/22/finding-the-difference-in-time-between-the-first-and-last-file-in-a-folder-using-bash/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:40:58 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=440</guid>
		<description><![CDATA[I was working on running some statistics on log files and it required me to figure out the difference to increase the accuracy.  I came up with the following bash script:

#!/bin/bash
# get the dates
start_date=$&#40;date --utc --date &#34;$(ls -Rt --full-time &#124; tail -n1 &#124; awk '{ print $6 }')&#34; +%s&#41;
end_date=$&#40;date --utc --date &#34;$(ls -Rt --full-time [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on running some statistics on log files and it required me to figure out the difference to increase the accuracy.  I came up with the following bash script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co0">#!/bin/bash</span>
<span class="co0"># get the dates</span>
<span class="re2">start_date</span>=$<span class="br0">&#40;</span><span class="kw2">date</span> <span class="re5">--utc</span> <span class="re5">--date</span> <span class="st0">&quot;<span class="es4">$(ls -Rt --full-time | tail -n1 | awk '{ print $6 }')</span>&quot;</span> +<span class="sy0">%</span>s<span class="br0">&#41;</span>
<span class="re2">end_date</span>=$<span class="br0">&#40;</span><span class="kw2">date</span> <span class="re5">--utc</span> <span class="re5">--date</span> <span class="st0">&quot;<span class="es4">$(ls -Rt --full-time | head -n2 | tail -n1 | awk '{ print $6 }')</span>&quot;</span> +<span class="sy0">%</span>s<span class="br0">&#41;</span>
&nbsp;
<span class="co0"># find the difference</span>
<span class="re2">difference</span>=$<span class="br0">&#40;</span><span class="br0">&#40;</span>end_date-start_date<span class="br0">&#41;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co0"># echo results</span>
<span class="kw3">echo</span> <span class="re1">$end_date</span> - <span class="re1">$start_date</span> = <span class="re1">$difference</span> seconds
<span class="kw3">echo</span> $<span class="br0">&#40;</span><span class="br0">&#40;</span>difference<span class="sy0">/</span><span class="nu0">86400</span><span class="br0">&#41;</span><span class="br0">&#41;</span> days</pre></div></div>

<p>Which I originally wrote as a one liner:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="re2">start_date</span>=$<span class="br0">&#40;</span><span class="kw2">date</span> <span class="re5">--utc</span> <span class="re5">--date</span> <span class="st0">&quot;<span class="es4">$(ls -Rt --full-time | tail -n1 | awk '{ print $6 }')</span>&quot;</span> +<span class="sy0">%</span>s<span class="br0">&#41;</span>; <span class="re2">end_date</span>=$<span class="br0">&#40;</span><span class="kw2">date</span> <span class="re5">--utc</span> <span class="re5">--date</span> <span class="st0">&quot;<span class="es4">$(ls -Rt --full-time | head -n2 | tail -n1 | awk '{ print $6 }')</span>&quot;</span> +<span class="sy0">%</span>s<span class="br0">&#41;</span>; <span class="re2">difference</span>=$<span class="br0">&#40;</span><span class="br0">&#40;</span>end_date-start_date<span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw3">echo</span> <span class="re1">$end_date</span> - <span class="re1">$start_date</span> = <span class="re1">$difference</span> seconds; <span class="kw3">echo</span> $<span class="br0">&#40;</span><span class="br0">&#40;</span>difference<span class="sy0">/</span><span class="nu0">86400</span><span class="br0">&#41;</span><span class="br0">&#41;</span> days;</pre></div></div>

<p>I got a little carried away and created this beast, which still isn&#8217;t as accurate as I need it to be but it did give me some information:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="re2">map_1</span>=nordiccastle;<span class="re2">map_2</span>=dance;<span class="re2">start_date</span>=$<span class="br0">&#40;</span><span class="kw2">date</span> <span class="re5">--utc</span> <span class="re5">--date</span> <span class="st0">&quot;<span class="es4">$(ls -Rt --full-time | tail -n1 | awk '{ print $6 }')</span>&quot;</span> +<span class="sy0">%</span>s<span class="br0">&#41;</span>; <span class="re2">end_date</span>=$<span class="br0">&#40;</span><span class="kw2">date</span> <span class="re5">--utc</span> <span class="re5">--date</span> <span class="st0">&quot;<span class="es4">$(ls -Rt --full-time | head -n2 | tail -n1 | awk '{ print $6 }')</span>&quot;</span> +<span class="sy0">%</span>s<span class="br0">&#41;</span>; <span class="re2">difference</span>=$<span class="br0">&#40;</span><span class="br0">&#40;</span>end_date-start_date<span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw3">echo</span> $... Read Moreend_date - <span class="re1">$start_date</span> = <span class="re1">$difference</span> seconds; <span class="kw3">echo</span> logs <span class="kw1">for</span> $<span class="br0">&#40;</span><span class="br0">&#40;</span>difference<span class="sy0">/</span><span class="nu0">86400</span><span class="br0">&#41;</span><span class="br0">&#41;</span> days; <span class="re2">map_1_ended</span>=$<span class="br0">&#40;</span><span class="kw2">find</span> <span class="re5">-name</span> <span class="sy0">*</span>00<span class="sy0">*</span>.log <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">egrep</span> <span class="re5">-A</span> <span class="nu0">4</span> <span class="st0">&quot;endmatch|timelimit -1&quot;</span> <span class="sy0">|</span><span class="kw2">grep</span> <span class="re1">$map_1</span> <span class="sy0">|</span><span class="kw2">wc</span> -l<span class="br0">&#41;</span>; <span class="re2">map_1_played</span>=$<span class="br0">&#40;</span><span class="kw2">find</span> <span class="re5">-name</span> <span class="sy0">*</span>00<span class="sy0">*</span>.log <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">egrep</span> <span class="st0">&quot;gamestart&quot;</span> <span class="sy0">|</span><span class="kw2">grep</span> <span class="re1">$map_1</span> <span class="sy0">|</span><span class="kw2">wc</span> -l<span class="br0">&#41;</span>; <span class="kw3">echo</span> <span class="re1">$map_1</span> endmatched <span class="re1">$map_1_ended</span> out of <span class="re1">$map_1_played</span> <span class="kw3">times</span> played; <span class="re2">map_2_ended</span>=$<span class="br0">&#40;</span><span class="kw2">find</span> <span class="re5">-name</span> <span class="sy0">*</span>00<span class="sy0">*</span>.log <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">egrep</span> <span class="re5">-A</span> <span class="nu0">4</span> <span class="st0">&quot;endmatch|timelimit -1&quot;</span> <span class="sy0">|</span><span class="kw2">grep</span> <span class="re1">$map_2</span> <span class="sy0">|</span><span class="kw2">wc</span> -l<span class="br0">&#41;</span>; <span class="re2">map_2_played</span>=$<span class="br0">&#40;</span><span class="kw2">find</span> <span class="re5">-name</span> <span class="sy0">*</span>00<span class="sy0">*</span>.log <span class="sy0">|</span> <span class="kw2">xargs</span> <span class="kw2">egrep</span> <span class="st0">&quot;gamestart&quot;</span> <span class="sy0">|</span><span class="kw2">grep</span> <span class="re1">$map_2</span> <span class="sy0">|</span><span class="kw2">wc</span> -l<span class="br0">&#41;</span>; <span class="kw3">echo</span> <span class="re1">$map_2</span> endmatched <span class="re1">$map_2_ended</span> out of <span class="re1">$map_2_played</span> <span class="kw3">times</span> played</pre></div></div>

<p>It was used to see how many times a map was played and how many times it was voted to end the match.</p>
<p>It should really be a separate script to allow for more organization</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/08/22/finding-the-difference-in-time-between-the-first-and-last-file-in-a-folder-using-bash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>feh &#8211; lightweight command line image viewer and data tool</title>
		<link>http://www.doknowevil.net/2009/08/17/feh-lightweight-command-line-image-viewer-and-data-tool/</link>
		<comments>http://www.doknowevil.net/2009/08/17/feh-lightweight-command-line-image-viewer-and-data-tool/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 15:37:48 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=464</guid>
		<description><![CDATA[While I was looking for a better image viewer than the default &#8216;eye of gnome&#8217; (eog from the command line), that&#8217;s able to play animated gifs, I came across a command line tool called feh

sudo apt-get install feh

feh is is lightweight image viewer that you can call from the command line.  It can recursively [...]]]></description>
			<content:encoded><![CDATA[<p>While I was looking for a better image viewer than the default &#8216;eye of gnome&#8217; (eog from the command line), that&#8217;s able to play animated gifs, I came across a command line tool called feh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> feh</pre></div></div>

<p>feh is is lightweight image viewer that you can call from the command line.  It can recursively view files with the following command for example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">feh <span class="re5">-r</span> <span class="sy0">*</span>.jpg</pre></div></div>

<p>You can navigate through the images with your arrow keys or space bar and backspace.  Use the window close button or press esc to quit.</p>
<p>That&#8217;s all good and fun and I&#8217;ll probably use it from time to time but it&#8217;s not what really got me excited about this tool.  It has an option for a &#8220;list&#8221; of image attributes as the screenshot below shows.</p>
<p><a href="http://www.doknowevil.net/wp-content/uploads/2009/08/screenshot3.png" rel="shadowbox[post-464];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2009/08/screenshot3-500x177.png" alt="screenshot3" title="screenshot3" width="500" height="177" class="alignnone size-thumbnail wp-image-465" /></a></p>
<p>By typing for example</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">feh <span class="re5">-l</span> <span class="sy0">*</span>.jpg</pre></div></div>

<p>I would list all attributes for jpgs within a specified directory.  In my screenshot, I had a text file multiple image extensions, so I did a subshell with an &#8216;ls&#8217; command piped to &#8216;grep -v&#8217; which negates whatever pattern that follows it.  To rephrase, the command inside $() is run first and that list which has all files minus those ending in &#8216;.txt&#8217; is called by the &#8216;feh -l&#8217; command.</p>
<p>I find this very helpful for when I&#8217;m slicing images for web pages.  When I&#8217;m typing out css for example:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="re0">#my_image</span> <span class="br0">&#123;</span>
  <span class="kw1">display</span><span class="sy0">:</span><span class="kw2">block</span><span class="sy0">;</span>
  <span class="kw1">height</span><span class="sy0">:</span><span class="re3">25px</span><span class="sy0">;</span>
  <span class="kw1">width</span><span class="sy0">:</span><span class="re3">120px</span><span class="sy0">;</span>
  <span class="kw1">background</span><span class="re2">:<span class="kw2">transparent</span> </span>url<span class="br0">&#40;</span><span class="st0">'img/my_image.png'</span><span class="br0">&#41;</span> <span class="nu0">0</span> <span class="nu0">0</span> <span class="kw2">no-repeat</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

<p>it&#8217;s very handy to have the image dimensions.  The nice thing about this raw dimension output is that I can script it further to generate CSS like above.</p>
<p>There are many other tricks this command can do, just type &#8216;man feh&#8217; to learn more.</p>
<p>By the way, I&#8217;ve started using gThumb as my default image viewer, it&#8217;s still lightweight and quite powerful.  It&#8217;s essentially the same as eog with some minor differences and a few major enhancements</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> gthumb</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/08/17/feh-lightweight-command-line-image-viewer-and-data-tool/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Generating sequences of numbers or characters with bash</title>
		<link>http://www.doknowevil.net/2009/08/15/generating-sequences-of-numbers-or-characters-with-bash/</link>
		<comments>http://www.doknowevil.net/2009/08/15/generating-sequences-of-numbers-or-characters-with-bash/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 15:14:07 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[seq]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=442</guid>
		<description><![CDATA[If you ever needed to generate a sequence of characters or numbers, the terminal (using bash) is a quick and easy way to do it.  Lets explore some examples bash&#8217;s brace expansion:

$ echo &#123;a..z&#125;
a b c d e f g h i j k l m n o p q r s t u [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever needed to generate a sequence of characters or numbers, the terminal (using bash) is a quick and easy way to do it.  Lets explore some examples bash&#8217;s brace expansion:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw3">echo</span> <span class="br0">&#123;</span>a..z<span class="br0">&#125;</span>
a b c d e f g h i j k l m n o p q r s t u v <span class="kw2">w</span> x y z</pre></div></div>

<p>by defining a start and end character with the &#8216;..&#8217; in between, we tell bash to fill in the rest and echo a list for us.  Those are all lowercase, what if you wanted uppercase? simple:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw3">echo</span> <span class="br0">&#123;</span>A..Z<span class="br0">&#125;</span>
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</pre></div></div>

<p>Or both, with a few extra characters in the mix:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw3">echo</span> <span class="br0">&#123;</span>A..z<span class="br0">&#125;</span>
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z <span class="br0">&#91;</span>  <span class="br0">&#93;</span> ^ _ <span class="sy0">`</span> a b c d e f g h i j k l m n o p q r s t u v <span class="kw2">w</span> x y z</pre></div></div>

<p>It doesn&#8217;t always have to be a-z though,</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw3">echo</span> <span class="br0">&#123;</span>A..G<span class="br0">&#125;</span>
A B C D E F G</pre></div></div>

<p>This also works with numbers:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw3">echo</span> <span class="br0">&#123;</span>0..9<span class="br0">&#125;</span>
<span class="nu0">0</span> <span class="nu0">1</span> <span class="nu0">2</span> <span class="nu0">3</span> <span class="nu0">4</span> <span class="nu0">5</span> <span class="nu0">6</span> <span class="nu0">7</span> <span class="nu0">8</span> <span class="nu0">9</span>
<span class="kw3">echo</span> <span class="br0">&#123;</span>0..100<span class="br0">&#125;</span>
<span class="nu0">0</span> <span class="nu0">1</span> <span class="nu0">2</span> <span class="nu0">3</span> <span class="nu0">4</span> <span class="nu0">5</span> <span class="nu0">6</span> <span class="nu0">7</span> <span class="nu0">8</span> <span class="nu0">9</span> <span class="nu0">10</span> <span class="nu0">11</span> <span class="nu0">12</span> <span class="nu0">13</span> <span class="nu0">14</span> <span class="nu0">15</span> <span class="nu0">16</span> <span class="nu0">17</span> <span class="nu0">18</span> <span class="nu0">19</span> <span class="nu0">20</span> <span class="nu0">21</span> <span class="nu0">22</span> <span class="nu0">23</span> <span class="nu0">24</span> <span class="nu0">25</span> <span class="nu0">26</span> <span class="nu0">27</span> <span class="nu0">28</span> <span class="nu0">29</span> <span class="nu0">30</span> <span class="nu0">31</span> <span class="nu0">32</span> <span class="nu0">33</span> <span class="nu0">34</span> <span class="nu0">35</span> <span class="nu0">36</span> <span class="nu0">37</span> <span class="nu0">38</span> <span class="nu0">39</span> <span class="nu0">40</span> <span class="nu0">41</span> <span class="nu0">42</span> <span class="nu0">43</span> <span class="nu0">44</span> <span class="nu0">45</span> <span class="nu0">46</span> <span class="nu0">47</span> <span class="nu0">48</span> <span class="nu0">49</span> <span class="nu0">50</span> <span class="nu0">51</span> <span class="nu0">52</span> <span class="nu0">53</span> <span class="nu0">54</span> <span class="nu0">55</span> <span class="nu0">56</span> <span class="nu0">57</span> <span class="nu0">58</span> <span class="nu0">59</span> <span class="nu0">60</span> <span class="nu0">61</span> <span class="nu0">62</span> <span class="nu0">63</span> <span class="nu0">64</span> <span class="nu0">65</span> <span class="nu0">66</span> <span class="nu0">67</span> <span class="nu0">68</span> <span class="nu0">69</span> <span class="nu0">70</span> <span class="nu0">71</span> <span class="nu0">72</span> <span class="nu0">73</span> <span class="nu0">74</span> <span class="nu0">75</span> <span class="nu0">76</span> <span class="nu0">77</span> <span class="nu0">78</span> <span class="nu0">79</span> <span class="nu0">80</span> <span class="nu0">81</span> <span class="nu0">82</span> <span class="nu0">83</span> <span class="nu0">84</span> <span class="nu0">85</span> <span class="nu0">86</span> <span class="nu0">87</span> <span class="nu0">88</span> <span class="nu0">89</span> <span class="nu0">90</span> <span class="nu0">91</span> <span class="nu0">92</span> <span class="nu0">93</span> <span class="nu0">94</span> <span class="nu0">95</span> <span class="nu0">96</span> <span class="nu0">97</span> <span class="nu0">98</span> <span class="nu0">99</span> <span class="nu0">100</span></pre></div></div>

<p>Descending as well as ascending</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw3">echo</span> <span class="br0">&#123;</span>9..0<span class="br0">&#125;</span>
<span class="nu0">9</span> <span class="nu0">8</span> <span class="nu0">7</span> <span class="nu0">6</span> <span class="nu0">5</span> <span class="nu0">4</span> <span class="nu0">3</span> <span class="nu0">2</span> <span class="nu0">1</span> <span class="nu0">0</span></pre></div></div>

<p>There is another method to generate a sequence of numbers from the command line, rightfully called &#8217;seq&#8217;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw2">seq</span> <span class="nu0">1</span> <span class="nu0">5</span>
<span class="nu0">1</span>
<span class="nu0">2</span>
<span class="nu0">3</span>
<span class="nu0">4</span>
<span class="nu0">5</span></pre></div></div>

<p>The difference here is that it&#8217;s delimited by a new line, however, we can override that with the -s (seperator) flag</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">$ <span class="kw2">seq</span> <span class="re5">-s</span> <span class="st0">&quot; &quot;</span> <span class="nu0">1</span> <span class="nu0">10</span>
<span class="nu0">1</span> <span class="nu0">2</span> <span class="nu0">3</span> <span class="nu0">4</span> <span class="nu0">5</span> <span class="nu0">6</span> <span class="nu0">7</span> <span class="nu0">8</span> <span class="nu0">9</span> <span class="nu0">10</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/08/15/generating-sequences-of-numbers-or-characters-with-bash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The &#8220;easy&#8221; way to listen to internet radio in Ubuntu</title>
		<link>http://www.doknowevil.net/2009/07/15/the-easy-way-to-listen-to-internt-radio-in-ubuntu/</link>
		<comments>http://www.doknowevil.net/2009/07/15/the-easy-way-to-listen-to-internt-radio-in-ubuntu/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 02:13:21 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Application Management]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Freeware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=450</guid>
		<description><![CDATA[I started with rhythmbox like most new Ubuntu users.  It seemed nice enough but not in the area I was concerned with, internet radio.  I tried out many players but was disappointed with different areas of different players.  From Ubuntu 8.04 to 8.10 I was using the &#8220;good&#8221; Amarok (for KDE 3.5). [...]]]></description>
			<content:encoded><![CDATA[<p>I started with rhythmbox like most new Ubuntu users.  It seemed nice enough but not in the area I was concerned with, internet radio.  I tried out many players but was disappointed with different areas of different players.  From Ubuntu 8.04 to 8.10 I was using the &#8220;good&#8221; Amarok (for KDE 3.5).  Disappointed by the exclusion of that version in Ubuntu Jaunty 9.04 and unimpressed with workarounds like the PPA&#8217;s, I decided to play the field.  I came across Exaile, which I&#8217;ve blogged about in the past.  It&#8217;s a good enough player&#8230; most of the time.  It crashed too often for my likings and I&#8217;m getting sick of pkilling it.</p>
<p>It struck me today that I needed a simplier more streamlined solution for my simple needs.  I needed a console application.  Through  a little research, I found moc, which happens to play shoutcast streams as I&#8217;ve become accustom to.</p>
<p>I then proceeded to set myself the following way:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> moc
<span class="kw2">mkdir</span> <span class="re5">-p</span> ~<span class="sy0">/</span>Music<span class="sy0">/</span>internet_radio <span class="sy0">&amp;&amp;</span> <span class="kw3">cd</span> ~<span class="sy0">/</span>Music<span class="sy0">/</span>internet_radio
<span class="kw2">wget</span> <span class="re5">-r</span> <span class="re5">-l2</span> <span class="re5">-nd</span> <span class="re5">-Nc</span> -A.pls http:<span class="sy0">//</span>www.di.fm<span class="sy0">/</span>index.php
<span class="kw1">for</span> <span class="kw2">file</span> <span class="kw1">in</span> <span class="sy0">*</span>.pls; <span class="kw1">do</span> mocp <span class="re5">-a</span> <span class="re1">$file</span>; <span class="kw1">done</span>
mocp</pre></div></div>

<p>1) Installed moc<br />
2) created a directory to download all the playlists from di.fm (since this is the station I listen to most often)<br />
3) wget all the playlists<br />
4) add them all to moc<br />
5) start moc and [tab] to the play list side, enter to play</p>
<p><a href="http://www.doknowevil.net/wp-content/uploads/2009/07/screenshot-detrateshobo-music-internet_radio.png" rel="shadowbox[post-450];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2009/07/screenshot-detrateshobo-music-internet_radio-500x283.png" alt="screenshot-detrateshobo-music-internet_radio" title="screenshot-detrateshobo-music-internet_radio" width="500" height="283" class="alignnone size-thumbnail wp-image-453" /></a></p>
<pre>  enter  -- starts playing
  s      -- stops playing
  n      -- plays next item from the playlist
  b      -- plays previous item from the playlist
  space  -- pause
  p      -- pause

  S      -- plays at random
  R      -- repeats the same song in a loop,
	    Next (X button below) must be OFF
  X      -- switches to play sequentially
  o      -- plays a file from the Internet
  u      -- moves playlist item up
  j      -- moves playlist item down
  Ctrl+u -- adds the URL to the playlist
  g      -- searches marked string in file names
  /      -- searches marked string in file names

  r      -- rereads the directory
  T      -- switches to the theme selection menu
  f      -- toggles display mode of song titles
  TAB    -- switches marker bar between the playlist
	    and the file manager panels
  l      -- switches between displaying the playlist
            or the file manager panel
  P      -- switches full path in the playlist
  H      -- toggles hidden files view
  Ctrl-t -- toggles song duration time
  Ctrl-f -- toggles format file view
  m      -- moves to directory entered in config file
  G      -- moves to directory with currently played file
  i      -- moves to marked directory
  U      -- moves to upper directory
  a      -- adds a file to the playlist
  A      -- adds a directory recursively to the playlist
  C      -- clears the playlist
  V      -- saves the playlist
  d      -- removes marked item from the playlist
  Y      -- removes all empty items from the playlist

  < -- decreases volume by 1%
  ,      -- decreases volume by 5%
  >      -- increases volume by 1%
  .      -- increases volume by 5%

  x      -- toggles the mixer channel
  ?      -- shows help

  !      -- goes to a fast dir 1 (set in config file)
  @      -- goes to a fast dir 2
  #      -- goes to a fast dir 3
  $      -- goes to a fast dir 4
  %      -- goes to a fast dir 5
  ^      -- goes to a fast dir 6
  &#038;      -- goes to a fast dir 7
  *      -- goes to a fast dir 8
  (      -- goes to a fast dir 9
  )      -- goes to a fast dir 10

  F1     -- executes ExecCommand1 (set in config file)
  F2     -- executes ExecCommand2
  F3     -- executes ExecCommand3
  F4     -- executes ExecCommand4
  F5     -- executes ExecCommand5
  F6     -- executes ExecCommand6
  F7     -- executes ExecCommand7
  F8     -- executes ExecCommand8
  F9     -- executes ExecCommand9
  F10    -- executes ExecCommand10</pre>
<p>Above commands from <a href="http://polishlinux.org/apps/cli/moc-audio-player-advanced-tricks/" target="_blank">polish linux&#8217;s article on moc audo player</a>, great resource.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/07/15/the-easy-way-to-listen-to-internt-radio-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
