<?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>Jason L. Froebe - Tech tips and How Tos for Fellow Techies &#187; Linux</title>
	<atom:link href="http://froebe.net/blog/index.php/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://froebe.net/blog</link>
	<description>Tips &#38; Tricks for Databases (Sybase, Oracle, MySQL, PostgreSQL, SQLite), Windows, Linux, Solaris, Perl, Java, Bash and so much much more</description>
	<lastBuildDate>Sat, 07 Jan 2012 22:12:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Wanted:  Technical Support Analyst &#8211; WebSphere Linux SQL (2 positions available)</title>
		<link>http://froebe.net/blog/2011/11/28/wanted-technical-support-analyst-websphere-linux-sql/</link>
		<comments>http://froebe.net/blog/2011/11/28/wanted-technical-support-analyst-websphere-linux-sql/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 17:29:44 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[analyst]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[tse]]></category>
		<category><![CDATA[websphere]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1354</guid>
		<description><![CDATA[Position Responsibilities POSITION OVERVIEW The Technical Support Analyst for SunGard InvestOne&#8217;s global clients will be responsible for hands-on technical troubleshooting and support across a variety of platforms for a broad customer client base. This position is part of a global team with local responsibilities from 8am to 8pm. The Analyst will be responsible for Tier [...]]]></description>
			<content:encoded><![CDATA[<p>Position Responsibilities </p>
<p>POSITION OVERVIEW</p>
<p>The Technical Support Analyst for SunGard InvestOne&#8217;s global clients will be responsible for hands-on technical troubleshooting and support across a variety of platforms for a broad customer client base.  This position is part of a global team with local responsibilities from 8am to 8pm.</p>
<p>The Analyst will be responsible for Tier 1 level support, which includes break/fix management and communications to internal stake holders regarding status and problem tracking.  </p>
<p>He/She will also be responsible for performance, availability and customer satisfaction for all levels of a series of n-tier distributed web based applications.</p>
<p>PRIMARY RESPONSIBILITIES</p>
<p>•	Monitor error alerts from various systems<br />
•	Document incidents as warranted<br />
•	Answer client questions relating to technical aspects of the application<br />
•	Adhere to change control policies<br />
•	Responsible for first level technical system support for multiple customers along with implementation of network connectivity for new and existing customers<br />
•	Position is 80% technical and 20% project/customer management<br />
•	Participation on an on-call rotation is required<br />
•	Occasional weekend work is required</p>
<p>Position Requirements </p>
<p>•	Bachelor’s degree, preferably in an IT-related discipline, or the equivalent of education and experience<br />
•	Minimum of five years of related, technical experience, preferably in the financial systems industry<br />
•	Experience with troubleshooting, diagnosis and resolution of complex technical issues as well as escalation for complex web based applications<br />
•	Knowledge of Windows and Linux administration<br />
•	Knowledge of WebSphere<br />
•	Experience with Transact SQL, preferably Sybase<br />
•	Excellent communications skills and ability to translate technical concepts<br />
•	Excellent interpersonal, analytical, business and technical judgment, negotiation, problem solving, verbal and written communication skills<br />
•	Critical thinking skills and a mature approach to troubleshooting is critical<br />
•	Knowledge of investment accounting principles is a big plus<br />
•	Previous experience as Java developer is desired<br />
•	ITIL certification is desired but not required</p>
<p>Interested? (say I referred you on the <a href="http://careers.peopleclick.com/careerscp/client_sungard/external/jobDetails.do?functionName=getJobDetail&#038;jobPostId=25845&#038;localeCode=en-us">application form</a>) or <a href="http://careers.peopleclick.com/careerscp/client_sungard/external/jobDetails.do?functionName=getJobDetail&#038;jobPostId=25841&#038;localeCode=en-us">this one</a></p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2011/11/28/wanted-technical-support-analyst-websphere-linux-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Libvirt/KVM best practices</title>
		<link>http://froebe.net/blog/2011/11/28/libvirtkvm-best-practices/</link>
		<comments>http://froebe.net/blog/2011/11/28/libvirtkvm-best-practices/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 17:11:15 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[libvirt / KVM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[libvirt]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1346</guid>
		<description><![CDATA[For those of you that are thinking about using using libvirt/kvm on Linux&#8230; here is a discussion on proposed best practices]]></description>
			<content:encoded><![CDATA[<p>For those of you that are thinking about using using libvirt/kvm on Linux&#8230; here is a discussion on <a href="http://dag.wieers.com/blog/kvm-and-libvirt-best-practices">proposed best practices</a>  </p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2011/11/28/libvirtkvm-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a permission denied for your home directory while logging in but you can cd to it no problem?</title>
		<link>http://froebe.net/blog/2011/11/28/getting-a-permission-denied-for-your-home-directory-while-logging-in-but-you-can-cd-to-it-no-problem/</link>
		<comments>http://froebe.net/blog/2011/11/28/getting-a-permission-denied-for-your-home-directory-while-logging-in-but-you-can-cd-to-it-no-problem/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 16:15:00 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[restorecon]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1326</guid>
		<description><![CDATA[It is likely SELinux trying to keep you safe.  Just run: $ restorecon /home It will correct the SELinux flags on the /home directory.]]></description>
			<content:encoded><![CDATA[<p>It is likely SELinux trying to keep you safe.  Just run:</p>
<pre lang='bash'>$ restorecon /home</pre>
<p>It will correct the SELinux flags on the /home directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2011/11/28/getting-a-permission-denied-for-your-home-directory-while-logging-in-but-you-can-cd-to-it-no-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparing Linux huge memory pages &amp; Kernel Samepage Merging for KVM virtualization</title>
		<link>http://froebe.net/blog/2011/04/07/comparing-linux-huge-memory-pages-kernel-samepage-merging-for-kvm-virtualization/</link>
		<comments>http://froebe.net/blog/2011/04/07/comparing-linux-huge-memory-pages-kernel-samepage-merging-for-kvm-virtualization/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 20:59:28 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Proxmox VE]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[huge pages]]></category>
		<category><![CDATA[Kernel Samepage Merging]]></category>
		<category><![CDATA[ksm]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[proxmox]]></category>
		<category><![CDATA[proxmox ve]]></category>
		<category><![CDATA[qemu]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1318</guid>
		<description><![CDATA[A quick test (so take it with a grain of salt): Huge pages is slightly faster than not using huge pages (~10% with 4 winxp virtual machines copying 512MB from one memory location to another). KSM is slightly slower then not using KSM (~5% with 4 winxp virtual machines copying 512MB from one memory location [...]]]></description>
			<content:encoded><![CDATA[<p>A quick test (so take it with a grain of salt):</p>
<ol>
<li> <a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaat/liaattunconfighp.htm">Huge pages</a> is slightly faster than not using huge pages (~10% with 4  winxp virtual machines copying 512MB from one memory location to  another).</li>
<li><a href="http://pve.proxmox.com/wiki/KSM">KSM</a> is slightly slower then not using KSM (~5% with 4 winxp virtual  machines copying 512MB from one memory location to another).</li>
</ol>
<p>So, at first glance it would appear that we can use a loose rule of thumb:</p>
<ol>
<li>to consolidate the maximum number of machines, use KSM as it will allow you to over commit the amount of memory on your box.
<ol>
<li>Risk:  if the memory pages are significantly different, you may  start swapping in a very bad way.  This is where monitoring comes in</li>
</ol>
</li>
<li>to give the best performance to a number of machines, use huge memory pages.. does not allow you to over commit
<ol>
<li>Risk:  if you don&#8217;t leave enough memory for the host os, you can crash your machine.  This is also where monitoring comes in</li>
</ol>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2011/04/07/comparing-linux-huge-memory-pages-kernel-samepage-merging-for-kvm-virtualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxmox VE 1.8 and KVM:  Adding sound to your virtual machines!</title>
		<link>http://froebe.net/blog/2011/04/07/proxmox-ve-1-8-and-kvm-adding-sound-to-your-virtual-machines/</link>
		<comments>http://froebe.net/blog/2011/04/07/proxmox-ve-1-8-and-kvm-adding-sound-to-your-virtual-machines/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 19:14:06 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Proxmox VE]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[proxmox]]></category>
		<category><![CDATA[proxmox ve]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[win vista]]></category>
		<category><![CDATA[win7]]></category>
		<category><![CDATA[winxp]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1315</guid>
		<description><![CDATA[This assumes that your host machine has a sound card! Add the args line in your /etc/qemu-server/&#60;vm id&#62;.conf file should give you sound: args: -soundhw On my Proxmox VE 1.8, I have several virtual audio devices available.   I&#8217;ve had the best luck with ac97 with Windows XP/Vista and Win7. red:/etc/qemu-server# kvm -soundhw &#8216;?&#8217; Valid sound [...]]]></description>
			<content:encoded><![CDATA[<p>This assumes that your host machine has a sound card! <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Add the args line in your /etc/qemu-server/&lt;vm id&gt;.conf file should give you sound:</p>
<blockquote><p>args: -soundhw</p></blockquote>
<p>On my Proxmox VE 1.8, I have several virtual audio devices available.   I&#8217;ve had the best luck with ac97 with Windows XP/Vista and Win7.</p>
<blockquote><p>red:/etc/qemu-server# kvm -soundhw &#8216;?&#8217;<br />
Valid sound card names (comma separated):<br />
pcspk       PC speaker<br />
sb16        Creative Sound Blaster 16<br />
ac97        Intel 82801AA AC97 Audio<br />
es1370      ENSONIQ AudioPCI ES1370<br />
hda         Intel HD Audio</p>
<p>-soundhw all will enable all of the above</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2011/04/07/proxmox-ve-1-8-and-kvm-adding-sound-to-your-virtual-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install PostgreSQL 9 on Ubuntu Linux 10.04/10.10</title>
		<link>http://froebe.net/blog/2010/12/18/how-to-install-postgresql-9-on-ubuntu-linux-10-0410-10/</link>
		<comments>http://froebe.net/blog/2010/12/18/how-to-install-postgresql-9-on-ubuntu-linux-10-0410-10/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 15:59:32 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[DBMS]]></category>
		<category><![CDATA[Dctr Watson]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1298</guid>
		<description><![CDATA[Very easy, just add a repository and run apt-get install postresql-9.0 Dctr Watson explains how: Installing PostgreSQL 9.0 on Ubuntu 10.04]]></description>
			<content:encoded><![CDATA[<p>Very easy, just add a repository and run apt-get install postresql-9.0 <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <a href="http://www.postgresql.org"><img class="alignright" title="PostgreSQL" src="http://www.postgresql.org/layout/images/hdr_left.png" alt="" width="230" height="80" /></a></p>
<p><a href="http://www.dctrwatson.com/">Dctr Watson</a> explains how:</p>
<h2><a href="http://www.dctrwatson.com/2010/09/installing-postgresql-9-0-on-ubuntu-10-04/">Installing PostgreSQL 9.0 on Ubuntu 10.04</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2010/12/18/how-to-install-postgresql-9-on-ubuntu-linux-10-0410-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Run multiple versions of Perl from your home directory</title>
		<link>http://froebe.net/blog/2010/11/22/run-multiple-versions-of-perl-from-your-home-directory/</link>
		<comments>http://froebe.net/blog/2010/11/22/run-multiple-versions-of-perl-from-your-home-directory/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 04:07:46 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Kang-min Liu]]></category>
		<category><![CDATA[perlbrew]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1288</guid>
		<description><![CDATA[Run multiple versions of Perl from your home directory using Perlbrew! One thing to know:  Perl won&#8217;t compile if you have an encrypted home directory. Bug has been fixed but not exactly how and it hasn&#8217;t been put into the Ubuntu updates yet. Thanks goes to Kang-min Liu for creating Perlbrew!!!! The recommended way to [...]]]></description>
			<content:encoded><![CDATA[<p>Run multiple versions of Perl from your home directory using <a href="http://search.cpan.org/dist/App-perlbrew/lib/App/perlbrew.pm">Perlbrew</a>!<a href="http://search.cpan.org/dist/App-perlbrew/lib/App/perlbrew.pm"><img class="alignright" title="Kang-min Liu" src="http://external.ak.fbcdn.net/safe_image.php?d=cbda410c3d38aac55ff886e3270f01c3&amp;w=90&amp;h=90&amp;url=http%3A%2F%2Fwww.gravatar.com%2Favatar.php%3Fgravatar_id%3Dae74261cb1cdcc52eb0d2b1cbaf06e25%26rating%3DG%26size%3D80%26default%3Dhttp%3A%2F%2Fst.pimg.net%2Ftucs%2Fimg%2Fwho.png" alt="" width="80" height="80" /></a></p>
<div id="id_4ceb3c83b6a110a34130872">One thing to know:  Perl  won&#8217;t compile if you have an encrypted home directory. <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Bug has been  fixed but not exactly how and it hasn&#8217;t been put into the Ubuntu updates  yet.</div>
<div>Thanks goes to Kang-min Liu for creating Perlbrew!!!! <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div>
<blockquote><p><em>The recommended way to install perlbrew is to run these statements in your shell:</em></p>
<div class="bash dean_ch">&nbsp; &nbsp; curl <span class="re5">-LO</span> http:<span class="sy0">//</span>xrl.us<span class="sy0">/</span>perlbrew<br />
&nbsp; &nbsp; <span class="kw2">chmod</span> +x perlbrew<br />
&nbsp; &nbsp; .<span class="sy0">/</span>perlbrew <span class="kw2">install</span></div>
<p><em>After that, <code>perlbrew</code> installs itself to <code>~/perl5/perlbrew/bin</code>, and you should follow the instruction on screen to setup your <code>.bashrc</code> or <code>.cshrc</code> to put it in your PATH.</em></p></blockquote>
</div>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2010/11/22/run-multiple-versions-of-perl-from-your-home-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>High overview of Cloud Computing with Ubuntu Eucalyptus Cloud (UEC) from Canonical</title>
		<link>http://froebe.net/blog/2010/06/22/high-overview-of-cloud-computing-with-ubuntu-eucalyptus-cloud-uec-from-canonical/</link>
		<comments>http://froebe.net/blog/2010/06/22/high-overview-of-cloud-computing-with-ubuntu-eucalyptus-cloud-uec-from-canonical/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 12:52:15 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[em]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1260</guid>
		<description><![CDATA[I installed Ubuntu Eucalyptus cloud (#UEC) on a couple of servers at home. I was naively expecting it to be similar to VMware. Oh I was wrong. UEC is the Eucalyptus &#8216;cloud&#8217; software running on Ubuntu servers. The instances would run under the KVM or Xen hypervisors. Ubuntu&#8217;s defaulted to running KVM but isn&#8217;t restricted [...]]]></description>
			<content:encoded><![CDATA[<p>I installed Ubuntu Eucalyptus cloud (#UEC) on a couple of servers at home.  I was naively expecting it to be similar to VMware.  Oh I was wrong.</p>
<p>UEC is the Eucalyptus &#8216;cloud&#8217; software running on Ubuntu servers.  The instances would run under the KVM or Xen hypervisors.  Ubuntu&#8217;s defaulted to running KVM but isn&#8217;t restricted by it.</p>
<p>&#8220;Eucalyptus  is a software available under GPL that helps in creating and managing a private or even a publicly accessible cloud. It provides an EC2 compatible cloud computing platform and S3 compatible cloud storage platform&#8230;&#8221;  <a href="http://cssoss.wordpress.com/2010/05/10/eucalyptus-beginner%E2%80%99s-guide-%E2%80%93-uec-edition-chapter-1-%E2%80%93-introduction-to-uec-and-its%C2%A0components/">Eucalyptus Beginner’s Guide</a></p>
<p>This is how a vm works in UEC:</p>
<p>You publish an image that you previously installed all the software you need (or you can download such an image).  There can be as many instances of this image running as the hardware supports (spread across N number of backend Node Servers).</p>
<p>All instances are transient.  As long as an image is running, it will have a physical presence.. but when it is shutdown, the instance is removed including any work performed in the instance.</p>
<p>&#8220;static&#8221; storage is available via a Storage Server.  After you create an image but before you start it, you have the opportunity to attach storage to the instance.</p>
<div class="wp-caption alignnone" style="width: 610px"><a href="http://cssoss.wordpress.com/2010/05/10/eucalyptus-beginner%E2%80%99s-guide-%E2%80%93-uec-edition-chapter-1-%E2%80%93-introduction-to-uec-and-its%C2%A0components/"><img src="http://cssoss.files.wordpress.com/2010/05/eucalyptus_cloud.png?w=600&amp;h=467" alt="" width="600" height="467" /></a><p class="wp-caption-text">Diagram courtesy of  Eucalyptus Beginner’s Guide – UEC edition</p></div>
<p>While the management tools for UEC, and therefore Amazon EC2/EM, are primitive compared to VMware, it should be able to scale much higher with far less focus on which &#8216;virtual machine&#8217; goes where.</p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2010/06/22/high-overview-of-cloud-computing-with-ubuntu-eucalyptus-cloud-uec-from-canonical/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VMware 2.0.2 running on Win2k3 -&gt; VMware ESX 4.0 .. done :)</title>
		<link>http://froebe.net/blog/2010/04/24/vmware-2-0-2-running-on-win2k3-vmware-esx-4-0-done/</link>
		<comments>http://froebe.net/blog/2010/04/24/vmware-2-0-2-running-on-win2k3-vmware-esx-4-0-done/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 17:37:58 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[ASE]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Sybase]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[shadow]]></category>
		<category><![CDATA[vmware server]]></category>
		<category><![CDATA[volume]]></category>
		<category><![CDATA[volume shadow service]]></category>
		<category><![CDATA[winscp]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1232</guid>
		<description><![CDATA[I was able to move a VMware Server 2.0 (v7) vm to VMware ESX..  it was a *live* copy where I performed a Windows Volume Shadow copy of the vm files.  Everything worked for the most part but because the database, Sybase ASE 15.0.3, was running when the shadow copy was made, we had corruption [...]]]></description>
			<content:encoded><![CDATA[<p>I was able to move<a href="http://www.vmware.com"><img class="alignright size-full wp-image-711" title="VMware" src="http://froebe.net/blog/wp-content/uploads/2008/09/vmware.png" alt="" width="267" height="112" /></a> a VMware Server 2.0 (v7) vm to VMware ESX..  it was a *live* copy where I performed a Windows Volume Shadow copy of the vm files.  Everything worked for the most part but because the database, Sybase ASE 15.0.3, was running when the shadow copy was made, we had corruption in one database.  Restore from backup and all is good.</p>
<p>Now we need to get an updated license file from Sybase as the NIC mac address has changed..   You can *not* use the mac address from the VMware Server on ESX.  grr.</p>
<p>Twenty hours for the volume shadow copy to complete plus another 12 hours to scp the files to the esx box (esx console access is sloooow).   Keep in mind that the host VMware Server box was rebooting itself randomly so I really couldn’t leave it alone.  Then 3 hours to convert/clone the vmdk files and 2 hours to correct the database&#8230;  I&#8217;m tired.</p>
<p>It turned out to be an issue with allocating 3.75GB to a VM that was causing the rebooting.  Dropping it to 2 GB resolved the rebooting&#8230; who knew?  Nothing in Google and VMware Support wasn&#8217;t able to find anything on their side.</p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2010/04/24/vmware-2-0-2-running-on-win2k3-vmware-esx-4-0-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: Installing VMware ESXi 4 on a 6 year old cheap motherboard</title>
		<link>http://froebe.net/blog/2010/02/15/how-to-installing-vmware-esxi-4-on-a-6-year-old-cheap-motherboard/</link>
		<comments>http://froebe.net/blog/2010/02/15/how-to-installing-vmware-esxi-4-on-a-6-year-old-cheap-motherboard/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 14:59:17 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[ahci]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[oem.tgz]]></category>
		<category><![CDATA[old motherboards]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unsupported]]></category>
		<category><![CDATA[vmware esxi]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1203</guid>
		<description><![CDATA[I&#8217;ve been trying to get VMware ESXi 4 on my old MSI MS-7388 motherboard for a long time. No matter what I tried, neither the SATA controller on the motherboard or the add on SATA controller would be recognized. Install VMware ESXi 4.0 on an unsupported motherboard (SATA controller must support AHCI): make sure the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to get <a href="http://www.vmware.com">VMware ESXi 4</a> on my old MSI MS-7388 motherboard for a long time. No matter what I tried, neither the SATA controller on the motherboard or the add on SATA controller would be recognized.</p>
<h3>Install VMware ESXi 4.0 on an unsupported motherboard (SATA controller must support AHCI):</h3>
<ol>
<li>make sure the SATA controller(s) is set to AHCI in the computer&#8217;s BIOS</li>
<li>download VMware ESXi 4 iso</li>
<li><strong>burn</strong> the iso to either a cdrom or a USB thumb drive (512mb minimum) using <a href="http://unetbootin.sourceforge.net/">unetbootin</a></li>
<li>boot the computer into VMware ESXi</li>
<li>Before you&#8217;re prompted to hit <strong>Enter</strong> to begin, hit ALT-F1 which will get you to a console screen without a prompt</li>
<li>Type <strong>&#8220;unsupported&#8221;</strong> followed by <strong>Enter</strong></li>
<li>When prompted for a password, just hit <strong>Enter</strong></li>
<li>Type <strong>&#8220;vmkload_mod ahci&#8221;</strong> followed by <strong>Enter</strong>.  This will load in the driver for just about any AHCI compliant SATA controller</li>
<li>Hit <strong>ALT-F2</strong> to finish the installation</li>
</ol>
<p>At this point VMware ESXi 4.0 will be installed but it won&#8217;t start when you reboot.  This is because VMware won&#8217;t load the AHCI driver by default.  So&#8230; we will have to tell it to load it automatically.  You will need a Linux Live CD such as <a href="http://www.ubuntu.com">Ubuntu</a>.</p>
<ol>
<li>Boot into Linux</li>
<li>From the desktop you will need to mount the VMware partitions.  In Ubuntu 8.04 and higher, you just need to click on the <em>folders</em> in the drop down menu</li>
<li>Locate oem.tgz on the second VMware partition and overwrite it with this <a href="http://www.froebe.net/attachments/oem.tgz">oem.tgz</a>.  It includes a system.map file telling VMware to load the AHCI driver</li>
<li>reboot and boot into VMware ESXi</li>
</ol>
<p>You should have a fully working VMware ESXi server installed and ready for you to setup virtual machines! <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2010/02/15/how-to-installing-vmware-esxi-4-on-a-6-year-old-cheap-motherboard/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Sun&#8217;s VirtualBox 3.1.x: Getting VRDP (remote desktop) to authenticate properly with Linux PAM</title>
		<link>http://froebe.net/blog/2010/01/22/suns-virtualbox-3-1-x-getting-vrdp-remote-desktop-to-authenticate-properly-with-linux-pam/</link>
		<comments>http://froebe.net/blog/2010/01/22/suns-virtualbox-3-1-x-getting-vrdp-remote-desktop-to-authenticate-properly-with-linux-pam/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 16:39:55 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[3.1.2]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[user_mod]]></category>
		<category><![CDATA[vbox]]></category>
		<category><![CDATA[vboxheadless]]></category>
		<category><![CDATA[vboxtool]]></category>
		<category><![CDATA[vrdp]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1193</guid>
		<description><![CDATA[I rebuilt an Ubuntu 9.10 server this past week, ripping off VMware and replacing it with VirtualBox 3.1.2. Setting up VirtualBox as a headless server was very easy with VBoxTool. However, I ran into a problem that I was unable to connect using remote desktop (rdesktop) as any user but the user that started the [...]]]></description>
			<content:encoded><![CDATA[<p>I rebuilt an Ubuntu 9.10 server this past week, ripping off <a href="http://www.vmware.com">VMware</a> and replacing it with <a href="http://www.virtualbox.org">VirtualBox 3.1.2</a>.  Setting up VirtualBox as a headless server was very easy with <a href="http://vboxtool.sourceforge.net/">VBoxTool</a>.  However, I ran into a problem that I was unable to connect using remote desktop (rdesktop) as any user but the user that started the virtual machine.  </p>
<div class="bash dean_ch">Jan <span class="nu0">21</span> <span class="nu0">22</span>:<span class="nu0">43</span>:<span class="nu0">13</span> vm-holder unix_chkpwd<span class="br0">&#91;</span><span class="nu0">16040</span><span class="br0">&#93;</span>: check pass; user unknown<br />
Jan <span class="nu0">21</span> <span class="nu0">22</span>:<span class="nu0">43</span>:<span class="nu0">13</span> vm-holder unix_chkpwd<span class="br0">&#91;</span><span class="nu0">16040</span><span class="br0">&#93;</span>: password check failed <span class="kw1">for</span> user <span class="br0">&#40;</span>jason<span class="br0">&#41;</span><br />
Jan <span class="nu0">21</span> <span class="nu0">22</span>:<span class="nu0">43</span>:<span class="nu0">13</span> vm-holder VBoxHeadless: pam_unix<span class="br0">&#40;</span>vrdpauth:auth<span class="br0">&#41;</span>: authentication failure; <span class="re2">logname</span>=virtualbox <span class="re2">uid</span>=<span class="nu0">1001</span> <span class="re2">euid</span>=<span class="nu0">1001</span> <span class="re2">tty</span>= <span class="re2">ruser</span>= <span class="re2">rhost</span>= &nbsp;<span class="re2">user</span>=jason</div>
<p>This is, currently, an undocumented security feature of VirtualBox 3.1x to prevent just anyone from accessing the virtual machine <i>console</i>.  For most folk, this might be a very good thing but if you have a team of sysadmins that should have access to the virtual machine consoles, you probably don&#8217;t want them to use the same login.</p>
<p>If that is the case, you can add the user(s) that should have access the virtual machine console to the <i>shadow</i> group on the host Linux machine.  Be warned though that the user(s) that are added to the shadow group should not be able to log into the host machine else they will be able to read the shadow file where all the passwords to the box are stored.  If the users need access to the host box, then they should have a login for host access (not part of the shadow group) and another for virtual machine console access.</p>
<p><strong>Adding linux user <i>jason_vrdp</i> to the shadow group:</strong></p>
<div class="bash dean_ch"><span class="br0">&#40;</span>root<span class="br0">&#41;</span> <span class="co0"># usermod -G shadow,virtualbox jason_vrdp</span></div>
<p><strong>Prevent <i>jason_vrdp</i> from logging in to the host or anyone from sudo&#8217;ing to it:</strong></p>
<pre lang=bash>(root) # usermod --shell /bin/false jason_vrdp</pre>
<p>That&#8217;s it <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2010/01/22/suns-virtualbox-3-1-x-getting-vrdp-remote-desktop-to-authenticate-properly-with-linux-pam/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Started reading &#8220;Foundations of Qt Development&#8221;</title>
		<link>http://froebe.net/blog/2010/01/19/started-reading-foundations-of-qt-development/</link>
		<comments>http://froebe.net/blog/2010/01/19/started-reading-foundations-of-qt-development/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:57:48 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Book]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Bjarne Stroustrup]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[c plus plus]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Johan Thelin]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[qt4]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[trolltech]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1181</guid>
		<description><![CDATA[When I purchased Foundations of Qt Development (Expert&#8217;s Voice in Open Source) by Johan Thelin a few months back, I hoped to get to it right away but work and life diverted my attention. Today at lunch I dived into it. Even though I&#8217;m still going through chapter 1, I think I can give a [...]]]></description>
			<content:encoded><![CDATA[<p>When I <a href="http://en.wikipedia.org/wiki/Qt_%28toolkit%29"><img src="http://froebe.net/blog/wp-content/uploads/2010/01/Qt-logo.-150x150.png" alt="" title="Qt-logo" width="150" height="150" class="alignright size-thumbnail wp-image-1182" /></a>purchased <a href="http://www.amazon.com/gp/product/1590598318?ie=UTF8&#038;tag=froebe-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1590598318">Foundations of Qt Development (Expert&#8217;s Voice in Open Source) by Johan Thelin</a><img src="http://www.assoc-amazon.com/e/ir?t=froebe-20&#038;l=as2&#038;o=1&#038;a=1590598318" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> a few months back, I hoped to get to it right away but work and life diverted my attention.  Today at lunch I dived into it.  Even though I&#8217;m still going through chapter 1, I think I can give a hint of it:</p>
<p><a href="http://www.amazon.com/gp/product/1590598318?ie=UTF8&#038;tag=froebe-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1590598318">Foundations of QtÂ® Development (Expert&#8217;s Voice in Open Source)</a><img src="http://www.assoc-amazon.com/e/ir?t=froebe-20&#038;l=as2&#038;o=1&#038;a=1590598318" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> is well written.  He assumes that you have a little bit of C++ knowledge, avoiding into the trap that so many other authors do.  You wouldn&#8217;t believe how many technical books I have where the first half or more of the book is simply a rehash of the basics.  Forget that! </p>
<p>What I really like is that when he shows you an example of code, he explains why you would want to write it this way and how it differs from the Standard Template Language (STL &#8211; see <a href="http://www.amazon.com/gp/product/0201889544?ie=UTF8&#038;tag=froebe-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0201889544">C++ Programming Language, The (3rd Edition)</a><img src="http://www.assoc-amazon.com/e/ir?t=froebe-20&#038;l=as2&#038;o=1&#038;a=0201889544" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />).  Where there are performance gains or penalties of using Qt instead of STL, he demonstrates it.  </p>
<p>I never realized just how easy it is to write C++ using the <a href="http://en.wikipedia.org/wiki/Qt_(toolkit)">Qt framework</a>!  Just the Signals and Slots alone make it very very powerful and that&#8217;s just the beginning.  I&#8217;m completely blown away <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2010/01/19/started-reading-foundations-of-qt-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create an iTunes/iPod compatible audiobook (MPEG4 m4b) on Linux using MP4Box and mp4v2 v1.9.1 &#8211; it can be done!</title>
		<link>http://froebe.net/blog/2009/12/24/how-to-create-an-itunesipod-compatible-audiobook-mpeg4-m4b-on-linux-using-mp4box-and-mp4v2-v1-9-1-it-can-be-done/</link>
		<comments>http://froebe.net/blog/2009/12/24/how-to-create-an-itunesipod-compatible-audiobook-mpeg4-m4b-on-linux-using-mp4box-and-mp4v2-v1-9-1-it-can-be-done/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 17:39:18 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[add chapters]]></category>
		<category><![CDATA[audiobook]]></category>
		<category><![CDATA[chapters]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[gpac]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[mp4box]]></category>
		<category><![CDATA[mp4v2]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1163</guid>
		<description><![CDATA[I&#8217;ve been wracking my brains over this for the past few weeks and it finally struck me how to create an m4b audiobook with chapters that is compatible with your iPod, iTunes, VLC, etc.  It was very simple once I figured it out: Step 1: encode the mp3 files to &#8220;aac&#8221; (mpeg4) using your favorite [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wracking my brains over this for the past few weeks and it finally struck me how to create an m4b audiobook with chapters that is compatible with your iPod, iTunes, VLC, etc.  It was very simple once I figured it out:</p>
<h3>Step 1:</h3>
<p>encode the mp3 files to &#8220;aac&#8221; (mpeg4) using your favorite converter (I use ffmpeg):</p>
<div class="bash dean_ch"><span class="kw2">ffmpeg</span> <span class="re5">-i</span> <span class="st0">&quot;track1.mp3&quot;</span> <span class="re5">-y</span> <span class="re5">-vn</span> <span class="re5">-acodec</span> libfaac <span class="re5">-ab</span> 128k <span class="re5">-ar</span> <span class="nu0">44100</span> <span class="re5">-threads</span> <span class="nu0">3</span> <span class="re5">-f</span> mp4 track1.aac</div>
<h3>Step 2:</h3>
<p>Create a <i>chapters</i> file so that <a href="http://gpac.sourceforge.net">MP4Box</a> can understand it:</p>
<blockquote><p>    * Common syntax : CHAPTERX=h:m:s[:ms or .ms] on one line and CHAPTERXNAME=name on the other &#8211; the order is not important but chapter lines MUST be declared sequencially (same X value expected for 2 consecutive lines).</p></blockquote>
<div class="bash dean_ch">$ <span class="kw2">cat</span> track1.chapters<br />
<span class="re2">CHAPTER1</span>=00:00:<span class="nu0">00.000</span><br />
<span class="re2">CHAPTER1NAME</span>=Chapter 001<br />
<span class="re2">CHAPTER2</span>=00:<span class="nu0">30</span>:<span class="nu0">00.139</span><br />
<span class="re2">CHAPTER2NAME</span>=Chapter 002<br />
<span class="re2">CHAPTER3</span>=01:00:<span class="nu0">00.728</span><br />
<span class="re2">CHAPTER3NAME</span>=Chapter 003<br />
<span class="re2">CHAPTER4</span>=01:<span class="nu0">30</span>:<span class="nu0">01.269</span><br />
<span class="re2">CHAPTER4NAME</span>=Chapter 004<br />
<span class="re2">CHAPTER5</span>=02:00:<span class="nu0">01.858</span><br />
<span class="re2">CHAPTER5NAME</span>=Chapter 005<br />
<span class="re2">CHAPTER6</span>=02:<span class="nu0">30</span>:<span class="nu0">02.375</span><br />
<span class="re2">CHAPTER6NAME</span>=Chapter 006<br />
<span class="re2">CHAPTER7</span>=03:00:<span class="nu0">02.964</span><br />
<span class="re2">CHAPTER7NAME</span>=Chapter 007<br />
<span class="re2">CHAPTER8</span>=03:<span class="nu0">30</span>:<span class="nu0">03.553</span><br />
<span class="re2">CHAPTER8NAME</span>=Chapter 008<br />
<span class="re2">CHAPTER9</span>=04:00:<span class="nu0">04.094</span><br />
<span class="re2">CHAPTER9NAME</span>=Chapter 009<br />
<span class="re2">CHAPTER10</span>=04:<span class="nu0">30</span>:<span class="nu0">04.683</span><br />
<span class="re2">CHAPTER10NAME</span>=Chapter 010<br />
<span class="re2">CHAPTER11</span>=05:00:<span class="nu0">05.224</span><br />
<span class="re2">CHAPTER11NAME</span>=Chapter 011<br />
<span class="re2">CHAPTER12</span>=05:<span class="nu0">30</span>:<span class="nu0">05.765</span><br />
<span class="re2">CHAPTER12NAME</span>=Chapter 012<br />
<span class="re2">CHAPTER13</span>=05:<span class="nu0">46</span>:<span class="nu0">14.106</span><br />
<span class="re2">CHAPTER13NAME</span>=Chapter 013<br />
<span class="re2">CHAPTER14</span>=06:<span class="nu0">16</span>:<span class="nu0">14.143</span><br />
<span class="re2">CHAPTER14NAME</span>=Chapter 014<br />
<span class="re2">CHAPTER15</span>=06:<span class="nu0">46</span>:<span class="nu0">14.732</span><br />
<span class="re2">CHAPTER15NAME</span>=Chapter 015<br />
<span class="re2">CHAPTER16</span>=07:<span class="nu0">16</span>:<span class="nu0">15.249</span><br />
<span class="re2">CHAPTER16NAME</span>=Chapter 016<br />
<span class="re2">CHAPTER17</span>=07:<span class="nu0">46</span>:<span class="nu0">15.790</span><br />
<span class="re2">CHAPTER17NAME</span>=Chapter 017<br />
<span class="re2">CHAPTER18</span>=08:<span class="nu0">16</span>:<span class="nu0">16.331</span><br />
<span class="re2">CHAPTER18NAME</span>=Chapter 018<br />
<span class="re2">CHAPTER19</span>=08:<span class="nu0">46</span>:<span class="nu0">16.920</span><br />
<span class="re2">CHAPTER19NAME</span>=Chapter 019<br />
<span class="re2">CHAPTER20</span>=09:<span class="nu0">16</span>:<span class="nu0">17.460</span><br />
<span class="re2">CHAPTER20NAME</span>=Chapter 020<br />
<span class="re2">CHAPTER21</span>=09:<span class="nu0">46</span>:<span class="nu0">18.050</span><br />
<span class="re2">CHAPTER21NAME</span>=Chapter 021<br />
<span class="re2">CHAPTER22</span>=<span class="nu0">10</span>:<span class="nu0">16</span>:<span class="nu0">18.639</span><br />
<span class="re2">CHAPTER22NAME</span>=Chapter 022</div>
<h3>Step 3:</h3>
<p>Add the chapters to the audio file (creates Nero format chapter markers):</p>
<div class="bash dean_ch">MP4Box <span class="re5">-add</span> track1.aac <span class="re5">-chap</span> track1.chapters test.mp4</div>
<h3>Step 4:</h3>
<p>Convert the Nero chapter markers to Quicktime chapter markers using <a href="http://code.google.com/p/mp4v2/">mp4chaps from the mp4v2 project</a> (you will want v1.9.1 or higher):</p>
<div class="bash dean_ch">mp4chaps <span class="re5">&#8211;convert</span> <span class="re5">&#8211;chapter-qt</span> test.mp4<br />
converting chapters <span class="kw1">in</span> <span class="kw2">file</span> <span class="st0">&quot;test.mp4&quot;</span> from Nero to QuickTime</div>
<h3>Step 5:</h3>
<p>Rename the file from .mp4 to .m4b extension so iTunes will see it as an audiobook:</p>
<div class="bash dean_ch"><span class="kw2">mv</span> test.mp4 test.m4b</div>
<h3>Proof that it works:</h3>
<p><a href="http://froebe.net/blog/wp-content/uploads/2009/12/iTunes_showing_chapters.png"><img src="http://froebe.net/blog/wp-content/uploads/2009/12/iTunes_showing_chapters-300x253.png" alt="" title="iTunes with chapters shown" width="300" height="253" class="aligncenter size-medium wp-image-1164" /></a></p>
<p>and VLC showing the chapters:<br />
<a href="http://froebe.net/blog/wp-content/uploads/2009/12/VLC_showing_chapters.png"><img src="http://froebe.net/blog/wp-content/uploads/2009/12/VLC_showing_chapters.png" alt="" title="VLC showing chapters" width="427" height="138" class="aligncenter size-full wp-image-1165" /></a></p>
<p>Of course, we aren&#8217;t putting in any tags such as &#8220;author&#8221; or &#8220;genre&#8221; in this example.  Use your favorite tags editor to do so.</p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/12/24/how-to-create-an-itunesipod-compatible-audiobook-mpeg4-m4b-on-linux-using-mp4box-and-mp4v2-v1-9-1-it-can-be-done/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>How to convert a laptop running Microsoft Windows 7 to a VirtualBox virtual machine</title>
		<link>http://froebe.net/blog/2009/12/21/how-to-convert-a-laptop-running-microsoft-windows-7-to-a-virtualbox-virtual-machine/</link>
		<comments>http://froebe.net/blog/2009/12/21/how-to-convert-a-laptop-running-microsoft-windows-7-to-a-virtualbox-virtual-machine/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:32:53 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[dell latitiude]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft windows 7]]></category>
		<category><![CDATA[mint]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vboxmanage]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[win7]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1161</guid>
		<description><![CDATA[I was very much surprised just how easy it is to convert a Microsoft Windows 7 laptop into a virtual machine running within Sun&#8217;s VirtualBox.  This is what I did: Pull the hard drive from the laptop.  On my Dell Latitude, it was simply unscrewing the two screws on the bottom of the laptop marked [...]]]></description>
			<content:encoded><![CDATA[<p>I was very much surprised just how easy it is to convert a <a href="http://www.microsoft.com/windows7">Microsoft Windows 7</a> laptop into a virtual machine running within <a href="http://www.virtualbox.org">Sun&#8217;s VirtualBox</a>.  This is what I did:</p>
<ul>
<li>Pull the hard drive from the laptop.  On my Dell Latitude, it was simply unscrewing the two screws on the bottom of the laptop marked with the hard drive simble</li>
<li>Attach the drive to a SATA to USB connector and plug it in to your Linux box</li>
<li>If you don&#8217;t have VirtualBox installed, do so now using apt-get, rpm, or whatever you use to install software</li>
<li>Follow <a href="http://www.virtualbox.org/wiki/Migrate_Windows">How to migrate existing Windows installations to VirtualBox</a> but make sure you specify the entire drive (i.e. /dev/sdh) and not individual partitions else you will miss the hidden partitions that Vista and Windows 7 create</li>
</ul>
<p>You should have a working Windows 7 Virtual Machine.  You&#8217;ll notice that you probably have a huge vdi file.  Let&#8217;s shrink that down:</p>
<ul>
<li>Within Windows
<ul>
<li>download and install <a href="http://www.microsoft.com/technet/sysinternals/Security/SDelete.mspx">sdelete from Microsoft</a></li>
<li>download and install <a href="http://www.softpedia.com/get/System/Hard-Disk-Utils/Power-Defragmenter.shtml">PowerDefragmenter</a></li>
<li>Run PowerDefragmenter on your c: drive (as administrator)</li>
<li>Run <strong>&#8220;sdelete -c c:&#8221;</strong> from a cmd window (as administrator)</li>
<li>shutdown windows</li>
</ul>
</li>
<li>On the host
<ul>
<li>run <strong>&#8220;VBoxManage modifyvdi my_disk.vdi compact&#8221;</strong> replacing &#8220;my_disk.vdi&#8221; with the name of your vdi file you created earlier</li>
<li>Note that if you get a &#8220;Shrink hard disk operation is not implemented&#8221; error, then you&#8217;ve hit <a href="http://www.virtualbox.org/ticket/2833">bug #2833</a> and you will want to <a href="http://www.virtualbox.org">download the latest VirtualBox</a> to fix it.</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/12/21/how-to-convert-a-laptop-running-microsoft-windows-7-to-a-virtualbox-virtual-machine/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>A better way to convert your mp3 tags using Perl, POE, Linux::Inotify2 and POE::Wheel::Run (for you Sony PS3 or other media player)</title>
		<link>http://froebe.net/blog/2009/12/15/a-better-way-to-convert-your-mp3-tags-using-perl-poe-linuxinotify2-and-poewheelrun-for-you-sony-ps3-or-other-media-player/</link>
		<comments>http://froebe.net/blog/2009/12/15/a-better-way-to-convert-your-mp3-tags-using-perl-poe-linuxinotify2-and-poewheelrun-for-you-sony-ps3-or-other-media-player/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 22:00:06 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[id3v1]]></category>
		<category><![CDATA[id3v2]]></category>
		<category><![CDATA[Linux::Inotify2]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[playstation]]></category>
		<category><![CDATA[POE]]></category>
		<category><![CDATA[poe::wheel:run]]></category>
		<category><![CDATA[sony play]]></category>
		<category><![CDATA[sony playstation 3]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1157</guid>
		<description><![CDATA[Yesterday, I posted Howto: Convert your mp3 tags (id3v2 to id3v1) so your Playstation 3 can play your MP3s! and it worked fine but there was one little problem with it. When we processed the files, namely running eye3D, we did so synchronously. Essentially, the file notification came in from the Linux kernel and we [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I posted <a href="http://froebe.net/blog/2009/12/14/howto-convert-your-mp3-tags-id3v2-to-id3v1-so-your-playstation-3-can-play-your-mp3s/">Howto: Convert your mp3 tags (id3v2 to id3v1) so your Playstation 3 can play your MP3s!</a> and it worked fine but there was one little problem with it.</p>
<p>When we processed the files, namely running <strong>eye3D</strong>, we did so synchronously.  Essentially, the file notification came in from the Linux kernel and we processed the file at that time.  This may be an issue of overflowing the inotify queue within the Linux kernel if there are a lot of files to process.</p>
<p>A better solution would be to add the file to an internal queue and process the files in a sub process using POE::Wheel::Run.  Of course we will limit the number of sub processes <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="perl dean_ch"><span class="co1">#!/usr/bin/perl</span></p>
<p><span class="kw2">use</span> strict<span class="sy0">;</span><br />
<span class="kw2">use</span> warnings<span class="sy0">;</span></p>
<p><span class="kw2">use</span> File<span class="sy0">::</span><span class="me2">Basename</span><span class="sy0">;</span><br />
<span class="kw2">use</span> File<span class="sy0">::</span><span class="me2">Find</span> <span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">use</span> Getopt<span class="sy0">::</span><span class="me2">Std</span><span class="sy0">;</span><br />
<span class="kw2">use</span> Linux<span class="sy0">::</span><span class="me2">Inotify2</span><span class="sy0">;</span><br />
<span class="kw2">use</span> POE <a href="http://perldoc.perl.org/functions/qw.html"><span class="kw3">qw</span></a><span class="br0">&#40;</span> Kernel Session Wheel<span class="sy0">::</span><span class="me2">Run</span> <span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="co5">$|</span><span class="sy0">++;</span></p>
<p><span class="co1">#######################################</span><br />
<span class="co1">#######################################</span></p>
<p><span class="kw1">our</span> <span class="re0">@found_dirs</span><span class="sy0">;</span><br />
<span class="kw1">our</span> <span class="re0">$max_concurrent_tasks</span><span class="sy0">;</span></p>
<p><span class="kw2">sub</span> watch_add_dir <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="br0">&#40;</span><span class="re0">$heap_ref</span><span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">,</span> <span class="re0">$dir_name</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="co5">@_</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="co1"># Watch this directory with a call back</span><br />
&nbsp;<span class="co1"># &nbsp;to the watch_hdlr() subroutine via</span><br />
&nbsp;<span class="co1"># &nbsp;a message to the POE system</span><br />
&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="re0">$heap_ref</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="sy0">-&gt;</span><span class="me1">watch</span><span class="br0">&#40;</span><span class="re0">$dir_name</span><span class="sy0">,</span> IN_CREATE<span class="sy0">|</span>IN_CLOSE_WRITE<span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">-&gt;</span><span class="me1">postback</span><span class="br0">&#40;</span><span class="st0">&quot;watch_hdlr&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot; Watching directory $dir_name<span class="es0">\n</span>&quot;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">sub</span> watch_hdlr <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="br0">&#40;</span><span class="re0">$kernel</span><span class="sy0">,</span> <span class="re0">$heap</span><span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">,</span> <span class="re0">$event</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="br0">&#40;</span> <span class="co5">$_</span><span class="br0">&#91;</span>KERNEL<span class="br0">&#93;</span><span class="sy0">,</span> <span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="sy0">,</span> <span class="co5">$_</span><span class="br0">&#91;</span>SESSION<span class="br0">&#93;</span><span class="sy0">,</span> <span class="co5">$_</span><span class="br0">&#91;</span>ARG1<span class="br0">&#93;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="kw1">my</span> <span class="re0">$name</span> <span class="sy0">=</span> <span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">fullname</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">my</span> <span class="re0">$short_name</span> <span class="sy0">=</span> <span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">name</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="co1"># We can receive many many notifications</span><br />
&nbsp;<span class="co1"># &nbsp;for a file. &nbsp;If we&#8217;ve already processed</span><br />
&nbsp;<span class="co1"># &nbsp;the file, do nothing.</span><br />
&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="kw1">unless</span> <span class="br0">&#40;</span><span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="br0">&#123;</span>files<span class="br0">&#125;</span><span class="br0">&#123;</span><span class="re0">$name</span><span class="br0">&#125;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="co1"># If a new directory is added, we need</span><br />
&nbsp; <span class="co1"># &nbsp;to watch that directory too.</span><br />
&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">IN_CREATE</span> <span class="sy0">&amp;&amp;</span> <span class="sy0">-</span>d <span class="re0">$name</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;New directory: $name<span class="es0">\n</span>&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;watch_add_dir<span class="br0">&#40;</span><span class="re0">$heap</span><span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">,</span> <span class="re0">$name</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span> <span class="kw1">elsif</span> <span class="br0">&#40;</span><span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">IN_CLOSE_WRITE</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp;<span class="co1"># When a file descriptor that was opened for</span><br />
&nbsp; &nbsp;<span class="co1"># &nbsp;&#8217;writing&#8217; is closed, then process that</span><br />
&nbsp; &nbsp;<span class="co1"># &nbsp;file it was being written to. &nbsp;We&#8217;re</span><br />
&nbsp; &nbsp;<span class="co1"># &nbsp;assuming that the file is complete at this</span><br />
&nbsp; &nbsp;<span class="co1"># &nbsp;point as the operation will be a copy into</span><br />
&nbsp; &nbsp;<span class="co1"># &nbsp;the watched directory</span><br />
&nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp;<span class="kw1">my</span> <span class="re0">$ext</span> <span class="sy0">=</span> <span class="br0">&#40;</span> fileparse<span class="br0">&#40;</span><span class="re0">$name</span><span class="sy0">,</span> <span class="st_h">&#8216;\..*&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://perldoc.perl.org/functions/lc.html"><span class="kw3">lc</span></a><span class="br0">&#40;</span><span class="re0">$ext</span><span class="br0">&#41;</span> <span class="kw1">eq</span> <span class="st_h">&#8216;.mp3&#8242;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="co1"># Add the file to the file process queue</span><br />
&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/push.html"><span class="kw3">push</span></a> <span class="sy0">@</span><span class="br0">&#123;</span> <span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>task<span class="br0">&#125;</span><span class="br0">&#123;</span>task_files<span class="br0">&#125;</span> <span class="br0">&#125;</span><span class="sy0">,</span> <span class="re0">$name</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="co1"># Mark that we have processed the file. &nbsp;If</span><br />
&nbsp; &nbsp; <span class="co1"># &nbsp;we don&#8217;t we will end up processing the file</span><br />
&nbsp; &nbsp; <span class="co1"># &nbsp;in an infinite loop because we are modifying</span><br />
&nbsp; &nbsp; <span class="co1"># &nbsp;the files.</span><br />
&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="br0">&#123;</span>files<span class="br0">&#125;</span><span class="br0">&#123;</span><span class="re0">$name</span><span class="br0">&#125;</span> <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="co1"># Yield to &quot;task_next_file&quot; through so</span><br />
&nbsp; &nbsp; <span class="co1"># &nbsp;that we can process files in the queue.</span><br />
&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="re0">$kernel</span><span class="sy0">-&gt;</span><span class="me1">yield</span><span class="br0">&#40;</span><span class="st0">&quot;task_next_file&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp;<span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="br0">&#123;</span>files<span class="br0">&#125;</span><span class="br0">&#123;</span><span class="re0">$name</span><span class="br0">&#125;</span> <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp;<span class="br0">&#125;</span></p>
<p>&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="co1"># While possible, it is highly unlikely that we will</span><br />
&nbsp;<span class="co1"># &nbsp;overflow the notification buffers within the Linux</span><br />
&nbsp;<span class="co1"># &nbsp;kernel. &nbsp;If so, we should report that.</span><br />
&nbsp;<span class="co1">##############</span><br />
&nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;events for $name have been lost<span class="es0">\n</span>&quot;</span> <span class="kw1">if</span> <span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">IN_Q_OVERFLOW</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">sub</span> task_next_file <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="br0">&#40;</span><span class="re0">$kernel</span><span class="sy0">,</span> <span class="re0">$heap</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="co5">@_</span><span class="br0">&#91;</span> KERNEL<span class="sy0">,</span> HEAP <span class="br0">&#93;</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="co1"># Process the files in the queue up</span><br />
&nbsp;<span class="co1"># &nbsp;to the $max_concurrent_tasks at</span><br />
&nbsp;<span class="co1"># &nbsp;once. &nbsp;Any extras will be processed</span><br />
&nbsp;<span class="co1"># &nbsp;when a file (task) completes.</span><br />
&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="kw1">while</span> <span class="br0">&#40;</span> <a href="http://perldoc.perl.org/functions/keys.html"><span class="kw3">keys</span></a><span class="br0">&#40;</span> <span class="sy0">%</span><span class="br0">&#123;</span> <span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>task<span class="br0">&#125;</span> <span class="br0">&#125;</span> <span class="br0">&#41;</span> <span class="sy0">&lt;</span> <span class="re0">$max_concurrent_tasks</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">my</span> <span class="re0">$next_task_file</span> <span class="sy0">=</span> <a href="http://perldoc.perl.org/functions/shift.html"><span class="kw3">shift</span></a> <span class="sy0">@</span><span class="br0">&#123;</span> <span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>task<span class="br0">&#125;</span><span class="br0">&#123;</span>task_files<span class="br0">&#125;</span> <span class="br0">&#125;</span><span class="sy0">;</span></p>
<p>&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="co1"># If the $next_task_file is empty, then we can safely</span><br />
&nbsp; <span class="co1"># &nbsp;ignore it.</span><br />
&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="kw1">last</span> <span class="kw1">unless</span> <a href="http://perldoc.perl.org/functions/defined.html"><span class="kw3">defined</span></a> <span class="re0">$next_task_file</span><span class="sy0">;</span></p>
<p>&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="co1"># Use POE::Wheel::Run to fire off the</span><br />
&nbsp; <span class="co1"># &nbsp;file processing using a sub process</span><br />
&nbsp; <span class="co1"># &nbsp;to the process_file() subroutine</span><br />
&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="kw1">my</span> <span class="re0">$task</span> <span class="sy0">=</span> POE<span class="sy0">::</span><span class="me2">Wheel</span><span class="sy0">::</span><span class="me2">Run</span><span class="sy0">-&gt;</span><span class="me1">new</span> <span class="br0">&#40;</span><br />
&nbsp; &nbsp; Program <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span> process_file<span class="br0">&#40;</span><span class="re0">$next_task_file</span><span class="br0">&#41;</span> <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; StdoutEvent <span class="sy0">=&gt;</span> <span class="st0">&quot;task_output&quot;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; CloseEvent <span class="sy0">=&gt;</span> <span class="st0">&quot;task_done&quot;</span><span class="sy0">,</span><br />
&nbsp; &nbsp;<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="co1"># Update the session with the task</span><br />
&nbsp; <span class="co1"># &nbsp;information and the kernel with</span><br />
&nbsp; <span class="co1"># &nbsp;the SIG_CHILD handler. &nbsp;These are</span><br />
&nbsp; <span class="co1"># &nbsp;necessary for the task to execute.</span><br />
&nbsp; <span class="co1">##############</span><br />
&nbsp; <span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>task<span class="br0">&#125;</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span> <span class="re0">$task</span><span class="sy0">-&gt;</span><span class="me1">ID</span> <span class="br0">&#125;</span> <span class="sy0">=</span> <span class="re0">$task</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$kernel</span><span class="sy0">-&gt;</span><span class="me1">sig_child</span><span class="br0">&#40;</span> <span class="re0">$task</span><span class="sy0">-&gt;</span><span class="me1">PID</span><span class="sy0">,</span> <span class="st0">&quot;sig_child&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">sub</span> process_file <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="re0">$file</span> <span class="sy0">=</span> <a href="http://perldoc.perl.org/functions/shift.html"><span class="kw3">shift</span></a><span class="sy0">;</span></p>
<p>&nbsp;<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot; &nbsp;Processed <span class="es0">\&quot;</span>$file<span class="es0">\&quot;</span><span class="es0">\n</span>&quot;</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="co1"># Use the eyeD3 package to convert</span><br />
&nbsp;<span class="co1"># &nbsp;the mp3 id3v2/3/4 to id3v1. &nbsp;If</span><br />
&nbsp;<span class="co1"># &nbsp;eyeD3 fails, we don&#8217;t really care. <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span><br />
&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="kw1">my</span> <span class="re0">$cmd_output</span> <span class="sy0">=</span> <span class="st0">`eyeD3 &#8211;to-v1.1 &quot;$file&quot;`</span><span class="sy0">;</span><br />
&nbsp;<span class="re0">$cmd_output</span> <span class="sy0">=</span> <span class="st0">`eyeD3 &#8211;remove-v2 &quot;$file&quot;`</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">sub</span> find_wanted <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="re0">$object</span> <span class="sy0">=</span> <span class="re0">$File</span><span class="sy0">::</span><span class="me2">Find</span><span class="sy0">::</span><span class="me2">name</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">-</span>d <span class="re0">$object</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <a href="http://perldoc.perl.org/functions/push.html"><span class="kw3">push</span></a> <span class="re0">@found_dirs</span><span class="sy0">,</span> <span class="re0">$object</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="co1">#######################################</span><br />
<span class="co1">#######################################</span><br />
<span class="co1">#######################################</span></p>
<p><span class="kw1">my</span> <span class="re0">%arg_options</span><span class="sy0">;</span><br />
<span class="kw1">my</span> <span class="re0">$watch_dir</span><span class="sy0">;</span></p>
<p>getopts<span class="br0">&#40;</span><span class="st_h">&#8216;d:t:&#8217;</span><span class="sy0">,</span> <span class="re0">\%arg_options</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$arg_options</span><span class="br0">&#123;</span>d<span class="br0">&#125;</span> <span class="sy0">&amp;&amp;</span> <span class="sy0">-</span>d <span class="re0">$arg_options</span><span class="br0">&#123;</span>d<span class="br0">&#125;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re0">$watch_dir</span> <span class="sy0">=</span> <span class="re0">$arg_options</span><span class="br0">&#123;</span>d<span class="br0">&#125;</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$arg_options</span><span class="br0">&#123;</span>t<span class="br0">&#125;</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$arg_options</span><span class="br0">&#123;</span>t<span class="br0">&#125;</span> <span class="sy0">=~</span> <span class="co2">/^\d+/</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="re0">$max_concurrent_tasks</span> <span class="sy0">=</span> <span class="re0">$arg_options</span><span class="br0">&#123;</span>t<span class="br0">&#125;</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="re0">$max_concurrent_tasks</span> <span class="sy0">=</span> <span class="nu0">2</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span></p>
<p>&nbsp;<span class="co1">##############</span><br />
&nbsp;<span class="co1"># We need to watch all existing sub directories</span><br />
&nbsp;<span class="co1"># &nbsp;so we will find them and add them to the</span><br />
&nbsp;<span class="co1"># &nbsp;@found_dirs array to be added to the watched</span><br />
&nbsp;<span class="co1"># &nbsp;directories when we create the Inotify object</span><br />
&nbsp;<span class="co1">##############</span><br />
&nbsp;File<span class="sy0">::</span><span class="me2">Find</span><span class="sy0">::</span><span class="me2">find</span><span class="br0">&#40;</span><span class="br0">&#123;</span>wanted <span class="sy0">=&gt;</span> <span class="re0">\&amp;find_wanted</span><span class="br0">&#125;</span><span class="sy0">,</span> <span class="re0">$watch_dir</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp;POE<span class="sy0">::</span><span class="me2">Session</span><span class="sy0">-&gt;</span><span class="me1">create</span><br />
&nbsp; <span class="br0">&#40;</span> inline_states <span class="sy0">=&gt;</span><br />
&nbsp; &nbsp;<span class="br0">&#123;</span> _start <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">my</span> <span class="re0">$inotify_FH</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># alias this particular POE session to</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;&#8217;notify&#8217; so we can easily reference</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;it later if needed</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>KERNEL<span class="br0">&#93;</span><span class="sy0">-&gt;</span><span class="me1">alias_set</span><span class="br0">&#40;</span><span class="st_h">&#8216;notify&#8217;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># Create the Linux::INotify object</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span> <span class="sy0">=</span> <span class="kw2">new</span> Linux<span class="sy0">::</span><span class="me2">Inotify2</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">or</span> <a href="http://perldoc.perl.org/functions/die.html"><span class="kw3">die</span></a> <span class="st0">&quot;Unable to create new inotify object: $!&quot;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># Add the preexisting directories to</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;be watched from the @found_dirs array</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">foreach</span> <span class="kw1">my</span> <span class="re0">$dir</span> <span class="br0">&#40;</span><span class="re0">@found_dirs</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; watch_add_dir<span class="br0">&#40;</span><span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="sy0">,</span> <span class="co5">$_</span><span class="br0">&#91;</span>SESSION<span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$dir</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># We need to create a hash in the &quot;notify&quot;</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;POE session so we can determine if we&#8217;ve</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;processed a file already</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="br0">&#123;</span>files<span class="br0">&#125;</span> <span class="sy0">=</span> <span class="br0">&#123;</span><span class="br0">&#125;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># The Inotify notifications are received</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;on a file descriptor. &nbsp;We need to read</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;from it when there is something to be</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># &nbsp;read</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<a href="http://perldoc.perl.org/functions/open.html"><span class="kw3">open</span></a> <span class="re0">$inotify_FH</span><span class="sy0">,</span> <span class="st0">&quot;&lt; &amp;=&quot;</span> <span class="sy0">.</span> <span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="sy0">-&gt;</span><span class="me1">fileno</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">or</span> <a href="http://perldoc.perl.org/functions/die.html"><span class="kw3">die</span></a> <span class="st0">&quot;Can’t fdopen: $!<span class="es0">\n</span>&quot;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1"># Inform POE to poll the file descriptor</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">##############</span><br />
&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>KERNEL<span class="br0">&#93;</span><span class="sy0">-&gt;</span><span class="me1">select_read</span><span class="br0">&#40;</span> <span class="re0">$inotify_FH</span><span class="sy0">,</span> <span class="st0">&quot;inotify_poll&quot;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; inotify_poll <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="sy0">-&gt;</span><span class="me1">poll</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; watch_hdlr <span class="sy0">=&gt;</span> <span class="re0">\&amp;watch_hdlr</span><span class="sy0">,</span></p>
<p>&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="co1"># Process the next file in the queue</span><br />
&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; task_next_file <span class="sy0">=&gt;</span> <span class="re0">\&amp;task_next_file</span><span class="sy0">,</span></p>
<p>&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="co1"># print the output of the job</span><br />
&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; task_output <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">my</span> <span class="re0">$result</span> <span class="sy0">=</span> <span class="co5">$_</span><span class="br0">&#91;</span>ARG0<span class="br0">&#93;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;$result<span class="es0">\n</span>&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span></p>
<p>&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; <span class="co1"># When we are done with a file, go process the</span><br />
&nbsp; &nbsp; <span class="co1"># &nbsp;next file if there is one waiting</span><br />
&nbsp; &nbsp; <span class="co1">##############</span><br />
&nbsp; &nbsp; task_done <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">my</span> <span class="br0">&#40;</span><span class="re0">$kernel</span><span class="sy0">,</span> <span class="re0">$heap</span><span class="sy0">,</span> <span class="re0">$task_id</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="co5">@_</span><span class="br0">&#91;</span> KERNEL<span class="sy0">,</span> HEAP<span class="sy0">,</span> ARG0 <span class="br0">&#93;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<a href="http://perldoc.perl.org/functions/delete.html"><span class="kw3">delete</span></a> <span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>task<span class="br0">&#125;</span><span class="br0">&#123;</span><span class="re0">$task_id</span><span class="br0">&#125;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp;<span class="re0">$kernel</span><span class="sy0">-&gt;</span><span class="me1">yield</span><span class="br0">&#40;</span><span class="st0">&quot;task_next_file&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; sig_child <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">my</span> <span class="br0">&#40;</span><span class="re0">$heap</span><span class="sy0">,</span> <span class="re0">$pid</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="co5">@_</span><span class="br0">&#91;</span> HEAP<span class="sy0">,</span> ARG1 <span class="br0">&#93;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="kw1">my</span> <span class="re0">$details</span> <span class="sy0">=</span> <a href="http://perldoc.perl.org/functions/delete.html"><span class="kw3">delete</span></a> <span class="re0">$heap</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span><span class="re0">$pid</span><span class="br0">&#125;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp;<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp;POE<span class="sy0">::</span><span class="me2">Kernel</span><span class="sy0">-&gt;</span><span class="me1">run</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><a href="http://perldoc.perl.org/functions/exit.html"><span class="kw3">exit</span></a> <span class="nu0">0</span><span class="sy0">;</span></div>
<p>Example output:</p>
<div class="bash dean_ch">ps3_mp3_converter.pl <span class="re5">-d</span> <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>bin<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>doc<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>java<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>lib<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>j<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>j<span class="sy0">/</span>tmp<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>sdk<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>sdk<span class="sy0">/</span>demo<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>sdk<span class="sy0">/</span>include<br />
New directory: <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>Earth Final Conflict Soundtrack<br />
&nbsp;Watching directory <span class="sy0">/</span>home<span class="sy0">/</span>jfroebe<span class="sy0">/</span>j<span class="sy0">/</span>Earth Final Conflict Soundtrack<br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/01 Main Title.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/02 The Scret of Strandhill-Redemption.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/03 Old Flame.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/04 Defector.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/05 Decidion.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/06 Float Like a Butterfly.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/07 Sandoval&#8217;s Run.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/08 Bliss.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/09 If You Could Read My Mind.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/10 Lilli.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/11 Law and Order.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/12 Atavus.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/13 Between Heaven and Hell.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/14 Sleepers.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/15 Dimensions.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/16 Moonscape.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/17 Isabel.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/18 The Gauntlet.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/19 Second Chances.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/20 One Man&#8217;s Castle.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/21 Payback.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/22 Truth.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/23 Déjà Vu.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/24 Crossfire.mp3&quot;</span><br />
&nbsp; Processed <span class="st0">&quot;/home/jfroebe/j/Earth Final Conflict Soundtrack/25 Volunteers-End Credits.mp3&quot;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/12/15/a-better-way-to-convert-your-mp3-tags-using-perl-poe-linuxinotify2-and-poewheelrun-for-you-sony-ps3-or-other-media-player/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto: Convert your mp3 tags (id3v2 to id3v1) so your Playstation 3 can play your MP3s!</title>
		<link>http://froebe.net/blog/2009/12/14/howto-convert-your-mp3-tags-id3v2-to-id3v1-so-your-playstation-3-can-play-your-mp3s/</link>
		<comments>http://froebe.net/blog/2009/12/14/howto-convert-your-mp3-tags-id3v2-to-id3v1-so-your-playstation-3-can-play-your-mp3s/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 22:58:26 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[id3v1]]></category>
		<category><![CDATA[id3v2]]></category>
		<category><![CDATA[Linux::Inotify2]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[playstation 3]]></category>
		<category><![CDATA[POE]]></category>
		<category><![CDATA[ps3]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1154</guid>
		<description><![CDATA[Run the converter on your media server: ps3_mp3_converter.pl -d {directory} Copy your mp3 collection wherever you told ps3_mp3_converter.pl to run in. #!/usr/bin/perl use strict; use warnings; use File::Basename; use File::Find &#40;&#41;; use Getopt::Std; use Linux::Inotify2; use POE; $&#124;++; ####################################### ####################################### our @found_dirs; sub watch_add_dir &#123; &#160;my &#40;$heap_ref, $session, $dir_name&#41; = @_; &#160;$heap_ref-&#62;&#123;inotify&#125;-&#62;watch&#40;$dir_name, IN_CREATE&#124;IN_CLOSE_WRITE, $session-&#62;postback&#40;&#34;watch_hdlr&#34;&#41;&#41;; &#160;print [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>Run the converter on your media server:  ps3_mp3_converter.pl -d {directory}</li>
<li>Copy your mp3 collection wherever you told ps3_mp3_converter.pl to run in.</li>
</ol>
<div class="perl dean_ch"><span class="co1">#!/usr/bin/perl</span></p>
<p><span class="kw2">use</span> strict<span class="sy0">;</span><br />
<span class="kw2">use</span> warnings<span class="sy0">;</span></p>
<p><span class="kw2">use</span> File<span class="sy0">::</span><span class="me2">Basename</span><span class="sy0">;</span><br />
<span class="kw2">use</span> File<span class="sy0">::</span><span class="me2">Find</span> <span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">use</span> Getopt<span class="sy0">::</span><span class="me2">Std</span><span class="sy0">;</span><br />
<span class="kw2">use</span> Linux<span class="sy0">::</span><span class="me2">Inotify2</span><span class="sy0">;</span><br />
<span class="kw2">use</span> POE<span class="sy0">;</span></p>
<p><span class="co5">$|</span><span class="sy0">++;</span></p>
<p><span class="co1">#######################################</span><br />
<span class="co1">#######################################</span></p>
<p><span class="kw1">our</span> <span class="re0">@found_dirs</span><span class="sy0">;</span></p>
<p><span class="kw2">sub</span> watch_add_dir <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="br0">&#40;</span><span class="re0">$heap_ref</span><span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">,</span> <span class="re0">$dir_name</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="co5">@_</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="re0">$heap_ref</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="sy0">-&gt;</span><span class="me1">watch</span><span class="br0">&#40;</span><span class="re0">$dir_name</span><span class="sy0">,</span> IN_CREATE<span class="sy0">|</span>IN_CLOSE_WRITE<span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">-&gt;</span><span class="me1">postback</span><span class="br0">&#40;</span><span class="st0">&quot;watch_hdlr&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot; Watching directory $dir_name<span class="es0">\n</span>&quot;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">sub</span> watch_hdlr <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="br0">&#40;</span><span class="re0">$heap_ref</span><span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">,</span> <span class="re0">$event</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="br0">&#40;</span> <span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="sy0">,</span> <span class="co5">$_</span><span class="br0">&#91;</span>SESSION<span class="br0">&#93;</span><span class="sy0">,</span> <span class="co5">$_</span><span class="br0">&#91;</span>ARG1<span class="br0">&#93;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="kw1">my</span> <span class="re0">$name</span> <span class="sy0">=</span> <span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">fullname</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">my</span> <span class="re0">$short_name</span> <span class="sy0">=</span> <span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">name</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="kw1">unless</span> <span class="br0">&#40;</span><span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="br0">&#123;</span>files<span class="br0">&#125;</span><span class="br0">&#123;</span><span class="re0">$name</span><span class="br0">&#125;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">IN_CREATE</span> <span class="sy0">&amp;&amp;</span> <span class="sy0">-</span>d <span class="re0">$name</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;New directory: $name<span class="es0">\n</span>&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;watch_add_dir<span class="br0">&#40;</span><span class="re0">$heap_ref</span><span class="sy0">,</span> <span class="re0">$session</span><span class="sy0">,</span> <span class="re0">$name</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span> <span class="kw1">elsif</span> <span class="br0">&#40;</span><span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">IN_CLOSE_WRITE</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw1">my</span> <span class="re0">$ext</span> <span class="sy0">=</span> <span class="br0">&#40;</span> fileparse<span class="br0">&#40;</span><span class="re0">$name</span><span class="sy0">,</span> <span class="st_h">&#8216;\..*&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://perldoc.perl.org/functions/lc.html"><span class="kw3">lc</span></a><span class="br0">&#40;</span><span class="re0">$ext</span><span class="br0">&#41;</span> <span class="kw1">eq</span> <span class="st_h">&#8216;.mp3&#8242;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;-&quot;</span>x20 <span class="sy0">.</span> <span class="st0">&quot;<span class="es0">\n</span>&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;$name:<span class="es0">\n</span>&quot;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">my</span> <span class="re0">$cmd_output</span> <span class="sy0">=</span> <span class="st0">`eyeD3 &#8211;to-v1.1 &quot;$name&quot;`</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$cmd_output</span> <span class="sy0">=</span> <span class="st0">`eyeD3 &#8211;remove-v2 &quot;$name&quot;`</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="br0">&#123;</span>files<span class="br0">&#125;</span><span class="br0">&#123;</span><span class="re0">$name</span><span class="br0">&#125;</span> <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp;<span class="br0">&#125;</span></p>
<p>&nbsp;<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;events for $name have been lost<span class="es0">\n</span>&quot;</span> <span class="kw1">if</span> <span class="re0">$event</span><span class="sy0">-&gt;</span><span class="me1">IN_Q_OVERFLOW</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">sub</span> find_wanted <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">my</span> <span class="re0">$object</span> <span class="sy0">=</span> <span class="re0">$File</span><span class="sy0">::</span><span class="me2">Find</span><span class="sy0">::</span><span class="me2">name</span><span class="sy0">;</span></p>
<p>&nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">-</span>d <span class="re0">$object</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <a href="http://perldoc.perl.org/functions/push.html"><span class="kw3">push</span></a> <span class="re0">@found_dirs</span><span class="sy0">,</span> <span class="re0">$object</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="co1">#######################################</span><br />
<span class="co1">#######################################</span><br />
<span class="co1">#######################################</span></p>
<p><span class="kw1">my</span> <span class="re0">%arg_options</span><span class="sy0">;</span><br />
<span class="kw1">my</span> <span class="re0">$watch_dir</span><span class="sy0">;</span></p>
<p>getopts<span class="br0">&#40;</span><span class="st_h">&#8216;d:&#8217;</span><span class="sy0">,</span> <span class="re0">\%arg_options</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$arg_options</span><span class="br0">&#123;</span>d<span class="br0">&#125;</span> <span class="sy0">&amp;&amp;</span> <span class="sy0">-</span>d <span class="re0">$arg_options</span><span class="br0">&#123;</span>d<span class="br0">&#125;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re0">$watch_dir</span> <span class="sy0">=</span> <span class="re0">$arg_options</span><span class="br0">&#123;</span>d<span class="br0">&#125;</span><span class="sy0">;</span><br />
&nbsp;File<span class="sy0">::</span><span class="me2">Find</span><span class="sy0">::</span><span class="me2">find</span><span class="br0">&#40;</span><span class="br0">&#123;</span>wanted <span class="sy0">=&gt;</span> <span class="re0">\&amp;find_wanted</span><span class="br0">&#125;</span><span class="sy0">,</span> <span class="re0">$watch_dir</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp;POE<span class="sy0">::</span><span class="me2">Session</span><span class="sy0">-&gt;</span><span class="me1">create</span><br />
&nbsp; <span class="br0">&#40;</span> inline_states <span class="sy0">=&gt;</span><br />
&nbsp; &nbsp;<span class="br0">&#123;</span> _start <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">my</span> <span class="re0">$inotify_FH</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>KERNEL<span class="br0">&#93;</span><span class="sy0">-&gt;</span><span class="me1">alias_set</span><span class="br0">&#40;</span><span class="st_h">&#8216;notify&#8217;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span> <span class="sy0">=</span> <span class="kw2">new</span> Linux<span class="sy0">::</span><span class="me2">Inotify2</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">or</span> <a href="http://perldoc.perl.org/functions/die.html"><span class="kw3">die</span></a> <span class="st0">&quot;Unable to create new inotify object: $!&quot;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="kw1">foreach</span> <span class="kw1">my</span> <span class="re0">$dir</span> <span class="br0">&#40;</span><span class="re0">@found_dirs</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; watch_add_dir<span class="br0">&#40;</span><span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="sy0">,</span> <span class="co5">$_</span><span class="br0">&#91;</span>SESSION<span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$dir</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="br0">&#123;</span>files<span class="br0">&#125;</span> <span class="sy0">=</span> <span class="br0">&#123;</span><span class="br0">&#125;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<a href="http://perldoc.perl.org/functions/open.html"><span class="kw3">open</span></a> <span class="re0">$inotify_FH</span><span class="sy0">,</span> <span class="st0">&quot;&lt; &amp;=&quot;</span> <span class="sy0">.</span> <span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="sy0">-&gt;</span><span class="me1">fileno</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">or</span> <a href="http://perldoc.perl.org/functions/die.html"><span class="kw3">die</span></a> <span class="st0">&quot;Can’t fdopen: $!<span class="es0">\n</span>&quot;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co5">$_</span><span class="br0">&#91;</span>KERNEL<span class="br0">&#93;</span><span class="sy0">-&gt;</span><span class="me1">select_read</span><span class="br0">&#40;</span> <span class="re0">$inotify_FH</span><span class="sy0">,</span> <span class="st0">&quot;inotify_poll&quot;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp;inotify_poll <span class="sy0">=&gt;</span> <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co5">$_</span><span class="br0">&#91;</span>HEAP<span class="br0">&#93;</span><span class="br0">&#123;</span>inotify<span class="br0">&#125;</span><span class="sy0">-&gt;</span><span class="me1">poll</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; watch_hdlr <span class="sy0">=&gt;</span> <span class="re0">\&amp;watch_hdlr</span><span class="sy0">,</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp;<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp;POE<span class="sy0">::</span><span class="me2">Kernel</span><span class="sy0">-&gt;</span><span class="me1">run</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><a href="http://perldoc.perl.org/functions/exit.html"><span class="kw3">exit</span></a> <span class="nu0">0</span><span class="sy0">;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/12/14/howto-convert-your-mp3-tags-id3v2-to-id3v1-so-your-playstation-3-can-play-your-mp3s/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Trying to compile gspca on Ubuntu 9.04 or another recent Linux distribution?  We have the way!</title>
		<link>http://froebe.net/blog/2009/10/13/trying-to-compile-gspca-on-ubuntu-9-04-or-another-recent-linux-distribution-we-have-the-way/</link>
		<comments>http://froebe.net/blog/2009/10/13/trying-to-compile-gspca-on-ubuntu-9-04-or-another-recent-linux-distribution-we-have-the-way/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 18:13:47 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[gspca]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux journal]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1140</guid>
		<description><![CDATA[gspca On August 12th, 2009 Baires Norte Lug (not verified) says: Kernel >= 2.6.27 wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20071224.tar.gz wget http://www.bairesnortelug.com.ar/diff/gspca.diff tar -zxvf gspcav1-20071224.tar.gz cd gspcav1-20071224 cat ../gspca.diff &#124; patch -p1 sudo ./gspca_build Happy !!!! Thz http://www.bairesnortelug.com.ar Slackware Rulez]]></description>
			<content:encoded><![CDATA[<h3><a href="http://www.linuxjournal.com/video/get-your-webcam-working-gspca">gspca</a></h3>
<h4>On August 12th, 2009 Baires Norte Lug (not verified) says:<a href="http://www.linuxjournal.com"><img class="alignright size-full wp-image-1141" title="Linux Journal Magazine" src="http://froebe.net/blog/wp-content/uploads/2009/10/linuxjournal.png" alt="Linux Journal Magazine" width="158" height="69" /></a></h4>
<div>
<p>Kernel >= 2.6.27</p>
<div class="bash dean_ch"><span class="kw2">wget</span> http:<span class="sy0">//</span>mxhaard.free.fr<span class="sy0">/</span>spca50x<span class="sy0">/</span>Download<span class="sy0">/</span>gspcav1-<span class="nu0">20071224</span>.tar.gz<br />
<span class="kw2">wget</span> http:<span class="sy0">//</span>www.bairesnortelug.com.ar<span class="sy0">/</span>diff<span class="sy0">/</span>gspca.diff<br />
<span class="kw2">tar</span> <span class="re5">-zxvf</span> gspcav1-<span class="nu0">20071224</span>.tar.gz<br />
<span class="kw3">cd</span> gspcav1-<span class="nu0">20071224</span><br />
<span class="kw2">cat</span> ..<span class="sy0">/</span>gspca.diff <span class="sy0">|</span> <span class="kw2">patch</span> <span class="re5">-p1</span><br />
<span class="kw2">sudo</span> .<span class="sy0">/</span>gspca_build</div>
<p>Happy !!!!</p>
<p>Thz http://www.bairesnortelug.com.ar</p>
<p>Slackware Rulez <img src='http://froebe.net/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </div>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/10/13/trying-to-compile-gspca-on-ubuntu-9-04-or-another-recent-linux-distribution-we-have-the-way/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Howto convert an entire directory of videos to play on your Sony Playstation 3 using ffmpeg</title>
		<link>http://froebe.net/blog/2009/09/23/howto-convert-an-entire-directory-of-videos-to-play-on-your-sony-playstation-3-using-ffmpeg/</link>
		<comments>http://froebe.net/blog/2009/09/23/howto-convert-an-entire-directory-of-videos-to-play-on-your-sony-playstation-3-using-ffmpeg/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 14:16:00 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[aac]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[checkinstall]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[libxvid]]></category>
		<category><![CDATA[mediatomb]]></category>
		<category><![CDATA[mp4]]></category>
		<category><![CDATA[mpeg4]]></category>
		<category><![CDATA[pearl]]></category>
		<category><![CDATA[ps3]]></category>
		<category><![CDATA[sony]]></category>
		<category><![CDATA[sony playstation 3]]></category>
		<category><![CDATA[storm]]></category>
		<category><![CDATA[transcode]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[x264]]></category>
		<category><![CDATA[xvid]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1127</guid>
		<description><![CDATA[I think a lot of people have been struggling with mass converting of videos for the ps3&#8230; I&#8217;ve been searching for a way to mass convert my videos (mostly podcasts) to play on my Sony PlayStation 3 over the wire with Mediatomb.  For a long time I&#8217;ve been using a hodpodge of mp4box and mencoder [...]]]></description>
			<content:encoded><![CDATA[<p>I think a lot of people have been struggling with mass converting of videos for the ps3&#8230;<br />
I&#8217;ve been searching for a way to mass convert my videos (mostly podcasts) to play on my <a href="http://www.amazon.com/gp/product/B002I0J4VQ?ie=UTF8&amp;tag=froebe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B002I0J4VQ">Sony PlayStation 3</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=froebe-20&amp;l=as2&amp;o=1&amp;a=B002I0J4VQ" border="0" alt="" width="1" height="1" /> over the wire with <a href="http://mediatomb.cc/">Mediatomb</a>.  For a long time I&#8217;ve been using a hodpodge of <a href="http://gpac.sourceforge.net/">mp4box</a> and <a href="http://www.mplayerhq.hu">mencoder</a> to convert the videos.  The problem was that mp4box more often then not would crash or get stuck in a loop where it fills up a 1TB harddrive converting a 20mb file.  There had to be a better way.</p>
<p>If your ffmpeg doesn&#8217;t support x264 (video) or aac (audio) encoding, like all Ubuntu Linux distributions, then you will have to recompile ffmpeg.  Don&#8217;t worry, it is easier then you think!</p>
<p><a href="http://ubuntuforums.org/member.php?u=162846">FakeOutdoorsman</a> over on the Ubuntu Forums posted the method to <a href="http://ubuntuforums.org/showthread.php?t=7860j95">build ffmpeg from scratch</a>:</p>
<blockquote><p>
<strong>Choose your Ubuntu</strong></p>
<p>0.The instructions on the page are for Ubuntu Jaunty Jackalope 9.04 and Ubuntu Intrepid Ibex 8.10. Separate instructions are also available for other releases:</p>
<p>    * Install FFmpeg and x264 on Ubuntu Hardy Heron 8.04 LTS<br />
    * Install FFmpeg and x264 on Ubuntu Dapper Drake 6.06 LTS</p>
<p><strong>Getting the Dependencies</strong></p>
<p>1. Uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following:</p>
<div class="bash dean_ch"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> purge <span class="kw2">ffmpeg</span> x264 libx264-dev</div>
<p>2. Next, get all of the packages you will need to install FFmpeg and x264 (you may need to enable the universe and multiverse repositories):</p>
<p>Code:</p>
<div class="bash dean_ch"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> update<br />
<span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libsdl1.2-dev libtheora-dev libx11-dev libxvidcore4-dev zlib1g-dev</div>
<p><strong>Install x264</strong><br />
3. Get the most current source files from the official x264 git repository, compile, and install. You can run &#8220;./configure &#8211;help&#8221; to see what features you can enable/disable. If you are behind a firewall or unable to use git, then daily source tarballs are also available.</p>
<div class="bash dean_ch"><span class="kw3">cd</span><br />
<span class="kw2">git</span> clone <span class="kw2">git</span>:<span class="sy0">//</span>git.videolan.org<span class="sy0">/</span>x264.git<br />
<span class="kw3">cd</span> x264<br />
.<span class="sy0">/</span>configure<br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> checkinstall <span class="re5">&#8211;fstrans</span>=no <span class="re5">&#8211;install</span>=<span class="kw2">yes</span> <span class="re5">&#8211;pkgname</span>=x264 <span class="re5">&#8211;pkgversion</span> <span class="st0">&quot;1:0.svn<span class="es5">`date +%Y%m%d`</span>-0.0ubuntu1&quot;</span> <span class="re5">&#8211;default</span></div>
<p><strong>Install FFmpeg</strong><br />
4. Get the most current source files from the official FFmpeg svn, compile, and install. Run &#8220;./configure &#8211;help&#8221; to see what features you can enable/disable. If you are behind a firewall or unable to use subversion, then nightly FFmpeg snapshots are also available.</p>
<div class="bash dean_ch"><span class="kw3">cd</span><br />
<span class="kw2">svn</span> checkout <span class="kw2">svn</span>:<span class="sy0">//</span>svn.ffmpeg.org<span class="sy0">/</span>ffmpeg<span class="sy0">/</span>trunk <span class="kw2">ffmpeg</span><br />
<span class="kw3">cd</span> <span class="kw2">ffmpeg</span><br />
.<span class="sy0">/</span>configure <span class="re5">&#8211;enable-gpl</span> <span class="re5">&#8211;enable-nonfree</span> <span class="re5">&#8211;enable-pthreads</span> <span class="re5">&#8211;enable-libfaac</span> <span class="re5">&#8211;enable-libfaad</span> <span class="re5">&#8211;enable-libmp3lame</span> <span class="re5">&#8211;enable-libtheora</span> <span class="re5">&#8211;enable-libx264</span> <span class="re5">&#8211;enable-libxvid</span> <span class="re5">&#8211;enable-x11grab</span><br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> checkinstall <span class="re5">&#8211;fstrans</span>=no <span class="re5">&#8211;install</span>=<span class="kw2">yes</span> <span class="re5">&#8211;pkgname</span>=<span class="kw2">ffmpeg</span> <span class="re5">&#8211;pkgversion</span> <span class="st0">&quot;3:0.svn<span class="es5">`date +%Y%m%d`</span>-12ubuntu3&quot;</span> <span class="re5">&#8211;default</span> </div>
<p>That&#8217;s it for installation. You can keep the ~/x264 and ~/ffmpeg directories if you later want to update the source files to a new revision. See &#8220;Updating Your Installation&#8221; below for more details.</p></blockquote>
<p>Now that we have a working ffmpeg, we can go on to the converting the video files (<a href='http://froebe.net/blog/wp-content/uploads/2009/10/convert_videos.sh'>convert_videos.sh</a>):</p>
<div class="bash dean_ch"><span class="co0">#!/bin/bash</span></p>
<p><span class="kw1">function</span> print_usage <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot;=============================================================================================&quot;</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot; &nbsp; &nbsp; &nbsp; &nbsp;convert_videos.sh [file|directory] [output directory] {bb|bb_storm|ps3} {file prefix}&quot;</span> <br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot;=============================================================================================&quot;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">function</span> verify_file <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">echo</span> j<br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">function</span> process_file <span class="br0">&#123;</span><br />
&nbsp; <span class="re2">ORIG_FILE</span>=<span class="st0">&quot;$1&quot;</span><br />
&nbsp; <span class="re2">DEST_DIR</span>=<span class="st0">&quot;$2&quot;</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-z</span> <span class="co1">${BLACKBERRY}</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="re2">DEST_FILE</span>=<span class="co1">${DEST_DIR}</span><span class="sy0">/</span><span class="co1">${FILE_PREFIX}</span>$<span class="br0">&#40;</span> <span class="kw2">basename</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">perl</span> <span class="re5">-ne</span> <span class="st_h">&#8216;s/\.(?:[a-z,A-Z,0-9]{3,4})$/\.mp4/; print $_&#8217;</span> <span class="br0">&#41;</span><br />
&nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="re2">DEST_FILE</span>=<span class="co1">${DEST_DIR}</span><span class="sy0">/</span><span class="co1">${FILE_PREFIX}</span>$<span class="br0">&#40;</span> <span class="kw2">basename</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">perl</span> <span class="re5">-ne</span> <span class="st_h">&#8216;s/\.(?:[a-z,A-Z,0-9]{3,4})$/_bb\.mp4/; print $_&#8217;</span> <span class="br0">&#41;</span><br />
&nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-f</span> <span class="st0">&quot;<span class="es3">${DEST_FILE}</span>&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot; &nbsp; &nbsp;We already processed <span class="es1">\&quot;</span><span class="es3">${ORIG_FILE}</span><span class="es1">\&quot;</span> &#8230; skipping&quot;</span><br />
&nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="re2">VID_INFO_FPS</span>=$<span class="br0">&#40;</span> <span class="kw2">mplayer</span> <span class="re5">-identify</span> <span class="re5">-nosound</span> <span class="re5">-vo</span> null <span class="re5">-nocache</span> <span class="re5">-really-quiet</span> <span class="re5">-frames</span> <span class="nu0">1</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="nu0">2</span><span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null <span class="sy0">|</span> <span class="kw2">grep</span> FPS <span class="br0">&#41;</span> <br />
&nbsp; &nbsp; <span class="re2">VID_INFO_FPS</span>=<span class="co1">${VID_INFO_FPS#*=}</span><br />
&nbsp; &nbsp; <span class="re2">VID_INFO_WIDTH</span>=$<span class="br0">&#40;</span> <span class="kw2">mplayer</span> <span class="re5">-identify</span> <span class="re5">-nosound</span> <span class="re5">-vo</span> null <span class="re5">-nocache</span> <span class="re5">-really-quiet</span> <span class="re5">-frames</span> <span class="nu0">1</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="nu0">2</span><span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null <span class="sy0">|</span> <span class="kw2">grep</span> WIDTH <span class="br0">&#41;</span> <br />
&nbsp; &nbsp; <span class="re2">VID_INFO_WIDTH</span>=<span class="co1">${VID_INFO_WIDTH##*=}</span><br />
&nbsp; &nbsp; <span class="re2">VID_INFO_HEIGHT</span>=$<span class="br0">&#40;</span> <span class="kw2">mplayer</span> <span class="re5">-identify</span> <span class="re5">-nosound</span> <span class="re5">-vo</span> null <span class="re5">-nocache</span> <span class="re5">-really-quiet</span> <span class="re5">-frames</span> <span class="nu0">1</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="nu0">2</span><span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null <span class="sy0">|</span> <span class="kw2">grep</span> HEIGHT <span class="br0">&#41;</span> <br />
&nbsp; &nbsp; <span class="re2">VID_INFO_HEIGHT</span>=<span class="co1">${VID_INFO_HEIGHT##*=}</span><br />
&nbsp; &nbsp; <span class="re2">VID_INFO_ASPECT</span>=$<span class="br0">&#40;</span> <span class="kw2">mplayer</span> <span class="re5">-identify</span> <span class="re5">-nosound</span> <span class="re5">-vo</span> null <span class="re5">-nocache</span> <span class="re5">-really-quiet</span> <span class="re5">-frames</span> <span class="nu0">1</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="nu0">2</span><span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null <span class="sy0">|</span> <span class="kw2">grep</span> ASPECT <span class="br0">&#41;</span> <br />
&nbsp; &nbsp; <span class="re2">VID_INFO_ASPECT</span>=<span class="co1">${VID_INFO_ASPECT##*=}</span></p>
<p>&nbsp; &nbsp; <span class="re2">AUD_INFO_FORMAT</span>=$<span class="br0">&#40;</span> <span class="kw2">mplayer</span> <span class="re5">-identify</span> <span class="re5">-ao</span> null <span class="re5">-vo</span> null <span class="re5">-nocache</span> <span class="re5">-really-quiet</span> <span class="re5">-frames</span> <span class="nu0">1</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="nu0">2</span><span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null <span class="sy0">|</span> <span class="kw2">grep</span> AUDIO_FORMAT <span class="br0">&#41;</span> <br />
&nbsp; &nbsp; <span class="re2">AUD_INFO_FORMAT</span>=<span class="co1">${AUD_INFO_FORMAT##*=}</span><br />
&nbsp; &nbsp; <span class="re2">AUD_INFO_CHANNELS</span>=$<span class="br0">&#40;</span> <span class="kw2">mplayer</span> <span class="re5">-identify</span> <span class="re5">-ao</span> null <span class="re5">-vo</span> null <span class="re5">-nocache</span> <span class="re5">-really-quiet</span> <span class="re5">-frames</span> <span class="nu0">1</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="nu0">2</span><span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null <span class="sy0">|</span> <span class="kw2">grep</span> AUDIO_NCH <span class="br0">&#41;</span> <br />
&nbsp; &nbsp; <span class="re2">AUD_INFO_CHANNELS</span>=<span class="co1">${AUD_INFO_CHANNELS##*=}</span><br />
&nbsp; &nbsp; <span class="re2">AUD_INFO_BITRATE</span>=$<span class="br0">&#40;</span> <span class="kw2">mplayer</span> <span class="re5">-identify</span> <span class="re5">-ao</span> null <span class="re5">-vo</span> null <span class="re5">-nocache</span> <span class="re5">-really-quiet</span> <span class="re5">-frames</span> <span class="nu0">1</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="nu0">2</span><span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null <span class="sy0">|</span> <span class="kw2">grep</span> ID_AUDIO_BITRATE <span class="br0">&#41;</span> <br />
&nbsp; &nbsp; <span class="re2">AUD_INFO_BITRATE</span>=<span class="co1">${AUD_INFO_BITRATE##*=}</span></p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${AUD_INFO_BITRATE}</span> <span class="sy0">&lt;</span> <span class="nu0">163840</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">AUD_INFO_BITRATE</span>=<span class="nu0">160</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">AUD_INFO_BITRATE</span>=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${AUD_INFO_BITRATE}</span> <span class="sy0">/</span> <span class="nu0">1024</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; &nbsp; <span class="co0">###############</span><br />
&nbsp; &nbsp; <span class="co0"># &nbsp;We need to make the frame rate an acceptible amoun</span><br />
&nbsp; &nbsp; <span class="co0">###############</span><br />
&nbsp; &nbsp; <span class="kw1">case</span> <span class="co1">${VID_INFO_FPS}</span> <span class="kw1">in</span><br />
&nbsp; &nbsp; &nbsp; <span class="nu0">60.000</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co0"># HD</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_INFO_FPS</span>=<span class="nu0">59.94</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; &nbsp; <span class="nu0">30.000</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co0"># NTSC</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_INFO_FPS</span>=<span class="nu0">29.97</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; &nbsp; <span class="nu0">24.000</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co0"># PAL</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_INFO_FPS</span>=<span class="nu0">23.97</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; <span class="kw1">esac</span> </p>
<p>&nbsp; &nbsp; <span class="co0">###############</span><br />
&nbsp; &nbsp; <span class="co0"># &nbsp;We need to make the video resolution a multiple of 16 for it to be properly compressed</span><br />
&nbsp; &nbsp; <span class="co0">###############</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_INFO_HEIGHT}</span> <span class="sy0">%</span> <span class="nu0">16</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_VERTICAL</span>=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="nu0">16</span> &#8211; <span class="co1">${VID_INFO_HEIGHT}</span> <span class="sy0">%</span> <span class="nu0">16</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_VERTICAL</span>=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${VID_BORDER_VERTICAL}</span> <span class="sy0">/</span> <span class="nu0">2</span> <span class="br0">&#41;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_BORDER_VERTICAL}</span> <span class="sy0">%</span> <span class="nu0">2</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> VID_BORDER_VERTICAL_TOP+=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${VID_BORDER_VERTICAL}</span> &#8211; <span class="nu0">1</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> VID_BORDER_VERTICAL_BOTTOM+=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${VID_BORDER_VERTICAL}</span> + <span class="nu0">1</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_VERTICAL_TOP</span>=<span class="co1">${VID_BORDER_VERTICAL}</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_VERTICAL_BOTTOM</span>=<span class="co1">${VID_BORDER_VERTICAL}</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_VERTICAL_TOP</span>=<span class="nu0">0</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_VERTICAL_BOTTOM</span>=<span class="nu0">0</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_INFO_WIDTH}</span> <span class="sy0">%</span> <span class="nu0">16</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_HORIZONTAL</span>=$<span class="br0">&#40;</span> <span class="nu0">16</span> &#8211; <span class="co1">${VID_INFO_WIDTH}</span> <span class="sy0">%</span> <span class="nu0">16</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_HORIZONTAL</span>=$<span class="br0">&#40;</span> <span class="co1">${VID_INFO_WIDTH}</span> <span class="sy0">/</span> <span class="nu0">2</span> <span class="br0">&#41;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_BORDER_HORIZONTAL}</span> <span class="sy0">%</span> <span class="nu0">2</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> VID_BORDER_HORIZONTAL_RIGHT+=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${VID_BORDER_HORIZONTAL}</span> + <span class="nu0">1</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> VID_BORDER_HORIZONTAL_LEFT+=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${VID_BORDER_HORIZONTAL}</span> &#8211; <span class="nu0">1</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_HORIZONTAL_RIGHT</span>=<span class="co1">${VID_BORDER_HORIZONTAL}</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_HORIZONTAL_LEFT</span>=<span class="co1">${VID_BORDER_HORIZONTAL}</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_HORIZONTAL_LEFT</span>=<span class="nu0">0</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_BORDER_HORIZONTAL_RIGHT</span>=<span class="nu0">0</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-z</span> <span class="co1">${VID_INFO_ASPECT}</span> <span class="br0">&#93;</span><span class="br0">&#93;</span> <span class="sy0">||</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="co1">${VID_INFO_ASPECT}</span> == <span class="st0">&quot;0.0000&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_INFO_ASPECT</span>=<span class="st0">&quot;16:9&quot;</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-z</span> <span class="co1">${AUD_INFO_CHANNELS}</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">AUD_INFO_CHANNELS</span>=<span class="nu0">2</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span></p>
<p>
&nbsp; &nbsp; <span class="co0">##############</span><br />
&nbsp; &nbsp; <span class="co0"># If we&#8217;re not converting for the blackberry, perform a normal conversion </span><br />
&nbsp; &nbsp; <span class="co0">##############</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-z</span> <span class="co1">${BLACKBERRY}</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; <span class="re2">VID_INFO_RESOLUTION</span>=<span class="st0">&quot;<span class="es3">${VID_INFO_WIDTH}</span>x<span class="es3">${VID_INFO_HEIGHT}</span>&quot;</span></p>
<p>&nbsp; &nbsp; &nbsp; convert_file_first_pass </p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="sy0">!</span> <span class="re5">-z</span> <span class="co1">${FIRST_PASS_BITRATE}</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">BITRATE</span>=<span class="co1">${FIRST_PASS_BITRATE}</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; <span class="co0">############</span><br />
&nbsp; &nbsp; &nbsp; <span class="co0"># if we have a blackberry, set the resolution appropriately</span><br />
&nbsp; &nbsp; &nbsp; <span class="co0">############</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="co1">${BB_TYPE}</span> <span class="kw1">in</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; STORM<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_INFO_RESOLUTION</span>=<span class="st0">&quot;480&#215;360&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">*</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">VID_INFO_RESOLUTION</span>=<span class="st0">&quot;240&#215;180&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">esac</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; &nbsp; convert_file_second_pass <br />
&nbsp; <span class="kw1">fi</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">function</span> process_directory <span class="br0">&#123;</span><br />
&nbsp;<span class="re2">ORIG_VIDEO_DIR</span>=<span class="st0">&quot;$1&quot;</span><br />
&nbsp;<span class="re2">DEST_VIDEO_DIR</span>=<span class="st0">&quot;$2&quot;</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-d</span> <span class="st0">&quot;<span class="es3">${ORIG_VIDEO_DIR}</span>&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span> <span class="sy0">&amp;&amp;</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-d</span> <span class="st0">&quot;<span class="es3">${DEST_VIDEO_DIR}</span>&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="re2">IFS</span>=$<span class="st_h">&#8216;\n&#8217;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">for</span> ORIG_VIDEO_FILE <span class="kw1">in</span> $<span class="br0">&#40;</span> <span class="kw2">find</span> <span class="st0">&quot;<span class="es3">${ORIG_VIDEO_DIR}</span>&quot;</span> <span class="re5">-depth</span> <span class="re5">-maxdepth</span> <span class="nu0">1</span> <span class="re5">-type</span> f <span class="re5">-readable</span> <span class="re5">-iregex</span> <span class="st_h">&#8216;.*\.\(3gp\|3g2\|avi\|divx\|flv\|m4v\|mj2\|mov\|mp1\|mp2\|mp4\|mpe\|mpeg\|mpeg4\|mpg\|mkv\|mv\|ogm\|rm\|rmvb\|rv\|qt\|wmv\)&#8217;</span> <span class="br0">&#41;</span>; <span class="kw1">do</span><br />
&nbsp; &nbsp; &nbsp; process_file <span class="st0">&quot;<span class="es3">${ORIG_VIDEO_FILE}</span>&quot;</span> <span class="st0">&quot;<span class="es3">${DEST_VIDEO_DIR}</span>&quot;</span><br />
&nbsp; &nbsp; <span class="kw1">done</span><br />
&nbsp; <span class="kw1">fi</span> <br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">function</span> convert_file_first_pass <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&quot;</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot; &nbsp; First pass: <span class="es3">${ORIG_FILE}</span>&quot;</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot;ffmpeg -i <span class="es1">\&quot;</span><span class="es3">${ORIG_FILE}</span><span class="es1">\&quot;</span> -an -pass 1 <span class="es1">\<br />
</span> &nbsp; &nbsp;-vcodec libx264 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 <span class="es1">\<br />
</span> &nbsp; &nbsp;-me_method epzs -subq 1 -trellis 0 -refs 1 -bf 3 -b_strategy 1 -level 31 -coder 1 -me_range 16 -g 250 -keyint_min 25 <span class="es1">\<br />
</span> &nbsp; &nbsp;-sc_threshold 40 -i_qfactor 0.71 -bt 200kb -rc_eq &#8216;blurCplx^(1-qComp)&#8217; -qcomp 0.6 -qmin 1 -qmax 51 -qdiff 4 <span class="es1">\<br />
</span> &nbsp; &nbsp;-padtop <span class="es3">${VID_BORDER_VERTICAL_TOP}</span> -padbottom <span class="es3">${VID_BORDER_VERTICAL_BOTTOM}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp;-padleft <span class="es3">${VID_BORDER_HORIZONTAL_LEFT}</span> -padright <span class="es3">${VID_BORDER_HORIZONTAL_RIGHT}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp;-threads 2 <span class="es1">\<br />
</span> &nbsp; &nbsp;-s <span class="es3">${VID_INFO_RESOLUTION}</span> -aspect <span class="es3">${VID_INFO_ASPECT}</span> -f rawvideo -y /dev/null&quot;</span> </p>
<p>&nbsp; <span class="kw2">ffmpeg</span> <span class="re5">-i</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="re5">-an</span> <span class="re5">-pass</span> <span class="nu0">1</span> \<br />
&nbsp; &nbsp; <span class="re5">-vcodec</span> libx264 <span class="re5">-flags</span> +loop <span class="re5">-cmp</span> +chroma <span class="re5">-partitions</span> +parti4x4+partp8x8+partb8x8 \<br />
&nbsp; &nbsp; -me_method epzs <span class="re5">-subq</span> <span class="nu0">1</span> <span class="re5">-trellis</span> <span class="nu0">0</span> <span class="re5">-refs</span> <span class="nu0">1</span> <span class="re5">-bf</span> <span class="nu0">3</span> -b_strategy <span class="nu0">1</span> <span class="re5">-level</span> <span class="nu0">31</span> <span class="re5">-coder</span> <span class="nu0">1</span> -me_range <span class="nu0">16</span> <span class="re5">-g</span> <span class="nu0">250</span> -keyint_min <span class="nu0">250</span> \<br />
&nbsp; &nbsp; -sc_threshold <span class="nu0">40</span> -i_qfactor <span class="nu0">0.71</span> <span class="re5">-bt</span> 200kb -rc_eq <span class="st_h">&#8216;blurCplx^(1-qComp)&#8217;</span> <span class="re5">-qcomp</span> <span class="nu0">0.6</span> <span class="re5">-qmin</span> <span class="nu0">1</span> <span class="re5">-qmax</span> <span class="nu0">51</span> <span class="re5">-qdiff</span> <span class="nu0">4</span> \<br />
&nbsp; &nbsp; <span class="re5">-padtop</span> <span class="co1">${VID_BORDER_VERTICAL_TOP}</span> <span class="re5">-padbottom</span> <span class="co1">${VID_BORDER_VERTICAL_BOTTOM}</span> \<br />
&nbsp; &nbsp; <span class="re5">-padleft</span> <span class="co1">${VID_BORDER_HORIZONTAL_LEFT}</span> <span class="re5">-padright</span> <span class="co1">${VID_BORDER_HORIZONTAL_RIGHT}</span> \<br />
&nbsp; &nbsp; <span class="re5">-threads</span> <span class="nu0">2</span> \<br />
&nbsp; &nbsp; <span class="re5">-s</span> <span class="co1">${VID_INFO_RESOLUTION}</span> <span class="re5">-aspect</span> <span class="co1">${VID_INFO_ASPECT}</span> <span class="re5">-f</span> rawvideo <span class="re5">-y</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null <span class="nu0">2</span><span class="sy0">&gt;&amp;</span><span class="nu0">1</span> <span class="sy0">|</span> <span class="kw2">tee</span> pass2.out</p>
<p>&nbsp; <span class="re2">BITRATE</span>=$<span class="br0">&#40;</span> <span class="kw2">grep</span> <span class="re5">-e</span> <span class="st0">&quot;\[libx264.*kb\/s&quot;</span> pass2.out <span class="br0">&#41;</span><br />
&nbsp; <span class="re2">BITRATE</span>=<span class="co1">${BITRATE##*:}</span><br />
&nbsp; <span class="re2">BITRATE</span>=<span class="co1">${BITRATE/.*}</span></p>
<p>&nbsp; <span class="kw3">echo</span> <span class="st0">&quot;average first pass bitrate: <span class="es3">${BITRATE}</span>&quot;</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-n</span> <span class="co1">${BITRATE}</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${BITRATE}</span> <span class="sy0">%</span> <span class="nu0">16</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw3">let</span> BITRATE+=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${BITRATE}</span> <span class="sy0">%</span> <span class="nu0">16</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_INFO_WIDTH}</span> <span class="sy0">&gt;</span> <span class="nu0">1024</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="re2">BITRATE</span>=<span class="nu0">15360</span><br />
&nbsp; &nbsp; <span class="kw1">elif</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_INFO_WIDTH}</span> <span class="sy0">&gt;</span> <span class="nu0">900</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="re2">BITRATE</span>=<span class="nu0">10240</span> <br />
&nbsp; &nbsp; <span class="kw1">elif</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_INFO_WIDTH}</span> <span class="sy0">&gt;</span> <span class="nu0">719</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="re2">BITRATE</span>=<span class="nu0">8192</span><br />
&nbsp; &nbsp; <span class="kw1">elif</span> <span class="br0">&#40;</span><span class="br0">&#40;</span> <span class="co1">${VID_INFO_WIDTH}</span> <span class="sy0">&gt;</span> <span class="nu0">620</span> <span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="re2">BITRATE</span>=<span class="nu0">2560</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="re2">BITRATE</span>=<span class="nu0">512</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; <span class="re2">MAX_BITRATE</span>=$<span class="br0">&#40;</span> <span class="kw2">expr</span> <span class="co1">${BITRATE}</span> + <span class="nu0">512</span> <span class="br0">&#41;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">function</span> convert_file_second_pass <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&quot;</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st0">&quot; &nbsp; Second pass: <span class="es3">${ORIG_FILE}</span>&quot;</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-n</span> <span class="co1">${BLACKBERRY}</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;ffmpeg -i <span class="es1">\&quot;</span><span class="es3">${ORIG_FILE}</span><span class="es1">\&quot;</span> -vcodec mpeg4 -vtag XVID -s <span class="es3">${VID_INFO_RESOLUTION}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-qscale 10 -ab 48k -ar 22050 -ac 2 -acodec libmp3lame -deinterlace <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-b 512kb -qmin 1 -qmax 51 <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-padtop <span class="es3">${VID_BORDER_VERTICAL_TOP}</span> -padbottom <span class="es3">${VID_BORDER_VERTICAL_BOTTOM}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-padleft <span class="es3">${VID_BORDER_HORIZONTAL_LEFT}</span> -padright <span class="es3">${VID_BORDER_HORIZONTAL_RIGHT}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-aspect <span class="es3">${VID_INFO_ASPECT}</span> <span class="es1">\&quot;</span><span class="es3">${DEST_FILE}</span><span class="es1">\&quot;</span>&quot;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">ffmpeg</span> <span class="re5">-i</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="re5">-vcodec</span> mpeg4 <span class="re5">-vtag</span> XVID <span class="re5">-s</span> <span class="co1">${VID_INFO_RESOLUTION}</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-ab</span> 48k <span class="re5">-ar</span> <span class="nu0">22050</span> <span class="re5">-ac</span> <span class="nu0">2</span> <span class="re5">-acodec</span> libmp3lame <span class="re5">-deinterlace</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-b</span> 512kb <span class="re5">-qmin</span> <span class="nu0">1</span> <span class="re5">-qmax</span> <span class="nu0">51</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-padtop</span> <span class="co1">${VID_BORDER_VERTICAL_TOP}</span> <span class="re5">-padbottom</span> <span class="co1">${VID_BORDER_VERTICAL_BOTTOM}</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-padleft</span> <span class="co1">${VID_BORDER_HORIZONTAL_LEFT}</span> <span class="re5">-padright</span> <span class="co1">${VID_BORDER_HORIZONTAL_RIGHT}</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-aspect</span> <span class="co1">${VID_INFO_ASPECT}</span> <span class="st0">&quot;<span class="es3">${DEST_FILE}</span>&quot;</span><br />
&nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;ffmpeg -i <span class="es1">\&quot;</span><span class="es3">${ORIG_FILE}</span><span class="es1">\&quot;</span> -acodec libfaac -ar 44100 -ac <span class="es3">${AUD_INFO_CHANNELS}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-async 1 -f mp4 -pass 2 -vcodec libx264 -vtag XVID -flags +loop+ilme -cmp +chroma <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me_method umh -subq 5 <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-trellis 1 -refs 5 -bf 3 -b_strategy 1 -level 31 -coder 1 -me_range 16 <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-g 250 -keyint_min 250 -sc_threshold 40 -i_qfactor 0.71 -bt 200kb <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-rc_eq &#8216;blurCplx^(1-qComp)&#8217; -qcomp 0.6 -qmin 3 -qmax 15 -qdiff 4 <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-s <span class="es3">${VID_INFO_RESOLUTION}</span> -aspect <span class="es3">${VID_INFO_ASPECT}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-padtop <span class="es3">${VID_BORDER_VERTICAL_TOP}</span> -padbottom <span class="es3">${VID_BORDER_VERTICAL_BOTTOM}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-padleft <span class="es3">${VID_BORDER_HORIZONTAL_LEFT}</span> -padright <span class="es3">${VID_BORDER_HORIZONTAL_RIGHT}</span> <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-b <span class="es3">${BITRATE}</span>kb -maxrate <span class="es3">${MAX_BITRATE}</span>kb <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-bufsize <span class="es3">${MAX_BITRATE}</span>kb -ab <span class="es3">${AUD_INFO_BITRATE}</span>kb <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-threads 2 <span class="es1">\<br />
</span> &nbsp; &nbsp; &nbsp;-r <span class="es3">${VID_INFO_FPS}</span> <span class="es1">\&quot;</span><span class="es3">${DEST_FILE}</span><span class="es1">\&quot;</span>&quot;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">ffmpeg</span> <span class="re5">-i</span> <span class="st0">&quot;<span class="es3">${ORIG_FILE}</span>&quot;</span> <span class="re5">-acodec</span> libfaac <span class="re5">-ar</span> <span class="nu0">44100</span> <span class="re5">-ac</span> <span class="co1">${AUD_INFO_CHANNELS}</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-async</span> <span class="nu0">1</span> <span class="re5">-f</span> mp4 <span class="re5">-pass</span> <span class="nu0">2</span> <span class="re5">-vcodec</span> libx264 <span class="re5">-vtag</span> XVID <span class="re5">-flags</span> +loop+ilme <span class="re5">-cmp</span> +chroma \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-partitions</span> +parti4x4+partp8x8+partb8x8 <span class="re5">-flags2</span> +mixed_refs -me_method umh <span class="re5">-subq</span> <span class="nu0">5</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-trellis</span> <span class="nu0">1</span> <span class="re5">-refs</span> <span class="nu0">5</span> <span class="re5">-bf</span> <span class="nu0">3</span> -b_strategy <span class="nu0">1</span> <span class="re5">-level</span> <span class="nu0">31</span> <span class="re5">-coder</span> <span class="nu0">1</span> -me_range <span class="nu0">16</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-g</span> <span class="nu0">250</span> -keyint_min <span class="nu0">250</span> -sc_threshold <span class="nu0">40</span> -i_qfactor <span class="nu0">0.71</span> <span class="re5">-bt</span> 200kb \<br />
&nbsp; &nbsp; &nbsp; -rc_eq <span class="st_h">&#8216;blurCplx^(1-qComp)&#8217;</span> <span class="re5">-qcomp</span> <span class="nu0">0.6</span> <span class="re5">-qmin</span> <span class="nu0">1</span> <span class="re5">-qmax</span> <span class="nu0">51</span> <span class="re5">-qdiff</span> <span class="nu0">4</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-s</span> <span class="co1">${VID_INFO_RESOLUTION}</span> <span class="re5">-aspect</span> <span class="co1">${VID_INFO_ASPECT}</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-padtop</span> <span class="co1">${VID_BORDER_VERTICAL_TOP}</span> <span class="re5">-padbottom</span> <span class="co1">${VID_BORDER_VERTICAL_BOTTOM}</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-padleft</span> <span class="co1">${VID_BORDER_HORIZONTAL_LEFT}</span> <span class="re5">-padright</span> <span class="co1">${VID_BORDER_HORIZONTAL_RIGHT}</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-b</span> <span class="co1">${BITRATE}</span>kb <span class="re5">-maxrate</span> <span class="co1">${MAX_BITRATE}</span>kb \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-bufsize</span> <span class="co1">${MAX_BITRATE}</span>kb <span class="re5">-ab</span> <span class="co1">${AUD_INFO_BITRATE}</span>kb \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-threads</span> <span class="nu0">2</span> \<br />
&nbsp; &nbsp; &nbsp; <span class="re5">-r</span> <span class="co1">${VID_INFO_FPS}</span> <span class="st0">&quot;<span class="es3">${DEST_FILE}</span>&quot;</span><br />
&nbsp; <span class="kw1">fi</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-n</span> <span class="st0">&quot;$1&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span> <span class="sy0">&amp;&amp;</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-n</span> <span class="st0">&quot;$2&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-n</span> <span class="st0">&quot;$3&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&quot;$3&quot;</span> <span class="kw1">in</span><br />
&nbsp; &nbsp; &nbsp; bb<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">BLACKBERRY</span>=<span class="nu0">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">BB_TYPE</span>=<span class="st0">&quot;norm&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; &nbsp; bb_storm<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">BLACKBERRY</span>=<span class="nu0">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">BB_TYPE</span>=<span class="st0">&quot;STORM&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; &nbsp; ps3<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; &nbsp; <span class="sy0">*</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">;;</span><br />
&nbsp; &nbsp; <span class="kw1">esac</span><br />
&nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-n</span> <span class="st0">&quot;$4&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="re2">FILE_PREFIX</span>=<span class="st0">&quot;<span class="es3">${4}</span>_&quot;</span><br />
&nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="re2">FILE_PREFIX</span>=<span class="st0">&quot;&quot;</span><br />
&nbsp; <span class="kw1">fi</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-f</span> <span class="st0">&quot;$1&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; process_file <span class="st0">&quot;$1&quot;</span> <span class="st0">&quot;$2&quot;</span><br />
&nbsp; <span class="kw1">elif</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re5">-d</span> <span class="st0">&quot;$1&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; process_directory <span class="st0">&quot;$1&quot;</span> <span class="st0">&quot;$2&quot;</span><br />
&nbsp; <span class="kw1">fi</span><br />
<span class="kw1">else</span><br />
&nbsp; print_usage<br />
&nbsp; <span class="kw3">exit</span><br />
<span class="kw1">fi</span><br />
&nbsp;</div>
<p>The ffmpeg parameters are based off of <a href="http://ps3wiki.qj.net/index.php/Using_ffmpeg_to_transcode_video_for_the_PS3">Using ffmpeg to transcode video for the PS3</a>.  Hope his works for you too.</p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/09/23/howto-convert-an-entire-directory-of-videos-to-play-on-your-sony-playstation-3-using-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Developing games with Perl and SDL</title>
		<link>http://froebe.net/blog/2009/09/12/developing-games-with-perl-and-sdl/</link>
		<comments>http://froebe.net/blog/2009/09/12/developing-games-with-perl-and-sdl/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 19:09:41 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[APIs]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[directx]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sdl]]></category>
		<category><![CDATA[simple directmedia library]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1124</guid>
		<description><![CDATA[Andy Bakun over at Ars Technica wrote an excellent &#8220;HowTo&#8221; on writing games with Perl and the Simple DirectMedia Library: Developing games with Perl and SDL Get ready to dive into game development! Ars explores the art of SDL game programming with Perl. A dynamic, high-level scripting language and powerful open source SDL bindings make [...]]]></description>
			<content:encoded><![CDATA[<p>Andy Bakun over at Ars Technica wrote an excellent &#8220;HowTo&#8221; on writing games with Perl and the Simple DirectMedia Library:</p>
<blockquote>
<h2>Developing games with Perl and SDL</h2>
<p><a href="http://arstechnica.com/gaming/news/2006/02/games-perl.ars"><img class="alignright size-full wp-image-1125" title="ars technica" src="http://froebe.net/blog/wp-content/uploads/2009/09/arstechnica.png" alt="ars technica" width="120" height="90" /></a>Get ready to dive into game development! Ars explores the art of SDL game programming with Perl. A dynamic, high-level scripting language and powerful open source SDL bindings make it possible to produce sophisticated games without a lot of effort or overhead.<br />
By    <a href="http://arstechnica.com/authors/ohrmazd/">Andy Bakun</a> | Last updated <abbr title="2006-02-14T21:00:00-06:00">February 14, 2006  9:00 PM CT</abbr></p>
<h2>What is SDL_perl?</h2>
<p><a href="http://sdl.perl.org/">SDL_Perl</a> is a perl interface to the  <a href="http://www.libsdl.org/">Simple DirectMedia Library</a>.  It is composed of a  both a XS wrapper to the SDL libraries and a series of Perl modules that export SDL functionality in an object-oriented fashion.<br />
One of the biggest benefits of using SDL is that it allows portable media applications to be written without having to be concerned with specific implmentations of media libraries for each target platform. Bringing Perl into the picture takes the portability one step further, allowing media-rich applications to be written in a high-level language that can be targeted to a number of platforms. While programming using SDL requires knowledge of C and access to a C compiler, using SDL_perl does not. This greatly decreases the amount of time it takes to get something up on the screen and working.</p>
<p><a href="http://arstechnica.com/gaming/news/2006/02/games-perl.ars">Read more</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/09/12/developing-games-with-perl-and-sdl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Want to upgrade your iTunes DRM&#8217;d music (m4p,aac) to non-DRM legally?  Check out iTunes 8</title>
		<link>http://froebe.net/blog/2009/07/06/want-to-upgrade-your-itunes-drmd-music-m4paac-to-non-drm-legally-check-out-itunes-8/</link>
		<comments>http://froebe.net/blog/2009/07/06/want-to-upgrade-your-itunes-drmd-music-m4paac-to-non-drm-legally-check-out-itunes-8/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 02:15:33 +0000</pubDate>
		<dc:creator>Jason L Froebe</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[blackberry storm]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[drm free]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[m4a]]></category>
		<category><![CDATA[m4p]]></category>
		<category><![CDATA[upgrade itunes music]]></category>

		<guid isPermaLink="false">http://froebe.net/blog/?p=1085</guid>
		<description><![CDATA[In iTunes 8, Apple has mentioned in their &#8220;What&#8217;s New in iTunes 8&#8221; that it is possible to upgrade your iTunes music to non-DRM&#8217;d for a small fee.  Great! I purchased quite a bit of music from the iTunes store when I ran WinXP as my primary desktop.  Now I can legally convert them to [...]]]></description>
			<content:encoded><![CDATA[<p>In iTunes 8, Apple has mentioned in their &#8220;<a href="http://www.apple.com/itunes/whatsnew/">What&#8217;s New in iTunes 8</a>&#8221; that it is possible to <em>upgrade</em> your iTunes music to non-DRM&#8217;d for a small fee.  Great!</p>
<p>I purchased quite a bit of music from the iTunes store when I ran WinXP as my primary desktop.  Now I can legally convert them to something that Linux (and my Blackberry Storm) can read!</p>
<p>Let me just pull up iTunes and do that.  Can&#8217;t find how do <em>upgrade</em> my iTunes music from within iTunes.  Tried help but that didn&#8217;t give me any clue.</p>
<p>After much hunting on the apple.com website, I was able to figure out that while iTunes supports the upgrade, it appears that Apple really doesn&#8217;t want you to else they would have made it far less obscure on how to do it.  In Apple&#8217;s <a title="iTunes Store: iTunes Plus Frequently Asked Questions (FAQ)" href="http://support.apple.com/kb/HT1711">TechDoc HT1711</a>, you will be directed to go to a <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/iTunesPlusPage">special link</a> that will activate the upgrade process in iTunes 8.</p>
<p>Excerpt from the Apple TechDoc:</p>
<blockquote>
<h4><a href="http://support.apple.com/kb/HT1711"><em>Can I upgrade previously purchased music to iTunes Plus?</em></a></h4>
<p><em>Yes. Any available upgrades will be shown on the Upgrade to iTunes Plus page. You can upgrade all of your items at once by using the Buy All button. This replaces all eligible previous purchases with iTunes Plus versions of the same items. You can also choose to make individual upgrades by clicking the Buy button to the right of each item. Song upgrades are available for 0.30 USD, video upgrades for 0.60 USD, and albums for 30 percent of the album price. The counter to the right of the &#8220;Upgrade to iTunes Plus&#8221; link in the Quick Links box will indicate when additional eligible content become available.</em></p>
<p><em>You can view your eligible iTunes Plus upgrade items by <a onclick="s_objectID=&quot;http://phobos.apple.com/WebObjects/MZStore.woa/wa/iTunesPlusPage_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/iTunesPlusPage">clicking here</a>.</em></p></blockquote>
<p>After you re-purchase *cough* <strong>upgrade</strong> your music, iTunes will download the music files (with the .M4a extension) and replace your old DRM encumbered music (with the .M4P extension).  Note that the non-DRM music files will contain enough information for you to identified easily if you should share your music with your friends.  The music files also contain water marks that will also survive if you should convert the non-DRM music files into mp3, ogg or flac files.  So, share your music at your own risk.</p>
]]></content:encoded>
			<wfw:commentRss>http://froebe.net/blog/2009/07/06/want-to-upgrade-your-itunes-drmd-music-m4paac-to-non-drm-legally-check-out-itunes-8/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

