<?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>John Hobbs on coding, Omaha, and life in general &#187; Computers</title>
	<atom:link href="http://www.velvetcache.org/tag/computers/feed" rel="self" type="application/rss+xml" />
	<link>http://www.velvetcache.org</link>
	<description>I Love Darcy. I Love Code. I love Omaha.</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:00:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Thursday Quote: Matthew Inman</title>
		<link>http://www.velvetcache.org/2009/12/31/thursday-quote-matthew-inman</link>
		<comments>http://www.velvetcache.org/2009/12/31/thursday-quote-matthew-inman#comments</comments>
		<pubDate>Thu, 31 Dec 2009 15:10:00 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Quotes]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/?p=454</guid>
		<description><![CDATA[&#8220;Watching someone else use your computer is like watching a drunk orangutan solve a Rubix cube. - Matthew Inman, The Three Phases of Owning a Computer Related posts:Thursday Quote: Flobots Thursday Quote: Showbread Thursday Quote: Allen Ginsberg


Related posts:<ol><li><a href='http://www.velvetcache.org/2009/12/17/thursday-quote-flobots' rel='bookmark' title='Permanent Link: Thursday Quote: Flobots'>Thursday Quote: Flobots</a></li>
<li><a href='http://www.velvetcache.org/2009/12/03/quote-showbread' rel='bookmark' title='Permanent Link: Thursday Quote: Showbread'>Thursday Quote: Showbread</a></li>
<li><a href='http://www.velvetcache.org/2010/02/11/thursday-quote-allen-ginsberg' rel='bookmark' title='Permanent Link: Thursday Quote: Allen Ginsberg'>Thursday Quote: Allen Ginsberg</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>
<blockquote>&#8220;Watching someone else use your computer is like watching a drunk orangutan solve a Rubix cube.</p></blockquote>
<p style="text-align: right;"><b>- Matthew Inman, <a href="http://theoatmeal.com/comics/computer_phases" target="_blank">The Three Phases of Owning a Computer</a></b></p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2009/12/17/thursday-quote-flobots' rel='bookmark' title='Permanent Link: Thursday Quote: Flobots'>Thursday Quote: Flobots</a></li>
<li><a href='http://www.velvetcache.org/2009/12/03/quote-showbread' rel='bookmark' title='Permanent Link: Thursday Quote: Showbread'>Thursday Quote: Showbread</a></li>
<li><a href='http://www.velvetcache.org/2010/02/11/thursday-quote-allen-ginsberg' rel='bookmark' title='Permanent Link: Thursday Quote: Allen Ginsberg'>Thursday Quote: Allen Ginsberg</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2009/12/31/thursday-quote-matthew-inman/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hard subs with mencoder, or, annotating screencasts for free.</title>
		<link>http://www.velvetcache.org/2009/12/02/hard-subs-with-mencoder-or-annotating-screencasts-for-free</link>
		<comments>http://www.velvetcache.org/2009/12/02/hard-subs-with-mencoder-or-annotating-screencasts-for-free#comments</comments>
		<pubDate>Wed, 02 Dec 2009 06:24:46 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/?p=464</guid>
		<description><![CDATA[I was working on a screen cast for a project and I could not get anything to work the way I wanted to. I didn&#8217;t have the desire to purchase software, so I sought a way to annotate it for free. I tried a half dozen free and open source video editors, with no real [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2008/03/18/any2mp3' rel='bookmark' title='Permanent Link: any2mp3'>any2mp3</a></li>
<li><a href='http://www.velvetcache.org/2007/06/04/m4a2mp3' rel='bookmark' title='Permanent Link: m4a2mp3'>m4a2mp3</a></li>
<li><a href='http://www.velvetcache.org/2007/10/01/command-line-package-installation-in-opensuse' rel='bookmark' title='Permanent Link: Command Line Package Installation in OpenSuSE'>Command Line Package Installation in OpenSuSE</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was working on a screen cast for a project and I could not get anything to work the way I wanted to. I didn&#8217;t have the desire to purchase software, so I sought a way to annotate it for free.  I tried a half dozen free and open source video editors, with no real luck.  Either they choked on the format I captured (from CamStudio) or they didn&#8217;t have a readily available inline text tool.</p>
<p>What I ended up using was plain old subtitles, plus the handyman&#8217;s secret weapon, <tt>mplayer/mencoder</tt>.</p>
<p>Here&#8217;s what I did.  I fired up the video in VLC and found the points where I wanted to put my subtitle help text.  Subtitle files are usually pretty straight forward.  I chose the <tt>.srt</tt> format, which is plain text. You can edit by hand, or you can use a tool, I used the aptly named <a href="http://home.gna.org/subtitleeditor/" target="_blank">subtitleeditor</a>. Which, by the way, barfed on my video file.</p>
<p>Here&#8217;s a snippet of the resulting <tt>.srt</tt> file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">1
00:00:00,000 --&gt; 00:00:13,000
Welcome to the product gallery walk through.
&nbsp;
2
00:00:13,000 --&gt; 00:00:23,000
Adding a product: Select image.
&nbsp;
3
00:00:23,000 --&gt; 00:00:32,000
Insert title and description.</pre></div></div>

</p>
<p>Next I needed to turn those &#8220;soft&#8221; subs into &#8220;hard&#8221; ones. This is where <tt>mplayer/mencoder</tt> come in.  To add soft subs to a video in <tt>mplayer</tt>, you use the <tt>-sub</tt> option.  Running this in <tt>mplayer</tt> first is a good way to see how it will look at tweak it according to the <a href="http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html#OSD/SUBTITLE%20OPTIONS" target="_blank">many options</a> you have.  I went with the defaults, it looks pretty good that way.</p>
<p>Lastly, I needed a good <tt>mencoder</tt> recipe to pull it all together. After lots of searching I found a great MPEG4 one <a href="http://personal.cscs.ch/~mvalle/mencoder/mencoder.html" target="_blank">here</a>.</p>
<p>It&#8217;s a two pass system, and the crucial piece is in calculating the bitrate:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">bitrate = 50 * 25 * width_of_video * height_of_video / 256</pre></div></div>

</p>
<p>My bitrate was 2540600. After you get that, you just plug it into the two passes below. This includes my subtitle options.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mencoder -o /dev/null -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1:vbitrate=2540600:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:mv0:last_pred=3 -nosound -sub MySubTitles.srt -subfont-text-scale 3 RawScreenCast.avi
mencoder -o FinishedScreenCast.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=2:vbitrate=2540600:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:mv0:last_pred=3 -nosound -sub MySubTitles.srt -subfont-text-scale 3 RawScreenCast.avi</pre></div></div>

</p>
<p>It takes a while but not too long.  When all was said and done I had a perfect hard-subbed version and it shrank my file size from ~550MB to 7.6MB. That is a great encoding recipe.</p>
<p style="text-align: center;"><a href="http://static.velvetcache.org/pages/2009/12/02/hard-subs-with-mencoder-or-annotating-screencasts-for-free/edited.png" target="_blank" rel="lightbox[464]"><img src="http://static.velvetcache.org/pages/2009/12/02/hard-subs-with-mencoder-or-annotating-screencasts-for-free/edited_sm.png" alt="Average video still." style="border: 0 none;"/></a><br/>An average frame, with hard subs.</p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2008/03/18/any2mp3' rel='bookmark' title='Permanent Link: any2mp3'>any2mp3</a></li>
<li><a href='http://www.velvetcache.org/2007/06/04/m4a2mp3' rel='bookmark' title='Permanent Link: m4a2mp3'>m4a2mp3</a></li>
<li><a href='http://www.velvetcache.org/2007/10/01/command-line-package-installation-in-opensuse' rel='bookmark' title='Permanent Link: Command Line Package Installation in OpenSuSE'>Command Line Package Installation in OpenSuSE</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2009/12/02/hard-subs-with-mencoder-or-annotating-screencasts-for-free/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great bash calculator</title>
		<link>http://www.velvetcache.org/2009/11/03/great-bash-calculator</link>
		<comments>http://www.velvetcache.org/2009/11/03/great-bash-calculator#comments</comments>
		<pubDate>Tue, 03 Nov 2009 22:13:47 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/?p=401</guid>
		<description><![CDATA[I spend a lot of time on the command line, and one thing I run up against every once in a while is doing math. I normally jump through the bc hoops, but today this bit came through my feed reader. calc&#40;&#41;&#123; awk &#34;BEGIN{ print $* }&#34; ;&#125; Just drop it into your .bashrc, .alias, [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2007/11/03/recursive-word-count-with-bash' rel='bookmark' title='Permanent Link: Recursive Word Count With Bash'>Recursive Word Count With Bash</a></li>
<li><a href='http://www.velvetcache.org/2007/08/01/bash-line-for-constant-monitoring' rel='bookmark' title='Permanent Link: Bash Line For Constant Monitoring'>Bash Line For Constant Monitoring</a></li>
<li><a href='http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script' rel='bookmark' title='Permanent Link: WLAN Router Monitor BASH Script'>WLAN Router Monitor BASH Script</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I spend a lot of time on the command line, and one thing I run up against every once in a while is doing math.  I normally jump through the <tt>bc</tt> hoops, but today this bit came through my feed reader.</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">calc<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">&quot;BEGIN{ print $* }&quot;</span> ;<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

</p>
<p>Just drop it into your .bashrc, .alias, or whatever else you use.</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">jmhobbs@asuka:~$ calc 9*100+14/10
901.4
jmhobbs@asuka:~$</pre></div></div>

</p>
<p>Great solution using existing tools, props to <a href="http://tinyhacker.com/hacks/the-geeky-command-prompt-calculator/" target="_blank">TinyHacker.com</a> for this one.</p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2007/11/03/recursive-word-count-with-bash' rel='bookmark' title='Permanent Link: Recursive Word Count With Bash'>Recursive Word Count With Bash</a></li>
<li><a href='http://www.velvetcache.org/2007/08/01/bash-line-for-constant-monitoring' rel='bookmark' title='Permanent Link: Bash Line For Constant Monitoring'>Bash Line For Constant Monitoring</a></li>
<li><a href='http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script' rel='bookmark' title='Permanent Link: WLAN Router Monitor BASH Script'>WLAN Router Monitor BASH Script</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2009/11/03/great-bash-calculator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Gnome Keyring for SVN</title>
		<link>http://www.velvetcache.org/2009/10/28/disable-gnome-keyring-for-svn</link>
		<comments>http://www.velvetcache.org/2009/10/28/disable-gnome-keyring-for-svn#comments</comments>
		<pubDate>Wed, 28 Oct 2009 17:27:01 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Pro-Tip]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/?p=397</guid>
		<description><![CDATA[Although I am personally switching over to git for my projects, we still use Subversion here at work. Something I&#8217;ve noticed recently is that SVN now stores my passwords in gnome-keyring. This appears to be a feature in version 1.6 and I am running 1.6.5. It seems from that article that it can also use [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2008/11/12/move-subversion-repository-without-svnadmin' rel='bookmark' title='Permanent Link: Move Subversion repository without svnadmin'>Move Subversion repository without svnadmin</a></li>
<li><a href='http://www.velvetcache.org/2006/10/23/javascript-password-generator' rel='bookmark' title='Permanent Link: Javascript Password Generator'>Javascript Password Generator</a></li>
<li><a href='http://www.velvetcache.org/2010/05/12/awesome-c-program' rel='bookmark' title='Permanent Link: Awesome C Program'>Awesome C Program</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Although I am personally switching over to <a href="http://github.com/jmhobbs" target="_blank">git</a> for my projects, we still use Subversion here at work.</p>
<p>Something I&#8217;ve noticed recently is that SVN now stores my passwords in gnome-keyring.  This appears to be a feature in <a href="http://blogs.open.collab.net/svn/2009/07/subversion-16-security-improvements.html" target="_blank">version 1.6</a> and I am running 1.6.5.  It seems from that article that it can also use KDE&#8217;s Wallet system.</p>
<p>However, I do not use Gnome, and I don&#8217;t like KDE wallet.  Plus, sometimes it seemed that gnome-keyring would stick on me during a transaction.  The only way to fix it was to run another transaction (svn update usually) in another shell.</p>
<p>I finally got sick of it today and Google&#8217;d around.  Here is the fix I found, <a href="http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&#038;dsMessageId=2402527&#038;orderBy=createDate&#038;orderType=desc" target="_blank">edit ~/.subversion/config and add one key.</a></p>
<p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[auth]
password-stores =</pre></div></div>

</p>
<p>Easy enough, and once I did everything was a-okay. Hope this helps someone else!</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">jmhobbs@katya:/var/www/experimental/source$ svn commit -m &quot;SOME MESSAGE&quot;
Password for 'default' GNOME keyring:
Sending        SOME FILE
Transmitting file data ...
Committed revision 448.
jmhobbs@katya:/var/www/experimental/source$ vim /home/jmhobbs/.subversion/config
jmhobbs@katya:/var/www/experimental/source$ svn update
Authentication realm: &lt;http://svn.REDACTED.com:80&gt; Private SVN
Password for 'jmhobbs':
-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:
&nbsp;
   &lt;http://svn.REDACTED.com:80&gt; Private SVN
&nbsp;
can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.
&nbsp;
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/jmhobbs/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes
At revision 448.
jmhobbs@katya:/var/www/experimental/source$</pre></div></div>
</p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2008/11/12/move-subversion-repository-without-svnadmin' rel='bookmark' title='Permanent Link: Move Subversion repository without svnadmin'>Move Subversion repository without svnadmin</a></li>
<li><a href='http://www.velvetcache.org/2006/10/23/javascript-password-generator' rel='bookmark' title='Permanent Link: Javascript Password Generator'>Javascript Password Generator</a></li>
<li><a href='http://www.velvetcache.org/2010/05/12/awesome-c-program' rel='bookmark' title='Permanent Link: Awesome C Program'>Awesome C Program</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2009/10/28/disable-gnome-keyring-for-svn/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImageMagick Thumbnails and Contact Sheets</title>
		<link>http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets</link>
		<comments>http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets#comments</comments>
		<pubDate>Tue, 31 Mar 2009 02:59:11 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/?p=345</guid>
		<description><![CDATA[Update (2010-06-14)Thanks to Glenn Turnbull I&#8217;ve fixed a bug where the last contact sheet would not be created when the number of photos is evenly divisible by the contact sheet size. Additionally, this script and others will now be kept updated at http://github.com/jmhobbs/helper-scripts Wow, long time no post. Darcy and I got a digital camera [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2007/11/30/howtos' rel='bookmark' title='Permanent Link: HowTo&#8217;s'>HowTo&#8217;s</a></li>
<li><a href='http://www.velvetcache.org/2007/11/03/recursive-word-count-with-bash' rel='bookmark' title='Permanent Link: Recursive Word Count With Bash'>Recursive Word Count With Bash</a></li>
<li><a href='http://www.velvetcache.org/2008/11/12/move-subversion-repository-without-svnadmin' rel='bookmark' title='Permanent Link: Move Subversion repository without svnadmin'>Move Subversion repository without svnadmin</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="update">
<p><b>Update (2010-06-14)</b><br/>Thanks to Glenn Turnbull I&#8217;ve fixed a bug where the last contact sheet would not be created when the number of photos is evenly divisible by the contact sheet size.</p>
<p>Additionally, this script and others will now be kept updated at <a href="http://github.com/jmhobbs/helper-scripts" target="_blank">http://github.com/jmhobbs/helper-scripts</a></p>
</div>
<p>Wow, long time no post.  Darcy and I got a digital camera about a week ago, a Nikon D90.  We haven&#8217;t really had a chance to put it through it&#8217;s paces, but we&#8217;ve taken a few pictures around the house to play with it.</p>
<p>At about 3mb each (JPEG&#8217;s) the images are <em>really</em> slow to preview in Konqueror.  I decided it would be better to be able to download all the photos from the card, then run a script to make my thumbnails.  That way I wouldn&#8217;t have to wait around while I was viewing photos, instead I could just wait once at the beginning of the process.</p>
<p>My resulting script may have some holes, but it works well for me on Sidux.  It takes all of the images in the current directory and makes 600&#215;600 base thumbnails into a directory called &#8220;thumb&#8221; then uses those to make 12 image contact sheets into a directory called &#8220;contact&#8221;.</p>
<table style="float: right; font-size: 10px;" border="1">
<tr>
<th></th>
<th><em>real</em></th>
<th><em>user</em></th>
<th><em>sys</em></th>
</tr>
<tr>
<td><strong>resize</strong></td>
<td align="right">0m43.478s</td>
<td align="right">0m40.625s</td>
<td align="right">0m2.525s</td>
</tr>
<tr>
<td><strong>scale</strong></td>
<td align="right">0m25.449s</td>
<td align="right">0m22.975s</td>
<td align="right">0m2.236s</td>
</tr>
<tr>
<td><strong>sample</strong></td>
<td align="right">0m18.362s</td>
<td align="right">0m15.983s</td>
<td align="right">0m2.211s</td>
</tr>
<tr>
<td colspan="4"><strong><em>Script times for 16 JPEG images at 3Mb each<br/>To 600&#215;600 thumbnails and 200&#215;200 contact sheet frames.</strong></td>
</tr>
</table>
<p>Your results will vary, but I ran it with three different scaling types (resize, scale, sample).  I&#8217;m fine with the output from the fastest one (sample) but you can do as you please.  I didn&#8217;t add command line options because I wanted to have consistent sizes and qualities every time I use it.</p>
<p>
<table>
<tr>
<td align="center"><a href="http://static.velvetcache.org/pages/2009/03/30/imagemagick-thumbnails-and-contact-sheets/dsc_0096_each.jpg" target="_blank" rel="lightbox[345]"><img src="http://static.velvetcache.org/pages/2009/03/30/imagemagick-thumbnails-and-contact-sheets/dsc_0096_each_sm.jpg" /></a><br/><em>Side By Side Resize Method Comparison<br/>Click For Fullsize</em></td>
<td align="center"><a href="http://static.velvetcache.org/pages/2009/03/30/imagemagick-thumbnails-and-contact-sheets/contact.jpg" target="_blank" rel="lightbox[345]"><img src="http://static.velvetcache.org/pages/2009/03/30/imagemagick-thumbnails-and-contact-sheets/contact_sm.jpg" /></a><br/><em>Sample Contact Sheet<br/>Click For Full Size</em></td>
</tr>
</table>
<p>It keeps you updated so you know it hasn&#8217;t stalled, here is a sample run.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jmhobbs<span style="color: #000000; font-weight: bold;">@</span>asuka:~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>D90<span style="color: #000000; font-weight: bold;">/</span>dcim<span style="color: #000000; font-weight: bold;">/</span>example$ digiCamProc.sh
Processing <span style="color: #000000;">16</span> Images
&nbsp;
Creating Thumbnails
<span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span>
&nbsp;
Creating Contact Sheets
<span style="color: #000000;">1</span> of <span style="color: #000000;">2</span>
<span style="color: #000000;">2</span> of <span style="color: #000000;">2</span>
jmhobbs<span style="color: #000000; font-weight: bold;">@</span>asuka:~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>D90<span style="color: #000000; font-weight: bold;">/</span>dcim<span style="color: #000000; font-weight: bold;">/</span>example$</pre></div></div>

<p>And here it is.  Feel free to comment your changes!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Digital camera thumbnail/contact sheet tool.</span>
<span style="color: #666666; font-style: italic;"># http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets</span>
<span style="color: #666666; font-style: italic;"># http://github.com/jmhobbs/helper-scripts</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Copyright (c) 2009-2010 John Hobbs</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Permission is hereby granted, free of charge, to any person</span>
<span style="color: #666666; font-style: italic;"># obtaining a copy of this software and associated documentation</span>
<span style="color: #666666; font-style: italic;"># files (the &quot;Software&quot;), to deal in the Software without</span>
<span style="color: #666666; font-style: italic;"># restriction, including without limitation the rights to use,</span>
<span style="color: #666666; font-style: italic;"># copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span style="color: #666666; font-style: italic;"># copies of the Software, and to permit persons to whom the</span>
<span style="color: #666666; font-style: italic;"># Software is furnished to do so, subject to the following</span>
<span style="color: #666666; font-style: italic;"># conditions:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># The above copyright notice and this permission notice shall be</span>
<span style="color: #666666; font-style: italic;"># included in all copies or substantial portions of the Software.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span>
<span style="color: #666666; font-style: italic;"># EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES</span>
<span style="color: #666666; font-style: italic;"># OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span>
<span style="color: #666666; font-style: italic;"># NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</span>
<span style="color: #666666; font-style: italic;"># HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,</span>
<span style="color: #666666; font-style: italic;"># WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<span style="color: #666666; font-style: italic;"># FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR</span>
<span style="color: #666666; font-style: italic;"># OTHER DEALINGS IN THE SOFTWARE.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># CHANGELOG</span>
<span style="color: #666666; font-style: italic;"># 2010-06-14 - Fixed contact sheet problem, thanks to Glenn Turnbull. (John Hobbs)</span>
<span style="color: #666666; font-style: italic;"># 2009-03-30 - Created script. (John Hobbs)</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### SETTINGS ###</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Scaling Methods:</span>
<span style="color: #666666; font-style: italic;"># resize (Best/Slow)</span>
<span style="color: #666666; font-style: italic;"># scale (Middle/Middle)</span>
<span style="color: #666666; font-style: italic;"># sample (Worst/Fast)</span>
<span style="color: #007800;">METHOD</span>=<span style="color: #ff0000;">&quot;sample&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Thumbnail Size</span>
<span style="color: #007800;">THUMBSIZE</span>=<span style="color: #ff0000;">&quot;600x600&quot;</span>
<span style="color: #666666; font-style: italic;"># Thumbnail Directory</span>
<span style="color: #007800;">THUMBDIR</span>=<span style="color: #ff0000;">&quot;thumb&quot;</span>
<span style="color: #666666; font-style: italic;"># Thumbnail Quality</span>
<span style="color: #007800;">THUMBQUALITY</span>=<span style="color: #ff0000;">&quot;80&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Contact Item Size</span>
<span style="color: #007800;">CONTACTSIZE</span>=<span style="color: #ff0000;">&quot;200x200&quot;</span>
<span style="color: #666666; font-style: italic;"># Contact Sheet Max Width</span>
<span style="color: #007800;">CONTACTWIDTH</span>=<span style="color: #ff0000;">&quot;3&quot;</span>
<span style="color: #666666; font-style: italic;"># Contact Sheet Max Height</span>
<span style="color: #007800;">CONTACTHEIGHT</span>=<span style="color: #ff0000;">&quot;4&quot;</span>
<span style="color: #666666; font-style: italic;"># Horizontal Spacing</span>
<span style="color: #007800;">CONTACTSPACINGH</span>=<span style="color: #ff0000;">&quot;3&quot;</span>
<span style="color: #666666; font-style: italic;"># Vertical Spacing</span>
<span style="color: #007800;">CONTACTSPACINGV</span>=<span style="color: #ff0000;">&quot;3&quot;</span>
<span style="color: #666666; font-style: italic;"># Contact Sheet Directory</span>
<span style="color: #007800;">CONTACTDIR</span>=<span style="color: #ff0000;">&quot;contact&quot;</span>
<span style="color: #666666; font-style: italic;"># Contact Sheet Quality</span>
<span style="color: #007800;">CONTACTQUALITY</span>=<span style="color: #ff0000;">&quot;100&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################</span>
&nbsp;
&nbsp;
<span style="color: #007800;">CONTACTCOUNT</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CONTACTWIDTH</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">$CONTACTHEIGHT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">PIX</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">*</span>.jpg <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Processing <span style="color: #007800;">$PIX</span> Images&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Creating Thumbnails&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$THUMBDIR</span>
<span style="color: #007800;">CTR</span>=<span style="color: #000000;">0</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;0%&quot;</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.jpg; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$((100 * $CTR / $PIX)</span>)%&quot;</span>
    convert <span style="color: #660033;">-strip</span> <span style="color: #660033;">-quality</span> <span style="color: #800000;">${THUMBQUALITY}</span> -<span style="color: #800000;">${METHOD}</span> <span style="color: #800000;">${THUMBSIZE}</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${THUMBDIR}</span>/<span style="color: #007800;">${i}</span>&quot;</span>
    <span style="color: #007800;">CTR</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CTR</span> + <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;100%&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Creating Contact Sheets&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$CONTACTDIR</span>
<span style="color: #007800;">CTR</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">PAGES</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PIX</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;">$CONTACTCOUNT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PIX</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #007800;">$CONTACTCOUNT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">PAGES</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PAGES</span> + <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">PAGE</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${THUMBDIR}</span><span style="color: #000000; font-weight: bold;">/*</span>.jpg; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CTR</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #007800;">$CONTACTCOUNT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CTR</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PAGE</span> of <span style="color: #007800;">$PAGES</span>&quot;</span>
        montage <span style="color: #660033;">-label</span> <span style="color: #000000; font-weight: bold;">%</span>f <span style="color: #660033;">-quality</span> <span style="color: #007800;">$CONTACTQUALITY</span> <span style="color: #660033;">-frame</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-tile</span> <span style="color: #800000;">${CONTACTWIDTH}</span>x<span style="color: #800000;">${CONTACTHEIGHT}</span> <span style="color: #660033;">-geometry</span> <span style="color: #800000;">${CONTACTSIZE}</span>+<span style="color: #800000;">${CONTACTSPACINGH}</span>+<span style="color: #800000;">${CONTACTSPACINGV}</span> <span style="color: #007800;">$LIST</span> jpg:- <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${CONTACTDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PAGE}</span>.jpg
        <span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;&quot;</span>
        <span style="color: #007800;">PAGE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PAGE</span> + <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$LIST</span> <span style="color: #007800;">$i</span>&quot;</span>
    <span style="color: #007800;">CTR</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CTR</span> + <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$LIST</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PAGE</span> of <span style="color: #007800;">$PAGES</span>&quot;</span>
    montage <span style="color: #660033;">-label</span> <span style="color: #000000; font-weight: bold;">%</span>f <span style="color: #660033;">-quality</span> <span style="color: #007800;">$CONTACTQUALITY</span> <span style="color: #660033;">-frame</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-tile</span> <span style="color: #800000;">${CONTACTWIDTH}</span>x<span style="color: #800000;">${CONTACTHEIGHT}</span> <span style="color: #660033;">-geometry</span> <span style="color: #800000;">${CONTACTSIZE}</span>+<span style="color: #800000;">${CONTACTSPACINGH}</span>+<span style="color: #800000;">${CONTACTSPACINGV}</span> <span style="color: #007800;">$LIST</span> jpg:- <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${CONTACTDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PAGE}</span>.jpg
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>



<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2007/11/30/howtos' rel='bookmark' title='Permanent Link: HowTo&#8217;s'>HowTo&#8217;s</a></li>
<li><a href='http://www.velvetcache.org/2007/11/03/recursive-word-count-with-bash' rel='bookmark' title='Permanent Link: Recursive Word Count With Bash'>Recursive Word Count With Bash</a></li>
<li><a href='http://www.velvetcache.org/2008/11/12/move-subversion-repository-without-svnadmin' rel='bookmark' title='Permanent Link: Move Subversion repository without svnadmin'>Move Subversion repository without svnadmin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gmail Attachment Gets Stuck Scanning For Virus</title>
		<link>http://www.velvetcache.org/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus</link>
		<comments>http://www.velvetcache.org/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus#comments</comments>
		<pubDate>Fri, 26 Dec 2008 23:06:09 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/?p=328</guid>
		<description><![CDATA[I&#8217;ve been having trouble with Gmail for my domain getting stuck scanning for viruses on my attachments, which means I can&#8217;t download them, which is annoying. I got fed up with waiting for Gmail, so I just got them through the old fashioned means. Here&#8217;s how&#8230; Attachment is stuck&#8230; View the original message&#8230; What that [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2006/10/12/yahoo-mail-beta' rel='bookmark' title='Permanent Link: Yahoo! Mail Beta'>Yahoo! Mail Beta</a></li>
<li><a href='http://www.velvetcache.org/2007/03/17/ouruno-mod_rewrite' rel='bookmark' title='Permanent Link: OurUNO &#038; mod_rewrite'>OurUNO &#038; mod_rewrite</a></li>
<li><a href='http://www.velvetcache.org/2007/06/04/m4a2mp3' rel='bookmark' title='Permanent Link: m4a2mp3'>m4a2mp3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having trouble with Gmail for my domain getting stuck scanning for viruses on my attachments, which means I can&#8217;t download them, which is annoying.</p>
<p>I got fed up with waiting for Gmail, so I just got them through the old fashioned means.</p>
<p>Here&#8217;s how&#8230;</p>
<p><img src="http://static.velvetcache.org/pages/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus/fail1.png" /><br/><b>Attachment is stuck&#8230;</b></p>
<p><img src="http://static.velvetcache.org/pages/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus/fail3.png" /><br/><b>View the original message&#8230;</b></p>
<p><a href="http://static.velvetcache.org/pages/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus/fail4.png" rel="lightbox[328]"><img src="http://static.velvetcache.org/pages/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus/fail4_sm.png" border="0"/></a><br/><b>What that looks like (click image for bigger view)</b></p>
<p><a href="http://static.velvetcache.org/pages/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus/fail5.png" rel="lightbox[328]"><img src="http://static.velvetcache.org/pages/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus/fail5_sm.png" border="0" style="width: 500px;" /></a><br/>Find the base64 encoded contents of your attachment (click image for bigger view)</p>
<p>Then you just copy and paste that into a file and run it through <tt>base64</tt>, a la <tt>$ base64 -d getImage.raw > getImage.php</tt></p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2006/10/12/yahoo-mail-beta' rel='bookmark' title='Permanent Link: Yahoo! Mail Beta'>Yahoo! Mail Beta</a></li>
<li><a href='http://www.velvetcache.org/2007/03/17/ouruno-mod_rewrite' rel='bookmark' title='Permanent Link: OurUNO &#038; mod_rewrite'>OurUNO &#038; mod_rewrite</a></li>
<li><a href='http://www.velvetcache.org/2007/06/04/m4a2mp3' rel='bookmark' title='Permanent Link: m4a2mp3'>m4a2mp3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2008/12/26/gmail-attachment-gets-stuck-scanning-for-virus/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Encrypted Laptop</title>
		<link>http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop</link>
		<comments>http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop#comments</comments>
		<pubDate>Fri, 25 Jan 2008 05:22:40 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop/</guid>
		<description><![CDATA[This post will (try to) explain how to set up a working system of hard drive encryption on a Debian system, in this case sidux. I&#8217;m going to outline the specific course of action I took to set up my own laptop, but will try to provide generic enough instructions alongside that to help the [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2006/09/25/linux-and-western-digital' rel='bookmark' title='Permanent Link: Linux And Western Digital'>Linux And Western Digital</a></li>
<li><a href='http://www.velvetcache.org/2008/01/16/submitting-assignments-in-blackboard-with-linux' rel='bookmark' title='Permanent Link: Submitting Assignments In Blackboard With Linux'>Submitting Assignments In Blackboard With Linux</a></li>
<li><a href='http://www.velvetcache.org/2007/03/18/digipro-tablet-and-linux' rel='bookmark' title='Permanent Link: DigiPro Tablet And Linux'>DigiPro Tablet And Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>
This post will (try to) explain how to set up a working system of hard drive encryption on a Debian system, in this case <a href="http://www.sidux.com/">sidux</a>.  I&#8217;m going to outline the specific course of action I took to set up my own laptop, but will try to provide generic enough instructions alongside that to help the reader adapt it for themselves.  Please excuse the wild tense changing and poor overall writing style, I&#8217;m not that good at this stuff.
</p>
<p>
This post <u>is not</u> aimed at the novice Linux user.  I&#8217;m not going to hold your hand, so be comfortable with the command line and competent enough to get your system back if you screw up along the way.  Also, <u>do not</u> skip the backup step!  Finally, this is (obviously) not a wholly original and independent work, I owe a great deal to the sources I&#8217;ve listed at the bottom.  Enjoy!
</p>
<p>
<b>The Context</b><br/>I run Linux on my laptop and I want to encrypt the important parts of my hard drive because there is a lot of my personal life on there.  Most specifically I&#8217;m interested in my passwords, many of which I store in <span style="text-decoration: line-through;">firefox</span> Iceweasel for convenience, and my financial data which is in the form of KMyMoney files and pdf receipts.
</p>
<p>
Here&#8217;s the layout of my disk, and yes I know I have outrageous sizes on some of these partitions, I just like to have breathing room. Please see <a href="#sources"><sup>[1]</sup></a> for a good guide to partitioning.</p>
<table>
<tr>
<td>/dev/sda1</td>
<td>ntfs</td>
<td>/windows</td>
<td>40.00 GB</td>
</tr>
<tr>
<td>/dev/sda2</td>
<td>ext3</td>
<td>/</td>
<td>15.00 GB</td>
</tr>
<tr>
<td>/dev/sda3</td>
<td>EXTENDED</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda6</td>
<td>swap</td>
<td></td>
<td>509.81 MB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda7</td>
<td>ext3</td>
<td>/tmp</td>
<td>1.00 GB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda8</td>
<td>ext3</td>
<td>/var</td>
<td>5.00 GB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda9</td>
<td>ext3</td>
<td>/home</td>
<td>39.51GB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda5</td>
<td>fat32</td>
<td>/winshare</td>
<td>9.98 GB</td>
</tr>
<tr>
<td>/dev/sda4</td>
<td>ext3</td>
<td>/data</td>
<td>121.88 GB</td>
</tr>
</table>
<p>
What we need to encrypt on there are: /home, /tmp, /data and /swap.  I&#8217;ll be treating the /windows and the /winshare as dirty and never let anything important touch those partitions, I rarely boot into XP for anything but school work anyway.
</p>
<p>
<b>The Tools</b><br/>You&#8217;ll need a very few pieces of software, and possibly a piece of hardware.  For the software side you just need &#8220;<tt>cryptsetup</tt>&#8221; and possibly a partitioning tool if you want to change your layout.  You&#8217;ll also be needing some spare hard drive space to hold your existing data if you have any.  I used an 80 GB external drive I had on hand.
</p>
<p>
<b>Backup</b><br/>I&#8217;m using an existing system as my base, so I have to copy off my /home and /data partitions.  Once we are backed up, it&#8217;s important to write down somewhere the /dev names of the file system.  I made a little table, like the one above, by using gparted.
</p>
<p>
<b>Unmounting</b><br/>Now I&#8217;m going to go down to run level 3.  This is just to minimize noise on the system.  We need to unmount /home, /data and /tmp.  When unmounting file systems, you might get something like the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;">root@asuka:/home/jmhobbs# umount /tmp
umount: /tmp: device is busy
umount: /tmp: device is busy
root@asuka:/home/jmhobbs#</pre></div></div>

<p>This just tells us there is an open file descriptor on /tmp, we can see who has it with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>asuka:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>jmhobbs<span style="color: #666666; font-style: italic;"># lsof | grep /tmp</span>
COMMAND    PID    USER   FD   TYPE     DEVICE SIZE   NODE NAME
atievents <span style="color: #000000;">3037</span>    root    4r   DIR      <span style="color: #000000;">254</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">4096</span>  <span style="color: #000000;">29249</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>.X11-unix
kdeinit   <span style="color: #000000;">5418</span> jmhobbs    8u  unix 0xf31fc000       <span style="color: #000000;">11568</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ksocket-jmhobbs<span style="color: #000000; font-weight: bold;">/</span>kdeinit-
gconfd-<span style="color: #000000;">2</span>  <span style="color: #000000;">6127</span> jmhobbs   11wW  REG      <span style="color: #000000;">254</span>,<span style="color: #000000;">2</span>  <span style="color: #000000;">625</span> <span style="color: #000000;">102371</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>gconfd-jmhobbs<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>0t1201112611ut204480u1000p6127r1358695165k3219666472 <span style="color: #7a0874; font-weight: bold;">&#40;</span>deleted<span style="color: #7a0874; font-weight: bold;">&#41;</span>
konqueror <span style="color: #000000;">6627</span> jmhobbs   12u   REG      <span style="color: #000000;">254</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">1270</span>  <span style="color: #000000;">58498</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>kde-jmhobbs<span style="color: #000000; font-weight: bold;">/</span>konqueror-crash-y2tzca.log
root<span style="color: #000000; font-weight: bold;">@</span>asuka:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>jmhobbs<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>Now in the above example it is obvious that I did not go down to run level 3, X11 and kde are still running.  So just weed out the open files and then unmount them when there are none left.
</p>
<p>
<b>Encrypting</b><br/>This is where that /dev table you made earlier (you did make it right?) comes in handy.    Be sure that you are backed up, because this is the point of no return.  Setting up an encrypted partition is dead simple.  As root you&#8217;ll want to run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cryptsetup <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--verify-passphrase</span> luksFormat <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda9</pre></div></div>

<p>Where /dev/sda9 is your /home partition.  I encourage you to go read the man pages for cryptsetup <a href="#sources"><sup>[2]</sup></a>.  I just went with the values on a post I found <a href="#sources"><sup>[3]</sup></a>.
</p>
<p>
Now we need to open and format that, so we use cryptsetup to open it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cryptsetup luksOpen <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda9 chome</pre></div></div>

<p>This is going to create a mapper device called &#8220;chome&#8221; in /dev/mapper/chome.  You don&#8217;t need to call it chome, I just do it to keep track of whats what.
</p>
<p>
Now to format it we need to do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkfs.ext3 <span style="color: #660033;">-j</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-O</span> dir_index,filetype,sparse_super <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>chome</pre></div></div>

<p>The file system really doesn&#8217;t matter, you can use ext2, reiserfs, whatever your heart desires.  Once you&#8217;ve done that, you&#8217;ll want to close it again.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cryptsetup luksClose chome</pre></div></div>

</p>
<p>
We need to repeat that process for /data, but since it&#8217;s essentially the same procedure I&#8217;m not going to run through it here.
</p>
<p>
The /tmp partition is a different story.  You&#8217;ve got an existing file system on there that we need to blow away.  The first way that came into my head was to use <tt>dd</tt> to copy zeros over it, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda7</pre></div></div>

<p>That&#8217;ll probably take a while and not report in.  You can force it to give you a status by stopping it, sending it a <tt>USR1</tt> signal then restarting it.  Not really a big deal though, I just waited it out.
</p>
<p>
It also might be wise to increase the block size on that, and you might not have to do the whole thing either.  Again, refer to the man pages <a href="#sources"><sup>[4]</sup></a> if it concerns you.
</p>
<p>
<b>Set Up crypttab And fstab</b><br/>We now need to update our fstab and the crypt equivalent, crypttab.  This is going to vary for everyone, but there are a few key things to note.  Let&#8217;s look at crypttab first.  Here&#8217;s mine, and I&#8217;ll walk you through it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># &lt;target name&gt; &lt;source device&gt;         &lt;key file&gt;      &lt;options&gt;</span>
chome   <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda9                       none luks
cdata    <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>                               none luks
cswap   <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6       <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>random     swap
ctmp    <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda7       <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>random     tmp</pre></div></div>

</p>
<p>
So the major things here are the target, which is what the device will be called in /dev/mapper.  I picked the easy to associate: chome,cdata, cswap, and ctmp.  Next is the source device, which are the partitions we messed with earlier.  The key file is set to /dev/random on cswap and ctmp because those are going to be one time file systems, and the key should just be random garbage.
</p>
<p>
Finally we get to options.  chome and cdata have &#8220;none&#8221; in there.  This is just saying &#8220;prompt us for the password&#8221;.  You could put the password in there and it would happily take care of it for you, but that seems like a stupid thing to do to me.  The &#8220;luks&#8221; just tells it to use the luks extensions.  cswap and ctmp both use special options.  The swap and tmp options basically say &#8220;reformat this then encrypt it&#8221;. They are reformatted on boot to linux-swap and ext2 file systems, respectively.  For more information check out the, you guessed it, man page <a href="#sources"><sup>[5]</sup></a>.
</p>
<p>
Now that we&#8217;ve got the crypttab set up we need to modify out fstab.  Again, I&#8217;ll show you the relevant parts of mine, and walk you through.  It&#8217;s pretty simple though.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/fstab - static information about the filesystems - fstab(5)</span>
<span style="color: #666666; font-style: italic;"># &lt;filesystem&gt;  &lt;mountpoint&gt;    &lt;type&gt;          &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part2, /dev/sda2</span>
<span style="color: #007800;">UUID</span>=60a14eae-a8c7-4ecb-a222-79a0e97fd73e       <span style="color: #000000; font-weight: bold;">/</span>       ext3    defaults,noatime,<span style="color: #007800;">errors</span>=remount-ro      <span style="color: #000000;">0</span>       <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part7, /dev/sda7</span>
<span style="color: #666666; font-style: italic;">#UUID=0da43c8e-2a64-4f45-b967-91504b4aa167      /tmp    ext3    defaults,noatime        0       2</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>ctmp                                <span style="color: #000000; font-weight: bold;">/</span>tmp    ext2    defaults,noatime        <span style="color: #000000;">0</span>       <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part9, /dev/sda9</span>
<span style="color: #666666; font-style: italic;">#UUID=3ee7225e-f04a-4d96-b28d-e867ed38a73c      /home   ext3    defaults,noatime        0       2</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>chome                               <span style="color: #000000; font-weight: bold;">/</span>home   ext3    defaults,noatime        <span style="color: #000000;">0</span>       <span style="color: #000000;">2</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part4, /dev/sda4, LABEL=\x2fdata</span>
<span style="color: #666666; font-style: italic;">#UUID=e3e9105b-1820-4edc-a660-7d569bc61900       /data   ext3    auto,users,exec,noatime 0       2</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>cdata                               <span style="color: #000000; font-weight: bold;">/</span>data   ext3    defaults,noatime        <span style="color: #000000;">0</span>       <span style="color: #000000;">2</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part6, /dev/sda6</span>
<span style="color: #666666; font-style: italic;">#UUID=21ac314b-704b-4675-bf5e-769745b46f7a      none    swap    sw      0       0</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>cswap                               none    swap    sw      <span style="color: #000000;">0</span>       <span style="color: #000000;">0</span></pre></div></div>

</p>
<p>
Okay, so, the basic idea is that we find the old /tmp, /home, /data and swap entries, and replace them with the mapped ones.  One important item here is that you&#8217;ll want to set that last digit to a <b>0</b> on /tmp.  This is what says &#8220;Hey, fsck me!&#8221; at boot time, and we don&#8217;t want to bother with a checking a brand new file system, right?
</p>
<p>
<b>cryptdisks And cryptdisks-early</b><br/>These two are the init scripts for starting up your disks.  They should be in /etc/init.d, which on my system just lead to /lib/cryptsetup/cryptdisks.functions.  I tried using bum to add them, but I wasn&#8217;t getting them to run before the mounting took place.  I poked around on the sidux forums and found a post <a href="#sources"><sup>[6]</sup></a> (in German) that had another way of adding them.  I don&#8217;t know if this is a Debian issue or not, but the following worked for me, as root.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">update-rc.d <span style="color: #660033;">-f</span> cryptdisks-early remove
update-rc.d <span style="color: #660033;">-f</span> cryptdisks remove
update-rc.d cryptdisks-early start <span style="color: #000000;">26</span> S . start <span style="color: #000000;">59</span> <span style="color: #000000;">0</span> <span style="color: #000000;">6</span> .
update-rc.d cryptdisks start <span style="color: #000000;">28</span> S . start <span style="color: #000000;">48</span> <span style="color: #000000;">0</span> <span style="color: #000000;">6</span> .</pre></div></div>

</p>
<p>
<b>Reboot</b><br/>Now you should be able to just reboot and be good to go.  I&#8217;m not 100% on this guide as I made it after the fact, so I may have spaced off some small things.  If I did, they should be very, very minor and shouldn&#8217;t cause any problems.  Please do leave comments if you have an issue, I&#8217;d like to correct any errors I may have made.  There are some additional sources below, please read up if you have the time.  Good luck!
</p>
<p>
<a name="sources"></a><br />
<b>Sources</b></p>
<style type="text/css">
ol li {
  list-style-type: decimal;
background: none;
margin: 0px;
padding: 0px;
}
</style>
<ol>
<li><a href="http://www.linuxsa.org.au/tips/disk-partitioning.html">Linux Tips &#8211; Disk Partitioning</a></li>
<li><a href="http://linux.die.net/man/8/cryptsetup">cryptsetup(8)</a></li>
<li><a href="http://www.fsckin.com/2008/01/15/howto-setup-and-benchmark-encrypted-partitions-in-ubuntu/">HowTo: Setup and Benchmark Encrypted Partitions in Ubuntu</a></li>
<li><a href="http://linux.die.net/man/1/dd">dd(1)</a></li>
<li><a href="http://linux.die.net/man/5/crypttab">crypttab(5)</a></li>
<li><a href="http://forums.sidux.com/PNphpBB2-viewtopic-t-8029-highlight-cryptdisksearly.html">Startskript &#8220;cryptdisks-early&#8221; wird zu spät ausgef</a></li>
<li><a href="http://www.enterprisenetworkingplanet.com/netsecur/article.php/3683011">Protect Your Stuff With Encrypted Linux Partitions</a> &#8211; <a href="http://www.enterprisenetworkingplanet.com/netsecur/article.php/3683996">(And Part 2)</li>
</ol>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2006/09/25/linux-and-western-digital' rel='bookmark' title='Permanent Link: Linux And Western Digital'>Linux And Western Digital</a></li>
<li><a href='http://www.velvetcache.org/2008/01/16/submitting-assignments-in-blackboard-with-linux' rel='bookmark' title='Permanent Link: Submitting Assignments In Blackboard With Linux'>Submitting Assignments In Blackboard With Linux</a></li>
<li><a href='http://www.velvetcache.org/2007/03/18/digipro-tablet-and-linux' rel='bookmark' title='Permanent Link: DigiPro Tablet And Linux'>DigiPro Tablet And Linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Command Line Package Installation in OpenSuSE</title>
		<link>http://www.velvetcache.org/2007/10/01/command-line-package-installation-in-opensuse</link>
		<comments>http://www.velvetcache.org/2007/10/01/command-line-package-installation-in-opensuse#comments</comments>
		<pubDate>Mon, 01 Oct 2007 21:51:40 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2007/10/01/command-line-package-installation-in-opensuse/</guid>
		<description><![CDATA[One of the things I love the most about Debian is apt. It&#8217;s a great and speedy package manager. Being able to apt-get install from the command line and not have to wait for a heavy UI to come up is a major plus for me. Thats why I was frustrated with OpenSuSE, which we [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2007/08/01/bash-line-for-constant-monitoring' rel='bookmark' title='Permanent Link: Bash Line For Constant Monitoring'>Bash Line For Constant Monitoring</a></li>
<li><a href='http://www.velvetcache.org/2007/03/12/peguin-swap' rel='bookmark' title='Permanent Link: Peguin Swap'>Peguin Swap</a></li>
<li><a href='http://www.velvetcache.org/2009/05/21/mysql-ruby-on-debian-sidux' rel='bookmark' title='Permanent Link: MySQL &#038; Ruby on Debian (sidux)'>MySQL &#038; Ruby on Debian (sidux)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of the things I love the most about Debian is apt.  It&#8217;s a great and speedy package manager.  Being able to apt-get install from the command line and not have to wait for a heavy UI to come up is a major plus for me.  Thats why I was frustrated with OpenSuSE, which we use at work.</p>
<p>First thing first, I think that the OpenSuSE package system is a pig.  Yast is a pig. Zypper is a pig.  I did, however, find the fastest route to installing via the command line, which I&#8217;ll share here.</p>
<p>Unless you happen to know the <u>exact</u> name of the package you want to install, you&#8217;ll need to look it up.  The fastest way I&#8217;ve found is using <a href="http://benjiweber.co.uk:8080/webpin/" target="_blank">Webpin</a>, a nice online package searcher.  Be careful that you are reading from the right repo though.  For example, a search on &#8220;magick++&#8221; returns many packages, including &#8220;libMagick++-devel (6.3.5.10)&#8221;  which, to my Debian eye, looks like the perfect package.  It is from an odd repo though, &#8220;Results from http://download.opensuse.org/repositories/home:/dipe/openSUSE_10.2&#8243; and the one I really want, and have access to mind you, is &#8220;ImageMagick-Magick++-devel (6.3.0.0)&#8221; which is in the main repo &#8220;Results from http://download.opensuse.org/distribution/10.2/repo/oss/suse&#8221;.  It&#8217;s already too complicated, but we soldier on.</p>
<p>With my new, exact, package name in hand, I open up a root command line.  The syntax for a zypper install is <tt>zypper install [package name]</tt> so I do <tt>zypper install ImageMagick-Magick++-devel</tt> and let it rip.  After a ridiculous amount of parsing, it figures out the dependencies and asks me to continue, which I do.  You have to babysit it for key managing, I havent figured out how to force &#8220;yes&#8221; on it. And that is how you use zypper to install on OpenSuSE.</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root:~$ zypper <span style="color: #c20cb9; font-weight: bold;">install</span> ImageMagick-Magick++-devel
&nbsp;
Restoring system sources...
&nbsp;
Parsing metadata <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;">20070918</span>-142944...
&nbsp;
Parsing metadata <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;">20070927</span>-100843...
&nbsp;
Parsing metadata <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;">20070927</span>-100709...
&nbsp;
Parsing metadata <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;">20070918</span>-055437...
&nbsp;
Parsing metadata <span style="color: #000000; font-weight: bold;">for</span> SUSE-Linux-<span style="color: #000000;">10.2</span>-Updates...
&nbsp;
Parsing RPM database...
&nbsp;
Summary:
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #7a0874; font-weight: bold;">&#91;</span>S3:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libxml2-devel-2.6.26-27.pm.1.i586
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>liblcms-devel-<span style="color: #000000;">1.15</span>-30.i586
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libwmf-gnome-0.2.8.4-24.i586
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libwmf-devel-0.2.8.4-24.i586
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>readline-devel-<span style="color: #000000;">5.1</span>-55.i586
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #7a0874; font-weight: bold;">&#91;</span>S5:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>ImageMagick-Magick++-devel-6.3.0.0-27.6.i586
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #7a0874; font-weight: bold;">&#91;</span>S5:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>ImageMagick-devel-6.3.0.0-27.6.i586
&nbsp;
Continue? <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span> y
&nbsp;
Downloading: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>liblcms-devel-<span style="color: #000000;">1.15</span>-30.i586, <span style="color: #000000;">141.5</span> K<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">490.1</span> K unpacked<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
Installing: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>liblcms-devel-<span style="color: #000000;">1.15</span>-30.i586
&nbsp;
Downloading: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libwmf-gnome-0.2.8.4-24.i586, <span style="color: #000000;">7.7</span> K<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9.6</span> K unpacked<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
Installing: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libwmf-gnome-0.2.8.4-24.i586
&nbsp;
Downloading: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>readline-devel-<span style="color: #000000;">5.1</span>-55.i586, <span style="color: #000000;">137.2</span> K<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">376.7</span> K unpacked<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
Installing: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>readline-devel-<span style="color: #000000;">5.1</span>-55.i586
&nbsp;
Downloading: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libwmf-devel-0.2.8.4-24.i586, <span style="color: #000000;">414.1</span> K<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2.7</span> M unpacked<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
Installing: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S4:<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libwmf-devel-0.2.8.4-24.i586
&nbsp;
Downloading: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S3:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libxml2-devel-2.6.26-27.pm.1.i586, <span style="color: #000000;">2.5</span> M<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">11.6</span> M unpacked<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
Installing: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S3:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>libxml2-devel-2.6.26-27.pm.1.i586
&nbsp;
Downloading: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S5:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>ImageMagick-devel-6.3.0.0-27.6.i586, <span style="color: #000000;">1.5</span> M<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">5.6</span> M unpacked<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
Installing: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S5:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>ImageMagick-devel-6.3.0.0-27.6.i586
&nbsp;
Downloading: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S5:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>ImageMagick-Magick++-devel-6.3.0.0-27.6.i586, <span style="color: #000000;">193.2</span> K<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">939.8</span> K unpacked<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
Installing: <span style="color: #7a0874; font-weight: bold;">&#91;</span>S5:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>ImageMagick-Magick++-devel-6.3.0.0-27.6.i586
&nbsp;
root:~$</pre></div></div>
</p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2007/08/01/bash-line-for-constant-monitoring' rel='bookmark' title='Permanent Link: Bash Line For Constant Monitoring'>Bash Line For Constant Monitoring</a></li>
<li><a href='http://www.velvetcache.org/2007/03/12/peguin-swap' rel='bookmark' title='Permanent Link: Peguin Swap'>Peguin Swap</a></li>
<li><a href='http://www.velvetcache.org/2009/05/21/mysql-ruby-on-debian-sidux' rel='bookmark' title='Permanent Link: MySQL &#038; Ruby on Debian (sidux)'>MySQL &#038; Ruby on Debian (sidux)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2007/10/01/command-line-package-installation-in-opensuse/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geek Joke</title>
		<link>http://www.velvetcache.org/2007/07/23/geek-joke</link>
		<comments>http://www.velvetcache.org/2007/07/23/geek-joke#comments</comments>
		<pubDate>Mon, 23 Jul 2007 18:51:52 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Funny]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2007/07/23/geek-joke/</guid>
		<description><![CDATA[What do geeky snakes use to connect to remote machines? (Highlight this line for answer) &#8216;Hiss-SH&#8217; (say it out loud if you don&#8217;t get it) No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>What do geeky snakes use to connect to remote machines?</p>
<p>(Highlight this line for answer) <span style="color: #FFF;">&#8216;Hiss-SH&#8217; (say it out loud if you don&#8217;t get it)</span></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2007/07/23/geek-joke/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>m4a2mp3</title>
		<link>http://www.velvetcache.org/2007/06/04/m4a2mp3</link>
		<comments>http://www.velvetcache.org/2007/06/04/m4a2mp3#comments</comments>
		<pubDate>Tue, 05 Jun 2007 02:56:47 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2007/06/04/m4a2mp3/</guid>
		<description><![CDATA[I had some m4a encoded files I wanted in mp3 (don&#8217;t judge me) so I cooked up a modified script from one found here, that does the trick. 1 2 3 4 5 6 7 8 9 10 11 12 #!/bin/bash # # m4a2mp3 # for i in *.m4a; do mplayer -vc null -vo null [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2008/03/18/any2mp3' rel='bookmark' title='Permanent Link: any2mp3'>any2mp3</a></li>
<li><a href='http://www.velvetcache.org/2007/11/30/howtos' rel='bookmark' title='Permanent Link: HowTo&#8217;s'>HowTo&#8217;s</a></li>
<li><a href='http://www.velvetcache.org/2008/11/12/move-subversion-repository-without-svnadmin' rel='bookmark' title='Permanent Link: Move Subversion repository without svnadmin'>Move Subversion repository without svnadmin</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I had some m4a encoded files I wanted in mp3 (don&#8217;t judge me) so I cooked up a modified script from one found <a href="http://gimpel.gi.funpic.de/wiki/index.php?title=Howto:convert_aac/mp4_to_wav/mp3/ogg_on_Linux#aac.2Fm4a_to_mp3" target="_blank">here</a>, that does the trick.</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># m4a2mp3</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.m4a; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #c20cb9; font-weight: bold;">mplayer</span> <span style="color: #660033;">-vc</span> null <span style="color: #660033;">-vo</span> null <span style="color: #660033;">-ao</span> pcm:fast <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span> <span style="color: #660033;">-ao</span> pcm:<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">file</span></span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${i%.m4a}</span>.wav&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.wav; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #c20cb9; font-weight: bold;">lame</span> <span style="color: #660033;">-h</span> <span style="color: #660033;">-V2</span> <span style="color: #660033;">--vbr-new</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span> <span style="color: #ff0000;">&quot;$(i%.wav}.mp3&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">*</span>.wav</pre></td></tr></table></div>

</p>
<div class="update"><b>Update (06/19/07)</b><br/>Just a quick note, you can use this to convert any supported audio file by replacing all the <tt>m4a</tt> with the correct extension.  E.G. For flac replace <tt>m4a</tt> with <tt>fla</tt>.  A nice little vim command for that would be <tt>:%s/m4a/fla/g</tt></div>
<div class="update"><b>Update (03/18/08)</b><br/>I posted a version to go from anything (that mplayer can play) to mp3 without editing the script.  Check it out <a href="http://www.velvetcache.org/2008/03/18/any2mp3">here</a>.</div>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2008/03/18/any2mp3' rel='bookmark' title='Permanent Link: any2mp3'>any2mp3</a></li>
<li><a href='http://www.velvetcache.org/2007/11/30/howtos' rel='bookmark' title='Permanent Link: HowTo&#8217;s'>HowTo&#8217;s</a></li>
<li><a href='http://www.velvetcache.org/2008/11/12/move-subversion-repository-without-svnadmin' rel='bookmark' title='Permanent Link: Move Subversion repository without svnadmin'>Move Subversion repository without svnadmin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2007/06/04/m4a2mp3/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
