<?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>My Foo Is Strong</title>
	<atom:link href="http://blog.subaquatic.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.subaquatic.net</link>
	<description>Another superfluous development, Java, Linux and technology blog. Now with iOS!</description>
	<lastBuildDate>Sat, 19 Jan 2013 01:54:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Xcode GCD Snippets</title>
		<link>http://blog.subaquatic.net/archives/xcode-gcd-snippets/</link>
		<comments>http://blog.subaquatic.net/archives/xcode-gcd-snippets/#comments</comments>
		<pubDate>Sat, 19 Jan 2013 01:54:13 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Objective-c]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=856</guid>
		<description><![CDATA[Provide new Grand Central Dispatch snippets for Xcode to solve the problem of Xcode attempting to code complete with dispatch_after.  Drop in ready snippets are included. <a href="http://blog.subaquatic.net/archives/xcode-gcd-snippets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is going to be short and sweet.  For all those Mac/iOS developers that use Grand Central Dispatch, you&#8217;re probably tired of Xcode attempting to code complete <code>dispatch_after</code> once you&#8217;ve hit the dispatch_a while typing.  99.999999% of the time I&#8217;m after dispatch_async.  It drives me crazy.  </p>
<p>Interestingly enough Apple provided a dispatch_after code snippet, but not one for dispatch_async. A side effect of this oversight is that the code completion appears to show snippets first.  So I&#8217;ve created two additional snippets that reflect the most common use cases that I encounter &#8211; dispatch_async with a global or main queue.</p>
<p>Download my <a href="http://blog.subaquatic.net/wp-content/uploads/2013/01/gcd_snippets.zip">Xcode GCD Snippets</a> and install into <code>~/Library/Developer/Xcode/UserData/CodeSnippets</code> and restart xcode.  </p>
<p>Enjoy and never again see <code>dispatch_after</code>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/xcode-gcd-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting server bit rate in AVFoundation</title>
		<link>http://blog.subaquatic.net/archives/getting-server-bit-rate-in-avfoundation/</link>
		<comments>http://blog.subaquatic.net/archives/getting-server-bit-rate-in-avfoundation/#comments</comments>
		<pubDate>Sat, 27 Oct 2012 03:14:01 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Objective-c]]></category>
		<category><![CDATA[AVFoundation]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=835</guid>
		<description><![CDATA[I was recently asked if it would be possible to provide the bit rate of the stream that is currently being viewed. Figuring that it would be possible as it has to be something that&#8217;s known to the AVPlayer, I &#8230; <a href="http://blog.subaquatic.net/archives/getting-server-bit-rate-in-avfoundation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I was recently asked if it would be possible to provide the bit rate of the stream that is currently being viewed.  Figuring that it would be possible as it has to be something that&#8217;s known to the AVPlayer, I agreed.  Fortunately, I was correct.  Unfortunately, it wasn&#8217;t as quick of an answer as I originally believed.  Here&#8217;s how I solved it.</p>
<p><span id="more-835"></span></p>
<h4>Background</h4>
<p>Before we get to the implementation details, a little background is necessary.  If you use <a href="https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html" title="HTTP Live Streaming Overview" target="_blank">HTTP Live Streaming</a> and <a href="https://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html" title="AV Foundation Programming Guide" target="_blank">AVFoundation</a>, typically you encode your content at multiple bit rates so that the client can deliver suitable content over a wide spectrum of conditions.  This can and typically does happen throughout the playback of your content with AVFoundation switching streams, either higher or lower, depending on network conditions.  The result is that the actual bit rate can be a very transient value. </p>
<p>Additionally, we also need to clarify that there&#8217;s really two bit rates; an implied bit rate, and an observed bit rate.  What&#8217;s the difference?  The answer is relatively simple.  The implied bit rate is the rate in which the server has encoded the media to be displayed and represents a minimum rate level that the client should be able to maintain to properly display the content.  The observed bit rate then is the rate that the player actually observed.  Where the implied bit rate is provided by the server, the observed is calculated by the player itself.  In this instance, we&#8217;re going to provide the implied bit rate.  </p>
<h4>Details</h4>
<p>The docs for AVFoundation don&#8217;t point to an obvious solution.  The <a href="https://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html#//apple_ref/doc/uid/TP40010188">AV Foundation Programming Guide</a> doesn&#8217;t provide any insight on the matter either.  Well, maybe one nugget. Here&#8217;s a simplified class diagram of the relevant parts of AVPlayer.</p>
<p><a href="http://blog.subaquatic.net/wp-content/uploads/2012/10/AVPlayer-Layout.png"><img src="http://blog.subaquatic.net/wp-content/uploads/2012/10/AVPlayer-Layout.png" alt="" title="AVPlayer Layout" width="557" height="318" class="aligncenter size-full wp-image-844" /></a></p>
<p>When media is being played, <code>AVPlayer</code> is really presenting the contents of it&#8217;s currentItem, which is an <code>AVPlayerItem</code> class.  If you look closely at the API docs for <code>AVPlayerItem</code>, you will see the <code>-accessLog</code> method which is defined as, &#8220;[returning] an object that represent a snapshot of the network access log.&#8221;  We&#8217;re getting closer.</p>
<p>Falling down the rabbit hole we find that the returned object, an <code>AVPlayerItemAccessLog</code> contains an events property that is a simple <code>NSArray</code> of <code>AVPlayerItemAccessLogEvent</code> objects.  One more iteration and we find it.  Within the <code>AVPlayerItemAccessLogEvents</code> we find two properties that appear to be related to the bit rate.  The <code>indicatedBitrate</code> and the <code>observedBitrate</code>.</p>
<p>After testing these I can verify they are indeed usable.  The <code>indicatedBitrate</code> is the bitrate reported by the server proving the HLS stream, and therefore &#8220;indicated.&#8221;  The <code>observedBitrate</code> is an empirical value that&#8217;s derived from the data received by AVPlayer and represent a more real-world calculation of the players bit rate.</p>
<p>As usual, the actual research took longer than the coding.  Here&#8217;s hoping to save someone else the pain of &#8220;falling down the rabbit hole.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/getting-server-bit-rate-in-avfoundation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Provide a library that works with an iOS device and the simulator.</title>
		<link>http://blog.subaquatic.net/archives/provide-a-library-that-works-with-an-ios-device-and-the-simulator/</link>
		<comments>http://blog.subaquatic.net/archives/provide-a-library-that-works-with-an-ios-device-and-the-simulator/#comments</comments>
		<pubDate>Sat, 25 Aug 2012 21:36:41 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Objective-c]]></category>
		<category><![CDATA[protip]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=828</guid>
		<description><![CDATA[To create a combined library: 1.) Compile library for each SDK as usual. 2.) lipo -create libdevice.a libsimulator.a -output libcombined.a That&#8217;s it.]]></description>
				<content:encoded><![CDATA[<p>To create a combined library:</p>
<p>1.) Compile library for each SDK as usual.<br />
2.) <code>lipo -create libdevice.a libsimulator.a -output libcombined.a</code></p>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/provide-a-library-that-works-with-an-ios-device-and-the-simulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide unwanted external drives on the Mac OSX desktop</title>
		<link>http://blog.subaquatic.net/archives/hide-unwanted-external-drives/</link>
		<comments>http://blog.subaquatic.net/archives/hide-unwanted-external-drives/#comments</comments>
		<pubDate>Wed, 01 Aug 2012 03:27:11 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[protip]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=821</guid>
		<description><![CDATA[I have a number of external hard drives attached to my Mac. Some for Time Machine, others for iTunes media, but they&#8217;re all external drives. In the MacOS finder preferences you have the ability to hide items from the desktop, &#8230; <a href="http://blog.subaquatic.net/archives/hide-unwanted-external-drives/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I have a number of external hard drives attached to my Mac.  Some for Time Machine, others for iTunes media, but they&#8217;re all external drives.  In the MacOS finder preferences you have the ability to hide items from the desktop, and one of those is aptly labeled, &#8220;External disks.&#8221;</p>
<p>I like the desktop clutter free, and mounted volumes that I&#8217;ll never directly need access to (away from the command line), I don&#8217;t want to see on the desktop. However, I do want to see items like USB flash drives mounted on the desktop.  Unfortunately these items are all considered &#8220;External disks.&#8221;  However there is a solution.</p>
<p>And it&#8217;s a very simple solution.  First, make sure that Finder is configured to display external disks on the desktop.  The real answer lies in using the built in file flags that are part of Mac OSX.  Simply issue a <code>chflags hidden [file]</code> and you&#8217;re already the majority of the way there.</p>
<p>Example:</p>
<pre type="shell">
$ chflags hidden /Volumes/Time\ Machine/
$ chflags hidden /Volumes/Media/
</pre>
<p>You can verify that the flags were set by using:</p>
<pre type="shell">
$ ls -ldO /Volumes/Media
drwxrwxr-x@ 11 jhowk  staff  hidden 442 Jul 29 18:29 /Volumes/Media
</pre>
<p>The last item that needs to be done is to restart the Finder. The <code>chflags</code> changes will not be reflected until the Finder has been restarted.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/hide-unwanted-external-drives/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Subversion recommits</title>
		<link>http://blog.subaquatic.net/archives/subversion-recommits/</link>
		<comments>http://blog.subaquatic.net/archives/subversion-recommits/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 19:11:22 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=784</guid>
		<description><![CDATA[A colleague at work was facing a dilemma and asked for help and I figured that the solution might be usable for others. Here&#8217;s the setup. Our SVN trunk typically matches production. Don&#8217;t ask why, it just does. Once a &#8230; <a href="http://blog.subaquatic.net/archives/subversion-recommits/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A colleague at work was facing a dilemma and asked for help and I figured that the solution might be usable for others.  Here&#8217;s the setup.  Our SVN trunk typically matches production.  Don&#8217;t ask why, it just does.  Once a release is pushed into production the contents of whatever was deployed is merged into trunk.  More like it obliterates what was in trunk.</p>
<p>In this particular case a commit was made after deployment but before the merge, effectively wiping out the changes to trunk.  However we still needed to have the commits re-applied.  We could have attempted some SVN slight-of-hand, but as it usually works out, the simplest solution is usually the best.</p>
<p>The easiest, and most scriptable solution was to use the way back machine and apply some<code>diff</code> and <code>patch</code> magic.  Here&#8217;s what we did (make sure your completely up to date when you do).</p>
<ol>
<li>Get the files that were changed in the previous revision with <br /><code>svn log -v -r [REV] |grep "^   M " |awk '{print $2}' |cut -c2-</code></li>
<li>Go old school and diff and patch<br /><code>svn diff -r [REV] [FILE] | patch -R [FILE]</code></li>
<li>Commit away!</li>
</ol>
<p>Assuming the changes you want applied are in version 2, and HEAD is at version 3, here&#8217;s how it might look</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">svn log</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-r</span> <span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^   M &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;">cut</span> -c2-<span style="color: #000000; font-weight: bold;">`</span>; 
<span style="color: #000000; font-weight: bold;">do</span> 
<span style="color: #c20cb9; font-weight: bold;">svn diff</span> <span style="color: #660033;">-r</span> HEAD <span style="color: #007800;">$f</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$f</span>; 
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>Lastly, issue the commit and your back to where you should be&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/subversion-recommits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get a quick fingerprint from public key</title>
		<link>http://blog.subaquatic.net/archives/get-a-quick-fingerprint-from-public-key/</link>
		<comments>http://blog.subaquatic.net/archives/get-a-quick-fingerprint-from-public-key/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 19:58:09 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[protip]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=764</guid>
		<description><![CDATA[Due to the GitHub &#8220;SSH Key Vulnerability&#8221;, all of my keys were deactivated and I needed to reactivate them. Without going into details about the issue, GitHub provides you a list of your key fingerprints that you need to validate &#8230; <a href="http://blog.subaquatic.net/archives/get-a-quick-fingerprint-from-public-key/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Due to the GitHub &#8220;SSH Key Vulnerability&#8221;, all of my keys were deactivated and I needed to reactivate them.  Without going into details about the issue, GitHub provides you a list of your key fingerprints that you need to validate and reactivate.  If you don&#8217;t know the fingerprints of your keys, you might think your stuck.  Not necessarily.</p>
<p>If you have the public key handy, you can do this:</p>
<pre>
ssh-keygen -l -f [public key file]
</pre>
<p>And you get exactly what you need; a fingerprint of your public key.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/get-a-quick-fingerprint-from-public-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xcode 4.3 quirks</title>
		<link>http://blog.subaquatic.net/archives/xcode-4-3-quirks/</link>
		<comments>http://blog.subaquatic.net/archives/xcode-4-3-quirks/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 22:57:22 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-c]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=765</guid>
		<description><![CDATA[With the Xcode 4.3 update, Xcode has become a full-fledged application in the App Store. There are a few implications to this seemingly innocuous change, but they can (and have) cause a few hiccups that I&#8217;m going to point out &#8230; <a href="http://blog.subaquatic.net/archives/xcode-4-3-quirks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>With the Xcode 4.3 update, Xcode has become a full-fledged application in the App Store.  There are a few implications to this seemingly innocuous change, but they can  (and have) cause a few hiccups that I&#8217;m going to point out below.  The obvious change is that Xcode is no longer installed via an installer.  Should help out tremendously for updates so developers are no longer forced to re-download a gigabyte plus of data for the small fraction that was actually updated.</p>
<p>More importantly though, is that Xcode <em>was</em> just one application in a suite of tools that was installed in /Developer.  In order for Xcode to become an &#8220;application&#8221; in the App Store vis-a-vis an installer, a number of changes were made that will affect Xcode users prior to 4.3.<br />
<span id="more-765"></span><br />
Here&#8217;s a summary of some of the changes that have been found.</p>
<ul>
<li>The contents of <code>/Developer</code> have been moved into <code>/Applications/Xcode.app/Contents/Developer</code>.</li>
<li>On my machine at least, xcode-select was not updated to point to this new directory, so command line invocations of some of the tools failed outright.<br />
To fix: <code>sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer</code></li>
<li>Some of the tools are still delivered, but quasi-hidden in the app bundle.<br />
<div id="attachment_771" class="wp-caption aligncenter" style="width: 537px"><a href="http://blog.subaquatic.net/wp-content/uploads/2012/02/developer_tool_menu.png"><img src="http://blog.subaquatic.net/wp-content/uploads/2012/02/developer_tool_menu.png" alt="Developer Tool Menu" title="developer_tool_menu" width="527" height="150" class="size-full wp-image-771" /></a><p class="wp-caption-text">Developer Tool Menu</p></div><br />
To access them, right-click on the Xcode icon and under &#8220;Open Developer Tool&#8221; five of the additional tools can be accessed.  Instruments, File Merge, Icon Composer, OpenGL ES Performance Detective, and Application Loader are found under this new menu option.</li>
</ul>
<p>If you want a full blown breakdown of the changes to Xcode 4.3, Peter Hosey has an excellent write up.  Check out <a href="http://boredzo.org/blog/archives/2012-02-17/xcode-and-friends">http://boredzo.org/blog/archives/2012-02-17/xcode-and-friends</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/xcode-4-3-quirks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a background texture behind a UITableView</title>
		<link>http://blog.subaquatic.net/archives/getting-a-background-texture-behind-a-uitableview/</link>
		<comments>http://blog.subaquatic.net/archives/getting-a-background-texture-behind-a-uitableview/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 19:28:51 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-c]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=754</guid>
		<description><![CDATA[In many apps when you viewing the top of a UITableView and you pull down you get one of three things: a plain white background (i.e. YouTube), a pull to refresh (i.e. twitter), or a textured or differently colored background &#8230; <a href="http://blog.subaquatic.net/archives/getting-a-background-texture-behind-a-uitableview/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In many apps when you viewing the top of a UITableView and you pull down you get one of three things:  a plain white background (i.e. YouTube),  a pull to refresh (i.e. twitter), or a textured or differently colored background (i.e. contacts). By default when you have a UITableView, you will get the first option, a plain white background.  </p>
<p>If however you would like to do something like contacts where the perceived &#8220;background&#8221; of the table view is something other than default.  If that&#8217;s the case, it&#8217;s relatively easy to do.  Here&#8217;s how.</p>
<p>In your <code>UITableViewController</code> (usually <code>viewDidLoad:</code>)</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// This sets the lighter linen looking background.  see UIColor for more &quot;System Colors&quot;</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self navigationController<span style="color: #002200;">&#93;</span> view<span style="color: #002200;">&#93;</span> setBackgroundColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIColor underPageBackgroundColor<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">// Make the background of the table view transparent.</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self tableView<span style="color: #002200;">&#93;</span> setBackgroundColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIColor clearColor<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>Then implement this method in your <code>UITableViewController</code>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView willDisplayCell<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableViewCell <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>cell forRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSIndexPath</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath
<span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>cell setBackgroundColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIColor whiteColor<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>After playing around and failing in different ways, this seems to be the simplest solution by far.  Simple, easy and does what it should.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/getting-a-background-texture-behind-a-uitableview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X Lion Clean Install Quirks</title>
		<link>http://blog.subaquatic.net/archives/mac-os-x-lion-clean-install-quirks/</link>
		<comments>http://blog.subaquatic.net/archives/mac-os-x-lion-clean-install-quirks/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 05:28:02 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[10.7]]></category>
		<category><![CDATA[Lion]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=735</guid>
		<description><![CDATA[I decided to do a clean install on my development laptop with Lion to clean out the cruft. Not that it really needed to be done, but I was curious to see if there were any discernible differences between the &#8230; <a href="http://blog.subaquatic.net/archives/mac-os-x-lion-clean-install-quirks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I decided to do a clean install on my development laptop with Lion to clean out the cruft.  Not that it really needed to be done, but I was curious to see if there were any discernible differences between the Snow Leopard (SL) upgrade and a clean install.</p>
<p>For those who are wondering, you can find a plethora of resources on how to do it if you so choose, but I did want to point out a few quirks that I ran into after the install.  I&#8217;m not sure if these are environmental differences that I had adjusted a some point in the past, but when I re-installed a clean version of Lion a few things changed.</p>
<ol>
<li>Mission Control &#8211; By default, there&#8217;s really only one space.  If you upgraded an existing SL installation and used spaces, it created them by default in MC.  Furthermore, Control-UP activates MC.  Control-Down does the old Exposé routine.</li>
<li>Tap to Drag &#8211; I don&#8217;t remember the actual starting state of this but I checked on another laptop and my desktop with the Magic Trackpad and they were configured the same so I&#8217;m working under the assumption that this may affect a few people like myself.  If you were used to the whole tap to drag routine, it&#8217;s not there &#8212; well technical it&#8217;s there but not active.  Once you activate the tap to click, tap to drag doesn&#8217;t.  And it&#8217;s not in the Trackpad preference pane either.  Strangely enough, it&#8217;s tucked away under Universal Access/ Mouse &amp; Trackpad/ Trackpad Options&#8230;<a rel="lightbox" href="http://blog.subaquatic.net/wp-content/uploads/2011/07/tap_to_drag.png"><img src="http://blog.subaquatic.net/wp-content/uploads/2011/07/tap_to_drag.png" alt="Universal Access Preference Pane" title="tap_to_drag" width="782" height="697" class="aligncenter size-full wp-image-740" /></a></li>
</ol>
<p>As I find more quirks I&#8217;ll update this post.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/mac-os-x-lion-clean-install-quirks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selective Site Mirroring with wget</title>
		<link>http://blog.subaquatic.net/archives/selective-site-mirroring-with-wget/</link>
		<comments>http://blog.subaquatic.net/archives/selective-site-mirroring-with-wget/#comments</comments>
		<pubDate>Wed, 11 May 2011 17:14:04 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[UNIX]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=728</guid>
		<description><![CDATA[Since Cloudera doesn&#8217;t seem to support an rsync server for us to mirror against, I had to resort to using wget to mirror their CDH distribution. To save some time for those who are attempting to do something similar, here&#8217;s &#8230; <a href="http://blog.subaquatic.net/archives/selective-site-mirroring-with-wget/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Since <a href="http://www.cloudera.com">Cloudera</a> doesn&#8217;t seem to support an <a href="http://rsync.samba.org/">rsync</a> server for us to mirror against, I had to resort to using <a href="http://www.gnu.org/software/wget/">wget</a> to mirror their CDH distribution.  To save some time for those who are attempting to do something similar, here&#8217;s a wget one-liner to grab only the RPM&#8217;s (while maintaining the directory structure):</p>
<p><code><br />
wget -N -r -nH -np --cut-dirs=3 -A rpm,xml http://archive.cloudera.com/redhat/cdh/3/<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/selective-site-mirroring-with-wget/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a Linux Boot ISO image to start via Kickstart</title>
		<link>http://blog.subaquatic.net/archives/create-a-linux-boot-iso-image-to-start-via-kickstart/</link>
		<comments>http://blog.subaquatic.net/archives/create-a-linux-boot-iso-image-to-start-via-kickstart/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 23:45:19 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[isolinux]]></category>
		<category><![CDATA[kickstart]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=695</guid>
		<description><![CDATA[Getting tired of creating new VM&#8217;s, and don&#8217;t want to clone for a particular reason but want them standardized? Easy. By creating a boot image that immediately starts a kickstart installation, you can completely automate creating a VM regardless of &#8230; <a href="http://blog.subaquatic.net/archives/create-a-linux-boot-iso-image-to-start-via-kickstart/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Getting tired of creating new VM&#8217;s, and don&#8217;t want to clone for a particular reason but want them standardized?  Easy.  By creating a boot image that immediately starts a kickstart installation, you can completely automate creating a VM regardless of virtualization solution your using.</p>
<p>To create the isolinux boot image:</p>
<p>Mount the DVD image.</p>
<p><code>mount -o loop /path/to/dvd.iso /mnt</code></p>
<p>Copy the data locally.</p>
<p><code>rsync -av /mnt/isolinux [where ever]</code></p>
<p>Edit the <code>isolinux.cfg</code> file to update and point to proper kickstart location, and make it auto start by setting <code>prompt</code> to 0.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">default linux
prompt 0
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
  kernel vmlinuz
  append initrd=initrd.img ks=nfs:192.168.0.1:/mnt/vg1/iso/kickstart/centos55_text.ks
label text
  kernel vmlinuz
  append initrd=initrd.img text
label ks
  kernel vmlinuz
  append ks initrd=initrd.img
label local
  localboot 1
label memtest86
  kernel memtest
  append -</pre></td></tr></table></div>

<p>Create a simple script in the isolinux directory to do the heavy lifting.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">#!/bin/sh
ISO_NAME=centos55_boot.iso
# Remove the old iso.
rm -f $ISO_NAME
# Make the image.
mkisofs -o $ISO_NAME -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T $PWD</pre></td></tr></table></div>

<p>Kick it off and you should now have a viable boot image.  Once you boot the newly created guest, just boot using the new image and it will automatically start your kickstart installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/create-a-linux-boot-iso-image-to-start-via-kickstart/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>OpenAM Apache Web Agent</title>
		<link>http://blog.subaquatic.net/archives/openam-apache-web-agent/</link>
		<comments>http://blog.subaquatic.net/archives/openam-apache-web-agent/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 20:13:16 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenAM]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=690</guid>
		<description><![CDATA[Make sure you set the Encode Cookie Value to Yes or True. If it&#8217;s not able to be modified, it&#8217;s an inherited setting that you will need to change. If you don&#8217;t, you&#8217;ll get a 500 error once a successful &#8230; <a href="http://blog.subaquatic.net/archives/openam-apache-web-agent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Make sure you set the Encode Cookie Value to Yes or True.  If it&#8217;s not able to be modified, it&#8217;s an inherited setting that you will need to change.  If you don&#8217;t, you&#8217;ll get a 500 error once a successful login has occurred.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/openam-apache-web-agent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update Postgres in Ubuntu</title>
		<link>http://blog.subaquatic.net/archives/update-postgres-in-ubuntu/</link>
		<comments>http://blog.subaquatic.net/archives/update-postgres-in-ubuntu/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 17:41:53 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=671</guid>
		<description><![CDATA[The Postgres website download page doesn&#8217;t do a great job of documenting how to keep PG up to the latest release. Even for those of us who are using 10.10, the standard repositories still point to older 8.X versions. To &#8230; <a href="http://blog.subaquatic.net/archives/update-postgres-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://www.postgresql.org">Postgres</a> website download page doesn&#8217;t do a great job of documenting how to keep PG up to the latest release.  Even for those of us who are using 10.10, the standard repositories still point to older 8.X versions.  To ensure that you have access to the latest version of PostgreSQL in Ubuntu, install <a href="https://launchpad.net/~pitti/+archive/postgresql">Martin Pitt&#8217;s backports</a> <a href="https://help.launchpad.net/Packaging/PPA">PPA</a>.  If you are running Ubuntu >= 9.10 you can do this with one simple command:</p>
<p><code>sudo add-apt-repository ppa:pitti/postgresql</code></p>
<p>Once that is done, you may need to enable the updates to use backports.  In Synaptic, open Settings -> Repositories and select the Updates tab.  Make sure that &#8220;Unsupported updates&#8221; is checked.</p>
<p><a rel="lightbox" href="http://blog.subaquatic.net/wp-content/uploads/2010/11/UbuntuSoftware-Sources.png"><img src="http://blog.subaquatic.net/wp-content/uploads/2010/11/UbuntuSoftware-Sources-440x437.png" alt="" title="Ubuntu Software Sources" width="440" height="437" class="aligncenter size-medium wp-image-672" /></a></p>
<p>Then just update as usual, and Postgres will be updated to the latest and greatest.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/update-postgres-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regex Recipes</title>
		<link>http://blog.subaquatic.net/archives/regex-recipes/</link>
		<comments>http://blog.subaquatic.net/archives/regex-recipes/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 04:11:50 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=628</guid>
		<description><![CDATA[Since I went through the time to create these, I might as well document a few of them for myself and anyone else who might be looking for it. As I refine and author more, I&#8217;ll add them here. Phone &#8230; <a href="http://blog.subaquatic.net/archives/regex-recipes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Since I went through the time to create these, I might as well document a few of them for myself and anyone else who might be looking for it.  As I refine and author more, I&#8217;ll add them here.</p>
<h3>Phone Number Validation</h3>
<p>This would be useful to validate phone numbers of customers, clients or prospects.  This only validates the 10 digit phone number that does not have parenthesis and dashes.  Minor modifications would be necessary to validate with those formatting characters included. (via <a href="http://www.nanpa.com/area_codes/index.html">NANPA</a>.)</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">^(8(?:00|88)|([2-9])(?!\2{2}|9[\d]|00|11)[\d]{2})([2-9&amp;&amp;[^5]][\d]{2}|(?:5(?!55)[\d]{2}))([\d]{4})$</pre></td></tr></table></div>

<p>[UPDATE: Didn't like what I had before and this should be a smaller, more optimized, version.]<br />
This regex covers:</p>
<ul>
<li>All ERC (Easily Recognizable Codes) which would include codes like 333,444,555, etc. </li>
<li>Allowance for toll-free numbers (800,866,877,888, etc.)</li>
<li>ERC Service codes 211,311,411,511,611,711,811,911.</li>
<li>Unallocated and/or premium codes (200,300,400,500,700,900, etc.)</li>
<li>Standard area codes from 201 to 989.</li>
<li>Removal of 555 Central Office prefix.</li>
</ul>
<p>If you want to give these a try there are a number of online utilities, but <a href="http://gskinner.com/RegExr/">RegExr</a> is one of my favorites.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/regex-recipes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install VirtualBox Guest Additions on CentOS 5.x</title>
		<link>http://blog.subaquatic.net/archives/install-virtualbox-guest-additions-on-centos-5-x/</link>
		<comments>http://blog.subaquatic.net/archives/install-virtualbox-guest-additions-on-centos-5-x/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 17:36:37 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=618</guid>
		<description><![CDATA[This has been documented many times before, but for some reason installing VirtualBox guest additions on CentOS is a pain. To install them: yum install kernel-devel gcc either ln -s /usr/src/kernel/[current version] /usr/src/linux or export KERN_DIR=/usr/src/kernel/[current version] Then the usual &#8230; <a href="http://blog.subaquatic.net/archives/install-virtualbox-guest-additions-on-centos-5-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This has been documented many times before, but for some reason installing VirtualBox guest additions on CentOS is a pain.  To install them:</p>
<ol>
<li><code>yum install kernel-devel gcc</code></li>
<li>either <code>ln -s /usr/src/kernel/[current version] /usr/src/linux</code> <strong>or</strong></li>
<li><code>export KERN_DIR=/usr/src/kernel/[current version]</code></li>
<li>Then the usual <code>./VBoxLinuxAdditions-[arch].run</code></li>
</ol>
<p>For whatever reason, the VirtualBox guest additions still expect to find the kernel headers in /usr/src/linux and not the location in which they are really installed to.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/install-virtualbox-guest-additions-on-centos-5-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Really Using OpenSSO with Salesforce</title>
		<link>http://blog.subaquatic.net/archives/really-using-opensso-with-salesforce/</link>
		<comments>http://blog.subaquatic.net/archives/really-using-opensso-with-salesforce/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 22:14:03 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[OpenAM]]></category>
		<category><![CDATA[OpenSSO]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=611</guid>
		<description><![CDATA[This subject has been covered many times before, but one thing that is not easily identified in ANY of them is that for this to work properly, you must be using a version of OpenSSO express, not enterprise. You&#8217;ll bang &#8230; <a href="http://blog.subaquatic.net/archives/really-using-opensso-with-salesforce/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This subject has been <a href="http://developers.sun.com/identity/reference/techart/salesforce.html">covered</a> <a href="http://indirat.wordpress.com/salesforce/">many</a> <a href="http://wiki.developerforce.com/index.php/Single_Sign-On_with_SAML_on_Force.com">times</a> before, but one thing that is not easily identified in ANY of them is that for this to work properly, <strong>you must be using a version of OpenSSO express, not enterprise</strong>.  You&#8217;ll bang your head against a rock looking for a solution.</p>
<p>The problem is that OpenSSO express doesn&#8217;t exist anymore.  Well not in a form supported/provided by Oracle.  ForgeRock now has it and it&#8217;s been rebranded to <a href="http://forgerock.com/openam.html">OpenAM</a>.  The good news is that all of these tutorials and documents still are valid &#8212; so long as you actually got the right piece of software.  </p>
<p>I wish that when folks write documentation they include specifics about the software they are writing about.  But then again, maybe it&#8217;s just me&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/really-using-opensso-with-salesforce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SalesForce.com JAX-WS &amp; Netbeans</title>
		<link>http://blog.subaquatic.net/archives/salesforce-com-jax-ws-netbeans/</link>
		<comments>http://blog.subaquatic.net/archives/salesforce-com-jax-ws-netbeans/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 17:04:48 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jaxws]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[salesforce.com]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=394</guid>
		<description><![CDATA[The process for using SalesForce.com (SFDC) webservices in Netbeans isn&#8217;t as intuitive as you would think. Most of the SFDC documentation examples are built using Apache Axis vis-a-vis JAX-WS. The good news is that it&#8217;s possible to get Netbeans (and &#8230; <a href="http://blog.subaquatic.net/archives/salesforce-com-jax-ws-netbeans/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The process for using <a href="http://www.salesforce.com">SalesForce.com</a> (SFDC) webservices in <a href="http://www.netbeans.org">Netbeans</a> isn&#8217;t as intuitive as you would think.  Most of the SFDC documentation examples are built using <a href="http://ws.apache.org/axis">Apache Axis</a> vis-a-vis JAX-WS.  The good news is that it&#8217;s possible to get Netbeans (and therefore JAX-WS) to properly build a WS client for SFDC.  </p>
<p>Once you&#8217;ve downloaded your organizations enterprise or partner WSDL, in Netbeans, right-click on the project and select New -> Web Service Client (if it&#8217;s not there then <code>New -> Other -> Web Services Category</code>, and then <code>Web Service Client</code>).  Select Local File and Browse to the location of your downloaded WSDL.  Specify your package and leave the Client Style as JAX-WS and &#8220;Generate Dispatch Code&#8221; unselected.</p>
<p>Netbeans will attempt to do it&#8217;s thing and fail with an error &#8211; however, it&#8217;s not the only thing standing between you and a working web service client in Netbeans.  Below is the error that I received.</p>
<p><a rel="lightbox" href="http://blog.subaquatic.net/wp-content/uploads/2010/02/Screenshot-Error.png"><br />
<img src="http://blog.subaquatic.net/wp-content/uploads/2010/02/Screenshot-Error-439x191.png" alt="" title="Screenshot-Error" width="439" height="191" class="aligncenter size-medium wp-image-532" /><br />
</a></p>
<p>In this case, it&#8217;s complaining about a ComplexType and element that share the same name.  There are two different ways to solve the problem and really only one that works with Netbeans.  To properly fix the issue (and have Netbeans &#8220;see&#8221; the fix) you need to create a JAX-WS binding document to prevent the naming collision from occurring.  To do this create a new file and cut and paste this into it.  You may have to adjust the <code>@targetNamespace='urn:enterprise.soap.sforce.com'</code> to whichever version (enterprise or partner) your using.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bindings</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:jaxb</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/xml/ns/jaxb&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:wsdl</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/xml/ns/jaxws&quot;</span> <span style="color: #000066;">wsdlLocation</span>=<span style="color: #ff0000;">&quot;../wsdl/enterprise.wsdl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bindings</span></span>
<span style="color: #009900;">    <span style="color: #000066;">node</span>=<span style="color: #ff0000;">&quot;//xsd:schema[@targetNamespace='urn:enterprise.soap.sforce.com']&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jaxb:globalBindings</span></span>
<span style="color: #009900;">      <span style="color: #000066;">underscoreBinding</span>=<span style="color: #ff0000;">&quot;asCharInWord&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jaxb:schemaBindings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jaxb:nameXmlTransform<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jaxb:typeName</span> <span style="color: #000066;">suffix</span>=<span style="color: #ff0000;">&quot;Type&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/jaxb:nameXmlTransform<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/jaxb:schemaBindings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bindings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enableWrapperStyle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enableWrapperStyle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enableAsyncMapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enableAsyncMapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bindings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>But we&#8217;re not done quite yet.  Even though the first attempt failed, Netbeans created a new &#8220;Web Service References&#8221; node in the Projects tree.  If you expand that node, you&#8217;ll see your webservice.  Right-click on the service and select &#8220;Edit Web Service Attributes&#8221;.  Select the &#8220;WSDL Customization&#8221; tab and scroll all the way to the bottom section named &#8220;External Binding Files&#8221;.  Expand it, and click &#8220;Add&#8221;.  Answer &#8220;Yes&#8221; to the dialog and then find the xml file you created earlier that contained the binding changes.  </p>
<p><a rel="lightbox" href="http://blog.subaquatic.net/wp-content/uploads/2010/04/Screenshot-enterprise.png"><img src="http://blog.subaquatic.net/wp-content/uploads/2010/04/Screenshot-enterprise-440x422.png" alt="" title="Screenshot-enterprise" width="440" height="422" class="aligncenter size-medium wp-image-573" /></a></p>
<p>Once you select &#8220;OK&#8221;, a dialog will appear indicating that a refresh of the client is underway.  At that point, Netbeans will attempt to re-create the client.  If all goes well you should have a working SFDC client in Netbeans.</p>
<h3>[UPDATE 1]</h3>
<p>The security model in the SFDC API is interesting.  In order to properly utilize the service, you must do two things after logging in. One, re-point to a URL that actually contains your organization, and two, make all subsequent calls to that new URL with a session ID that is provided as a result of the login process.  The good thing is it&#8217;s documented.  The bad thing is it&#8217;s not documented well at all for JAXWS.  What follows is a condensed version of what it took to make it really work.</p>
<h4>Repoint to the correct URL</h4>
<p>You log into one URL and as part of the LoginResponse you get the real URL of your organization.  All subsequent calls made after logging in must use this new URL.  It&#8217;s in the documentation and described well.  However, the redirection of subsequent calls requires the user (caller) to change the <code>ENDPOINT_ADDRESS_PROPERTY</code> to the new URL.  The SFDC documentation that uses Axis, shows that with Axis the ability to manipulate a SOAP binding property is relatively straightforward.  Unfortunately it&#8217;s not quite so simple with JAXWS.</p>
<p>All of the documentation regarding using JAXWS in SFDC focuses on the use of the non-standard <code>com.sun.xml.internal.ws.developer.WSBindingProvider</code> to get access to the SOAP binding properties to insert the new endpoint URL once the login has successfully completed.  For some reason, if you attempt to use this from <a href="https://glassfish.dev.java.net/">glassfish</a>, the downcast of the port to <code>WSBindingProvider</code> causes an exception preventing it from working properly and successfully getting the port to re-point to the proper endpoint URL.  However, I was able to figure a way around the WSBindingProvider to get access to the SOAP header to set the proper endpoint address.  I&#8217;ll detail that step in another post.</p>
<h4>Provide the proper session ID</h4>
<p>This workaround was somewhat simpler even though the <a href="http://www.jroller.com/gmazza/entry/using_implicit_soap_headers_with">reasons</a> are just a complex.  The short answer is that the SOAP headers are not implicitly defined in the Salesforce.com WSDL.  Because the SOAP headers are defined in the WSDL binding section instead of the portType section, they don&#8217;t become available and you won&#8217;t be able to get set the proper session ID wihout getting really creative.  The solution is very straightforward.  In the <code>WSImport Options</code> tab where you set the jaxb options, set one more <code>WSImport Option</code> as well.  Add in <code>xadditionalHeaders</code> and <code>true</code>.  </p>
<p><a rel="lightbox" href="http://blog.subaquatic.net/wp-content/uploads/2010/04/Screenshot-enterprise-1.png"><img src="http://blog.subaquatic.net/wp-content/uploads/2010/04/Screenshot-enterprise-1-440x422.png" alt="" title="Screenshot-enterprise-1" width="440" height="422" class="aligncenter size-medium wp-image-572" /></a></p>
<p>When done successfully, the method signatures will now include a parameter for the SessionHeader (where you set the sessionID).</p>
<p>I&#8217;m going to show a full working example of all of this in a subsequent post for those who want/need more information.</p>
<h3>[UPDATE 2]</h3>
<p>Upon further testing it appears that wsimport will disregard the <code>-XautoNameResolution</code> if you also provide a mapping file because they&#8217;re actually attempting to do the same thing.  Furthermore, if you just use <code>-XautoNameResolution</code> without the mapping, wsimport will work properly however Netbeans doesn&#8217;t &#8220;see&#8221; the fix and still complains even though you can compile and run.  Removing the references for <code>-XautoNameResolution</code> for now.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/salesforce-com-jax-ws-netbeans/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>The problem with technical books.</title>
		<link>http://blog.subaquatic.net/archives/the-problem-with-technical-books/</link>
		<comments>http://blog.subaquatic.net/archives/the-problem-with-technical-books/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 21:00:32 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=447</guid>
		<description><![CDATA[Introduction Technology books (especially programming books) are a required item for most software professionals and my office at work is littered with them. At any given time there are a dozen books that I may actively reference on a day-to-day &#8230; <a href="http://blog.subaquatic.net/archives/the-problem-with-technical-books/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Technology books (especially programming books) are a required item for most software professionals and my office at work is littered with them.  At any given time there are a dozen books that I may actively reference on a day-to-day basis for the projects that I&#8217;m working on.  My main library, literally, is my home.  I cycle books in and out of my house with the regularity of a public branch library; albeit one dedicated to technology.  I have racks of books in my basement where they are shelved and ready to be used when needed.  While not necessarily grouped and classified using structure of the <a href="http://en.wikipedia.org/wiki/Dewey_Decimal_Classification">Dewey Decimal System</a>, it&#8217;s good enough for me.</p>
<p>If you&#8217;ve been around software long enough you&#8217;ve been exposed to the almost universal maxim regarding software &#8212; it almost never stops changing.  Software changes and grows, sometimes organically, sometimes in rough and abrupt ways, but rarely does it stay constant.  Nascent projects change so rapidly that any attempt to produce good documentation usually leads to those same documents being outdated before they are published.  Luckily, maturity usually means a certain level of stability where documentation can be produced and consumed before a new version of the system is released and the documentation has to be updated.  It becomes an infinite, but necessary loop.</p>
<p>At some point someone may write a book on the subject at which point in time the current state of system is not only captured, but actually printed and bound, effectively freezing the state of the system for all time.  But if software is constantly evolving, doesn&#8217;t the material physically printed in these books become obsolete?  Yes, and it&#8217;s a common problem that those of us who purchase technology books have come to accept.  A technology book isn&#8217;t like most other books &#8212; it has a built in but hidden expiration date.  Because almost all software invariably changes, the printed page being a physical immutable object can no longer accurately describe the current state of the system.  Most readers of technology books learn this, and book publishers have grown smarter about it and started to identify the version of the software that the book applies to.</p>
<h2>The Problem</h2>
<p>At some point the printed material itself becomes more than outdated, it becomes obsolete.  I have collected hundreds of technology books over the years.  Some for work endeavors, others for personal learning, but all have served me well.  Unlike non-technology focused books, I have to periodically purge my collection to avoid the issues described earlier.  There may be someone who becomes interested in the lineage of a particular piece of software and therefore the book becomes a historical reference capturing the evolution of a piece of software.  But for most of us, they simple become unusable and start collecting dust.</p>
<p>With book prices typically ranging between $30.00 and $70.00, purchasing something that&#8217;s going to be out of date in the near future may not be the best financial decision in the long run.  Witness the prices for a used Java EJB book on <a href="http://www.amazon.com">Amazon</a>.</p>
<p><a rel="lightbox" href="http://blog.subaquatic.net/wp-content/uploads/2009/11/amazon_ejb_ss.png"><img class="size-medium wp-image-486 alignnone" title="amazon_ejb_ss" src="http://blog.subaquatic.net/wp-content/uploads/2009/11/amazon_ejb_ss-440x317.png" alt="amazon_ejb_ss" width="440" height="317" /></a></p>
<p>This particular title, is selling for $0.29 used.  Anyone who purchased this book new and at list price has lost 99.99% of it&#8217;s original value.  It&#8217;s understandable why.  This particular book has been in print since late 2004.  The subject matter is mature but now outdated.  The value that this book provides is limited to anyone who must still use or support this older version and the audience will continue to shrink over time.  To be fair to the authors of the book, an updated version of this book has already been released that addresses the improvements to EJBs.  The changes are sufficiently large enough to warrant re-purchasing the book again even if someone currently possesses the previous version.</p>
<p>After years of this, I think it&#8217;s getting wasteful. Both on my wallet and the amount of dead trees that I currently house in my personal library.  For my technical collection, I have wished for a solution that avoids the dead tree and continual update syndrome for those of us who purchase technology books are subject to.  I want authors to get paid, high quality material to continually be published, and I&#8217;m willing to re-purchase for documentation that contains significant changes or for new version.  However,  I also want to have access to updates and fixes to typographical and code examples.  Printed material just can&#8217;t offer that and my books are usually marked up with errata found on the publishers or book&#8217;s web site.  It&#8217;s not an optimal solution by any stretch of the imagination.</p>
<h2>An Interim Solution</h2>
<p>One interim solution that I have used for the last couple of years is <a href="http://www.safaribooksonline.com">Safari Books Online</a>.  Safari has multiple membership levels, and I subscribe to the one that gives unlimited access to the library for approximately $40.00 a month.  So for about the price of one physical book, you get access to a dizzying array of technical books for the same cost.  For me personally it&#8217;s worked well.  Here&#8217;s an example of the book discussed earlier.</p>
<p><a rel="lightbox" href="http://blog.subaquatic.net/wp-content/uploads/2009/11/safari_ejb_ss.png"><img class="alignnone size-medium wp-image-487" title="safari_ejb_ss" src="http://blog.subaquatic.net/wp-content/uploads/2009/11/safari_ejb_ss-440x317.png" alt="safari_ejb_ss" width="440" height="317" /></a></p>
<p>Safari allows me access to <em>all</em> versions of this book. As new editions are released, the updates are also released into the library satisfying my need for access to timely updates to typographical and code corrections.  The interface gives a true print fidelity view as well so what appears on the screen is what the book actually looks like printed.  Just as important, you can annotate, bookmark, and make notes.  Additionally, as a bonus, you are also given tokens that can be redeemed to download chapters and/or entire books into PDF form and kept offline.  Safari has a ton of features so it&#8217;s worth a look for someone who is purchasing books on a regular basis.</p>
<p>The problem with Safari is that it is a service.  Once you stop paying, you lose everything.  PDF&#8217;s you generate and have downloaded are yours, but everything else is gone.  So far it hasn&#8217;t been an issue, but it&#8217;s something to be aware of.  Finally, and this is a personal issue, I don&#8217;t really <em>enjoy</em> reading on a monitor.  Usually with most technical books it&#8217;s done in a reference type mode so it&#8217;s usually not a continual three hour session but nevertheless it&#8217;s not very ergonomic.</p>
<p>Overall Safari is great.  It deals with most of my issues about owning technical books.  I still have to read them online, but for the price, my technical collection expanded a hundred-fold and I never have to donate a book again.  As an interim solution I think it has worked well and I&#8217;ll continue to subscribe to Safari just for the unfettered access to a huge technical library.  Still, what I really want is something that I can hold in my hand but has the power of Safari.</p>
<h2>The Perfect Solution</h2>
<p>What I really would like is for the publishers of technical books to <em>always</em> provide a version of the book that could be used with the latest eReaders like the <a href="http://www.bn.com/nook">Barnes  &amp; Noble Nook</a> or the <a href="http://www.amazon.com/kindle">Amazon Kindle</a>.  If I could tote around one of those with a couple hundred technical eBooks, I&#8217;d be loving life.  I wouldn&#8217;t know what to do with myself if I could get access to Safari using the eReader as an interface.  The eBook concept, especially for technical books, is a great idea that is being offered more and more.  They&#8217;re priced considerably less that the printed version, and I don&#8217;t have to deal with the disposal issues later.</p>
<p>I think we&#8217;re close enough that I purchased a Nook.  The screen may be smallish for technical reading, but it&#8217;s a start and it has to be better than the monitor.  It can hold an entire libraries worth of book and it&#8217;s portable.  Only time will tell, but it&#8217;s a start.  As a result, I think I&#8217;ll convert this article into a series about getting technical material on eReaders.  As I progress I&#8217;ll continue the series.  Happy eReading for all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/the-problem-with-technical-books/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix zimbra logrotate issues</title>
		<link>http://blog.subaquatic.net/archives/fix-zimbra-logrotate-issues/</link>
		<comments>http://blog.subaquatic.net/archives/fix-zimbra-logrotate-issues/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 17:03:21 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[zimbra]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=436</guid>
		<description><![CDATA[If this error occurs on a host with Zimbra installed: /etc/cron.daily/logrotate: error: zimbra:64 unexpected text It&#8217;s due to a typographical error in /etc/logrotate.d/zimbra that has not been fixed in the latest release (6.0.3.) The log rotate configuration file for Zimbra &#8230; <a href="http://blog.subaquatic.net/archives/fix-zimbra-logrotate-issues/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If this error occurs on a host with <a href="http://www.zimbra.com">Zimbra</a> installed:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">/etc/cron.daily/logrotate:
error: zimbra:64 unexpected text</pre></td></tr></table></div>

<p>It&#8217;s due to a typographical error in <code>/etc/logrotate.d/zimbra</code> that has not been fixed in the latest release (6.0.3.)  The log rotate configuration file for Zimbra as delivered has a typographical error in the freshclam section.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">/opt/zimbra/log/freshclam.log {
    daily
    missingok
    copytruncate
    notifempty    create 0660 zimbra zimbra
    postrotate
     kill -HUP `cat /opt/zimbra/log/freshclam.pid 2&gt; /dev/null` 2&gt; /dev/null || true
    endscript
    compress
    size 5000k
    rotate 7
}</pre></td></tr></table></div>

<p>On line five, the <code>notifempty</code> and <code>create 0660 zimbra zimbra</code> have been concatenated together.  To fix, just move the <code>create</code> stanza to the next line like so.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">/opt/zimbra/log/freshclam.log {
    daily
    missingok
    copytruncate
    notifempty    
    create 0660 zimbra zimbra
    postrotate
     kill -HUP `cat /opt/zimbra/log/freshclam.pid 2&gt; /dev/null` 2&gt; /dev/null || true
    endscript
    compress
    size 5000k
    rotate 7
}</pre></td></tr></table></div>

<p>Be aware that since this isn&#8217;t officially fixed from the folks at Zimbra, any updates applied after this change is made may revert this back to the original, broken behavior.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/fix-zimbra-logrotate-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 12 on VirtualBox</title>
		<link>http://blog.subaquatic.net/archives/fedora-12-on-virtualbox/</link>
		<comments>http://blog.subaquatic.net/archives/fedora-12-on-virtualbox/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 17:30:52 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=430</guid>
		<description><![CDATA[Just a quick note that if you use the default VirtualBox settings during the &#8220;Create New Virtual Machine&#8221; wizard for a new install of Fedora 12, you&#8217;ll find that the .iso will boot to the live user screen, but when &#8230; <a href="http://blog.subaquatic.net/archives/fedora-12-on-virtualbox/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Just a quick note that if you use the default <a href="http://www.virtualbox.org">VirtualBox</a> settings during the &#8220;Create New Virtual Machine&#8221; wizard for a new install of <a href="http://fedoraproject.org">Fedora 12</a>, you&#8217;ll find that the .iso will boot to the live user screen, but when attempting to run the &#8220;Install to Hard Drive&#8221; installation routine, it&#8217;s runs for a second and then quits.</p>
<p>The problem is that the default memory settings in VirtualBox for fedora are insufficient.  Reset the system base memory to a more appropriate 512MB and you&#8217;ll find the installation routine runs as expected.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/fedora-12-on-virtualbox/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Fix Logwatch emails on Zimbra hosts</title>
		<link>http://blog.subaquatic.net/archives/fix-logwatch-emails-on-zimbra-hosts/</link>
		<comments>http://blog.subaquatic.net/archives/fix-logwatch-emails-on-zimbra-hosts/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 16:53:54 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[logwatch]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[zimbra]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=396</guid>
		<description><![CDATA[We&#8217;ve had an issue for a while where Logwatch emails are not getting through properly in Zimbra with Zimbra complaining about relay issues. While our migration to Zimbra will be the subject of another, much longer post, our last remaining &#8230; <a href="http://blog.subaquatic.net/archives/fix-logwatch-emails-on-zimbra-hosts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>We&#8217;ve had an issue for a while where <a href="http://www.logwatch.org">Logwatch</a> emails are not getting through properly in <a href="http://www.zimbra.com">Zimbra</a> with Zimbra complaining about relay issues.  While our migration to Zimbra will be the subject of another, much longer post, our last remaining issue looks to be finally resolved.  Here&#8217;s what we found.</p>
<p/>
The solution was relatively simple:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">[zimbra@zimbra ~]$ zmprov mcf zimbraMtaMyDestination 'localhost zimbra.subaquatic.net'</pre></td></tr></table></div>

<p>
That allowed us to use the /etc/aliases file and forward logwatch emails destined for root to our mailbox of choice.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/fix-logwatch-emails-on-zimbra-hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy ways to convert a man page</title>
		<link>http://blog.subaquatic.net/archives/easy-ways-to-convert-a-man-page/</link>
		<comments>http://blog.subaquatic.net/archives/easy-ways-to-convert-a-man-page/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 17:31:14 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Document Processing]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[man]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[roff]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=354</guid>
		<description><![CDATA[I typically author UNIX man pages for projects a couple of times a year. When I do, the next request I usually receive is to provide a hard copy of the man page as well. Depending on the system, there &#8230; <a href="http://blog.subaquatic.net/archives/easy-ways-to-convert-a-man-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I typically author UNIX man pages for projects a couple of times a year.  When I do, the next request I usually receive is to provide a hard copy of the man page as well.  Depending on the system, there are a litany of ways to convert a man page into something print ready.  Here&#8217;s a few:<br />
<span id="more-354"></span></p>
<p><h3>Adobe PDF  &#8211; The defacto standard.</h3>
<p>In most instances, an Adobe PDF of the file yields excellent results.  It&#8217;s simple enough to convert a man page to PDF:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">$ man -l -Tps /path/to/manpage | ps2pdf14 - manpage.pdf</pre></td></tr></table></div>

<p>It&#8217;s dead simple, and produces good output.  I haven&#8217;t run into any issues providing PDF&#8217;s in this manner.  Groff/troff don&#8217;t yet support a PDF as a output device, so for now the man page is output in PostScript and then converted into PDF.  If you&#8217;re not familar with <code>man</code>, the <code>-l</code> is for a local file.  If you want to do this on a known command (i.e. man itself), remove the <code>-l</code>.</p>
<h3>PostScript or DVI</h3>
<p>To produce PostScript or DVI output, it&#8217;s even easier than creating PDF&#8217;s as these devices are known to groff/troff.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">$ man -l -T[ps|dvi] /path/to/manpage &gt; manpage.[ps|dvi]</pre></td></tr></table></div>

<p>Remember that if you need/want to proof this on screen, you&#8217;ll need applications that can display PostScript and DVI files.  If your on Linux, evince can display both formats.  Windows folks are on their own.  To determine what devices are available, <code>man man</code> or <code>man groff</code> and look at the -T argument for output device possibilities.</p>
<h3>The screen?</h3>
<p>Typically when I author man pages and if I use some special formatting or more complex layouts, I want to graphically proof what I&#8217;ve done.  <code>xman</code> won&#8217;t work in these instances, and all that&#8217;s really needed is to get a good idea of what it&#8217;s going to look like when it&#8217;s printed.  The normal <code>man</code> command is good enough to get a textual reference, but not a graphical one, and the methods above are too cumbersome for a quick proof.  So is there another way to view it?  </p>
<p>
Yes there is and you get to go really old school with this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">$ troff -man /path/to/manpage | xditview -</pre></td></tr></table></div>

<p>or if your using some special macros (like tbl), you can use groff instead and have it invoke gxditview directly instead.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">$ groff -X -t -man /path/to/manpage</pre></td></tr></table></div>

<p>The nice thing is that you can print from <code>gxditview</code> if necessary.   It&#8217;s quick and easy to view a man page in this manner and works well for a quick look.  If you still want to keep it seriously old school the troff equivalent would be <code>tbl /path/to/manpage | troff -man -|xditview -</code></p>
<p>
Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/easy-ways-to-convert-a-man-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find supported LDAP syntaxes in OpenLdap</title>
		<link>http://blog.subaquatic.net/archives/find-supported-ldap-syntaxes-in-openldap/</link>
		<comments>http://blog.subaquatic.net/archives/find-supported-ldap-syntaxes-in-openldap/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 07:29:50 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[OpenLDAP]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=347</guid>
		<description><![CDATA[To lookup the supported syntaxes in OpenLdap, issue this command: ldapsearch -x -s base -b "cn=subschema" ldapsyntaxes Should end up with output like: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 &#8230; <a href="http://blog.subaquatic.net/archives/find-supported-ldap-syntaxes-in-openldap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To lookup the supported syntaxes in OpenLdap, issue this command:</p>
<pre>ldapsearch -x -s base -b "cn=subschema" ldapsyntaxes</pre>
<p>Should end up with output like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre></td><td class="code"><pre class="" style="font-family:monospace;"><span class="br0">&#91;</span>root@ldap schema<span class="br0">&#93;</span># ldapsearch  -x -s base -b &quot;cn=subschema&quot; ldapsyntaxes
# extended LDIF
#
# LDAPv3
# base &lt;cn=subschema&gt; with scope baseObject
# filter: <span class="br0">&#40;</span>objectclass=*<span class="br0">&#41;</span>
# requesting: ldapsyntaxes 
#
&nbsp;
# Subschema
dn: cn=Subschema
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.1.16.1 DESC 'UUID' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.1.1.0.1 DESC 'RFC2307 Boot Parameter' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.1.1.0.0 DESC 'RFC2307 NIS Netgroup Triple' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.52 DESC 'Telex Number' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.50 DESC 'Telephone Number' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.49 DESC 'Supported Algorithm' X-BIN
 ARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.45 DESC 'SubtreeSpecification' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.44 DESC 'Printable String' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.41 DESC 'Postal Address' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.40 DESC 'Octet String' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.39 DESC 'Other Mailbox' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.38 DESC 'OID' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.36 DESC 'Numeric String' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.34 DESC 'Name And Optional UID' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' X-NOT-HUMAN-READABLE
  'TRUE' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.27 DESC 'Integer' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5 String' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.24 DESC 'Generalized Time' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.22 DESC 'Facsimile Telephone Number
 ' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.14 DESC 'Delivery Method' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.2.36.79672281.1.5.0 DESC 'RDN' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.12 DESC 'Distinguished Name' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.11 DESC 'Country String' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.10 DESC 'Certificate Pair' X-BINARY
 -TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.9 DESC 'Certificate List' X-BINARY-
 TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.8 DESC 'Certificate' X-BINARY-TRANS
 FER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.7 DESC 'Boolean' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' X-NOT-HUMAN-READABL
 E 'TRUE' <span class="br0">&#41;</span>
ldapSyntaxes: <span class="br0">&#40;</span> 1.3.6.1.4.1.1466.115.121.1.4 DESC 'Audio' X-NOT-HUMAN-READABLE
  'TRUE' <span class="br0">&#41;</span>
&nbsp;
# search result
search: <span style="">2</span>
result: <span style="">0</span> Success
&nbsp;
# numResponses: <span style="">2</span>
# numEntries: <span style="">1</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/find-supported-ldap-syntaxes-in-openldap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Keep JUnit TestCases from Cobertura Instrumentation</title>
		<link>http://blog.subaquatic.net/archives/keep-junit-testcases-from-cobertura-intrumentation/</link>
		<comments>http://blog.subaquatic.net/archives/keep-junit-testcases-from-cobertura-intrumentation/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 21:05:48 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[cobertura]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=305</guid>
		<description><![CDATA[To keep your Cobertura code coverage reports accurate, don&#8217;t forget to exclude any JUnit TestCases during instrumentation. Example: 1 2 3 4 5 6 &#60;cobertura-instrument todir=&#34;${cobertura.inst.classes}&#34; datafile=&#34;${cobertura.datafile}&#34;&#62; &#60;fileset dir=&#34;${build}&#34;&#62; &#60;include name=&#34;**/*.class&#34;/&#62; &#60;exclude name=&#34;**/*Test*.class&#34;/&#62; &#60;/fileset&#62; &#60;/cobertura-instrument&#62; Here&#8217;s one of my full &#8230; <a href="http://blog.subaquatic.net/archives/keep-junit-testcases-from-cobertura-intrumentation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To keep your <a href="http://cobertura.sourceforge.net/">Cobertura</a> code coverage reports accurate, don&#8217;t forget to exclude any <a href="http://www.junit.org">JUnit</a> TestCases during instrumentation. </p>
<p>Example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cobertura-instrument</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${cobertura.inst.classes}&quot;</span> <span style="color: #000066;">datafile</span>=<span style="color: #ff0000;">&quot;${cobertura.datafile}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.class&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclude</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*Test*.class&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cobertura-instrument<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Here&#8217;s one of my full Cobertura target&#8217;s that contains the above example.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cobertura&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cobertura.home&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/opt/cobertura-1.9.1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cobertura.datafile&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${build}/cobertura.ser&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cobertura.inst.classes&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${build}/instrumented-classes&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cobertura.coverage&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${reports}/coverage&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- Cleanup an previous runs --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${cobertura.coverage}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${cobertura.inst.classes}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${cobertura.datafile}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;cobertura.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${cobertura.home}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cobertura.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;lib/**/*.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;cobertura.classpath&quot;</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;tasks.properties&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cobertura-instrument</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${cobertura.inst.classes}&quot;</span> <span style="color: #000066;">datafile</span>=<span style="color: #ff0000;">&quot;${cobertura.datafile}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.class&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclude</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*Test*.class&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cobertura-instrument<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;junit</span> <span style="color: #000066;">showoutput</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">printsummary</span>=<span style="color: #ff0000;">&quot;withOutAndErr&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">forkmode</span>=<span style="color: #ff0000;">&quot;once&quot;</span> <span style="color: #000066;">failureproperty</span>=<span style="color: #ff0000;">&quot;test.failed&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;cobertura.classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sysproperty</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;net.sourceforge.cobertura.datafile&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${cobertura.datafile}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${cobertura.inst.classes}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${build}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;batchtest</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${reports}/junit/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${src}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*Test*.java&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/batchtest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/junit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cobertura-report</span> <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;${src}&quot;</span> <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${cobertura.coverage}&quot;</span> <span style="color: #000066;">datafile</span>=<span style="color: #ff0000;">&quot;${cobertura.datafile}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/keep-junit-testcases-from-cobertura-intrumentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Citrix XenServer 5.0 with acpi issues</title>
		<link>http://blog.subaquatic.net/archives/installing-citrix-xenserver-50-with-acpi-issues/</link>
		<comments>http://blog.subaquatic.net/archives/installing-citrix-xenserver-50-with-acpi-issues/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 16:46:37 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[xenserver]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=294</guid>
		<description><![CDATA[Like my other post related to getting CentOS installed on an HP dc5800, Citrix XenServer also balks on this host. There&#8217;s a technote to get you past some of the issues, but it doesn&#8217;t completely fix the issue in 5.0. &#8230; <a href="http://blog.subaquatic.net/archives/installing-citrix-xenserver-50-with-acpi-issues/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Like my other post related to getting CentOS installed on an HP dc5800, <a href="http://www.citrix.com">Citrix XenServer</a> also balks on this host.  There&#8217;s a <a href="http://support.citrix.com/article/CTX116617">technote</a> to get you past some of the issues, but it doesn&#8217;t completely fix the issue in 5.0.</p>
<p>The doc cover says it covers up to XenServer 4.1, but works for 5.0 with some adjustments.  The condensed and revised version is:</p>
<ol>
<li>While booting off of the CD/DVD, hit escape to stop the timer, and select <code>F2</code></li>
<li>At the boot prompt, type <code>menu.c32</code></li>
<li>Move to the <code>install</code> line and hit the tab button to bring up the boot stanza.</li>
<li>After <code>/boot/xen.gz</code> insert <code>no-real-mode acpi=off</code> and hit enter</li>
<li>Boot process should continue and you install away.</li>
<li><strong>However</strong>, this doesn&#8217;t fix the problem from re-occuring after installation (this is where the document diverges drastically.)</li>
<li>With the installation CD/DVD out of the machine, boot the machine and at the <code>boot:</code> prompt, again type <code>menu.c32</code></li>
<li>Select the <code>xe</code> boot option and hit tab to edit the boot stanza.</li>
<li>After<code> /boot/xen.gz</code>, add <code>acpi=off</code> again and hit enter.  XenServer should now start up properly.</li>
<li>To permanently resolve the issue, with XenServer up and running, cursor down to Local Command Shell</li>
<li>From the shell, <code>cd  /boot</code> and backup the <code>extlinux.conf</code> file.</li>
<li><code>vi extlinux.conf</code> and re-add the <code>acpi=off</code> directly after <code>/boot/xen.gz</code> for each entry

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">label xe
  # XenServer
  kernel mboot.c32
  append /boot/xen.gz acpi=off om0_mem=752M lowmem_emergency_pool=16M crashkernel=64M@32M console=/dev/null vga=mode-0x0311 --- /boot/vmlinuz-2.6-xen root=LABEL=root-vodjnbjv ro quiet vga=785 splash --- /boot/initrd-2.6-xen.img
&nbsp;
label fallback
  # XenServer (Xen 3.2.1 / Linux 2.6.18-92.1.10.el5.xs5.0.0.426.647xen)
  kernel mboot.c32
  append /boot/xen-3.2.1.gz acpi=off dom0_mem=752M lowmem_emergency_pool=16M crashkernel=64M@32M --- /boot/vmlinuz-2.6.18-92.1.10.el5.xs5.0.0.426.647xen root=LABEL=root-vodjnbjv ro console=tty0 --- /boot/initrd-2.6.18-92.1.10.el5.xs5.0.0.426.647xen.img</pre></td></tr></table></div>

</li>
<li>Exit out of the shell and reboot.</li>
</ol>
<p> XenServer 5.0 should now startup without any issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/installing-citrix-xenserver-50-with-acpi-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Cisco VPN software to work on a Windows guest running in VirtualBox</title>
		<link>http://blog.subaquatic.net/archives/getting-cisco-vpn-software-to-work-on-a-windows-guest-running-in-virtualbox/</link>
		<comments>http://blog.subaquatic.net/archives/getting-cisco-vpn-software-to-work-on-a-windows-guest-running-in-virtualbox/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 20:01:17 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=289</guid>
		<description><![CDATA[Problem: Cisco VPN client running on a Windows XP guest in VirtualBox is unable to connect. Each attempt to connect is met with the same result &#8212; it won&#8217;t connect and endlessly asks for re-authentication. Answer: After some googling, I &#8230; <a href="http://blog.subaquatic.net/archives/getting-cisco-vpn-software-to-work-on-a-windows-guest-running-in-virtualbox/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>Problem:</strong>  Cisco VPN client running on a Windows XP guest in VirtualBox is unable to connect.  Each attempt to connect is met with the same result &#8212; it won&#8217;t connect and endlessly asks for re-authentication.</p>
<p><strong>Answer:</strong>  After some googling, I made a snapshot of the guest (just in case), and changed the guest configuration from using the default NAT setup to having it bridge directly to my network.  Bring the guest back up and attempt the VPN connection again and lo&#8217; and behold, it works.  The why/hows are still unknown, but at least it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/getting-cisco-vpn-software-to-work-on-a-windows-guest-running-in-virtualbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Netbackup RMAN job issue?</title>
		<link>http://blog.subaquatic.net/archives/new-netbackup-rman-job-issue/</link>
		<comments>http://blog.subaquatic.net/archives/new-netbackup-rman-job-issue/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 20:59:29 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=282</guid>
		<description><![CDATA[Ever run into issues with a NetBackup RMAN job failing for what seems no reason? Do your logs look something like below? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 RMAN-03009: failure of &#8230; <a href="http://blog.subaquatic.net/archives/new-netbackup-rman-job-issue/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Ever run into issues with a NetBackup RMAN job failing for what seems no reason?  Do your logs look something like below?</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">RMAN-03009: failure of backup command on t1 channel at 02/26/2009 16:31:05
ORA-19513: failed to identify sequential file
ORA-27206: requested file not found in media management catalog
continuing other job steps, job failed will not be re-run
channel t1: starting full datafile backupset
channel t1: specifying datafile(s) in backupset
including current control file in backupset
channel t1: starting piece 1 at 26-FEB-09
released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on t1 channel at 02/26/2009 16:32:11
ORA-19513: failed to identify sequential file
ORA-27206: requested file not found in media management catalog</pre></td></tr></table></div>

<p>To fix it, make sure that the <code>CLIENT_NAME</code> in <code>/usr/openv/netbackup/bp.conf</code> matches (including the case) the client name entered in the NetBackup policy.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/new-netbackup-rman-job-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HP dc5800 Linux Boot Fix</title>
		<link>http://blog.subaquatic.net/archives/hp-dc5800-linux-boot-fix/</link>
		<comments>http://blog.subaquatic.net/archives/hp-dc5800-linux-boot-fix/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 17:41:02 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[UNIX]]></category>
		<category><![CDATA[CentOS]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=275</guid>
		<description><![CDATA[If your attempting to install CentOS 5.2 on a HP dc5800 and it&#8217;s hanging, you need to alter the boot line during install. linux pci=nommconf This will allow the CentOS Installation to continue.]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.subaquatic.net/wp-content/uploads/2009/02/centos_icon_60.png" alt="centos" title="centos" width="63" height="60" class="alignleft size-thumbnail" />If your attempting to install CentOS 5.2 on a HP dc5800 and it&#8217;s hanging, you need to alter the boot line during install.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">linux pci=nommconf</pre></td></tr></table></div>

<p>This will allow the CentOS Installation to continue.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/hp-dc5800-linux-boot-fix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configure default paper size in LaTeX</title>
		<link>http://blog.subaquatic.net/archives/configure-default-paper-size-in-latex/</link>
		<comments>http://blog.subaquatic.net/archives/configure-default-paper-size-in-latex/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 18:57:48 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Document Processing]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=265</guid>
		<description><![CDATA[If you use LaTeX and produce PDF&#8217;s in the U.S. you may find that your documents are being produced on A4 paper instead of letter paper even though you have defined letterpaper in your document class. If you create just &#8230; <a href="http://blog.subaquatic.net/archives/configure-default-paper-size-in-latex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you use LaTeX and produce PDF&#8217;s in the U.S. you may find that your documents are being produced on A4 paper instead of letter paper even though you have defined <code>letterpaper</code> in your document class.  If you create just DVI output it works correctly, but as soon as you convert to PDF, or use pdftex, the document is still on A4.  What&#8217;s going on?</p>
<p>Believe it or not, it doesn&#8217;t really matter which PDF generation mechanism you are using, all work in the same manner and therefore exhibit the same behavior.  Whether it&#8217;s pdftex, dvipdfm, or ps2pdf, all don&#8217;t/can&#8217;t use the document class paper size definition.  So if that&#8217;s all that&#8217;s been set, that&#8217;s not enough.<br />
<span id="more-265"></span><br />
There&#8217;s two equally simple solutions:</p>
<ol>
<li>Next to your document class, add these additional parameters

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">\pdfpagewidth 8.5in
\pdfpageheight 11.0in</pre></td></tr></table></div>

<p>      Of course this could be customized to any size paper you wish, but it&#8217;s simple and easy enough to include in a template for all future documents.
       </li>
<li>If you&#8217;re using a LaTeX distribution like TeX Live and want to make sure <em>everything</em> produced is on letter paper, run the <code>texconfig</code> command.

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">jhowk@host:~$ texconfig paper letter
texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/dvips/config/config.ps'
texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/dvipdfm/config/config'
texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/dvipdfm/config/dvipdfmx.cfg'
texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/xdvi/XDvi'
texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/tex/generic/config/pdftexconfig.tex'
...</pre></td></tr></table></div>

<p>You&#8217;ll get a ton of output, but rest assured you&#8217;ve set your default paper size to letter.  Using texconfig is not setting a system-wide command and only configured the user who ran it.  To undo, just remove the .texmf-config and .texmf-var directories in the users home directory.  Texconfig is also has a curses based gui if you run it without any parameters.
</li>
</ol>
<p>There it is.  Two simple solutions for an issue that unfortunately I&#8217;ve run into more than once before&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/configure-default-paper-size-in-latex/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>VirtualBox P2V Success</title>
		<link>http://blog.subaquatic.net/archives/virtualbox-p2v-success/</link>
		<comments>http://blog.subaquatic.net/archives/virtualbox-p2v-success/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 21:00:09 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=251</guid>
		<description><![CDATA[I&#8217;ve been using VirtualBox prior to 1.4, and P2V&#8217;ing a Windows host into VirtualBox has been close to impossible. With some hints from Katsumi Inoue and a comment from Robert, I&#8217;ve been successfully able to P2V my primary Windows host &#8230; <a href="http://blog.subaquatic.net/archives/virtualbox-p2v-success/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img class="size-thumbnail wp-image-94 alignleft" src="http://blog.subaquatic.net/wp-content/uploads/2008/12/virtualbox.png" alt="virtualbox logo" width="173" height="173" /></p>
<p>I&#8217;ve been using <a href="http://www.virtualbox.org">VirtualBox</a> prior to 1.4, and P2V&#8217;ing a Windows host into VirtualBox has been close to impossible.  With some hints from <a href="http://blogs.sun.com/LetTheSunShineIn">Katsumi Inoue</a> and a comment from Robert, I&#8217;ve been successfully able to P2V my primary Windows host at work.  The following is a quick rundown on how I did it with VirtualBox 2.1.2 and VMware Converter.<br />
<span id="more-251"></span></p>
<ol>
<li>Get a copy of <a href="http://www.vmware.com/download/converter/">VMware Converter</a>.  I went with the standalone version, and if you don&#8217;t have an enterprise agreement or license with them, you will need this version too.</li>
<li>Install it.</li>
<li>Run VMware Converter and convert the physical host that you installed it to.  I opted to write the conversion to an external USB drive, and it took about 2 hours to migrate a 37GB disk.  Converter opted for multiple .vmdk&#8217;s instead of one monolithic image.  In the past this is where we had to apply some black magic to get VirtualBox to work with a .vmdk.  With the new 2.1 series (this was tested on 2.1.2), VirtualBox is able to use vmdk&#8217;s.  With 2.1.2 (possibly earlier), it can deal with a sliced image making this processes extremely simple.</li>
<li>Import the VMDK into VirtualBox.  Make sure that you grab the correct vmdk and not one of the slices.</li>
<li>Create the new guest and attach the VMDK.</li>
<li>In the setting configuration of the guest, make sure that you initially have the &#8220;IO APIC&#8221; selected.</li>
<li>The machine should boot without a complaint but will run slowly due to IO APIC.</li>
<li>In your new Windows guest, open up the device manager and update the driver for &#8220;ACPI Uniprocessor PC&#8221;.  Update the driver to use &#8220;Advanced Configutation and Power Interface (ACPI) PC&#8221; instead.</li>
<li>Shutdown the guest and modify the settings and unselect the &#8220;IO APIC&#8221;.</li>
<li>Startup the VM and enjoy a newly converted guest!</li>
</ol>
<p>Finally.  A fully working guest that was P2V&#8217;d and didn&#8217;t require 24 hours of endless searching or head scratching to get it to work.  Hooray!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/virtualbox-p2v-success/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Removing EMC SAN Disk from AIX using powerpath</title>
		<link>http://blog.subaquatic.net/archives/removing-emc-san-disk-from-aix-using-powerpath/</link>
		<comments>http://blog.subaquatic.net/archives/removing-emc-san-disk-from-aix-using-powerpath/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 18:02:43 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[SAN]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[clariion]]></category>
		<category><![CDATA[emc]]></category>
		<category><![CDATA[powerpath]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=245</guid>
		<description><![CDATA[To unmap EMC disk that is connected and using powerpath: Remove the device from powerpath: powermt remove dev=[hdiskpowerX] Remove powerpath hdiskpower devices from system: rmdev -dl hdiskpowerXX Remove standard SAN disk devices: rmdev -dl hdiskX Confirm lsdev -Cc disk and &#8230; <a href="http://blog.subaquatic.net/archives/removing-emc-san-disk-from-aix-using-powerpath/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To unmap EMC disk that is connected and using powerpath:</p>
<ol>
<li>Remove the device from powerpath:

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">powermt remove dev=[hdiskpowerX]</pre></td></tr></table></div>

</li>
<li>Remove powerpath hdiskpower devices from system:

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">rmdev -dl hdiskpowerXX</pre></td></tr></table></div>

</li>
<li>
        Remove standard SAN disk devices:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">rmdev -dl hdiskX</pre></td></tr></table></div>

</li>
<li>Confirm

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">lsdev -Cc disk</pre></td></tr></table></div>

<p> and again with inq</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">inq</pre></td></tr></table></div>

</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/removing-emc-san-disk-from-aix-using-powerpath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lack of .Xauthority</title>
		<link>http://blog.subaquatic.net/archives/lack-of-xauthority/</link>
		<comments>http://blog.subaquatic.net/archives/lack-of-xauthority/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 18:54:58 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=211</guid>
		<description><![CDATA[Have you ever had an issue with running X clients on a firewall protected host where you can&#8217;t login directly as the user?  I happens more often than you might think. Here&#8217;s an example: You are user &#8220;A&#8221; on &#8220;hostA&#8221;, &#8230; <a href="http://blog.subaquatic.net/archives/lack-of-xauthority/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Have you ever had an issue with running X clients on a firewall protected host where you can&#8217;t login directly as the user?  I happens more often than you might think.  Here&#8217;s an example:</p>
<p>You are user &#8220;A&#8221; on &#8220;hostA&#8221;, and hostA is your client machine. Host &#8220;hostB&#8221; is the host in which you need to run the X application on as user &#8220;B&#8221;.  Furthermore, hostB only allows SSH connections.  In addition to the SSH restriction, you need to run an X application as someone other than yourself and you don&#8217;t have the password but you can use <code>sudo</code> to become that user.  What can you do?<br />
<span id="more-211"></span><br />
The good new is that it can be done.   If you&#8217;re interested in the how but not the why, <a href="#oneline">read the end for a one line solution</a>.  Otherwise, there are a few road blocks that need to be overcome to get this to work so let&#8217;s look at some of those issues:</p>
<ol>
<li>Since hostA is behind a firewall, the firewall may not be configured to allow X traffic.  More than likely this is the case and would prevent the user from simply sudo&#8217;ing to the new user and export a display back to hostA.</li>
<li>If you attempted to tunnel the X connection over your SSH connection and then become the user running the X application, you would have found out that once you became the new user and attempted to run the X application you would have been presented with this error similar to this:

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">X11 connection rejected because of wrong authentication.
X connection to localhost:10.0 broken (explicit kill or server shutdown).</pre></td></tr></table></div>

</li>
</ol>
<p>So what can you do to get this to work?  Actually the answer isn&#8217;t all that difficult; it just requires an understanding of how X works.  Most users will know that they can export the display to another host by exporting the <code>DISPLAY</code> variable, and that they can use <code>xhost</code> command on the local host to allow access to it.  This is called host-based access and is the simplest and least secure access control mechanism available in X.</p>
<p>We already know that X isn&#8217;t going to pass through the firewall so any attempt at simply exporting the display isn&#8217;t going to work regardless of our initial connect method (SSH or telnet).  Some of you who are familiar with SSH will know that it can also tunnel X.  SSH creates a &#8220;proxy&#8221; X server on the remote host and X traffic will be forwarded over the encrypted channel.  We can do a simple test to verify this.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">A@hostA:~$ ssh -X hostB
Last login: Fri Jan  9 14:23:03 2009 from hostA
/usr/X11R6/bin/xauth:  creating new authority file /home/A/.Xauthority
[~]
A@hostB =&gt; xclock</pre></td></tr></table></div>

<p>At which point the xclock application will appear on the display of hostA and we now know that X tunneling over SSH works.  </p>
<p style="text-align: center;"><img class="size-full wp-image-226 aligncenter" title="xclock_screenshot" src="http://blog.subaquatic.net/wp-content/uploads/2009/01/xclock_screenshot.png" alt="xclock_screenshot" width="174" height="193" /></p>
<p>But what happens when we become the &#8220;B&#8221; user?  Let&#8217;s try again.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">A@hostB =&gt; sudo su - B
Password:
[~]
B@hostB =&gt; xclock
X11 connection rejected because of wrong authentication.
X connection to localhost:10.0 broken (explicit kill or server shutdown).
[~]
B@hostB =&gt;</pre></td></tr></table></div>

<p>No luck.  The reason this didn&#8217;t work is that user &#8220;B&#8221; doesn&#8217;t have the proper authority to display on another user&#8217;s display.  Remember that X uses an access control mechanism to allow client to write to a display.  Unlike the host-based access that we touched on above, X can also use a more secure control mechanism called a &#8220;magic cookie&#8221;.  This cookie allows a <em>user</em> to gain access to a display.  By default, these cookies are stored in a file named <code>.Xauthority</code>.</p>
<p>Recall that when we used the X forwarding capabilities of SSH it created a &#8220;proxy&#8221; X server.  Part of the creation of that proxy is the creation of an <code>.Xauthority</code> file to manage the connections to that proxy server.  When we created the initial SSH connection with the <code>-X</code> option, &#8220;hostB&#8221; created a proxy X server with a <code>.Xauthority</code> file in the user&#8217;s home directory and added a cookie for the new connection.</p>
<p>One of the good things about cookies is that they can be <strong>shared</strong>.  If I copy the cookie from user &#8220;A&#8221; and import it into the <code>.Xauthority</code> file of user &#8220;B&#8221;, user B will be able to use A&#8217;s display.  There are some caveats to this, but it&#8217;s safe to assume that B will be able to display on A for as long as A has the display.  Since we are using SSH and it&#8217;s providing a proxy X server, it&#8217;s very important to remember that we need to <strong>copy the cookie from user A on hostB</strong>.  SSH is doing some translation on the cookies as part of acting as a proxy, so copying user A&#8217;s cookie from hostA isn&#8217;t going to work. </p>
<p>We can use <code>/usr/X11R6/bin/xauth</code> to manage our <code>.Xauthority</code> file and the cookies contained in it.  Let&#8217;s validate that we actually have a cookie after logging in with X forwarding turned on.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">A@hostB =&gt; xauth list
hostB/unix:10  MIT-MAGIC-COOKIE-1  db6b0a2c3f6ef0d52454532e4fb42b93</pre></td></tr></table></div>

<p>We know this works as we were able to display the xclock application on our host previously. Notice that we&#8217;re looking at user A&#8217;s cookie on hostB, NOT hostA.  In order to allow user B access to user A&#8217;s display, B needs to import A&#8217;s cookie.  Again, we can use <code>xauth</code> to accomplish this and it&#8217;s a quick <a name="oneline">one-liner</a>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">A@hostB =&gt; xauth extract - :`echo $DISPLAY |awk -F: '{print $2}'` | sudo su - B -c &quot;/usr/X11R6/bin/xauth merge -&quot;</pre></td></tr></table></div>

<p>This assumes that user A has the ability to sudo su to user B.  Once this is done, xclock (or whatever you wish) can be run as user B and will now appear on user A&#8217;s display running on hostA.  If all of your hosts are internal, this is a relatively secure method of granting access to remote displays.  Since the cookies are not encrypted, using this where the connection could be intercepted may not be the best idea and X offers some additional access methods other than host-based and magic cookie.</p>
<p>If you&#8217;d like even more info, read the man pages on <a href="http://www.xfree86.org/current/xauth.1.html">xauth</a>, and <a href="http://www.xfree86.org/current/Xsecurity.7.html">Xsecurity</a>.  If a screencast of this would help, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/lack-of-xauthority/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Setting up stronger password policy rules in Linux &#8211; Part II</title>
		<link>http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux-part-ii/</link>
		<comments>http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux-part-ii/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 07:21:07 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=155</guid>
		<description><![CDATA[In a previous post we discussed how to setup stronger password policy rules in Linux and found out that any changes we make are not reflected back to existing accounts. So how do we make these changes retroactively apply to &#8230; <a href="http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux-part-ii/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In a previous post we discussed <a href="/index.php?p=132">how to setup stronger password policy rules in Linux</a> and found out that any changes we make are not reflected back to existing accounts.  So how do we make these changes retroactively apply to existing accounts?<br />
<span id="more-155"></span><br />
The answer to our question is relatively straightforward.  As RHEL is using shadow passwords by default, the <code>chage</code> command can be used to modify an existing account&#8217;s aging information.  Before we delve into the specifics, we need to refresh some of the requirements that were given to us.</p>
<p>In our previous discussion we were provided with an account policy document that stated passwords must:</p>
<ul>
<li>Be at least 8 characters long.</li>
<li>Use of at least one upper case character.</li>
<li>Use of at least one lower case character.</li>
<li>Use of special characters (!,@#$%, etc).</li>
<li>Warn 7 days prior to expiration.</li>
<li>Must expire after 90 days.</li>
<li>Must be locked after 97 days.</li>
</ul>
<p>Using chage we can complete the last three items.  To do so, we we use chage like so:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;"># chage -m 0 -M 90 -I 7 -W 7 [user]</pre></td></tr></table></div>

<p>This command reads, change the login user to have no minimum number of days for password changes (<code>-m 0</code>), allow at most 90 days before a password change is required (<code>-M 90</code>), lock the account 7 days after the account has expired (<code>-I 7</code>), and warn the user 7 days prior to account expiration (<code>-W 7</code>).</p>
<p>But what about the first four passwords requirements for existing accounts?  The password policy changes did not affect any existing accounts that already had passwords set.  If at any point the user manually changes their password, the new password policies will be enforced and the first four requirements will be met.  Realistically though, once the accounts have been modified using <code>chage</code> to have an expiration, the next user password change will force all accounts into compliance.  If accounts are needed to be in compliance immediately, a more active approach will require locking the account and requiring the user to change the password.</p>
<p>It&#8217;s important to point out that in many cases, there will be accounts that may not fall under this restriction. As an example, many service or application accounts that are are not used for direct logins may be exempted.  So long as the account was created before the modification of the password policies, no changes are necessary and the accounts will be left as is.  If any of these accounts were created after the policy change it will be important to remember that chage will have to be used to revert the account back to one that is exempt from aging criteria.</p>
<p>In conclusion, Linux has a standard set of tools that can be used to increase the security of an organization&#8217;s account data.  By re-configuring the system to enforce both account aging policies as well as more stringent password composition rules, a default Linux installation may be enhanced to meet the more realistic needs of today&#8217;s organizations.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux-part-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning to play</title>
		<link>http://blog.subaquatic.net/archives/learning-to-play/</link>
		<comments>http://blog.subaquatic.net/archives/learning-to-play/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 06:08:54 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=157</guid>
		<description><![CDATA[Totally off topic, but I&#8217;ve always wanted to learn to play hockey. There&#8217;s just something about this sport that has always captivated me.  The combination of skill on the ice with the very physical action that occurs during the game &#8230; <a href="http://blog.subaquatic.net/archives/learning-to-play/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Totally off topic, but I&#8217;ve always wanted to learn to play hockey. There&#8217;s just something about this sport that has always captivated me.  The combination of skill on the ice with the very physical action that occurs during the game just makes for a great sport.  I love to watch it and I&#8217;d really like to be able to compete.  I&#8217;m a very competitive person, so  it means I go full throttle. </p>
<p>Only one slight problem &#8212; I can&#8217;t skate particularly well.  Which in reality is a nice euphemism for, &#8220;I completely suck at skating.&#8221;  So with a new pair of hockey skates and a reckless abandon for my own personal safety, I take to the ice in an effort to improve my skating ability.  I&#8217;ve been on the ice every day and I&#8217;ve made real progress.  So much so, that I enrolled in an adult developmental hockey class.</p>
<p>So for the next six Sundays, I&#8217;ll be on the ice seeing how far I can push myself in a sport that has no longer remained elusive to me.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/learning-to-play/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up stronger password policy rules in Linux</title>
		<link>http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux/</link>
		<comments>http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 20:22:43 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=132</guid>
		<description><![CDATA[Increased password security is no longer an optional item in setting up a secure system.  Many external organizations (such as PCI) are now mandating security policies that can have a direct effect on your systems.  By default, the account and &#8230; <a href="http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Increased password security is no longer an optional item in setting up a secure system.  Many external organizations (such as PCI) are now mandating security policies that can have a direct effect on your systems.  By default, the account and password restrictions enabled on a Linux box are minimal at best.  To better secure your hosts and meet those requirements from external vendors and organizations, here&#8217;s a small how-to on setting up stronger password and account policies in Linux.  This is targeted at RHEL so other distributions may or may not be 100% compatible.<br />
<span id="more-132"></span><br />
As an example, let us assume that our security department has created an account security policy document.  This document identifies both account and password restrictions that are now going to be required for all accounts both existing and new. </p>
<p>The document states that passwords must:</p>
<ul>
<li>Be at least 8 characters long.</li>
<li>Use of at least one upper case character.</li>
<li>Use of at least one lower case character.</li>
<li>Use of at least one special character (!,@#$%, etc)</li>
<li>Warn 7 days prior to expiration.</li>
<li>Expire after 90 days </li>
<li>Lock after 97 days.</li>
</ul>
<p>The good news is that Linux has all of these features and can be setup to meet the requirements given to us.  Unfortunately though, Linux doesn&#8217;t have all this information located in one central place.   If you&#8217;re not using the RedHat supplied <code>redhat-config-users</code> GUI, you&#8217;re going to have to make the changes manually.  Since our server systems don&#8217;t run X, we will be making the changes directly to the system without the help of the GUI.</p>
<p>In RHEL, changes are made in multiple locations.  They are:</p>
<ul>
<li>/etc/pam.d/system-auth</li>
<li>/etc/login.defs</li>
<li>/etc/default/useradd</li>
</ul>
<p>In Linux, password changes are passed through <a href="http://www.kernel.org/pub/linux/libs/pam/">PAM</a>.  To satisfy the first three requirements we must modify the PAM entry that corresponds with passwords.  <code>/etc/pam.d/system-auth</code> is the PAM file responsible for authentication and where we will make our first modifications.  Inside <code>/etc/pam.d/system-auth</code> there are entries based on a &#8220;type&#8221; that the rules apply to.  As we are only discussing password rules, you will see a <code>password</code> type.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">password    requisite     /lib/security/$ISA/pam_cracklib.so retry=3</pre></td></tr></table></div>

<p>The password type is &#8220;required for updating the authentication token associated with the user.&#8221;  Simply put, we need a password type to update the password.   Looking at the example, we can see that <a href="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_cracklib.html">pam_cracklib</a> is the default module that is responsible for this operation.  To configure <code>pam_cracklib</code> to meet our specifications we need to modify the line accordingly:</p>
<ul>
<li>Minimum of 8 characters: <code>minlen=8</code></li>
<li>At least one upper case character: <code>ucredit=-1</code></li>
<li>At least one lower case character: <code>lcredit=-1</code></li>
<li>At least one special character: <code>ocredit=-1</code></li>
</ul>
<p>Our <code>/etc/pam.d/system-auth</code> will now look like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">#password    requisite     /lib/security/$ISA/pam_cracklib.so retry=3
password    requisite     /lib/security/$ISA/pam_cracklib.so retry=3 minlen=8 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1</pre></td></tr></table></div>

<p>If you are curious as to how pam_cracklib defines and uses credits, check the link above to the pam_cracklib module page.  Next, to meet the requirement to have passwords expire after 90 days, we need to modify the <code>/etc/login.defs</code> file.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;"># Password aging controls:
#
#       PASS_MAX_DAYS   Maximum number of days a password may be used.
#       PASS_MIN_DAYS   Minimum number of days allowed between password changes.
#       PASS_MIN_LEN    Minimum acceptable password length.
#       PASS_WARN_AGE   Number of days warning given before a password expires.
#
PASS_MAX_DAYS   90
PASS_MIN_DAYS   0
PASS_MIN_LEN    8
PASS_WARN_AGE   7</pre></td></tr></table></div>

<p>Notice how the <code>PASS_MIN_LEN</code> is also set here as well.  Since we have been given some latitude on when to warn users we have chosen to warn users seven days prior to expiration.  But our last item is curiously missing.  Where do we set up the accounts so that after 97 days the account is locked out and requires a system administrator to unlock?</p>
<p>Believe it or not <code>useradd</code> controls the initial locking of an account.  Issuing a <code>useradd -D</code> will show you the current default paramters that are used when useradd is invoked.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">[root@host ~]# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes</pre></td></tr></table></div>

<p>The <code>INACTIVE=-1</code> entry defines when an account will be deactivated.  Inactive is defined as the, &#8220;number of days after a password has expired before the account will be disabled.&#8221;  Our requirements state that the account should be disabled seven days after account expiration.  To set this we can either:</p>
<ul>
<li>Invoke <code>useradd -D -f 7</code></li>
<li>Modify <code>/etc/default/useradd</code> and change the <code>INACTIVE</code> entry.</li>
</ul>
<p>Just remember that an inactive or disabled account is a locked account whereas an expired account is <em>not</em> locked.  With this last change, all of the requirements that have been given to us have been met.  We modified the password rules for all new passwords, and setup the system to activate password aging as well as configure the system to disable an account if necessary.  But one issue remains &#8212; if this is not a new system what happens to all existing account?  The answer is <em>nothing</em>.</p>
<p>In the next installment I&#8217;ll show you how to make our modifications effective on existing user accounts&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/setting-up-stronger-password-policy-rules-in-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setup SAN disk for use in a Linux Veritas cluster</title>
		<link>http://blog.subaquatic.net/archives/setup-san-disk-for-use-in-a-linux-veritas-cluster/</link>
		<comments>http://blog.subaquatic.net/archives/setup-san-disk-for-use-in-a-linux-veritas-cluster/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 17:00:40 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[emc]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[vcs]]></category>
		<category><![CDATA[vx]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=73</guid>
		<description><![CDATA[For this particular exercise we&#8217;re going to go through the entire process of provisioning disk for use in a VCS cluster. We will use EMC Symmetrix disk zoned and masked to a RHEL 4u6 host as the foundation. Get the &#8230; <a href="http://blog.subaquatic.net/archives/setup-san-disk-for-use-in-a-linux-veritas-cluster/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For this particular exercise we&#8217;re going to go through the entire process of provisioning disk for use in a VCS cluster.  We will use <a href="http://www.emc.com/products/family/symmetrix-family.htm">EMC Symmetrix</a> disk zoned and masked to a <a href="http://www.redhat.com">RHEL</a> 4u6 host as the foundation.<br />
<span id="more-73"></span></p>
<ol>
<li>Get the disk(s) presented to the host observing that it&#8217;s visible down multiple paths.

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;"># inq -showvol
Inquiry utility, Version V7.3-771 (Rev 0.0)      (SIL Version V6.3.0.0 (Edit Level 771)
Copyright (C) by EMC Corporation, all rights reserved.
For help type inq -h.
&nbsp;
-----------------------------------------------------------------------------
DEVICE    :VEND    :PROD            :REV   :SER NUM    :Volume  :CAP(kb)
-----------------------------------------------------------------------------
/dev/sda  :EMC     :SYMMETRIX       :5771  :0123456789 :   00617:        2880
/dev/sdb  :EMC     :SYMMETRIX       :5771  :0123456789 :   00204:    35654400
/dev/sdc  :EMC     :SYMMETRIX       :5771  :0123456789 :   00206:    35654400
/dev/sdd  :EMC     :SYMMETRIX       :5771  :0123456789 :   00208:    35654400
/dev/sde  :EMC     :SYMMETRIX       :5771  :0123456789 :   0020A:    35654400
/dev/sdf  :EMC     :SYMMETRIX       :5771  :0123456789 :   0020C:    35654400
/dev/sdg  :EMC     :SYMMETRIX       :5771  :0123456789 :   0020E:    35654400
/dev/sdh  :EMC     :SYMMETRIX       :5771  :0123456789 :   00210:    35654400
/dev/sdi  :EMC     :SYMMETRIX       :5771  :0123456789 :   00212:    35654400
/dev/sdj  :EMC     :SYMMETRIX       :5771  :0123456789 :   00214:    35654400
/dev/sdk  :EMC     :SYMMETRIX       :5771  :0123456789 :   00263:    35654400
/dev/sdl  :EMC     :SYMMETRIX       :5771  :0123456789 :   00265:    35654400
/dev/sdm  :EMC     :SYMMETRIX       :5771  :0123456789 :   00267:    35654400
/dev/sdn  :EMC     :SYMMETRIX       :5771  :0123456789 :   00269:    35654400
/dev/sdo  :EMC     :SYMMETRIX       :5771  :0123456789 :   0026B:    35654400
/dev/sdp  :EMC     :SYMMETRIX       :5771  :0123456789 :   00617:        2880
/dev/sdq  :EMC     :SYMMETRIX       :5771  :0123456789 :   00204:    35654400
/dev/sdr  :EMC     :SYMMETRIX       :5771  :0123456789 :   00206:    35654400
/dev/sds  :EMC     :SYMMETRIX       :5771  :0123456789 :   00208:    35654400
/dev/sdt  :EMC     :SYMMETRIX       :5771  :0123456789 :   0020A:    35654400
/dev/sdu  :EMC     :SYMMETRIX       :5771  :0123456789 :   0020C:    35654400
/dev/sdv  :EMC     :SYMMETRIX       :5771  :0123456789 :   0020E:    35654400
/dev/sdw  :EMC     :SYMMETRIX       :5771  :0123456789 :   00210:    35654400
/dev/sdx  :EMC     :SYMMETRIX       :5771  :0123456789 :   00212:    35654400
/dev/sdy  :EMC     :SYMMETRIX       :5771  :0123456789 :   00214:    35654400
/dev/sdz  :EMC     :SYMMETRIX       :5771  :0123456789 :   00263:    35654400
/dev/sdaa :EMC     :SYMMETRIX       :5771  :0123456789 :   00265:    35654400
/dev/sdab :EMC     :SYMMETRIX       :5771  :0123456789 :   00267:    35654400
/dev/sdac :EMC     :SYMMETRIX       :5771  :0123456789 :   00269:    35654400
/dev/sdad :EMC     :SYMMETRIX       :5771  :0123456789 :   0026B:    35654400</pre></td></tr></table></div>

</li>
<li> See what disks Veritas can see.<br />
<code>vxdisk -o alldgs list</code></li>
<li> Initialize the disk for the first time.  This needs to be repeated for each individual disk.<br />
<code>/etc/vx/bin/vxdisksetup -i DEVICE format=cdsdisk</code></li>
<li> See if the intialize worked correctly. 

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;"># vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
EMC0_0       auto:cdsdisk    -            (dg_grp)     online
EMC0_1       auto:cdsdisk    -            (dg_grp)     online
EMC0_2       auto:cdsdisk    -            (dg_grp)     online
EMC0_3       auto:cdsdisk    -            (dg_grp)     online
EMC0_4       auto:cdsdisk    -            (dg_grp)     online
EMC0_5       auto:cdsdisk    -            (dg_grp)     online
EMC0_6       auto:cdsdisk    -            (dg_grp)     online
EMC0_7       auto:cdsdisk    -            (dg_grp)     online
EMC0_8       auto:cdsdisk    -            (dg_grp)     online
EMC0_9       auto:cdsdisk    -            (dg_grp)     online
EMC0_10      auto:cdsdisk    -            (dg_grp)     online
EMC0_11      auto:cdsdisk    -            (dg_grp)     online
&nbsp;
EMC0_12      auto:cdsdisk    -            (dg_grp)     online
EMC0_13      auto:cdsdisk    -            (dg_grp)     online
cciss/c0d0   auto:none       -            -            online invalid</pre></td></tr></table></div>

<p>All device(s) (e.g. <code>EMC0_n</code>) now show as online.</li>
<li> Create the disk group.<br />
<code>vxdg init dg_name dg_internal_name01=DEVICE</code><br />
The dg_name is the name of your disk group while dg_internal_name01 is the name of the <strong>first</strong> disk.  In our case <code>dg_internal_name01=EMC0_0</code>.</li>
<li> Add any additional disk to the disk group.<br />
<code>vxdg -g dg_name adddisk dg_internal_name02=EMC0_n+1</code><br />
Note that EMC0_n+1 is the next free disk that you are attempting to add.  So <code>dg_internal_name02=EMC0_1</code> (remember we started with EMC0_0).</li>
<li> To create the volume<br />
<code>vxassist -g dg_name make lv_name [size] dg_internal_nameN</code><br />
Repeat as necessary.</li>
<li> Finally, create the file system<br />
<code>mkfs -t vxfs /dev/vx/rdsk/dg_name/lv_name</code></li>
</ol>
<p>At this point the volumes are now available to be defined as a mount resource in VCS.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/setup-san-disk-for-use-in-a-linux-veritas-cluster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find WWN&#8217;s on Linux</title>
		<link>http://blog.subaquatic.net/archives/find-wwns-on-linux/</link>
		<comments>http://blog.subaquatic.net/archives/find-wwns-on-linux/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 23:33:38 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SAN]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=63</guid>
		<description><![CDATA[To find port and node WWN&#8217;s while the system is running: 2.4.x Kernels &#62; cat /proc/scsi/[hba_type]/(n) where hba_type is the driver (e.g. lpfc for Emulex) and (n) is the HBA number. 2.6.x Kernels: &#62; cat /sys/class/scsi_host/host(n)/[port_name&#124;node_name] Hosts with multiple HBAs &#8230; <a href="http://blog.subaquatic.net/archives/find-wwns-on-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To find port and node WWN&#8217;s while the system is running:</p>
<ul>
<li>2.4.x Kernels<br />
<code>&gt; cat /proc/scsi/[hba_type]/(n)</code><br />
where <code>hba_type</code> is the driver (e.g. lpfc for Emulex) and <code>(n)</code> is the HBA number.</li>
<li>2.6.x Kernels:<br />
<code>&gt; cat /sys/class/scsi_host/host(n)/[port_name|node_name]</code><br />
Hosts with multiple HBAs are enumerated via host(n) (e.g <code>host0</code>).</li>
</ul>
<p>You can use <code>lsmod</code> to determine which driver is in use.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/find-wwns-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up VirtualBox external VRDP authentication</title>
		<link>http://blog.subaquatic.net/archives/setting-up-virtualbox-external-vrdp-authentication/</link>
		<comments>http://blog.subaquatic.net/archives/setting-up-virtualbox-external-vrdp-authentication/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 04:00:14 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://blog.subaquatic.net/?p=38</guid>
		<description><![CDATA[[NOTE: I originally posted this on the VirtualBox forum for those that were having issues with using external VRDP authentication and wanted to add it here as well...] I finally found a workable solution that will work for everyone (at &#8230; <a href="http://blog.subaquatic.net/archives/setting-up-virtualbox-external-vrdp-authentication/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>[NOTE: I originally </em><a href="http://forums.virtualbox.org/viewtopic.php?t=5264&amp;p=22619"><em>posted</em></a><em> this on the VirtualBox forum for those that were having issues with using external VRDP authentication and wanted to add it here as well...]</em></p>
<p>I finally found a workable solution that will work for everyone (at least for the PAM challenged folks.) It&#8217;s more secure that setting group suid bits on VirtualBox and you&#8217;re not hacking the user to be a member of the shadow group. I&#8217;m running on Ubuntu 7.10 so your setup may vary slightly&#8230;<br />
<span id="more-38"></span><br />
[EDIT: Thanks to Finger for validating this through version 2.1.0]</p>
<p>You have two options depending on your comfort level (both tested and verified).</p>
<ol>
<li>Modify your existing <code>/etc/pam.d/login</code> file(s)</li>
<li>Create a custom PAM service in <code>/etc/pam.d</code></li>
</ol>
<p><strong>FIRST OPTION</strong></p>
<p>The VirtualBox provided <code>VRDPAuth.so</code> library defaults to using the <code>/etc/pam.d/login</code> service so changes have to be made there. In Ubuntu, the existing <code>/etc/pam.d/login</code> file includes pointers to other <code>/etc/pam.d</code> files, namely <code>common-account</code> that actually do the work (referenced by an @ in the file), so we need to modify <code>/etc/pam.d/common-account</code>.</p>
<p>My default <code>/etc/pam.d/common-account</code> looks like:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">#
# /etc/pam.d/common-account - authorization settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authorization modules that define
# the central access policy for use on the system.  The default is to
# only deny service to users whose accounts are expired in /etc/shadow.
#
account required        pam_unix.so</pre></td></tr></table></div>

<p>To fix, append &#8220;broken_shadow&#8221; to the account line. E.g.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">account required        pam_unix.so broken_shadow</pre></td></tr></table></div>

<p>This fixes the issue with minimal changes to your system. The impact of this change is that the change is valid for ALL services that use common-account.</p>
<p><strong>SECOND OPTION</strong></p>
<p>If your concerned about modifying a default PAM service, we can create our own. To resolve this issue using a custom PAM service:</p>
<ol>
<li>Create a new file named <code>/etc/pam.d/vrdpauth</code> (or whatever your want)</li>
<li>Add this to the following file.

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">auth       required     pam_unix.so
account    required     pam_unix.so broken_shadow</pre></td></tr></table></div>

</li>
<li>In order to use a custom service you must either set the <code>VRDP_AUTH_PAM_SERVICE</code> environment variable (or recompile the library). So&#8230;

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">jhowk@host:~$ export VRDP_AUTH_PAM_SERVICE=vrdpauth</pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all that&#8217;s needed. Easy fixes. If anyone has any questions just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/setting-up-virtualbox-external-vrdp-authentication/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Fix Linux time sync issues in VMware</title>
		<link>http://blog.subaquatic.net/archives/fix-linux-time-sync-issues-in-vmware/</link>
		<comments>http://blog.subaquatic.net/archives/fix-linux-time-sync-issues-in-vmware/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 22:33:30 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://10.165.10.40/?p=13</guid>
		<description><![CDATA[We&#8217;ve been having issues with our VMware guests keeping accurate time and didn&#8217;t want to break the best practices of using NTP like we normally do on our non-vm hosts so I ended up doing way more research on how &#8230; <a href="http://blog.subaquatic.net/archives/fix-linux-time-sync-issues-in-vmware/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-202" title="vmware" src="http://blog.subaquatic.net/wp-content/uploads/2009/01/vmware.jpg" alt="vmware"/>We&#8217;ve been having issues with our VMware guests keeping accurate time and didn&#8217;t want to break the best practices of using NTP like we normally do on our non-vm hosts so I ended up doing way more research on how VMware does time than I really would have cared for.<br />
<span id="more-19"></span><br />
The easily digestible answer is: </p>
<p><strong>For RHEL 4</strong></p>
<ul>
<li>32bit
<ul>
<li>Add the <code>clock=pit</code> parameter to the kernel boot params (grub.conf kernel stanza)</li>
</ul>
</li>
</ul>
<ul>
<li>64bit
<ul>
<li>Add the <code>notsc</code> parameter to the kernel boot params (grub.conf kernel stanza)</li>
</ul>
</li>
</ul>
<p><strong>For RHEL 5</strong></p>
<ul>
<li>Kernel &gt;= 2.6.18
<ul>
<li>overcorrection for lost ticks was fixed.</li>
</ul>
</li>
<li>Kernel &lt; 2.6.18
<ul>
<li>32bit
<ul>
<li>Add the <code>clocksource=pit</code> parameter to the kernel boot params (grub.conf kernel stanza)</li>
</ul>
</li>
<li>64bit
<ul>
<li>Add the <code>notsc</code> parameter to the kernel boot params (grub.conf kernel stanza)</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Make sure to verify that the system is syncing against the guest (via vmware-toolbox or directly in the .vmx as <code>tools.syncTime=TRUE</code>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/fix-linux-time-sync-issues-in-vmware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kickstarting a virtualized guest</title>
		<link>http://blog.subaquatic.net/archives/kickstarting-a-virtualized-guest/</link>
		<comments>http://blog.subaquatic.net/archives/kickstarting-a-virtualized-guest/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 22:19:04 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[kickstart]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[XEN]]></category>

		<guid isPermaLink="false">http://10.165.10.40/?p=3</guid>
		<description><![CDATA[If you need to provision hosts at a regular interval, kickstarting an installation is an effective and productive way of systematically creating guests. All of our Linux builds are now done via kickstart and as a result we have drastically &#8230; <a href="http://blog.subaquatic.net/archives/kickstarting-a-virtualized-guest/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you need to provision hosts at a regular interval, kickstarting an installation is an effective and productive way of systematically creating guests.  All of our Linux builds are now done via kickstart and as a result we have drastically reduced the turn-around time on the availability of new guests to our customers.  So for a first article, here&#8217;s a quick how-to on getting guests installed via kickstart over NFS.<br />
<span id="more-11"></span><br />
What you will need:</p>
<ul>
<li>A host to act as the hypervisor for the guest.</li>
<li>A host that will provide NFS an export the ISO image and kickstart files.  This can be the hypervisor if necessary.</li>
</ul>
<p>Tasks:</p>
<ol>
<li>Get the ISO.  CentOS 5.2 is <a href="http://mirror.centos.org/centos/5/isos/">here</a> and direct DVD downloads can be found by visiting the <a href="http://www.centos.org/modules/tinycontent/index.php?id=13">mirror page</a>.</li>
<li>Install CentOS onto the system that will be your hypervisor.  Be sure that the Virtualization group is checked so Xen will get installed.</li>
<li>On your NFS host, make the directories that will be NFS mounted and contain the ISO files as well as your kickstart file:

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;"># mkdir -p /opt/install /opt/install/5.2 /opt/install/ks</pre></td></tr></table></div>

</li>
<li>
On the NFS host, mount the image and copy the contents to  /opt/install/5.2</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;"># mount -t iso9660 -o loop ./CentOS-5.2-x86_64-bin-DVD.iso /mnt
# rsync -av /mnt/ /opt/install/5.2/</pre></td></tr></table></div>

<li>
Configure your NFS implementation.  If your on a Linux/UNIX host, make sure you have the proper permissions in place and export the <code>/opt/install</code> directory accordingly.
</li>
<li>Create the kickstart file.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
</pre></td><td class="code"><pre class="text" style="font-family:monospace;"># CENTOS 5.2 PVM Kickstart file
# THIS IS FOR PARAVIRTUALIZED GUESTS ONLY!
# Created By Jason Howk
&nbsp;
install
nfs --server=192.168.0.240 --dir=/opt/install/5.2
text
&nbsp;
# System Configuration...
lang en_US.UTF-8
keyboard us
# Temporary root password.  Should be changed once host is ready.
rootpw password
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --enforcing −−port=22:tcp
timezone --utc America/Denver
zerombr
# xvda (Xen Virtual Disk) is the xen block tap device for paravirtualized hosts.
# Non-PV hosts would see a normal hdx block device
# http://wiki.xensource.com/xenwiki/blktap
bootloader --location=mbr --driveorder=xvda --append=&quot;console=xvc0&quot;
reboot
&nbsp;
# Network Settings
network --device eth0 --bootproto dhcp
&nbsp;
# Partitioning
clearpart --all --initlabel --drives=xvda
part /boot --fstype ext3 --size=100 --ondisk=xvda
part pv.2 --size=0 --grow --ondisk=xvda
volgroup VolGroup00 --pesize=32768 pv.2
logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=256 --grow
--maxsize=512
&nbsp;
# Disable unneeded services
services --disabled microcode_ctl,smartd
&nbsp;
# Package Selection.  Core and Base are always selected by default.
# see: http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Installation_Guide/s1-kickstart2-packageselection.html
%packages
@ system-tools
&nbsp;
%pre
&nbsp;
%post
#!/bin/sh
&nbsp;
# Localize the resolv.conf.
cat &lt;&lt; EOF &gt; /etc/resolv.conf
domain subaquatic.net
search subaquatic.net
nameserver 192.168.0.223
nameserver 192.168.0.224
EOF
&nbsp;
# Update to local ntp servers.
sed -i -e &quot;s/0.centos.pool.ntp.org/192.168.0.1/&quot; /etc/ntp.conf
sed -i -e &quot;s/1.centos.pool.ntp.org/192.168.0.2/&quot; /etc/ntp.conf
sed -i -e &quot;/2.centos.pool.ntp.org/d&quot; /etc/ntp.conf
chkconfig ntpd on
service ntpd start
&nbsp;
# Turn off unnecessary services
chkconfig bluetooth off
chkconfig cups off
chkconfig gpm off</pre></td></tr></table></div>

</li>
<li>Create your VM.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
virt-install <span style="color: #660033;">-n</span> <span style="color: #800000;">${1}</span> <span style="color: #660033;">-r</span> <span style="color: #000000;">256</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${1}</span>.img <span style="color: #660033;">-s</span> <span style="color: #000000;">4</span> <span style="color: #660033;">--vnc</span>
<span style="color: #660033;">--os-type</span>=linux <span style="color: #660033;">--os-variant</span>=centos5 <span style="color: #660033;">-l</span> nfs:192.168.0.240:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>install<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.2</span>
<span style="color: #660033;">-x</span> <span style="color: #ff0000;">&quot;ks=nfs:192.168.0.240:/opt/install/ks/centos52_text_pvm.ks&quot;</span> <span style="color: #660033;">-p</span></pre></td></tr></table></div>

</li>
<li>Done!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.subaquatic.net/archives/kickstarting-a-virtualized-guest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
