<?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>Jtanium's Notebook &#187; Linux</title>
	<atom:link href="http://www.jtanium.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jtanium.com</link>
	<description>I jot things down, in hopes of finding them later...</description>
	<lastBuildDate>Wed, 21 Dec 2011 23:21:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Goodbye Parallels Desktop</title>
		<link>http://www.jtanium.com/2009/08/26/goodby-parallels-desktop/</link>
		<comments>http://www.jtanium.com/2009/08/26/goodby-parallels-desktop/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 20:16:14 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/?p=149</guid>
		<description><![CDATA[A few months ago, I upgraded to Parallels 4 because the performance of Parallels 3 was so poor. I will admit Parallels 4 is much, much better than 3, but there&#8217;s more than just performance when it comes to virtualization. Well I setup a VM of Ubuntu 9.04 and guess what: the Parallels Tools don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, I upgraded to Parallels 4 because the performance of Parallels 3 was so poor.  I will admit Parallels 4 is much, much better than 3, but there&#8217;s more than just performance when it comes to virtualization.</p>
<p>Well I setup a VM of Ubuntu 9.04 and guess what: the Parallels Tools don&#8217;t work. People have been asking for them since April, and now it turns out, Parallels 5 is in beta, where, naturally, the Tools will install.  How much do you want to be that you&#8217;ll have to plunk down another $50 for that?</p>
<p>Guess what Parallels: forget you.  I&#8217;m done.  I wanted to support the underdog, and even if the performance of the VM is good, this business of not updating your products isn&#8217;t worth it.</p>
<p>Anyone out there trying to decide whether to go with Parallels or VMWare Fusion: go with Fusion!</p>
<p>Boo Parallels.</p>
<p><strong>Update:</strong> A few days after I wrote this (Aug. 29, 2009) Parallels released an update (4.0.3846) where Parallels Tools can be installed on Jaunty.  Sorry guys, rolling that out more than <strong>four months</strong> after Jaunty was released is too little too late.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2009/08/26/goodby-parallels-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your Baby Is Dead!</title>
		<link>http://www.jtanium.com/2009/04/10/your-baby-is-dead/</link>
		<comments>http://www.jtanium.com/2009/04/10/your-baby-is-dead/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 19:18:54 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[dss]]></category>
		<category><![CDATA[pci]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/?p=125</guid>
		<description><![CDATA[That&#8217;s what you&#8217;d hear if your Linux server fell victim to the thousands of malware attacks lurking in the average network. That is, according to the PCI DSS. I read the PCI DSS Summary of Changes. It&#8217;s pretty much business as usual until you get to 5.1. That&#8217;s where you find this little gem: Clarified [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s what you&#8217;d hear if your Linux server fell victim to the <em>thousands</em> of malware attacks lurking in the average network.</p>
<p>That is, according to the PCI DSS.  I read the <a href="https://www.pcisecuritystandards.org/pdfs/pci_dss_summary_of_changes_v1-2.pdf">PCI DSS Summary of Changes</a>.  It&#8217;s pretty much business as usual until you get to 5.1.  That&#8217;s where you find this little gem:</p>
<blockquote><p>Clarified requirement applies to all operating systems types commonly affected by malicious software, if applicable anti-virus technology exists.</p></blockquote>
<p>Okay, sounds good.</p>
<blockquote><p>Besides use of the term “anti-virus software,” changed the term “virus” to “malicious software.”</p></blockquote>
<p>Good call, no doubt someone has tried to wriggle out of compliance using that excuse.</p>
<blockquote><p>Deleted note stating “Systems commonly affected by viruses typically do not include UNIX-based operating systems or mainframes.”
</p></blockquote>
<p>WTF?!?!?!?  Is this some kind of twisted April Fool&#8217;s prank.<br />
::Channelling Brian Regan::</p>
<blockquote><p>&#8220;Hey, come here; look what I put for Section Five. Did you see? I just did it as a joke but it&#8217;s going out like that. It&#8217;s already on the website. I don&#8217;t know what to do.&#8221;<br />
&#8220;Just let it go I guess.  There&#8217;s nothing you can do now.&#8221;</p></blockquote>
<p>Raise your hand if you&#8217;ve ever seen a Unix box infected with a virus.  Yeah, me neither.</p>
<p>It doesn&#8217;t take much imagination to figure out where this comes from.  There&#8217;s a lot of big money that doesn&#8217;t like Unix boxes getting a free pass for pretty much all of Section 5 of the DSS.</p>
<p>To unravel this &#8220;mystery&#8221; let&#8217;s start by figuring out who <strong>*loses*</strong> money by Unix not needing anti-malware&#8230; Yeah it&#8217;s Microsoft.  You have to think they&#8217;ve been shoving money in the pocket&#8217;s of PCI over this.  After all, if businesses realize that they can save money by switching to Linux, especially in the current economic climate, they&#8217;re gonna do it.  And what business wouldn&#8217;t, switching to Linux saves you the outrageous anti-malware fees and the exorbitant Windows license fees.</p>
<p>Now, besides Microsoft, who stands to benefit from this?  Of course the answer is the anti-malware venders: Symantec, McAfee, TrendMicro, Sophos, AVG (formerly Grisoft), Kaspersky (I&#8217;m not going to dignify them with links).  If you want some good laughs go read what these guys have to say about Unix viruses.</p>
<p>McAfee, <a href="http://www.mcafee.com/us/about/press/corporate/2006/20060505_12524_u.html">circa 2006</a>:</p>
<blockquote><p>Macintosh platform vulnerability discovery rates have increased by 228 percent in the past three years alone&#8230;</p></blockquote>
<p><strong>Translation:</strong> <em>Your baby is dead!</em><br />
To their credit, they did follow that up with:</p>
<blockquote><p>&#8230;from 45 found in 2003 to 143 in 2005</p></blockquote>
<p>Holy hell!  Please McAfee, take my money, just protect me!</p>
<p>Sophos, <a href="http://www.sophos.com/pressoffice/news/articles/2008/02/rstbtool.html">February 13th, 2008</a>, says of the Linux/Rst-B virus:</p>
<blockquote><p>Analysis of malware in Sophos&#8217;s Linux honeypots have shown almost 70 percent of the infections are due to this six-year-old malicious program.</p></blockquote>
<p><strong>Translation:</strong> <em>Your baby is dead!</em><br />
Holy hell!  Nooooo! Not the honeypots! Those things highly secure!  It takes mad 733t skillz to pwn a honeypot! Lots of critical thinking going on there.<br />
In that same press release, I liked this:</p>
<blockquote><p>&#8220;&#8230;we hope that Linux users who aren&#8217;t running security will at least run this tool to find out if they are infected with this granny virus.&#8221;</p></blockquote>
<p>Ha ha, &#8220;granny virus,&#8221; awesome.  And are you &#8220;running security&#8221; on your Linux box?  What exactly does that mean?  No matter, I wrote my own Linux/Rst-B scanner, check it:</p>
<pre>#!/usr/local/bin/bash
echo "Scanning for Linux/Rst-B virus..."
sleep(5)
echo "No virus detected!"</pre>
<p>To Sophos&#8217; credit the did put this in:</p>
<blockquote><p>Hackers typically gain control via weak SSH password or some other vulnerability.</p></blockquote>
<p>But that&#8217;s it.  The rest of the time it&#8217;s &#8220;Linux viruses are taking over! Give us lots of money, and we&#8217;ll protect you!&#8221;</p>
<p>Here&#8217;s the only place where you can argue Unix anti-malware makes sense: email and file servers. Let those servers be good Samaritans and catch the Windows viruses before they are spread around.  It&#8217;s a waste anywhere else.</p>
<p>That being said, one could argue running anti-malware on a Unix box does more harm than good.  It&#8217;s more than the obvious sucking up resources.  My biggest problem is running anti-malware on a box adds one more attack vector an attacker has.  Historically, there have been many instances where anti-malware software has made people more vulnerable, my favorite being <a href="http://secunia.com/advisories/18131/">this one</a>.</p>
<p>Finally, I want to add that viruses are already becoming passe.  Okay maybe not for Windows, but certainly Unix.  Just look at the pwn2own contest. Yeah, the Mac fell in like two minutes, but it had <strong>*nothing*</strong> to do with a virus, or any kind of malware that&#8217;s going to be detected.  And that&#8217;s the point. Linux, OS X, and other Unix OSes are not going to be taken by traditional malware.  Any attacker worth his salt is gonna do it through the web browser.  Email: lame.  Open ports: too much work.  SSH: maybe.  Web browser: booyah!</p>
<p>The web browser is the ultimate vector, because you as a user, are giving some portion of control of your computer to a remote machine. Just look at the recent OS X viruses, they change your system network settings so your traffic goes to the bad guys site.  Oh snap!</p>
<p>At any rate, PCI removing the statement that Unix systems are not commonly affected by malware has no basis in reality and exists <strong>*soley*</strong> to make big, slow, outdated, technology companies more money.</p>
<p>That&#8217;s bad enough in and of itself.  But what makes it worse is the fact that PCI auditors are just an army of box ticking robots.  Seriously.  Trying to reason with one is an exercise in futility.</p>
<p>Now the worst part:  There&#8217;s nothing we can do about it.  PCI can come up with any bull shit, cockamamie rule they feel like, and you have comply or you&#8217;re out of business.  Rant off.</p>
<p>P.S. &#8211; To any box ticking robots that read this, get off your Huffy and write to me.  I&#8217;m not an auditor, what&#8217;s your side of the story.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2009/04/10/your-baby-is-dead/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Native Bindings with Ruby Enterprise Edition</title>
		<link>http://www.jtanium.com/2008/10/13/using-native-bindings-with-ruby-enterprise-edition/</link>
		<comments>http://www.jtanium.com/2008/10/13/using-native-bindings-with-ruby-enterprise-edition/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 22:33:55 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[phusion]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[warehouse]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=63</guid>
		<description><![CDATA[I recently started using Passenger and Ruby Enterprise Edition to run my Rails apps. &#8220;It was just another day at the office, until suddenly&#8230;&#8221; I wanted to run Warehouse. It turns out that things get (just) slightly hairy when you need to use the native bindings for a library, in this case Subversion/SWIG. I ran [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started using <a href="http://www.modrails.com/">Passenger</a> and <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a> to run my Rails apps.</p>
<p>&#8220;It was just another day at the office, until suddenly&#8230;&#8221; I wanted to run <a href="http://www.warehouseapp.com/">Warehouse</a>.  It turns out that things get (just) slightly hairy when you need to use the native bindings for a library, in this case Subversion/SWIG.</p>
<p>I ran <code>rake warehouse:bootstrap</code> without incident, but as soon as I submitted the &#8216;install&#8217; form, it died.  This is what I found in the log:</p>
<pre>ActionView::TemplateError (/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in `const_missing': uninitialized constant Repository::Svn) on line #23 of repositories/index.html.erb:
20:
<li class="repo" id="repo-<%= repo.id %>">
21:     <%= link_to h(repo.name), hosted_url(repo, :admin) %>
22:     <span class="log"><%= repo.path %></span>
23:   <% if repo.sync? %>
24:   <% unless repo.sync_progress == 100 %>
25:
26:
<div class="need-sync" id="sync-<%= repo.id %>">

    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/vendor/plugins/expiring_attr_reader/lib/expiring_attr_reader.rb:32:in `silo'
    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/app/models/repository.rb:137:in `retrieve_silo'
    (eval):1:in `silo'
    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/app/models/repository.rb:100:in `eval'
    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/vendor/plugins/expiring_attr_reader/lib/expiring_attr_reader.rb:32:in `silo'
    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/app/models/repository.rb:100:in `sync?'
    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/app/views/repositories/index.html.erb:23:in `_run_erb_47app47views47repositories47index46html46erb'
    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/app/views/repositories/index.html.erb:19:in `each'
    /srv/rails/entp-warehouse-78376218f92e6bdf8b72993d9caa384e5d4a5c66/app/views/repositories/index.html.erb:19:in `_run_erb_47app47views47repositories47index46html46erb'
...</pre>
<p>Naturally I had installed the bindings using <code>sudo apt-get install libsvn-ruby1.8</code> so they were available to the default Ruby (located in <code>/usr/lib/ruby</code>), but not Ruby Enterprise Edition (located in <code>/opt/ruby-enterprise</code>), which the application runs on.</p>
<p>My solution was to simply symlink the Subversion bindings into Ruby Enterprise Edition.  A quick look in the libsvn-ruby package (<code>sudo dpkg -L libsvn-ruby1.8</code>) shows us what we&#8217;re dealing with:</p>
<pre>...
/usr/lib/ruby/1.8/i486-linux
/usr/lib/ruby/1.8/i486-linux/svn
/usr/lib/ruby/1.8/i486-linux/svn/ext
/usr/lib/ruby/1.8/i486-linux/svn/ext/core.so
/usr/lib/ruby/1.8/i486-linux/svn/ext/client.so
/usr/lib/ruby/1.8/i486-linux/svn/ext/delta.so
/usr/lib/ruby/1.8/i486-linux/svn/ext/fs.so
/usr/lib/ruby/1.8/i486-linux/svn/ext/ra.so
/usr/lib/ruby/1.8/i486-linux/svn/ext/repos.so
/usr/lib/ruby/1.8/i486-linux/svn/ext/wc.so
/usr/lib/ruby/1.8/svn
/usr/lib/ruby/1.8/svn/client.rb
/usr/lib/ruby/1.8/svn/core.rb
/usr/lib/ruby/1.8/svn/delta.rb
/usr/lib/ruby/1.8/svn/error.rb
/usr/lib/ruby/1.8/svn/fs.rb
/usr/lib/ruby/1.8/svn/info.rb
/usr/lib/ruby/1.8/svn/ra.rb
/usr/lib/ruby/1.8/svn/repos.rb
/usr/lib/ruby/1.8/svn/util.rb
/usr/lib/ruby/1.8/svn/wc.rb
...</pre>
<p>The key directories are: <code>/usr/lib/ruby/1.8/i486-linux/svn</code> and <code>/usr/lib/ruby/1.8/svn</code>.  So we&#8217;ll make them available to <code>/opt/ruby-enterprise</code> like so:</p>
<pre>cd /opt/ruby-enterprise/lib/ruby/1.8
sudo ln -s /usr/lib/ruby/1.8/svn
cd /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/i686-linux
sudo ln -s /usr/lib/ruby/1.8/i486-linux/svn</pre>
<p>After that, just restart Apache (<code>apache2ctl restart</code>), and it should be working.  Note, a simple <code>touch tmp/restart.txt</code> won&#8217;t work, because that doesn&#8217;t reload the libraries.  You actually need the <code>/opt/ruby-enterprise/ruby</code> process to restart.</p>
<p>Theoretically this same approach should work for any native bindings you need to be available to Ruby Enterprise Edition.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2008/10/13/using-native-bindings-with-ruby-enterprise-edition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>(update-)alternatives install java</title>
		<link>http://www.jtanium.com/2008/01/28/update-alternatives-install-java/</link>
		<comments>http://www.jtanium.com/2008/01/28/update-alternatives-install-java/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 23:52:42 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=60</guid>
		<description><![CDATA[Here&#8217;s the command to install an alternative installation of Java: alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_04/bin/java 99 In this case I used the self extracting file (not the RPM) from Sun, and moved the directory to /usr/lib/jvm/jdk1.6.0_04. Update: To finish it off, you need to do this: alternatives --config java There are 2 programs which provide [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the command to install an alternative installation of Java:</p>
<pre>alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_04/bin/java 99</pre>
<p>In this case I used the self extracting file (not the RPM) from Sun, and moved the directory to <code>/usr/lib/jvm/jdk1.6.0_04</code>.</p>
<p>Update:<br />
To finish it off, you need to do this:</p>
<pre>alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /usr/lib/jvm/jdk1.6.0_04/bin/java

Enter to keep the current selection[+], or type selection number: 2
[root@localhost jvm]# java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)</pre>
<p>Sometimes SELinux will prevent something from launching (e.g. Eclipse), and you&#8217;ll have to run a command like:</p>
<pre>chcon -t textrel_shlib_t /usr/lib/jvm/jdk1.6.0_04/jre/lib/i386/clientlibjvm.so</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2008/01/28/update-alternatives-install-java/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bash Launcher Loop</title>
		<link>http://www.jtanium.com/2008/01/03/bash-launcher-loop/</link>
		<comments>http://www.jtanium.com/2008/01/03/bash-launcher-loop/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 18:02:14 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=59</guid>
		<description><![CDATA[Have you written a bash script that executes a command in a loop, maybe to relaunch a process after it dies? What do you do when that process keeps dying? Enter the Bash Launcher Loop: #!/bin/bash # maximum number of attempts to launch max_launches=2 # maximum number of launches allowed in $reset seconds runaway_max=8 # [...]]]></description>
			<content:encoded><![CDATA[<p>Have you written a bash script that executes a command in a loop, maybe to relaunch a process after it dies?  What do you do when that process keeps dying?</p>
<p>Enter the Bash Launcher Loop:</p>
<pre>#!/bin/bash

# maximum number of attempts to launch
max_launches=2
# maximum number of launches allowed in $reset seconds
runaway_max=8
# minimum
min_seconds=1
# number of seconds to let process run before reset
reset_seconds=10

# number of attempts to launch
launch_attempts_count=0
start_time=`date +%s`

while true; do

  echo "Executing ($launch_attempts_count)..."
#  sleep 1

  # increment the number of launch attempts
  launch_attempts_count=$(($launch_attempts_count+1))
  # get the number of seconds since the start time...
  time=$((`date +%s`-$start_time))
  # if we launched more than $max_launches in less than $min_seconds, then
  # for some reason the process can't start, so exit
  if [ $launch_attempts_count -gt $max_launches -a $time -lt $min_seconds ]; then
    echo "Too many launches!"
    exit 1
  fi
  # If we haven't exceeded the threshold for failed starts, but
  # the process isn't running long enough to reset the counters,
  # we can guess there's a problem that keeps causing the process
  # to crash, so we should probably give up for now
  if [ $launch_attempts_count -gt $runaway_max ]; then
    echo "Process keeps crashing"
    exit 1
  fi
  # If the process has been running for more than $max_seconds, then
  # we're going to assume it was working properly, so reset the counters.
  # Normally, $max_seconds would be set to something like 3600 (1 hour).
  if [ $time -gt $reset_seconds ]; then
    launch_attempts_count=0
    start_time=`date +%s`
  fi

done</pre>
<p>The script above will stop trying to launch the process if:</p>
<ul>
<li>if there are more than 2 launch attempts in 1 second (printing &#8220;Too many launches!)</li>
<li>if there are more than 8 launch attempts in 10 seconds (printing &#8220;Process keeps crashing!)</li>
</ul>
<p>If the process is relaunched less than 8 times in 10 seconds, the <code>$start_time</code> and <code>$launch_attempts_count</code> will be reset, thus starting over.</p>
<p>To see this in action just run the script like it is, and the output will be:</p>
<pre>Executing (0)...
Executing (1)...
Executing (2)...
Too many launches!</pre>
<p>Now uncomment line 19 (<code>#  sleep 1</code>), and the output will be:</p>
<pre>Executing (0)...
Executing (1)...
Executing (2)...
Executing (3)...
Executing (4)...
Executing (5)...
Executing (6)...
Executing (7)...
Executing (8)...
Process keeps crashing</pre>
<p>Finally, change line 19 from <code>sleep 1</code> to <code>sleep 2</code>, and the output will be:</p>
<pre>Executing (0)...
Executing (1)...
Executing (2)...
Executing (3)...
Executing (4)...
Executing (5)...
Executing (0)...
Executing (1)...
Executing (2)...
Executing (3)...
Executing (4)...
Executing (5)...
Executing (0)...</pre>
<p>And so on, until you hit ctrl+c.</p>
<p>Obviously those values are just for demo purposes.  Better production values would be:</p>
<pre>max_launches=2
runaway_max=2
min_seconds=1
reset_seconds=3600</pre>
<p>This tells the script to exit if there are more than two launch attempts in one second or more than two in one hour, otherwise it will just keep running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2008/01/03/bash-launcher-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash: Get current script name and absolute paths</title>
		<link>http://www.jtanium.com/2007/12/21/bash-get-current-script-name-and-relative-and-absolute-paths/</link>
		<comments>http://www.jtanium.com/2007/12/21/bash-get-current-script-name-and-relative-and-absolute-paths/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 20:45:34 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=57</guid>
		<description><![CDATA[#!/usr/bin/env bash echo " \\$0: $0" _my_name=`basename $0` if [ "`echo $0 &#124; cut -c1`" = "/" ]; then _my_path=`dirname $0` else _my_path=`pwd`/`echo $0 &#124; sed -e s/$_my_name//` fi echo " Filename: $_my_name" echo "Absolute path: $_my_path"]]></description>
			<content:encoded><![CDATA[<pre>#!/usr/bin/env bash

echo "           \\$0: $0"

_my_name=`basename $0`
if [ "`echo $0 | cut -c1`" = "/" ]; then
  _my_path=`dirname $0`
else
  _my_path=`pwd`/`echo $0 | sed -e s/$_my_name//`
fi

echo "     Filename: $_my_name"
echo "Absolute path: $_my_path"</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2007/12/21/bash-get-current-script-name-and-relative-and-absolute-paths/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>OS X and Off Screen Windows: WTF?</title>
		<link>http://www.jtanium.com/2007/09/25/os-x-and-off-screen-windows-wtf/</link>
		<comments>http://www.jtanium.com/2007/09/25/os-x-and-off-screen-windows-wtf/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 04:38:53 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=48</guid>
		<description><![CDATA[This message is for Apple&#8230; You&#8217;re supposed to have the best user interface in the world. But I found a fatal flaw. There&#8217;s no way to get windows back on the main screen.* For me it was Parallels Desktop Snapshot Manager; I used it one time when I had a second monitor hooked up. Why [...]]]></description>
			<content:encoded><![CDATA[<p>This message is for <a href="http://www.apple.com">Apple</a>&#8230;</p>
<p>You&#8217;re supposed to have the best user interface in the world.  But I found a fatal flaw.  There&#8217;s no way to get windows back on the main screen.*  For me it was Parallels Desktop Snapshot Manager; I used it one time when I had a second monitor hooked up.</p>
<p>Why is this not directed at Parallels themselves?  I understand that in a perfect world all software would &#8220;do the right thing,&#8221; in this case, figure out if it&#8217;s drawing windows off screen, and remedy the situation.  I&#8217;m guessing this is what Apple&#8217;s software does, since their software doesn&#8217;t seem to suffer from this problem.  But we don&#8217;t live in a perfect world, so Apple you should give me a way to deal with this.  GNOME allows me to manipulate windows with keyboard shortcuts?  I&#8217;ll bet Win-blows will let me do it.  Why can&#8217;t Aqua?</p>
<p>[end-rant]</p>
<p>* &#8211; Actually there is a way: go in and delete the plist file(s) for the application in question, but that is entirely too complicated for most users, and just plain sucks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2007/09/25/os-x-and-off-screen-windows-wtf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache2 on Feisty</title>
		<link>http://www.jtanium.com/2007/09/06/apache2-on-feisty/</link>
		<comments>http://www.jtanium.com/2007/09/06/apache2-on-feisty/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 02:39:13 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=44</guid>
		<description><![CDATA[So I kept running into the following problem on my shiny new Feisty server: * Starting web server (apache2)... Syntax error on line 141 of /etc/apache2/apache2.conf: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration After a bit of Googling, I found this bug in Ubuntu. The lame [...]]]></description>
			<content:encoded><![CDATA[<p>So I kept running into the following problem on my shiny new Feisty server:</p>
<pre>
 * Starting web server (apache2)...
Syntax error on line 141 of /etc/apache2/apache2.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration</pre>
<p>After a bit of <a href="http://www.google.com/search?hl=en&#038;client=firefox-a&#038;rls=com.ubuntu%3Aen-US%3Aofficial&#038;hs=6m8&#038;q=feisty+Syntax+error+line+141+apache2.conf+Invalid+command+%27Order%27&#038;btnG=Search">Googling</a>, I found this <a href="https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/95162">bug</a> in Ubuntu.  The lame part is it&#8217;s not been fixed, and probably won&#8217;t be since the focus is on Gutsy&#8230;</p>
<p>Anywho, it suggested loading <code>mod_authz_host</code>, like so:</p>
<pre>sudo a2enmod authz_host</pre>
<p>But when I tried to start Apache again, I got this:</p>
<pre>
 * Starting web server (apache2)...
Syntax error on line 145 of /etc/apache2/apache2.conf:
Invalid command 'TypesConfig', perhaps misspelled or defined by a module not included in the server configuration</pre>
<p>Grrr&#8230;  Another <a href="http://www.google.com/search?q=Invalid+command+%27TypesConfig%27%2C&#038;ie=utf-8&#038;oe=utf-8&#038;aq=t&#038;rls=com.ubuntu:en-US:official&#038;client=firefox-a">Google search</a> led me to <a href="http://www.netadmintools.com/art398.html">this useful page</a>, which told me the missing module here is <code>mod_mime</code>.  Load that like so:</p>
<pre>sudo a2enmod mime</pre>
<p>And you should see:</p>
<pre> * Starting web server (apache2)...        [ OK ]</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2007/09/06/apache2-on-feisty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS 5 / MySQL 5.0.x / Ruby</title>
		<link>http://www.jtanium.com/2007/09/05/centos-5-mysql-50x-ruby/</link>
		<comments>http://www.jtanium.com/2007/09/05/centos-5-mysql-50x-ruby/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 18:31:07 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=42</guid>
		<description><![CDATA[I installed MySQL from the binaries on dev.mysql.com, here&#8217;s how I was able to build the native bindings. First, I installed the MySQL &#8220;Server&#8221;, &#8220;Client&#8221;, and &#8220;Headers and Libraries&#8221; binaries. Next, after Ruby and RubyGems were installed, I did this: sudo gem install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql Voila!]]></description>
			<content:encoded><![CDATA[<p>I installed MySQL from the binaries on dev.mysql.com, here&#8217;s how I was able to build the native bindings.</p>
<p>First, I installed the MySQL &#8220;Server&#8221;, &#8220;Client&#8221;, and &#8220;Headers and Libraries&#8221; binaries.  Next, after Ruby and RubyGems were installed, I did this:</p>
<pre>sudo gem install mysql --  --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql</pre>
<p>Voila!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2007/09/05/centos-5-mysql-50x-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search and Replace</title>
		<link>http://www.jtanium.com/2007/08/11/search-and-replace/</link>
		<comments>http://www.jtanium.com/2007/08/11/search-and-replace/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 20:08:14 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/blog/?p=39</guid>
		<description><![CDATA[I always seem to misplace these&#8230; find . -name "*.rb" -exec sed 's/oldstring/newstring' {} \; find . -name "*.yml" &#124; xargs perl -pi~ -e 's/oldstring/newstring/g;' Essentially they do the same thing, the first uses sed, the second uses Perl. Watch out what you&#8217;re doing with these! If you use find . -type f in a [...]]]></description>
			<content:encoded><![CDATA[<p>I always seem to misplace these&#8230;</p>
<p><code>find . -name "*.rb" -exec sed 's/oldstring/newstring' {} \;</code></p>
<p><code>find . -name "*.yml" | xargs perl -pi~ -e 's/oldstring/newstring/g;'</code></p>
<p>Essentially they do the same thing, the first uses <code>sed</code>, the second uses Perl.  Watch out what you&#8217;re doing with these!  If you use <code>find . -type f</code> in a directory managed by Subversion, prepare for some headaches.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2007/08/11/search-and-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

