<?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"
	>

<channel>
	<title>tinynation.com technical weblog</title>
	<atom:link href="http://tinynation.com/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://tinynation.com/wp</link>
	<description>Practical perspective on technology by Andrew Franklin.</description>
	<pubDate>Mon, 09 Jun 2008 22:16:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>gnome-do JIRA Plugin now at launchpad</title>
		<link>http://tinynation.com/wp/2008/06/06/gnome-do-jira-plugin-now-at-launchpad/</link>
		<comments>http://tinynation.com/wp/2008/06/06/gnome-do-jira-plugin-now-at-launchpad/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 15:00:41 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://tinynation.com/wp/?p=150</guid>
		<description><![CDATA[Update: The JIRA Plugin is now part of the community plugins source repository. I&#8217;ve merged my latest changes, so you&#8217;ll find them at: lp:~do-plugins/do-plugins/community. As a result it&#8217;s now part of the official community plugins, so you can obtain the binary through the Do repo, which is accessible from the new preferences pane in Do.
I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: The JIRA Plugin is now part of the community plugins source repository. I&#8217;ve merged my latest changes, so you&#8217;ll find them at: <a href="https://code.launchpad.net/~do-plugins/do-plugins/community">lp:~do-plugins/do-plugins/community</a>. As a result it&#8217;s now part of the official community plugins, so you can obtain the binary through the Do repo, which is accessible from the new preferences pane in Do.</strong></p>
<p>I&#8217;ve done some major changes such that it&#8217;s no longer just a blind regex that produces URLs, but a soap/rss JIRA connector which works out which issues are open and provides you the titles of the issues as you type. A sample of how this looks is shown below.</p>
<div style='text-align: center; padding: 5px;'>
<img src="http://img504.imageshack.us/img504/4663/gnomedojira2mo9.png" alt="Gnome Do JIRA New Plugin" />
</div>
<p>Being as though I&#8217;m now also building against the gnome-do trunk, I&#8217;ve decided to avoid the gconf configuration and instead use the new IConfigurable interface. A screenshot of how one configures the plugin is shown below:</p>
<div style='text-align: center; padding: 5px;'>
<img src="http://img75.imageshack.us/img75/4956/jiraconfigscreencv3.png" alt="Plugin Configuration" />
</div>
<p>At some point I&#8217;m wanting to show slightly different icons depending on issue state and/or priority, but that&#8217;s a work in progress. If you get the chance to check it out, your comments will be much appreciated.</p>
<p><div style="text-align: center; margin: 20px;">
<script type="text/javascript"><!--
google_ad_client = "pub-4006871781592962";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_text = "333333";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2008/06/06/gnome-do-jira-plugin-now-at-launchpad/feed/</wfw:commentRss>
		</item>
		<item>
		<title>gnome-do JIRA Plugin</title>
		<link>http://tinynation.com/wp/2008/05/21/gnome-do-jira-plugin/</link>
		<comments>http://tinynation.com/wp/2008/05/21/gnome-do-jira-plugin/#comments</comments>
		<pubDate>Tue, 20 May 2008 15:09:15 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tinynation.com/wp/?p=149</guid>
		<description><![CDATA[Update: I&#8217;ve rewritten the plugin to make it poll the JIRA installation for issues. Please checkout the latest updates!
I&#8217;ve been using gnome-do a bit on Ubuntu lately and I&#8217;m pretty impressed. As I&#8217;m regularly looking up JIRA issues at work, I figured I might create a basic plugin where a user can start typing a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: I&#8217;ve rewritten the plugin to make it poll the JIRA installation for issues. Please checkout the <a href="http://tinynation.com/wp/2008/06/06/gnome-do-jira-plugin-now-at-launchpad/">latest updates!</a></strong></p>
<p>I&#8217;ve been using <a href="https://wiki.ubuntu.com/GnomeDo">gnome-do</a> a bit on Ubuntu lately and I&#8217;m pretty impressed. As I&#8217;m regularly looking up JIRA issues at work, I figured I might create a basic plugin where a user can start typing a JIRA issue code, then press enter and it&#8217;ll take them to the relevant bug page. This is how it looks&#8230;</p>
<div style='text-align: center; padding: 5px;'>
<img src='http://tinynation.com/wp/uploads/gnome-do-JIRA.png' alt='Gnome-Do JIRA Plugin' />
</div>
<p>Basically you need to drop the JIRA.dll inside the archive below in ~/.local/share/gnome-do/plugins and restart gnome-do. By default the JIRA base repository is set to use the Apache one, so you&#8217;ll want to fire up &#8220;gconf-editor&#8221; and go to /apps/gnome-do/plugins/JIRA and then set the &#8220;baseUrl&#8221; property to your JIRA install location. After setting your preferred repository you&#8217;ll want to restart gnome-do.</p>
<p>Note this is a pretty primitive plugin. Essentially it&#8217;s just a regex that looks for an uppercase string, followed by a dash, followed by a number. If it detects that pattern, then it&#8217;ll suggest a url. Maybe at some point there should be ability to start the creation of issues or even do searches on the fly. For now it&#8217;s just a simple issue code lookup (which as a result requires no authentication). It also only supports a single repository.</p>
<p>If this sounds like it might interest you, the download archive (which contains a mono-devlop project) is below.</p>
<ul>
<li><a href="http://tinynation.com/wp/uploads/gnome-do-JIRA-0.1.tar.gz">gnome-do JIRA Plugin 0.1 (tar.gz)</a>
<ul>
<li>Initial Version</li>
</ul>
</li>
<li><a href="http://tinynation.com/wp/uploads/gnome-do-JIRA-0.2.tar.gz">gnome-do JIRA Plugin 0.2 (tar.gz)</a>
<ul>
<li>More relaxed regex, you can now type the project code in lowercase, and it will be converted to uppercase automatically.</li>
</ul>
</li>
</ul>
<p>The plugin is licenced under the GPL.</p>
<p><div style="text-align: center; margin: 20px;">
<script type="text/javascript"><!--
google_ad_client = "pub-4006871781592962";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_text = "333333";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2008/05/21/gnome-do-jira-plugin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NTLMv2 Authentication in Java (HTTPCLIENT Patch)</title>
		<link>http://tinynation.com/wp/2008/03/04/ntlmv2-authentication-in-java-httpclient-patch/</link>
		<comments>http://tinynation.com/wp/2008/03/04/ntlmv2-authentication-in-java-httpclient-patch/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 10:38:39 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://tinynation.com/wp/2008/03/04/ntlmv2-authentication-in-java-httpclient-patch/</guid>
		<description><![CDATA[The excellent article over at Oakland Software discusses the number of troubles one has trying to authenticate with NTLMv2, especially when the setting &#8220;Network security: Minimum session security for NTLM SSP based (including secure RPC) servers&#8220; is applied on the server.
As the article cites, commons-httpclient does not support NLTMv2. On HTTPCLIENT-579, a contributor names Konstantin [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://oaklandsoftware.com/papers/ntlm.html">excellent article over at Oakland Software</a> discusses the number of troubles one has trying to authenticate with NTLMv2, especially when the setting <em>&#8220;Network security: Minimum session security for NTLM SSP based (including secure RPC) servers</strong>&#8220;</em> is applied on the server.</p>
<p>As the article cites, commons-httpclient does not support NLTMv2. On <a href="http://issues.apache.org/jira/browse/HTTPCLIENT-579">HTTPCLIENT-579</a>, a contributor names Konstantin supplied an LGPL patch for negotitating NTLMv2. Unfortunately the patch didn&#8217;t seem to work with the <em>&#8220;Network security: Minimum session security for NTLM SSP based (including secure RPC) servers</strong>&#8220;</em> setting. I&#8217;ve submitted a path for Konstantin&#8217;s work that provides such support. If this is of interest to you, checkout the bug above, and <a href="http://issues.apache.org/jira/secure/attachment/12376092/ntlmv2-session-security.diff">my patch</a>. Keep in mind it&#8217;s obviously bound under the same licence as Konstantin&#8217;s work.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2008/03/04/ntlmv2-authentication-in-java-httpclient-patch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>commons-vfs : Cannot list children of HTTP folders (VFS-79)</title>
		<link>http://tinynation.com/wp/2007/09/30/commons-vfs-79/</link>
		<comments>http://tinynation.com/wp/2007/09/30/commons-vfs-79/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 05:56:41 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arbfranklin.com/wp/2007/09/30/commons-vfs-79/</guid>
		<description><![CDATA[Update: I&#8217;ve submitted this patch to Apache, with the issue code: VFS-199
I&#8217;ve been doing some development with commons-vfs lately and ran into an issue where the http file system provider doesn&#8217;t support the listing of http folders. A search on the commons-vfs JIRA yielded no results, but a search on google resulted in a reference [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: I&#8217;ve submitted this patch to Apache, with the issue code: <a href="http://issues.apache.org/jira/browse/VFS-199">VFS-199</a></strong></p>
<p>I&#8217;ve been doing some development with commons-vfs lately and ran into an issue where the http file system provider doesn&#8217;t support the listing of http folders. A search on the commons-vfs JIRA yielded no results, but a search on google resulted in a reference to the <strong>deleted</strong> bug VFS-79. The original author of the bug summed up my problem as:</p>
<blockquote><p>
The following code produces the below exception at f.getChildren(), even though<br />
the specified location is a folder with children.  Similar problems exist for<br />
other protocol supported by VFS.
</p></blockquote>
<pre>
FileSystemManager fsManager = VFS.getManager();
final FileObject f = fsManager.resolveFile(
            "http://people.apache.org/builds/jakarta-commons/nightly/commons-vfs/" );
FileObject[] children = f.getChildren();

Exception in thread &#8220;main&#8221; org.apache.commons.vfs.FileSystemException: Could
not list the contents of
&#8220;http://people.apache.org/builds/jakarta-commons/nightly/commons-vfs&#8221;; because
it is not a folder.
        at  org.apache.commons.vfs.provider.AbstractFileObject.getChildren(AbstractFileObject.java:525)
        at com.bashpole.reflectorGadget.reflectionGroup.Sync.test(Sync.java:118)
</pre>
<p>The bug was marked as <strong>won&#8217;t fix</strong>, with the comment:</p>
<blockquote><p>
Yep, unhappily the http filesystem do not support the getChildren method.</p>
<p>System.err.println(&#8221;can list children=&#8221; +<br />
f.getFileSystem().hasCapability(Capability.LIST_CHILDREN));</p>
<p>Some people already asked about this feature and maybe also started to<br />
implement it, but not patch has been submitted yet. The problem is, that its<br />
not necessarily easy to parse the html output.
</p></blockquote>
<p><!--adsense-->I&#8217;m going to need http browse support in a project I&#8217;m working on, so I went ahead and added the LIST_CHILDREN capability. I&#8217;ve included the patched files to apply to the commons-vfs trunk, ideally I&#8217;d like to see this end up on the official trunk but I&#8217;d want the Apache guys to check it out first!</p>
<p>There is a decent chance this patch won&#8217;t work on some folders and should be considered a proof of concept, so if you find any bugs then please comment here so I can fix them! I&#8217;d also be curious to know if you find this patch useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2007/09/30/commons-vfs-79/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spring.NET 1.1 on Mono</title>
		<link>http://tinynation.com/wp/2007/03/10/springnet-11-on-mono/</link>
		<comments>http://tinynation.com/wp/2007/03/10/springnet-11-on-mono/#comments</comments>
		<pubDate>Sat, 10 Mar 2007 04:55:26 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arbfranklin.com/wp/2007/03/10/springnet-11-on-mono/</guid>
		<description><![CDATA[Just managed to make a patch to my Spring.Core.dll such that I could get the basic IoC examples working under mono. This will fix applications such as the demo MovieLister, and the fix is fairly simple.
When you run the Spring.NET MovieLister app under Mono you&#8217;ll receive a stack trace which looks like this:

Unhandled Exception: System.Configuration.ConfigurationErrorsException: [...]]]></description>
			<content:encoded><![CDATA[<p>Just managed to make a patch to my Spring.Core.dll such that I could get the basic IoC examples working under mono. This will fix applications such as the demo MovieLister, and the fix is fairly simple.</p>
<p>When you run the Spring.NET MovieLister app under Mono you&#8217;ll receive a stack trace which looks like this:</p>
<blockquote><p>
Unhandled Exception: System.Configuration.ConfigurationErrorsException: Error instantiating context &#8217;spring.root&#8217;. () () &#8212;> Spring.Objects.FatalObjectException: Cannot instantiate Type [Spring.Context.Support.XmlApplicationContext] using ctor [Void .ctor(String, Boolean, String[])] : &#8216;Exception has been thrown by the target of an invocation.&#8217; &#8212;> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. &#8212;> System.NullReferenceException: Object reference not set to an instance of an object<br />
  at Mono.Xml.Schema.XmlSchemaValidatingReader.get_Prefix () [0x00000]<br />
  at System.Xml.XmlDocument.ReadAttributeNode (System.Xml.XmlReader reader) [0x00000]<br />
  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000]<br />
  at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00000]<br />
  at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00000]<br />
  at Spring.Objects.Factory.Xml.XmlObjectDefinitionReader.LoadObjectDefinitions (IResource resource) [0x00000]
</p></blockquote>
<p>The exception is a result of Mono not implementing XmlSchema.Add. The following is my fix that you need to apply to Spring.Core/Objects/Factory/Xml/XmlObjectDefinitionReader.cs.</p>
<p>Firstly, include the System namespace on Line 23</p>
<pre>
using System;
</pre>
<p>Next, on line 153, I make it such that if your application is running under mono, the schema isn&#8217;t validated against. Everything will perform as normal if you&#8217;re running under the .NET platform. Replace the line that reads:</p>
<pre>
reader = XmlUtils.CreateValidatingReader(stream, XmlParserRegistry.GetSchemas(),
                  new ValidationEventHandler(HandleValidation));
</pre>
<p>with:</p>
<pre>
// Enable validating reader when not running under mono
Type monoIdentifier = Type.GetType("Mono.Runtime");
if (monoIdentifier == null)
{
    reader = XmlUtils.CreateValidatingReader(stream, XmlParserRegistry.GetSchemas(),
                 new ValidationEventHandler(HandleValidation));
}
else
{
    reader = XmlReader.Create(stream);
}
</pre>
<p>It&#8217;s a simple fix, but means I can get my Spring.NET based application to run under mono! I&#8217;ve provided <a id="p145" href="http://arbfranklin.com/wp/wp-content/uploads/2007/03/springcore.zip">my compiled Spring.Core.dll for download</a>. I won&#8217;t be supporting the change, so If you want to be able to make future edits, I recommend you download the latest version from the <a href="http://www.springframework.net">Spring.NET site</a> and patch the source yourself.</p>
<p>Final note, this only seems to fix my troubles for Mono on Windows. Looking at addressing the  Linux issues asap. If you&#8217;ve got Spring.NET playing nicely on Linux Mono, please leave a comment. <strong>*Update* - Seems to only be occurring on my Ubuntu Edgy Box. Seems to work fine on Fedora! <img src='http://tinynation.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2007/03/10/springnet-11-on-mono/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Linux Admin Blog</title>
		<link>http://tinynation.com/wp/2007/02/27/linux-admin-blog/</link>
		<comments>http://tinynation.com/wp/2007/02/27/linux-admin-blog/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 09:40:58 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arbfranklin.com/wp/2007/02/27/linux-admin-blog/</guid>
		<description><![CDATA[First up, sorry I haven&#8217;t written recently, my internet has been capped and it&#8217;s been painfully slow. A recent discovery has been Sébastien Wains homepage which I&#8217;d like to think is in a similar vain to this page, simple tips related to day to day work. Sébastien&#8217;s blog is generally targeted at Linux administration and [...]]]></description>
			<content:encoded><![CDATA[<p>First up, sorry I haven&#8217;t written recently, my internet has been capped and it&#8217;s been painfully slow. A recent discovery has been <a href="http://www.wains.be/">Sébastien Wains homepage</a> which I&#8217;d like to think is in a similar vain to this page, simple tips related to day to day work. Sébastien&#8217;s blog is generally targeted at Linux administration and has a number of quality tips. Many of the tips are pure gold if you&#8217;ve ever been stuck in a similar situation. I recommend articles on <a href="http://www.wains.be/index.php/2007/02/19/the-linux-runlevel/">Linux Run  Levels</a>, <a href="http://www.wains.be/index.php/2007/02/13/securely-synchronize-a-folder-from-a-remote-machine-with-ssh/">Using Rsync over SSH</a> and <a href="http://www.wains.be/index.php/2007/01/11/subversion-automating-svnkeywords/">Automating SVN keywords</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2007/02/27/linux-admin-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple Shell Script to Convert DVD to XVID</title>
		<link>http://tinynation.com/wp/2007/02/05/simple-shell-script-to-convert-dvd-to-xvid/</link>
		<comments>http://tinynation.com/wp/2007/02/05/simple-shell-script-to-convert-dvd-to-xvid/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 11:58:47 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arbfranklin.com/wp/2007/02/05/simple-shell-script-to-convert-dvd-to-xvid/</guid>
		<description><![CDATA[I had a post on this a while ago which used &#34;transcode&#34; and a series of other convoluted steps. By far the easiest is to just use mencoder which is the encoding half of mplayer. The following commands build you an MPEG4 from a DVD in 2 easy passes, it&#8217;s really this simple!

mencoder dvd:// -ovc [...]]]></description>
			<content:encoded><![CDATA[<p>I had a post on this a while ago which used &quot;transcode&quot; and a series of other convoluted steps. By far the easiest is to just use <strong>mencoder</strong> which is the encoding half of <strong>mplayer</strong>. The following commands build you an MPEG4 from a DVD in 2 easy passes, it&#8217;s really this simple!</p>
<pre>
mencoder dvd:// -ovc xvid -xvidencopts pass=1 -alang en -oac copy -o /dev/null
mencoder dvd:// -ovc xvid -xvidencopts pass=2:bitrate=650000 -alang en -oac mp3lame
   -lameopts vbr=3 -o movie.avi
</pre>
<p>The only important bits are the bitrate in the second pass. Raise that number to maybe 768000 if you require even better quality and a larger file size. You&#8217;ll also want to <a href="http://ubuntuguide.org/wiki/Ubuntu_Edgy#How_to_install_DVD_playback_capability">Install DVD playback capability</a> which is pretty simple if you&#8217;re using Ubuntu (and there&#8217;s plenty of other guides for other distributions).</p>
<p>Finally sorry that I haven&#8217;t written lately, just got back from holiday, so more posts coming soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2007/02/05/simple-shell-script-to-convert-dvd-to-xvid/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spatial Data Support for SQL Server 2005</title>
		<link>http://tinynation.com/wp/2007/01/07/spatial-data-support-for-sql-server-2005/</link>
		<comments>http://tinynation.com/wp/2007/01/07/spatial-data-support-for-sql-server-2005/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 11:45:05 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arbfranklin.com/wp/2007/01/07/spatial-data-support-for-sql-server-2005/</guid>
		<description><![CDATA[The following article looks at adding Spatial Data Support to SQL Server 2005 using the free 3rd party open-source project MsSqlSpatial from the Codeplex site. By adding spatial extensions to SQL Server, you&#8217;ll easily be able to do geographical style queries such as &#34;Which walking tracks fall within my suburb or defined radius areas?&#34;. With [...]]]></description>
			<content:encoded><![CDATA[<p>The following article looks at adding Spatial Data Support to SQL Server 2005 using the free 3rd party open-source project <a href="http://www.codeplex.com/MsSqlSpatial">MsSqlSpatial</a> from the Codeplex site. By adding spatial extensions to SQL Server, you&#8217;ll easily be able to do geographical style queries such as &quot;Which walking tracks fall within my suburb or defined radius areas?&quot;. With the latest trends set by Google Maps &amp; Virtual Earth, managing more than simple x/y pushpins is becoming important. MsSqlSpatial is an open-source set of CLR extensions that add basic spatial support to SQL Server. The following article is based on the <a href="http://www.codeplex.com/MsSqlSpatial/Wiki/View.aspx?title=Getting%20Started">Getting Started Guide</a> from the project site.</p>
<p><img id="image134" src="http://tinynation.com/wp/wp-content/uploads/2007/01/mssqlspatial.png" alt="MsSqlSpatial from Codeplex" /></p>
<p>To get started, <a href="http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=MsSqlSpatial">download the latest binaries</a> for the project and save it wherever you like, I used: C:\Program Files\Microsoft SQL Server\MsSqlSpatial.</p>
<p>As I&#8217;m testing this with SQL Server 2005, I went ahead and downloaded the <a href="http://msdn.microsoft.com/vstudio/express/sql/download/">SQL Server Management Studio Express</a> to make management of the database a little easier.</p>
<p><img id="image133" src="http://tinynation.com/wp/wp-content/uploads/2007/01/sqlmanagement.png" alt="SQL Management Studio" /></p>
<p>As the MsSqlServer project uses CLR extensions, and SQL Server 2005 doesn&#8217;t enable them by default, we&#8217;ll need to do this now. Load the Management Studio, connect to your database and choose the option to run a query. You&#8217;ll want to run the following query which is sourced from <a href="http://msdn2.microsoft.com/en-us/library/ms131048.aspx">MSDN</a>:</p>
<pre>
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO
</pre>
<p>The following screenshot shows the successful run of the above query. Just a quick aside that my computer is called MELON, so any places below where you see MELON, substitute with your computer name.</p>
<p><img id="image135" src="http://tinynation.com/wp/wp-content/uploads/2007/01/enable-clr.png" alt="Enabling CLR Extensions" /></p>
<p>Next create a new database which we can deploy the extensions to. There is the potential to add the extensions to an existing database, but we&#8217;ll start with a fresh one in this example which I&#8217;ve named &#8220;GisDB&#8221;.</p>
<p>We now want to deploy the MsSqlSpatial extensions into our database within SQL Server 2005. To do this we&#8217;ll open a command window and cd into C:\Program Files\Microsoft SQL Server\MsSqlSpatial such that we can run the msscmd.exe utility. Run the following (substitute MELON with your computer name):</p>
<pre>
msscmd -deploy -server=MELON\\SQLEXPRESS -db=GisDB
</pre>
<p>If everything went well, you&#8217;ll have output like:</p>
<pre>
'C:\\Program Files\\Microsoft SQL Server\\MsSqlSpatial\\MsSqlSpatialLibrary.dll' deployed.
</pre>
<p>Congratulations, you now have a spatially enabled database! Now to do something useful with it. The &quot;shapefile&quot; format is the de-facto format for distributing GIS data. There are a number of free shapefiles already available which we can import into our spatially enabled SQL Server database to do some sample queries. I recommend you download a program like <a href="http://www.vdstech.com/mapbrowser.htm">MapBrowser</a> which lets you visually review the contents of a shapefile as a map. To get started with some sample data you might like to use something like <a href="http://www.weather.gov/geodata/catalog/national/html/cities.htm">US Cities</a> - <strong>it&#8217;s really big at 2GB!</strong>. Australian&#8217;s will want to look at the <a href="http://www.ga.gov.au/">Geoscience Australia</a> site which provides a number of data sources in the shapefile format. The sample I&#8217;ll be demonstrating below is the &quot;Sydney Special&quot; set from the GEODATA TOPO 250K Series 3, it&#8217;s really small at around 8MB. Having downloaded the zip file from above, extract it to somewhere convenient like c:\temp. You&#8217;ll have a folder that looks something like below.</p>
<p><img id="image136" src="http://tinynation.com/wp/wp-content/uploads/2007/01/sydney-special.png" alt="Sydney Special Dataset" /></p>
<p>Inside the various folders there&#8217;s information from major roads to airfields, and even swamp lands! Specifically in this example we&#8217;ll look at the placenames listing within the Habitation folder, titled: <b>i5605_placenames.shp</b>. Open it up in a tool like MapBrowser and you&#8217;ll see a listing like below. Note that you&#8217;ll want to click on Properties > Displayed Labels > NAME in-order to get a similar screenshot to below.</p>
<p><img id="image137" src="http://tinynation.com/wp/wp-content/uploads/2007/01/sydney-map-view.png" alt="Sydney MapBrowser View" /></p>
<p>We&#8217;re now going to import this shapefile into SQL Server. It turns out this is really easy, there&#8217;s a couple of ways of doing this, but we&#8217;ll use the command line tool to keep it simple. Using the utility before, we&#8217;ll create a new table called gPlaceNames from the shapefile. Note that the command will create the table for us, we should not create the table first. The command to be issued is as follows:</p>
<pre>
msscmd -server=MELON\\SQLEXPRESS -db=GisDB -table=gPlaceNames -import=shp
  -shp_filename="C:\\temp\\sydney-special\\Habitation\\i5605_placenames.shp"
</pre>
<p>If all is well, you&#8217;ll receive output similar to:</p>
<pre>
740 rows imported in 5 seconds from shapefile 'i5605_placenames.shp'.
</pre>
<p>Open SQL Server Management Studio, and connect to the GisDB database. At this point I&#8217;m going to go through a couple of queries to give you an idea of what you could potentially use. Firstly, to test that the data is all there, a simple select query will yield the 740 rows of data. You&#8217;ll note that MsSqlSpatial adds a geom column for holding the geographic data, as well as 4 columns representing a bounding rectangle for the geometry. The the_geom column is a byte representation, you could run <code>select NAME, ST.AsText(the_geom) from gPlaceNames</code> if you wanted to see the point as a lat/long.</p>
<p><img id="image138" src="http://tinynation.com/wp/wp-content/uploads/2007/01/select-star.png" alt="Select * from gPlaceNames" /></p>
<p>You can now run some sample queries on the dataset, I&#8217;ve outlined some below.</p>
<p>1. Find all the places within 0.05 decimal degrees of CRONULLA</p>
<pre>
select t.NAME, ST.AsText(t.the_geom)
from ST.IsWithinDistanceQuery('gPlaceNames', 'the_geom', (
	select the_geom from gPlaceNames where NAME='CRONULLA'
), 0.05) AS q
inner join gPlaceNames as t on q.oid = t.oid
</pre>
<p>Result:</p>
<p><img id="image139" src="http://tinynation.com/wp/wp-content/uploads/2007/01/result-set-1.png" alt="Result Set Distance Cronulla" /></p>
<p>2. Find all the places contained within the bounding box of PYMBLE and MARTIN PLACE (I&#8217;ve fixed the lat/long).</p>
<pre>
select t.NAME, ST.AsText(t.the_geom)
from ST.FilterQuery('gPlaceNames', 'the_geom',
    ST.MakeEnvelope(151.14539,-33.74366,151.21144,-33.86764,-1)) AS q
inner join gPlaceNames AS t ON q.oid = t.oid
</pre>
<p>Result:</p>
<p><img id="image140" src="http://tinynation.com/wp/wp-content/uploads/2007/01/result-set-2.png" alt="Result Set Bounding Envelope" /></p>
<p>Those 2 queries will get you started, keep in mind that MsSqlSpatial conforms to the OGC Simple Features Specification for SQL Revision 1.1, which means all the Open Spatial Consortium standards for SQL are followed, you might want to look into the <a href="http://www.opengeospatial.org/standards/sfs">Simple Feature Access</a> page for more advanced spatial sql.</p>
<p>Hope this write up has been useful, if you have any tips or tricks you have for dealing with Spatial data in SQL Server 2005 that you&#8217;d like to share, please comment below!</p>
<p><!--adsense#horizontal--></p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2007/01/07/spatial-data-support-for-sql-server-2005/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Mono on an Amazon EC2 Image</title>
		<link>http://tinynation.com/wp/2006/12/30/installing-mono-on-an-amazon-ec2-image/</link>
		<comments>http://tinynation.com/wp/2006/12/30/installing-mono-on-an-amazon-ec2-image/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 00:11:58 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Amazon EC2]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arbfranklin.com/wp/2006/12/30/installing-mono-on-an-amazon-ec2-image/</guid>
		<description><![CDATA[The following quickstart guide will get you up and running in mono on the Fedora Core 4 base image within Amazon Elastic Compute Cloud (EC2). By using mono you&#8217;ll be able to run some ASP.NET and C# command-line programs as the mono project supports around 90% of the .NET Framework API.
Before we get started, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>The following quickstart guide will get you up and running in mono on the Fedora Core 4 base image within Amazon Elastic Compute Cloud (EC2). By using mono you&#8217;ll be able to run some ASP.NET and C# command-line programs as the mono project supports around 90% of the .NET Framework API.</p>
<p>Before we get started, I&#8217;ll assume you&#8217;ve got the <a href="http://tinynation.com/wp/2006/12/29/getting-started-with-amazon-ec2-for-windows-users/">Amazon Fedora Core 4 image up and running</a>.</p>
<p>We now want to install Mono. This is a pretty simple process as all we need to do is add the mono repository into our yum sources. For those not familiar with yum, it&#8217;s similar to many of the linux package managers in that it enables the download of applications by name, resolving the various dependencies and downloading them via the internet. The following set of commands will add the mono repository, and then install the various components you&#8217;ll need within mono.</p>
<pre>
cd /etc/yum.repos.d
wget http://www.go-mono.com/download-stable/fedora-4-i386/mono.repo
yum -y install mono-core mono-nunit mono-web mono-basic xsp \\
    mod_mono monodoc-core mono-data
</pre>
<p>The process will take about 5 minutes, but that&#8217;s all there is to it&#8230; mono will be installed! To prove that it&#8217;s all working, cd into the asp.net examples directory and run the standalone mono ASP.NET service. The following will do the job&#8230;</p>
<pre>
cd /usr/lib/xsp/test
xsp2
</pre>
<p>At this point your asp.net mono server will be up and running with the test examples, the only problem is how do we see it? We need to open port 8080 on the firewall, similar to how we opened port 22. As before, the following is the output.</p>
<pre>
C:\\Program Files\\ec2\\bin>ec2-authorize default -p 8080
GROUP           default
PERMISSION              default ALLOWS  tcp     8080      8080      FROM    CIDR0.0.0.0/0
</pre>
<p>Now connect to your image via the web-browser, when I did this tutorial the address was http://domu-12-31-33-00-04-02.usma1.compute.amazonaws.com:8080.</p>
<p><img id="image131" src="http://tinynation.com/wp/wp-content/uploads/2006/12/mono.png" alt="Mono ASP.NET Example Page" /></p>
<p>Press Ctrl-C to kill the mono xsp process when you&#8217;re done.</p>
<p>That&#8217;s it for now, using WinSCP you might want to upload some of your own examples to a directory and run xsp2 and see how they look! <strong>Don&#8217;t forget to shutdown your image!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2006/12/30/installing-mono-on-an-amazon-ec2-image/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting Started with Amazon EC2 for Windows Users</title>
		<link>http://tinynation.com/wp/2006/12/29/getting-started-with-amazon-ec2-for-windows-users/</link>
		<comments>http://tinynation.com/wp/2006/12/29/getting-started-with-amazon-ec2-for-windows-users/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 03:39:23 +0000</pubDate>
		<dc:creator>arbfranklin</dc:creator>
		
		<category><![CDATA[Amazon EC2]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arbfranklin.com/wp/?p=124</guid>
		<description><![CDATA[
Before I get started, I just want to point out that I&#8217;ve got no affiliation with Amazon and that this guide is to try and help you get started with EC2. This tutorial requires reasonable competency with Windows and potentially some experience with Linux, please read over the post before you get started and check [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--></p>
<p>Before I get started, I just want to point out that I&#8217;ve got no affiliation with Amazon and that this guide is to try and help you get started with EC2. This tutorial requires reasonable competency with Windows and potentially some experience with Linux, please read over the post before you get started and check out the docs on Amazon to make sure you understand their terms of service.</p>
<p>The following guide should hopefully get you up and running such that you can boot your Amazon Elastic Compute Cloud (EC2) images from within a Windows environment. In particular, we&#8217;ll be booting one of the public images running Fedora Core 4.</p>
<p>You&#8217;ll need the following before you can get started, you may skip any section for a pre-requisite that you might already have. Note that all the software required to get started is freely available.</p>
<h4>Java Runtime Environment</h4>
<p>To get started you&#8217;ll need a Java Runtime Environment (JRE) as it&#8217;s a dependency for the EC2 tools. Look inside C:\Program Files\Java to see if you&#8217;ve already got one, if that folder doesn&#8217;t exist then <a href="http://java.sun.com/javase/downloads/index.jsp">download the latest JRE from the SUN site</a>. I don&#8217;t recall whether the JRE bin folder is put in your path as part of the installer, but if it isn&#8217;t right click on &#8220;My Computer&#8221;, then click &#8220;Properties&#8221; > &#8220;Advanced&#8221; > &#8220;Environment Variables&#8221;. Under &#8220;System Variables&#8221;:</p>
<ul>
<li>add JAVA_HOME as the location to your JRE.<br />
<code>ie. C:\Program Files\Java\jdk1.5.0_09</code></li>
<li>append the bin folder to your Path.<br />
<code>ie. C:\Program Files\Java\jdk1.5.0_09\bin</code></li>
</ul>
<p>You might want to open a command window at this point and type: <em>java -version</em>. If you don&#8217;t see output like the following, you&#8217;ve made an error above.</p>
<pre>
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01)
Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing)
</pre>
<h4>PuTTY/PuTTYGen</h4>
<p>Next you&#8217;ll need an SSH client and SSH keytool. The defacto standard is PuTTY and it&#8217;s sister tool PuTTYGen. You can download these tools from the <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuTTY Download Page</a>. There aren&#8217;t any installers, I recommend you place them in a location such as C:\Program Files\Utilities.</p>
<h4>WinSCP (Optional)</h4>
<p>In case you want to move files from your computer to your running instance, you&#8217;ll need an SCP client. SCP is similar to FTP except it is secure as it uses the SSH protocol. A great Windows frontend is called WinSCP. I recommend you just use the installer and perform a default install. You may freely download WinSCP 3.8.2 from the <a href="http://sourceforge.net/project/downloading.php?groupname=winscp&#038;filename=winscp382setup.exe&#038;use_mirror=optusnet"><br />
sourceforge site</a>.</p>
<h4>EC2 Tools</h4>
<p>Finally, you&#8217;ll need the Amazon developed EC2 tools. You may download them from the <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&#038;categoryID=88">Amazon site</a>. I recommend you extract the archive to a directory such as C:\Program Files\ec2.</p>
<h4>Summary of Tools so far</h4>
<p>At this point I&#8217;ll assume you&#8217;ve got an install that looks something like the following&#8230;</p>
<ul>
<li>JRE - C:\Program Files\Java\jdk1.5.0_09</li>
<li>EC2 Tools - C:\Program Files\ec2</li>
<li>PuTTY/PuTTYGen - C:\Program Files\Utilities</li>
</ul>
<p>Any paths referenced in this post from here on in with paths similar to the above you may replace with wherever you might have installed the pre-reqs to.</p>
<h4>Preparing your Environment</h4>
<p>Download your private key/public key pair from the &#8220;Your Account&#8221; section of the AmazonAWS site. A logical place to put the keys might be something like C:\Documents and Settings\Your Username\My Documents\ec2. You should have 2 files cert-XXX.pem and pk-XXX.pem where XXX is the unique id that Amazon defined.</p>
<p>At this point to use the tools you need to add a number of things to your path and set a few environment variables. To make this easier I created a bat file inside C:\Program Files\ec2 called prepare_env.bat, the contents of this file are outlined below. Substitute any path names and files as necessary.</p>
<pre>
rem Setting up EC2 Home
set EC2_HOME=C:\\Program Files\\ec2
set PATH=%PATH%;%EC2_HOME%\\bin

rem Loading Keys
set EC2_PRIVATE_KEY=c:\\Documents and Settings\\Your Username\\My Documents\\ec2\\pk-XXX.pem
set EC2_CERT=c:\\Documents and Settings\\Your Username\\My Documents\\ec2\\cert-XXX.pem
</pre>
<p>Load up a command window (Start > Run > cmd.exe), and cd to your ec2 folder. Run the prepare_env.bat script. If everything worked correctly, then cd into the bin folder. At this point you should be able to run one of the EC2 tools, try ec2-describe-images -o amazon. The following is a sample screendump:</p>
<pre>
C:\\Program Files\ec2\\bin>ec2-describe-images -o amazon
IMAGE   ami-20b65349    ec2-public-images/fedora-core4-base.manifest.xml amazon  available       public
IMAGE   ami-22b6534b    ec2-public-images/fedora-core4-mysql.manifest.xml amazon  available       public
IMAGE   ami-23b6534a    ec2-public-images/fedora-core4-apache.manifest.xml amazon  available       public
IMAGE   ami-25b6534c    ec2-public-images/fedora-core4-apache-mysql.manifest.xml         amazon  available       public
IMAGE   ami-26b6534f    ec2-public-images/developer-image.manifest.xml  amazon available       public
IMAGE   ami-2bb65342    ec2-public-images/getting-started.manifest.xml  amazon available       public
</pre>
<p>If you don&#8217;t see the above, or something very similar, then something is wrong. I&#8217;d recommend you go back through the tutorial and check your Java path as well as your prepare_env.bat. If it did work, then you&#8217;re ready to start loading up some remote images :).</p>
<h4>Loading the Amazon Public Base Image</h4>
<p>Amazon has a number of public images available, in fact the command you ran before listed 5 of them! The only problem with an image being public is that everyone knows the password to access your image. To avoid this problem, Amazon makes the actual password for the public images unavailable to the public, instead when you&#8217;re booting an image they allow you to attach the public portion of a key pair to your image such that you can login with a private key!</p>
<p>In order to create a key pair, run the following command: <code>ec2-add-keypair my-key</code>, you&#8217;ll receive output like the following:</p>
<pre>
KEYPAIR my-key  61:76:bb:3f:81:da:0f:5d:28:e4:36:70:f4:1b:26:f3:f9:3c:c0:10
-----BEGIN RSA PRIVATE KEY-----
B64 HEX HERE....
-----END RSA PRIVATE KEY-----
</pre>
<p>Copy paste everything but the first line into a new notepad document and after the &#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211; line <strong>add a single newline</strong>. We&#8217;re now going to take this private key file and convert it into a private key that PuTTY can read, save this file  in your My Documents\ec2 folder as AmazonPK.ppk.</p>
<p>We now need to convert this Private Key format to the format PuTTY understands. To do this, we&#8217;ll open up PuTTYGen.</p>
<p><img id="image128" src="http://tinynation.com/wp/wp-content/uploads/2006/12/puttygen-1.png" alt="PuTTYGen Intro" /></p>
<p>Choose the option to &#8220;Load&#8221; a Private Key. Then click &#8220;Save private key&#8221;, I recommend you Save this new Private Key right over the top of the old one. It&#8217;s ok to save the private key without a passphrase.</p>
<p>At this point we can boot a public image from the command line. In this instance we&#8217;ll boot the <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=517&#038;categoryID=101">Fedora Core Base Image</a>. The following is sample output.</p>
<pre>
C:\\Program Files\\ec2\\bin>ec2-run-instances ami-20b65349 -k my-key
RESERVATION     r-401aff29      904177591104    default
INSTANCE        i-6312f60a      ami-20b65349            pending my-key  0
</pre>
<p>Note that the image is in pending state. We may check the state of the image by running the following. Note the instance number of i-6312f60a is substituted into the next expression, your instance number will definitely be unique.</p>
<pre>
C:\Program Files\ec2-api-tools-1.2-7749\bin>ec2-describe-instances i-6312f60a
RESERVATION     r-401aff29      904177591104    default
INSTANCE        i-6312f60a      ami-20b65349    domU-12-31-33-00-04-02.usma1.compute.amazonaws.com      running my-key  0
</pre>
<p>You&#8217;ll want to keep running the command until you see your instance as &#8220;running&#8221;, it might take 5 minutes for your image to go live.</p>
<h4>Connecting to your Image</h4>
<p>Now that the image is live, you&#8217;ll want to connect to it. You&#8217;ll firstly need to open up the SSH port on the firewall, the following is sample output:</p>
<pre>
C:\\Program Files\\ec2\\bin>ec2-authorize default -p 22
GROUP           default
PERMISSION              default ALLOWS  tcp     22      22      FROM    CIDR0.0.0.0/0
</pre>
<p>Now that the firewall on our image is open for SSH access, open up PuTTY. Enter the address to the image as returned earlier (but don&#8217;t connect yet).</p>
<p><img id="image126" src="http://tinynation.com/wp/wp-content/uploads/2006/12/putty1.png" alt="PuTTY with the domU address" /></p>
<p>You&#8217;ll now want to switch to Connection > SSH > Auth, and add your private key.</p>
<p><img id="image127" src="http://tinynation.com/wp/wp-content/uploads/2006/12/putty2.png" alt="PuTTY accepting a private key" /></p>
<p>At this point you may click &#8220;Open&#8221;. You&#8217;ll be asked if you want to add the key to the cache, as you&#8217;ll most likely get issued a new IP next time, click No. When asked who you want to login as, enter the username &#8220;root&#8221;. Assuming everything worked, you&#8217;ll see the following:</p>
<p><img id="image129" src="http://tinynation.com/wp/wp-content/uploads/2006/12/ec2-putty.png" alt="EC2 Base Image running" /></p>
<p>Congratulations! You&#8217;re all done. When you&#8217;re done exploring the image <strong>do not forget to shut it down</strong>. There are 2 ways of doing this, within your Amazon tools there iis a tool called ec2-terminate-instances, which you can pass your instance id as a parameter. Alternatively, from within PuTTY run &#8220;shutdown -h now&#8221;. Note that when you terminate your instance, all changes will be lost.</p>
<p>In a following tutorial I&#8217;ll outline a basic mono setup, as well as how to persist your image.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinynation.com/wp/2006/12/29/getting-started-with-amazon-ec2-for-windows-users/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
