<?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>Automate Everything</title>
	<atom:link href="http://automate-everything.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://automate-everything.com</link>
	<description>Ruby, Linux and other hints, tips and tricks.</description>
	<lastBuildDate>Sat, 22 Aug 2009 19:05:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gnome and Autospec Notifications</title>
		<link>http://automate-everything.com/2009/08/gnome-and-autospec-notifications/</link>
		<comments>http://automate-everything.com/2009/08/gnome-and-autospec-notifications/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 15:38:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://automate-everything.com/?p=45</guid>
		<description><![CDATA[I wanted to share how I set up autospec notifications on Ubuntu (Jaunty 9.04). I'm using XCFE but should work perfectly on Gnome as well.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very keen on DBB with RSpec now and I wanted to share how I set up autospec notifications on Ubuntu (Jaunty 9.04) as long as the post I followed to do it is no longer available.</p>
<p>I&#8217;m using XCFE but should work perfectly on Gnome as well. This is an screenshot of what you&#8217;ll get in the end:</p>
<div id="attachment_46" class="wp-caption alignnone" style="width: 601px"><img src="http://automate-everything.com/wp-content/uploads/2009/08/autospec.png" alt="autospec notification XFCE/Gnome" title="autospec notification XFCE/Gnome" width="591" height="279" class="size-full wp-image-46" /><p class="wp-caption-text">autospec notification XFCE/Gnome</p></div>
<p>First you need the ZenTest gem, you probably already do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> ZenTest
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> redgreen</pre></div></div>

<p>Then install the <em>libnotify-bin</em> package:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libnotify-bin</pre></div></div>

<p>Here is the trick. Create a file called <em>~/.autotest</em> with this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/bin/ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'redgreen'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'autotest/timestamp'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> <span style="color:#6666ff; font-weight:bold;">Autotest::GnomeNotify</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">notify</span> title, msg, img
    <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;notify-send '#{title}' '#{msg}' -i #{img} -t 3000&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  Autotest.<span style="color:#9900CC;">add_hook</span> <span style="color:#ff3333; font-weight:bold;">:ran_command</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>at<span style="color:#006600; font-weight:bold;">|</span>
    image_root = <span style="color:#996600;">&quot;~/.autotest_images&quot;</span> 
    results = <span style="color:#006600; font-weight:bold;">&#91;</span>at.<span style="color:#9900CC;">results</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">flatten</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    results.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>\\e\<span style="color:#006600; font-weight:bold;">&#91;</span>\d<span style="color:#006600; font-weight:bold;">+</span>m<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    output = results.<span style="color:#9900CC;">slice</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span>\sexamples?,\s<span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span>\sfailures?<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#CC0066; font-weight:bold;">puts</span> output.<span style="color:#9900CC;">inspect</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> output
      <span style="color:#9966CC; font-weight:bold;">if</span> $~<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">0</span>
        notify <span style="color:#996600;">&quot;FAIL&quot;</span>, <span style="color:#996600;">&quot;#{output}&quot;</span>, <span style="color:#996600;">&quot;#{image_root}/fail.png&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>
        notify <span style="color:#996600;">&quot;Pass&quot;</span>, <span style="color:#996600;">&quot;#{output}&quot;</span>, <span style="color:#996600;">&quot;#{image_root}/pass.png&quot;</span> 
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>As you can see I use the fail.png and pass.png images to show those cheesy smileys : ). You can download them here and copy them to <em>~/.autotest_images/</em>.</p>
<p><a href="http://automate-everything.com/wp-content/uploads/2009/08/autotest_images.zip" onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2009/08/autotest_images.zip');">autotest_images.zip</a></p>
<p>Make your tests go green and have a beer! : ) </p>
<p>Update: Added redgreen gem and changed &#8220;require redgreen&#8221; as Rodrigo Flores and rakk suggested. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/08/gnome-and-autospec-notifications/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to embed .idx subtitles into an mp4 or avi file with mencoder</title>
		<link>http://automate-everything.com/2009/05/how-to-embed-idx-subtitles-into-an-mp4-or-avi-file-with-mencoder/</link>
		<comments>http://automate-everything.com/2009/05/how-to-embed-idx-subtitles-into-an-mp4-or-avi-file-with-mencoder/#comments</comments>
		<pubDate>Wed, 06 May 2009 19:07:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://automate-everything.com/?p=38</guid>
		<description><![CDATA[I usually watch movies with subtitles on my cellphone but before that I have to transcode the avi to an mp4 with the subtitles &#8220;burnt&#8221; on the movie, not as a separate file. Recently I came across a movie with subtitles in two files, one .idx and one .sub instead of the common .srt file. [...]]]></description>
			<content:encoded><![CDATA[<p>I usually watch movies with subtitles on my cellphone but before that I have to transcode the avi to an mp4 with the subtitles &#8220;burnt&#8221; on the movie, not as a separate file. Recently I came across a movie with<strong> subtitles in two files, one .idx and one .sub instead of the common .srt file</strong>. And converting the movie to mp4 with that vobsub subtitles embedded wasn&#8217;t easy.</p>
<p>First of all I tried converting the idx/sub pair to a single srt. Although possible it&#8217;s a pain as long as you have identify the chars with an OCR adding the new ones by hand. Then I tried to get mencoder to read the .idx subs directly as I do with srt. Didn&#8217;t work. Finally I came up with a workaround: <strong>Merging the avi and the .idx into one Matroska (mkv) file and transcoding that Matroska to mp4 then.</strong></p>
<p>Installing the necessary tools:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mencoder mkvtoolnix</pre></div></div>

<p>Merging the files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkvmerge <span style="color: #660033;">-o</span> video.mkv video.avi video.idx</pre></div></div>

<p>This is the output:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">mkvmerge v2.4.1 ('Use Me') built on Dec 13 2008 21:03:46
'video.avi': Using the AVI demultiplexer. Opening file. This may take some time depending on the file's size.
'video.idx': Using the VobSub subtitle reader (SUB file 'video.sub').
'video.avi' track 0: Using the MPEG-4 part 2 video output module.
'video.avi' track 1: Using the MPEG audio output module.
'video.idx' track 0: Using the VobSub subtitle output module (language: eng).
'video.idx' track 1: Using the VobSub subtitle output module (language: fre).
'video.idx' track 2: Using the VobSub subtitle output module (language: spa).
The file 'video.mkv' has been opened for writing.
Progress: 100%
The cue entries (the index) are being written...
Muxing took 23 seconds.</pre></div></div>

<p>As you can see the idx file contains subs for three languages, as long as we want to overlay the English one we will pass mencoder the option <strong>-slang eng</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mencoder <span style="color: #660033;">-slang</span> eng <span style="color: #660033;">-of</span> lavf <span style="color: #660033;">-lavfopts</span> <span style="color: #007800;">format</span>=mp4 <span style="color: #660033;">-oac</span> lavc <span style="color: #660033;">-ovc</span> lavc <span style="color: #660033;">-lavcopts</span> <span style="color: #007800;">aglobal</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">vglobal</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">acodec</span>=libfaac:<span style="color: #007800;">vcodec</span>=mpeg4:<span style="color: #007800;">abitrate</span>=<span style="color: #000000;">128</span>:<span style="color: #007800;">vbitrate</span>=<span style="color: #000000;">1200</span>:<span style="color: #007800;">keyint</span>=<span style="color: #000000;">250</span>:<span style="color: #007800;">mbd</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">vqmax</span>=<span style="color: #000000;">10</span>:<span style="color: #007800;">lmax</span>=<span style="color: #000000;">10</span>  <span style="color: #660033;">-vf</span> harddup <span style="color: #ff0000;">'video.mkv'</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'video.mp4'</span></pre></div></div>

<p>And the resultang mp4 should have the idx subtitles rendered inside, not in a very beautiful way but works : ).</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/05/how-to-embed-idx-subtitles-into-an-mp4-or-avi-file-with-mencoder/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to fix audio synchronization of an AVI on Linux</title>
		<link>http://automate-everything.com/2009/05/how-to-fix-audio-synchronization-of-an-avi-on-linux/</link>
		<comments>http://automate-everything.com/2009/05/how-to-fix-audio-synchronization-of-an-avi-on-linux/#comments</comments>
		<pubDate>Mon, 04 May 2009 19:15:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.team-trick.net/?p=34</guid>
		<description><![CDATA[I just downloaded an AVI file with audio out of sync. Everything sounded one second before it should during the whole movie so it was really annoying. Fixing this with mencoder is easy and fast.

mencoder video.avi  -oac copy -ovc copy  -delay -1 -o video-fixed.avi

That will delay sound for one second. Notice that &#8220;-1&#8243; [...]]]></description>
			<content:encoded><![CDATA[<p>I just downloaded an AVI file with audio out of sync. Everything sounded one second before it should during the whole movie so it was really annoying. Fixing this with mencoder is easy and fast.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mencoder video.avi  <span style="color: #660033;">-oac</span> copy <span style="color: #660033;">-ovc</span> copy  <span style="color: #660033;">-delay</span> <span style="color: #660033;">-1</span> <span style="color: #660033;">-o</span> video-fixed.avi</pre></div></div>

<p>That will delay sound for one second. Notice that &#8220;-1&#8243; represents a negative value, so you could write &#8220;2.5&#8243; to advance (not delay) audio for 2 seconds and a half.</p>
<p>Here comes the tedious part. How do I know how much do I have to delay audio? What I did is trial and error. But don&#8217;t scream yet it&#8217;s not as horrible as it sounds. You can make tries less painful encoding just the first 150 seconds of video adding &#8220;-endpos 150&#8243;:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mencoder video.avi  <span style="color: #660033;">-oac</span> copy <span style="color: #660033;">-ovc</span> copy  <span style="color: #660033;">-delay</span> <span style="color: #660033;">-1</span> <span style="color: #660033;">-endpos</span> <span style="color: #000000;">150</span> <span style="color: #660033;">-o</span> video-fixed.avi</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/05/how-to-fix-audio-synchronization-of-an-avi-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent apt-get from upgrading a package on Ubuntu</title>
		<link>http://automate-everything.com/2009/04/prevent-apt-get-from-upgrading-a-package-on-ubuntu/</link>
		<comments>http://automate-everything.com/2009/04/prevent-apt-get-from-upgrading-a-package-on-ubuntu/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 15:16:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.team-trick.net/?p=32</guid>
		<description><![CDATA[Jaunty Jackalope and it overwrote my custom version of <a href="http://en.wikipedia.org/wiki/Rxvt-unicode">rxvt-unicode</a> that supports 256 colors. Every time I try to update my packages apt-get tries to "upgrade" rxvt-unicode too discarding my version. I found the solution here]]></description>
			<content:encoded><![CDATA[<p>Yesterday I updated my Ubuntu to Jaunty Jackalope and it overwrote my custom version of <a href="http://en.wikipedia.org/wiki/Rxvt-unicode" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">rxvt-unicode</a> that supports 256 colors. I got it following this entry <a href="http://scie.nti.st/2008/10/13/get-rxvt-unicode-with-256-color-support-on-ubunut" onclick="javascript:pageTracker._trackPageview('/outbound/article/scie.nti.st');">Get rxvt-unicode with 256 color support on Ubuntu</a>.</p>
<p>To recover it I reinstalled the custom deb package. It worked, but every time I try to update my packages apt-get tries to &#8220;upgrade&#8221; rxvt-unicode too discarding my version.</p>
<p>I found the solution here: <a href="https://answers.launchpad.net/ubuntu/+question/9434" onclick="javascript:pageTracker._trackPageview('/outbound/article/answers.launchpad.net');">Keep a package at specified version</a>. It&#8217;s just a matter of pinning a package. Just go:</p>
<pre class="lang: bash">
sudo vim /etc/apt/preferences
</pre>
<p>And add the following:</p>
<pre class="lang: none">
Package: rxvt-unicode
Pin: version 9.05*
Pin-Priority: 1001
</pre>
<p>And no more whinning : )</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/04/prevent-apt-get-from-upgrading-a-package-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting Avi files to Mp4 for Nokia 5800</title>
		<link>http://automate-everything.com/2009/03/converting-avi-files-to-mp4-for-nokia-5800/</link>
		<comments>http://automate-everything.com/2009/03/converting-avi-files-to-mp4-for-nokia-5800/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 16:30:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.team-trick.net/?p=28</guid>
		<description><![CDATA[I've come to following Ruby script for converting an avi to mp4, Nokia 5800 ready. Subtitles included and 2 pass (which means high quality results).]]></description>
			<content:encoded><![CDATA[<p>Recently I acquired a <strong>Nokia 5800 XpressMusic</strong> mobile phone. Great one! It comes with a native video player capable of playing video up to a resolution of 640&#215;480 at 30fps. The video player, in combination with its big screen and the TV-out capability, makes this phone a good device for watching a movie with an acceptable quality. It can play videos in the following formats:</p>
<ul>
<li>3GPP formats (H.263)</li>
<li>Flash Video</li>
<li>H.264/AVC</li>
<li>MPEG-4</li>
<li>RealVideo 7,8,9/10</li>
<li>WMV 9</li>
</ul>
<p>But as you can see, there is <strong>no AVI playback</strong>. Right now there is no AVI player that supports Symbian s60 5th. So we&#8217;ll have to transcode our .avi files to .mp4 before playing them on the Nokia 5800. Playing with mencoder I&#8217;ve come to following commands for <strong>converting an AVI to MP4</strong>, Nokia 5800 ready. <strong>Subtitles included and 2 pass</strong> (which means high quality results):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mencoder <span style="color: #660033;">-of</span> lavf <span style="color: #660033;">-lavfopts</span> <span style="color: #007800;">format</span>=mp4 <span style="color: #660033;">-oac</span> lavc <span style="color: #660033;">-ovc</span> lavc <span style="color: #660033;">-lavcopts</span> <span style="color: #007800;">aglobal</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">vglobal</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">acodec</span>=libfaac:<span style="color: #007800;">vcodec</span>=mpeg4:<span style="color: #007800;">abitrate</span>=<span style="color: #000000;">96</span>:<span style="color: #007800;">vbitrate</span>=<span style="color: #000000;">800</span>:<span style="color: #007800;">keyint</span>=<span style="color: #000000;">250</span>:<span style="color: #007800;">mbd</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">vqmax</span>=<span style="color: #000000;">10</span>:<span style="color: #007800;">lmax</span>=<span style="color: #000000;">10</span>:<span style="color: #007800;">vpass</span>=<span style="color: #000000;">1</span>:turbo <span style="color: #660033;">-ofps</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-af</span> <span style="color: #007800;">lavcresample</span>=<span style="color: #000000;">44100</span> <span style="color: #660033;">-vf</span> harddup,<span style="color: #007800;">scale</span>=<span style="color: #000000;">640</span>:-<span style="color: #000000;">3</span> <span style="color: #660033;">-sub</span> <span style="color: #ff0000;">'input.srt'</span> <span style="color: #ff0000;">'input.avi'</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'output.mp4'</span>
mencoder <span style="color: #660033;">-of</span> lavf <span style="color: #660033;">-lavfopts</span> <span style="color: #007800;">format</span>=mp4 <span style="color: #660033;">-oac</span> lavc <span style="color: #660033;">-ovc</span> lavc <span style="color: #660033;">-lavcopts</span> <span style="color: #007800;">aglobal</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">vglobal</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">acodec</span>=libfaac:<span style="color: #007800;">vcodec</span>=mpeg4:<span style="color: #007800;">abitrate</span>=<span style="color: #000000;">96</span>:<span style="color: #007800;">vbitrate</span>=<span style="color: #000000;">800</span>:<span style="color: #007800;">keyint</span>=<span style="color: #000000;">250</span>:<span style="color: #007800;">mbd</span>=<span style="color: #000000;">1</span>:<span style="color: #007800;">vqmax</span>=<span style="color: #000000;">10</span>:<span style="color: #007800;">lmax</span>=<span style="color: #000000;">10</span>:<span style="color: #007800;">vpass</span>=<span style="color: #000000;">2</span> <span style="color: #660033;">-ofps</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-af</span> <span style="color: #007800;">lavcresample</span>=<span style="color: #000000;">44100</span> <span style="color: #660033;">-vf</span> harddup,<span style="color: #007800;">scale</span>=<span style="color: #000000;">640</span>:-<span style="color: #000000;">3</span> <span style="color: #660033;">-sub</span> <span style="color: #ff0000;">'input.srt'</span> <span style="color: #ff0000;">'input.avi'</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'output.mp4'</span></pre></div></div>

<p>Messy huh? What I did is a Ruby script that takes AVI files as an argument an transcode them taking care of everything. I mean: </p>
<ul>
<li>Automatically names the output as &#8220;file.mp4&#8243; from &#8220;file.avi&#8221;</li>
<li>Checks if there are subtitles (as an SRT file) and add them.</li>
<li>Performs the 2 passes.</li>
<li>Deletes the useless &#8220;divx2pass.log&#8221; once finished.</li>
<li>Resize and resample video and audio to fit the phone specs.</li>
</ul>
<p>Here is the script:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
&nbsp;
ARGV.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>input_f<span style="color:#006600; font-weight:bold;">|</span>
  everything_ok = <span style="color:#0000FF; font-weight:bold;">true</span>
  log_file = <span style="color:#996600;">&quot;divx2pass.log&quot;</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Escapes single quotes</span>
  input_f = input_f.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;'&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;<span style="color:#000099;">\'</span><span style="color:#000099;">\\</span>'<span style="color:#000099;">\'</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Extracts the file name without extension</span>
  file_name = input_f.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span>0..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>  
&nbsp;
  <span style="color:#008000; font-style:italic;"># Output file</span>
  output_f = file_name <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;.mp4&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>Converting <span style="color:#000099;">\'</span>#{input_f}<span style="color:#000099;">\'</span> into <span style="color:#000099;">\'</span>#{output_f}<span style="color:#000099;">\'</span>:&quot;</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Check if there are subtitles to add to the file</span>
  subs_args = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>file_name <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;.srt&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#996600;">&quot; -sub <span style="color:#000099;">\'</span>#{file_name}.srt<span style="color:#000099;">\'</span>&quot;</span> : <span style="color:#996600;">&quot;&quot;</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Encodes with two pass</span>
  <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;:vpass=1:turbo&quot;</span>,<span style="color:#996600;">&quot;:vpass=2&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>vpass<span style="color:#006600; font-weight:bold;">|</span>
    command = <span style="color:#996600;">&quot;mencoder&quot;</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; -of lavf -lavfopts format=mp4&quot;</span> <span style="color:#008000; font-style:italic;"># Set container format to mp4</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; -oac lavc&quot;</span> <span style="color:#008000; font-style:italic;"># Audio will be encoded with a libavcodec codec</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; -ovc lavc&quot;</span> <span style="color:#008000; font-style:italic;"># Video will be encoded with a libavcodec codec</span>
&nbsp;
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; -lavcopts&quot;</span> <span style="color:#008000; font-style:italic;"># Begin of options for libavcodec</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; aglobal=1:vglobal=1&quot;</span> <span style="color:#008000; font-style:italic;"># Needed for mp4</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;:acodec=libfaac&quot;</span> <span style="color:#008000; font-style:italic;"># Encode audio as AAC</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;:vcodec=mpeg4&quot;</span> <span style="color:#008000; font-style:italic;"># Encode video as mp4 too</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;:abitrate=96&quot;</span> <span style="color:#008000; font-style:italic;"># Audio bitrate in Kbps</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;:vbitrate=800&quot;</span> <span style="color:#008000; font-style:italic;"># Video bitrate in Kbps</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;:keyint=250&quot;</span> <span style="color:#008000; font-style:italic;"># Number of frames between keyframes, a bit lower than the default to save some Megabytes</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;:mbd=1&quot;</span> <span style="color:#008000; font-style:italic;"># Macroblock decision algorithm set to minimize size of file</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;:vqmax=10:lmax=10&quot;</span> <span style="color:#008000; font-style:italic;"># Don't know whay but raises the video quality</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> vpass <span style="color:#008000; font-style:italic;"># First pass or second pass</span>
&nbsp;
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; -ofps 25&quot;</span> <span style="color:#008000; font-style:italic;"># Convert the video to 25 fps to avoid incompatible fps values</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; -af lavcresample=44100&quot;</span> <span style="color:#008000; font-style:italic;"># Resample the audio</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; -vf harddup,scale=640:-3&quot;</span> <span style="color:#008000; font-style:italic;"># Scale the video to 640 px width mantaining aspect ratio</span>
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> subs_args <span style="color:#008000; font-style:italic;"># Add subs</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># command &lt;&lt; &quot; -endpos 10&quot; # Encode just the first 10 seconds of video, useful for testing</span>
&nbsp;
    command <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot; <span style="color:#000099;">\'</span>#{input_f}<span style="color:#000099;">\'</span> -o <span style="color:#000099;">\'</span>#{output_f}<span style="color:#000099;">\'</span>&quot;</span> <span style="color:#008000; font-style:italic;"># file names</span>
&nbsp;
    <span style="color:#CC0066; font-weight:bold;">puts</span> command
    everything_ok = <span style="color:#CC0066; font-weight:bold;">system</span> command
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span> !everything_ok
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;There were errors encoding #{input_f}, aborting.&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">break</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">delete</span> log_file <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>? log_file
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;File succesfully encoded as <span style="color:#000099;">\'</span>#{output_f}<span style="color:#000099;">\'</span>&quot;</span> <span style="color:#9966CC; font-weight:bold;">if</span> everything_ok
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Use it like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">avi2mp4 myfile.avi</pre></div></div>

<p>And it will generate &#8220;myfile.mp4&#8243;. It also can receive several files as argument and will encode each of them separately. Hope you find this useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/03/converting-avi-files-to-mp4-for-nokia-5800/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Adding all new files recursively to Subversion</title>
		<link>http://automate-everything.com/2009/03/adding-all-new-files-recursively-to-subversion/</link>
		<comments>http://automate-everything.com/2009/03/adding-all-new-files-recursively-to-subversion/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 18:25:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.team-trick.net/?p=23</guid>
		<description><![CDATA[Sometimes you want to add a lot of new files to a subversion repository. An smart solution can be found on this post:

svn status &#124; grep &#34;^?&#34; &#124; awk '{print $2}' &#124; xargs svn add

That will add the new files to the repository in just one command, not looping around for each file. Cool!
]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to add a lot of new files to a subversion repository. An smart solution can be found on this <a href="http://discuss.joyent.com/viewtopic.php?id=2592" onclick="javascript:pageTracker._trackPageview('/outbound/article/discuss.joyent.com');">post</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> status <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^?&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">svn</span> add</pre></div></div>

<p>That will add the new files to the repository in just one command, not looping around for each file. Cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/03/adding-all-new-files-recursively-to-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piston and git</title>
		<link>http://automate-everything.com/2009/03/piston-and-git/</link>
		<comments>http://automate-everything.com/2009/03/piston-and-git/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 18:15:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.team-trick.net/?p=19</guid>
		<description><![CDATA[As many Rails developers I have some projects that I haven&#8217;t migrated to git yet. Those are still under Subversion and I manage its plugins with Piston. But what happen when you want to import a plugin hosted on a git repository? That the gem &#8220;piston&#8221; doesn&#8217;t work.
The trick is that the last version of [...]]]></description>
			<content:encoded><![CDATA[<p>As many Rails developers I have some projects that I haven&#8217;t migrated to git yet. Those are still under Subversion and I manage its plugins with <a href="http://piston.rubyforge.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/piston.rubyforge.org');">Piston</a>. But what happen when you want to import a plugin hosted on a git repository? That the gem &#8220;piston&#8221; doesn&#8217;t work.</p>
<p>The trick is that the last version of piston that supports git is not the gem called &#8220;piston&#8221; but <a href="http://github.com/francois/piston/tree/master" onclick="javascript:pageTracker._trackPageview('/outbound/article/github.com');">&#8220;francois-piston&#8221;</a>. So let&#8217;s go:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem sources <span style="color: #660033;">-a</span> http:<span style="color: #000000; font-weight: bold;">//</span>gems.github.com 
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> francois-piston</pre></div></div>

<p>Now we can do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">piston import git:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>activescaffold<span style="color: #000000; font-weight: bold;">/</span>active_scaffold.git vendor<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>active_scaffold</pre></div></div>

<p>Easy :).</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/03/piston-and-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to migrate a Subversion repository from one server to another</title>
		<link>http://automate-everything.com/2009/02/how-to-migrate-a-subversion-repository-from-one-server-to-another/</link>
		<comments>http://automate-everything.com/2009/02/how-to-migrate-a-subversion-repository-from-one-server-to-another/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 10:50:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.team-trick.net/?p=5</guid>
		<description><![CDATA[Now I got a new server I had to migrate my old Subversion repository from the old server to the new one. Thanks to Subversion it was a cake easy task.]]></description>
			<content:encoded><![CDATA[<p>Now I got a new server I had to migrate my old Subversion repository from the old server to the new one. Thanks to Subversion it was a cake easy task:</p>
<p>First, we have to dump our old repository.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">ssh old-server.com
svnadmin dump svn/my-project &gt; my-project.dump
exit</pre></div></div>

<p>Then, we transfer the dump from one server to the other:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">cd /tmp
rsync -Praz old-server.com:my-project.dump .
rsync -Praz my-project.dump new-server.com:~</pre></div></div>

<p>We are now ready to load the dump into the new repository:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">ssh new-server.com
mkdir svn
svnadmin create svn/my-project
svnadmin load svn/my-project &amp;lt; my-project.dump
exit</pre></div></div>

<p>Finally, we update our local copy of the code:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">mv my-project my-project.old
svn co svn+ssh://new-server.com/home/your-user-name/svn/my-project/trunk my-project</pre></div></div>

<p>And you are ready to code!</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/02/how-to-migrate-a-subversion-repository-from-one-server-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I got Mephisto working on Dreamhost</title>
		<link>http://automate-everything.com/2009/02/how-i-got-mephisto-working-on-dreamhost/</link>
		<comments>http://automate-everything.com/2009/02/how-i-got-mephisto-working-on-dreamhost/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 10:49:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.team-trick.net/?p=3</guid>
		<description><![CDATA[Installing the Ruby on Rails blog engine <a href="http://mephistoblog.com/">Mephisto</a> should be an easy task. However, I found this trickier than I expected. ]]></description>
			<content:encoded><![CDATA[<p>As long as <a href="http://www.dreamhost.com/r.cgi?498018" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.dreamhost.com');">Dreamhost</a> supports <a href="http://www.modrails.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.modrails.com');">Phusion Passenger</a> now, installing the Ruby on Rails blog engine <a href="http://mephistoblog.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/mephistoblog.com');">Mephisto</a> should be an easy task. However, I found this trickier than I expected. I followed the basic instructions and I was getting the following error on my <em><code>log/production.log</code></em>:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">ActionView::TemplateError (can't convert nil into String) on line #6 of app/views/admin/design/_sidebar.rhtml:
3: &lt;p&gt;Modify a template by selecting it from the list below.  Add a new layout by creating a Liquid template with an
4:   *_layout suffix (e.g custom_layout).&lt;/p&gt;
5: &lt;ul id=&quot;attachments&quot;&gt;
6:   &lt;% @theme.templates.template_types(@theme.extension).each do |template| -%&gt;
7:     &lt;li&gt;&lt;%= link_to h(template), url_for_theme(:controller =&gt; 'templates', :action =&gt; 'edit', :filename =&gt; template) %&gt;&lt;/li&gt;
8:   &lt;% end -%&gt;
9:   &lt;% @theme.templates.custom(@theme.extension).each_with_index do |template, i| -%&gt;
&nbsp;
    /home/manuelmorales/mephisto/app/models/templates.rb:6:in `+'
    /home/manuelmorales/mephisto/app/models/templates.rb:6:in `template_types'
    /home/manuelmorales/mephisto/app/models/templates.rb:6:in `collect'
    /home/manuelmorales/mephisto/app/models/templates.rb:6:in `template_types'
    ....</pre></div></div>

<p>The problem is that, in spite of the right <em>tzinfo</em> gem already comes with Mephisto, Phusion Passenger is ignoring local gems, taking the old version of <em>tzinfo</em> that Dreamhost provides. The solution is simple: Force Rails to load exactly that gem adding the following to your <em><code>config/environment.rb</code></em>.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">...
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'/home/&lt;yourusernamehere&gt;/mephisto/vendor/gems/tzinfo-0.3.12/lib/tzinfo'</span>
...</pre></div></div>

<p>And restarted the server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">touch</span> tmp<span style="color: #000000; font-weight: bold;">/</span>restart.txt</pre></div></div>

<p>Visited a working page of the blog twice to force the restart to make effect and <em>tzinfo</em> error gone.</p>
<p>In case that you are trying to install another application that doesn’t already come with the gem you have to override, you will have to install it locally before forcing Rails to load it. Directions about how to install gems locally in the <a href="http://wiki.dreamhost.com/index.php/RubyGems#Installing.2Fupdating_gems_without_installing_gem_2" onclick="javascript:pageTracker._trackPageview('/outbound/article/wiki.dreamhost.com');">Dreamhost wiki</a>.</p>
<p>But that wasn’t enough. Then I was getting the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">ActionView::TemplateError (attempted to output tainted string: &lt;a href=&quot;mailto:email@domain.com&quot;&gt;email@domain.com&lt;/a&gt;) on line #14 of app/views/admin/sites/show.rhtml:
11: &lt;% form_for :site, :url =&gt; { :action =&gt; &quot;update&quot;, :id =&gt; @site } do |f| -%&gt;
12: &lt;%= f.error_messages %&gt;
13: &lt;div id=&quot;general&quot; class=&quot;setgroup&quot;&gt;
14:   &lt;h3&gt;&lt;%=h @site.title %&gt; &lt;small&gt;(&lt;%= mail_to @site.email %&gt;)&lt;/small&gt;&lt;/h3&gt;
15:   &lt;dl class=&quot;setform&quot;&gt;
16:             &lt;dt&gt;&lt;label for=&quot;site_host&quot;&gt;Host&lt;/label&gt;&lt;/dt&gt;
17:             &lt;dd&gt;&lt;%= f.text_field :host %&gt;&lt;/dd&gt;
&nbsp;
    /home/manuelmorales/mephisto/vendor/gems/emk-safe_erb-0.1.1/lib/safe_erb/common.rb:48:in `concat_unless_tainted'
    /home/manuelmorales/mephisto/app/views/admin/sites/show.rhtml:14
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/form_helper.rb:313:in `fields_for'
    ...</pre></div></div>

<p>As said here on the <a href="http://mephistoblog.com/2008/12/21/mephisto-security-advisory" onclick="javascript:pageTracker._trackPageview('/outbound/article/mephistoblog.com');">Mephisto blog</a>:</p>
<blockquote><p>One debugging tip: If you see an error like ActionView::TemplateError (attempted to output tainted string), you’ve run afoul of SafeERB and you probably need to insert an h(…) somewhere. Don’t hesitate to ask for help on #mephisto.</p></blockquote>
<p>That’s it. I had to go to file <em><code>app/views/admin/sites/show.rhtml</code></em>, line 14,  and modify this:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">&lt;h3&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>=h <span style="color:#0066ff; font-weight:bold;">@site</span>.<span style="color:#9900CC;">title</span> <span style="color:#006600; font-weight:bold;">%&gt;</span> &lt;small&gt;(<span style="color:#006600; font-weight:bold;">&lt;%</span>=<span style="color:#5A0A0A; font-weight:bold;">mail_to</span> <span style="color:#0066ff; font-weight:bold;">@site</span>.<span style="color:#9900CC;">email</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>)&lt;/small&gt;&lt;/h3&gt;</pre></div></div>

<p>to surround the <em><code>@site.email</code></em> with <em>h()</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">&lt;h3&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>=h <span style="color:#0066ff; font-weight:bold;">@site</span>.<span style="color:#9900CC;">title</span> <span style="color:#006600; font-weight:bold;">%&gt;</span> &lt;small&gt;(<span style="color:#006600; font-weight:bold;">&lt;%</span>=<span style="color:#5A0A0A; font-weight:bold;">mail_to</span> h<span style="color:#006600; font-weight:bold;">&#40;</span>@site.<span style="color:#9900CC;">email</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>)&lt;/small&gt;&lt;/h3&gt;</pre></div></div>

<p>And here is it. Fully working now! : )</p>
]]></content:encoded>
			<wfw:commentRss>http://automate-everything.com/2009/02/how-i-got-mephisto-working-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
