<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>DataChomp</title>
	
	<link>http://datachomp.com</link>
	<description>Chomping at the bits</description>
	<lastBuildDate>Mon, 25 Feb 2013 02:20:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Datachomp" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="datachomp" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Running the right rubies on Heroku</title>
		<link>http://datachomp.com/archives/running-the-right-rubies-on-heroku/</link>
		<comments>http://datachomp.com/archives/running-the-right-rubies-on-heroku/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 03:35:16 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AppDev]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=737</guid>
		<description><![CDATA[Being new to Ruby I have the luxury of running the latest rubies without much brownfield drama. With all the security concerns of late, I have never been more self righteous in my use of the latest and greatest in both rack and ruby. On my various servers, this has been very easy to do [...]]]></description>
				<content:encoded><![CDATA[<p>Being new to Ruby I have the luxury of running the latest rubies without much brownfield drama. With all the security concerns of late, I have never been more self righteous in my use of the latest and greatest in both rack and ruby.  On my various servers, this has been very easy to do with RVM and my Gemfile. On Heroku, I realized that I had been running 1.9.2 instead of 1.9.3.  The fix is easy enough though, as you just add which ruby you want to run to your Gemfile like so:<br />
<code><br />
source "https://rubygems.org"<br />
ruby '1.9.3'<br />
</code></p>
<p>You can get a list of the latest rubies supported by Heroku here:<br />
<a href="https://devcenter.heroku.com/articles/ruby-support#ruby-versions" title="Heroku Rubies" target="_blank">Heroku Rubies</a></p>
<p>If you are an RVM user like myself, feel free to add an .rvmrc file that will match what version Heroku is on for even more consistency goodness.<br />
<code><br />
rvm --create --rvmrc 1.9.3-p327@mycoolproject<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/running-the-right-rubies-on-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stopping spam in Contact Form 7</title>
		<link>http://datachomp.com/archives/stopping-spam-in-contact-form-7/</link>
		<comments>http://datachomp.com/archives/stopping-spam-in-contact-form-7/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 17:45:14 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=727</guid>
		<description><![CDATA[This blog is still running on wordpress and one of the plugins I use is contact form 7. I enjoy having a contact form over pasting an email address because it lets me append any number of constants to the email sent to me for me to filter on later. The downside to this is [...]]]></description>
				<content:encoded><![CDATA[<p>This blog is still running on wordpress and one of the plugins I use is contact form 7.  I enjoy having a contact form over pasting an email address because it lets me append any number of constants to the email sent to me for me to filter on later. The downside to this is that over the past week, I've had around 2,000 spam entries and gmail hasn't caught all of them.  Not being one to want to subject users to a painful CAPTCHA process, I found a simple work around by just running the form through akismet.  All it took was changing the form to the following:<br />
Ha, having issues getting the code to display properly so just check this link:<br/></p>
<p><a href="http://sproutnewmedia.com/how-to-use-akismet-protect-contact-form/" title="How To Use Akismet Protected Contact Form" target="_blank">http://sproutnewmedia.com/how-to-use-akismet-protect-contact-form/</a></p>
<p>Haven't had any spam since, form works fine, and no CAPTCHA's needed!</p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/stopping-spam-in-contact-form-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little bit more about sorting</title>
		<link>http://datachomp.com/archives/a-little-bit-more-about-sorting/</link>
		<comments>http://datachomp.com/archives/a-little-bit-more-about-sorting/#comments</comments>
		<pubDate>Sat, 01 Dec 2012 14:32:18 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AppDev]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=691</guid>
		<description><![CDATA[As a big fan of not sorting in the database when I don't have to, I have often resorted to heavy handed javascript libraries like datatables.net. I do this in large part because I am just awful at javascript and the libs typically already exists. As long as the database is saving a few cycles [...]]]></description>
				<content:encoded><![CDATA[<p>As a big fan of not <a href="http://datachomp.com/archives/hey-app-quit-wasting-my-time-sorting-your-data/" title="Don't waste my time" target="_blank">sorting in the database</a> when I don't have to, I have often resorted to heavy handed javascript libraries like <a href="http://datatables.net/" title="datatables.net" target="_blank">datatables.net</a>. I do this in large part because I am just awful at javascript and the libs typically already exists. As long as the database is saving a few cycles who cares about the client right?!?!  </p>
<p>This time of year is all about giving, so I thought I would try to find a better/lighter way of doing this. A few googles later, I found the <a href="http://tablesorter.com/docs/" title="tablesorter" target="_blank">tablesorter</a> lib and this looked like a pretty decent compromise.</p>
<p>Thinking I was onto something, I ran the idea by my resident javascript expert Michael Sarchet (<a href="http://www.michaelsarchet.com/" title="ha mikes blog" target="_blank">b</a> / <a href="https://twitter.com/msarchet" title="Mike" target="_blank">t</a>). His response was so simple and on point that I was slightly offended I hadn't thought of it. "I just use <a href="http://knockoutjs.com/" title="KnockoutJS" target="_blank">Knockout</a> for that." Advantages of this are that I'm not having to keep up with another lib (knockout is a default lib in MVC4) and this solution will be able to apply to collections outside of just a table. Thus, another life skill was born.</p>
<p><strong>Code Time<br />
Controller:</strong></p>
<pre class="brush: csharp; title: ; notranslate">var burritos = db.Select&lt;Burrito&gt;(&quot;select name,price from burritos&quot;);
var tacos = db.Select&lt;Taco&gt;(&quot;select name,price from tacos&quot;);
            
var viewModel = new viewmodel_Food
{
  burritos = burritos
  , tacos = tacos
};
return View(viewModel);</pre>
<p><strong>View:</strong></p>
<pre class="brush: xml; title: ; notranslate">@model burritoroll.web.Models.viewmodel_Food
@{
    ViewBag.Title = &quot;Index&quot;;
}

&lt;h2&gt;Index&lt;/h2&gt;

&lt;b&gt;&lt;em&gt;Can you dig our burritos?&lt;/em&gt;&lt;/b&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Burrito&lt;/th&gt;&lt;th&gt;Price&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
 &lt;tbody data-bind=&quot;foreach: burritosarray&quot;&gt;
  &lt;tr&gt;&lt;td data-bind=&quot;text: name&quot;&gt;&lt;/td&gt;&lt;td data-bind=&quot;text: price&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
 &lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;&lt;em&gt;Can you dig our tacos?&lt;/em&gt;&lt;/b&gt;
&lt;table&gt;
 &lt;thead&gt;
  &lt;tr&gt;&lt;th&gt;Taco&lt;/th&gt;&lt;th&gt;Price&lt;/th&gt;&lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody data-bind=&quot;foreach: tacosarray&quot;&gt;
  &lt;tr&gt;&lt;td data-bind=&quot;text: name&quot;&gt;&lt;/td&gt;&lt;td data-bind=&quot;text: price&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
@section scripts{
	&lt;script type=&quot;text/javascript&quot;&gt;
	function viewModel() {
		var self = this;

	    self.tacosarray = ko.observableArray(@Html.Raw(Json.Encode(Model.tacos.ToArray())));
	    self.burritosarray = ko.observableArray(@Html.Raw(Json.Encode(Model.burritos.ToArray())));
	    
	    var sortitFunction = function (a, b) {
	        return a.name.toLowerCase() == b.name.toLowerCase() ? 0 : a.name.toLowerCase() &lt; b.name.toLowerCase() ? -1 : 1;
	    };

	    self.tacosarray.sort(sortitFunction);
	    self.burritosarray.sort(sortitFunction);
	}

	ko.applyBindings(new viewModel());
	&lt;/script&gt;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/a-little-bit-more-about-sorting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What .NET ORM should I use?</title>
		<link>http://datachomp.com/archives/what-net-orm-should-i-use/</link>
		<comments>http://datachomp.com/archives/what-net-orm-should-i-use/#comments</comments>
		<pubDate>Fri, 30 Nov 2012 03:25:54 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AppDev]]></category>
		<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=663</guid>
		<description><![CDATA[I get asked all the time "What ORM should I use?" I typically answer the person with some spaghetti types/talks which of course runs counter to the DRY principle. To help get away from that, I'll hash out some of my typical responses below. One thing to keep in mind when reading, is that all [...]]]></description>
				<content:encoded><![CDATA[<p>I get asked all the time "What ORM should I use?" I typically answer the person with some spaghetti types/talks which of course runs counter to the DRY principle. To help get away from that, I'll hash out some of my typical responses below. One thing to keep in mind when reading, is that all of the ORMs mentioned below are really good choices. I'm "picking" one per situation as a way of helping someone avoid the paradox of choice. </p>
<dl>
<dt><strong>"Should I hand-roll my DAL?"</strong></dt>
<dd>No. Unless you just want an academic/code exercise. The libraries I'll mention in this post are already built, tested, fast and easy to use. If you are serious about building your application, don't waste time reinventing this wheel.</dd>
<p><br/></p>
<dt><strong>"I don't fear dynamics and I want something easy or rapid prototyping"</strong></dt>
<dd><a href="https://github.com/robconery/massive" title="Massive" target="_blank">Massive</a> - This ORM is simple to use, completely gets out of my way and lets me get right to building.</dd>
<p><br/></p>
<dt><strong>"I don't fear dynamics and I want some codefirst action"</strong></dt>
<dd><a href="https://github.com/amirrajan/Oak" title="Oak" target="_blank">Oak</a> - One of my coding heroes <a href="http://www.amirrajan.net/" title="Amir" target="_blank">Amir Rajan</a> has gone and taken everything good about ActiveRecord and melded it with Massive.</dd>
<p><br/></p>
<dt><strong>"I want POCOs, an old school feel and Stored Procs"</strong></dt>
<dd><a href="http://code.google.com/p/dapper-dot-net/" title="Dapper" target="_blank">Dapper</a> - When you need uncompromised speed and ease, Dapper is your tool. The Stackoverflow team uses it and that is one heck of a merit badge.</dd>
<p><br/></p>
<dt><strong>"I want POCOs with some codefirst action"</strong></dt>
<dd><a href="https://github.com/ServiceStack/ServiceStack.OrmLite" title="OrmLite" target="_blank">OrmLite</a> - ORMLite is a Post-CRUD augmentation to Dapper. In some ways, it is to Dapper what Oak is to Massive. Coded in awesome, covered in love.</dd>
<p><br/></p>
<dt><strong>"I'm using <a href="http://servicestack.net/" title="ServiceStack" target="_blank">ServiceStack</a> or planning to"</strong></dt>
<dd><a href="https://github.com/ServiceStack/ServiceStack.OrmLite" title="OrmLite" target="_blank">OrmLite</a> - This one is kind of obvious as OrmLite is part of the <a href="http://servicestack.net/" title="ServiceStack" target="_blank">ServiceStack</a> family.</dd>
<p><br/></p>
<dt><strong>"I am a huge fan of T4 and code gen"</strong></dt>
<dd><a href="http://www.toptensoftware.com/petapoco/" title="PetaPoco" target="_blank">PetaPoco</a> - PetaPoco is pretty fun regardless of your needs. If you are already pretty invested in T4 then this is for sure a love connection.</dd>
<p><br/></p>
<dt><strong>"I want POCOs and I might be doing some MongoDB in my app"</strong></dt>
<dd><a href="https://github.com/markrendle/Simple.Data" title="Simple.Data" target="_blank">Simple.Data</a> - I have personally not used this one yet, but I always hear wonderful things about it.</dd>
<p><br/></p>
<dt><strong>"My boss says we just have to use something ~Enterprisey~"</strong></dt>
<dd>Use OrmLite and tell them it is a MS ADO.NET CPT Gen2 Release of EntityFramework with Enhanced Cloud Coverage™ and Synergized Mix-ins™.</dd>
</dl>
<p><br/><br/></p>
<p>While all these ORMs are pretty easy to use, you should always be doing yourself/your app (and of course your DBA) a favor and profile your DAL. I highly recommend <a href="http://www.ormprofiler.com/" title="ORMProfiler" target="_blank">ORMProfiler</a>. I think it supports most if not all of the above ORMs, has a low cost, and you get a ton of information from it.</p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/what-net-orm-should-i-use/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Unicorn with Sinatra or Padrino on Heroku</title>
		<link>http://datachomp.com/archives/using-unicorn-with-sinatra-or-padrino-on-heroku/</link>
		<comments>http://datachomp.com/archives/using-unicorn-with-sinatra-or-padrino-on-heroku/#comments</comments>
		<pubDate>Tue, 16 Oct 2012 04:47:40 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AppDev]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=654</guid>
		<description><![CDATA[My apps on Heroku have been cruising along ok using Thin as my rack server, but on my VPS boxes, Unicorn. I was hoping to keep a more consistent experience for myself and as it turns out, getting my Heroku apps to run on Unicorn is pretty simple and runs really fast. 1st: I added [...]]]></description>
				<content:encoded><![CDATA[<p>My apps on <a href="http://www.heroku.com/" title="Heroku" target="_blank">Heroku</a> have been cruising along ok using Thin as my rack server, but on my <a href="http://www.lowendbox.com/" target="_blank">VPS boxes</a>, <a href="http://unicorn.bogomips.org/" title="Unicorn" target="_blank">Unicorn</a>. I was hoping to keep a more consistent experience for myself and as it turns out, getting my Heroku apps to run on Unicorn is pretty simple and runs really fast.</p>
<p>1st: I added a Unicorn config file: <strong>touch config/unicorn.rb</strong> and added the following:<br />
<code>worker_processes 3<br />
timeout 30<br />
preload_app true<br />
</code></p>
<p>2nd: I added Unicorn to my GemFile:<br />
<code>#rack server<br />
gem 'unicorn'</code></p>
<p>3rd: I added a Procfile to the root of my app:  <strong>touch Procfile</strong> and added the following:<br />
<code>web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb</code></p>
<p>Commit it into Git, then git push heroku branchname and you are enjoying the sweet sweet threading love of Unicorn.</p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/using-unicorn-with-sinatra-or-padrino-on-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content length issue on 404 pages in Padrino 10.7</title>
		<link>http://datachomp.com/archives/content-length-issue-on-404-pages-in-padrino-10-7/</link>
		<comments>http://datachomp.com/archives/content-length-issue-on-404-pages-in-padrino-10-7/#comments</comments>
		<pubDate>Tue, 16 Oct 2012 04:26:28 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AppDev]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=650</guid>
		<description><![CDATA[I've been tooling around with PadrinoRB lately. Personally, it has been a nice mix of SinatraRB and Rails. One of the annoying issues I've hit is that when I define a view for my 404 errors: error 404 do response.status = 404 render 'errors/404', :layout=>:applayout end It will only show 30 characters of the defined [...]]]></description>
				<content:encoded><![CDATA[<p>I've been tooling around with <a href="http://www.padrinorb.com/" title="PadrinoRB" target="_blank">PadrinoRB</a> lately. Personally, it has been a nice mix of <a href="http://www.sinatrarb.com/" title="Sinatrarb" target="_blank">SinatraRB</a> and Rails. One of the annoying issues I've hit is that when I define a view for my 404 errors:<br />
<code><br />
error 404 do<br />
  response.status = 404<br />
  render 'errors/404', :layout=>:applayout<br />
end<br />
</code><br />
It will only show 30 characters of the defined view. Luckily, in this day in age, Google has all the answers and I found out <a href="https://groups.google.com/forum/?fromgroups=#!topic/padrino/ThPy9U4sK4w" title="here" target="_blank">here</a> that in my Gemfile I need to define a certain version of Sinatra for this to work. So I popped open my Gemfile and added the following:<br />
<code><br />
gem 'rake'<br />
<strong>gem 'sinatra', '1.3.2'</strong><br />
gem 'sinatra-flash', :require => 'sinatra/flash'<br />
</code><br />
Once I locked in 1.3.2 instead of the 1.3.3 version of sinatra I was using, it worked like a charm and I stopped looking like a complete idiot that doesn't now how to serve up error pages properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/content-length-issue-on-404-pages-in-padrino-10-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CI with MVC4 and Linux? No Problem</title>
		<link>http://datachomp.com/archives/ci-with-mvc4-and-linux-no-problem/</link>
		<comments>http://datachomp.com/archives/ci-with-mvc4-and-linux-no-problem/#comments</comments>
		<pubDate>Thu, 03 May 2012 05:13:59 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AppDev]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=621</guid>
		<description><![CDATA[There are a lot of tools out there that we can use to automate our awesomeness. One of those easy/free/fun tools is a continuous integration (CI) server. Since we are building in Windows and deploying to Linux, we can go ahead and upgrade a CI server from 'important' to essential. There are various products out [...]]]></description>
				<content:encoded><![CDATA[<p>There are a lot of tools out there that we can use to automate our awesomeness. One of those easy/free/fun tools is a continuous integration (CI) server. Since we are building in Windows and deploying to Linux, we can go ahead and upgrade a CI server from 'important' to essential. There are various products out there that can accomplish this; I'm going with what I know and that is <a href="http://www.jetbrains.com/teamcity/" title="TeamCity" target="_blank">TeamCity</a> from JetBrains.</p>
<p>On our Ubuntu box, after we finish the easy as candy install, we're going to want to install Mono. Check out <a href="http://datachomp.com/archives/running-asp-net-mvc4-on-ubuntu-12-04/" title="Install Mono on Ubuntu" target="_blank">this previous post</a> on how to do that and set it up in your /etc/environment.</p>
<p>Now that Mono is rocking, lets hop over to our CI install. At the time of this post, the latest version of TeamCity is 7.0.2a. Looking at the code below, we're going to install Java, pull down the latest version of the TeamCity linux tar, decompress it, switch directories and fire it up :<br />
<code><br />
sudo apt-get install openjdk-7-jre<br />
wget - http://download.jetbrains.com/teamcity/TeamCity-7.0.2a.tar.gz<br />
tar xfz TeamCity-7.0.2a.tar.gz<br />
cd Teamcity<br />
sudo ./bin/runAll.bat start<br />
</code></p>
<p>Pretty easy right? Lets check out our web interface:<a href="http://files.datachomp.com/AppDev/mono/teamcitywelcome.png" target="_blank"><img src="http://files.datachomp.com/AppDev/mono/teamcitywelcome.png" alt="TeamcityWelcome" width="200" height="200" target="_blank" /></a></p>
<p>Yay! Everything works! You're also at a ubiquitous web interface which will likely give the Softie in you some solace. There are tons of resources online for setting up your project in TeamCity to check it out, build it, run tests, deploy, yada yada yada. If you are just getting started, I highly recommend <a href="http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html" title="Troy Hunt Deployments" target="_blank">Troy Hunt's post.</a> You can also install Ruby on this server and have a wonderfully awesome auto-deployment method via <a href="https://github.com/capistrano/capistrano/wiki/Documentation-v2.x" title="Capistrano" target="_blank">Capistrano</a>. If you are interested in deploying with Capistrano, let me know I'll try to barf out a quick post on it. This is a pretty short and to the point post, if it needs more content with regards to project checkouts and stuff, let me know and I can barf that out as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/ci-with-mvc4-and-linux-no-problem/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Running ASP.NET MVC4 on Ubuntu 12.04</title>
		<link>http://datachomp.com/archives/running-asp-net-mvc4-on-ubuntu-12-04/</link>
		<comments>http://datachomp.com/archives/running-asp-net-mvc4-on-ubuntu-12-04/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 04:11:07 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AppDev]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=551</guid>
		<description><![CDATA[The single most question I get regarding our Hello Postgres series over Tekpub is "How are you running your app on Linux?" As much as I enjoy sending volleys of fragmented explanations over emails to people, I decided it might be in everyone's best interest if I just blog it out. Technology moves fast... like [...]]]></description>
				<content:encoded><![CDATA[<p>The single most question I get regarding our <a href="http://tekpub.com/productions/pg" title="Hello Postgres" target="_blank">Hello Postgres</a> series over Tekpub is "How are you running your app on Linux?" As much as I enjoy sending volleys of fragmented explanations over emails to people, I decided it might be in everyone's best interest if I just blog it out. Technology moves fast... like super fast. So instead of showing you how to deploy an old and busted MVC3 app to a "has been" Ubuntu 11.10, we're going to be going with MVC4 and <a href="https://wiki.ubuntu.com/PrecisePangolin/TechnicalOverview/Beta2" title="Ubuntu 12.04 beta 2" target="_blank">Ubuntu 12.04</a>. We're so bleeding edge you can call us cutters!</p>
<p>I'm not going to show you how to set up and install your Ubuntu Server, as there is a ton of internet out there that can handle that for you and the installer itself is pretty hard to mess up. What I will cover is what to do after that last reboot where it is  just you and Bash, together... at last.</p>
<p>SSH into your fancy new Ubuntu box with <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" title="Putty" target="_blank">Putty</a> and Run this:<br />
<code>sudo apt-get update && sudo apt-get -y install git-core curl python-software-properties</code></p>
<p>This is going to let us add the ppa(think of this as a package location) to install a current nginx:<br />
<code>sudo add-apt-repository ppa:nginx/stable<br />
sudo apt-get update && sudo apt-get -y install nginx</code></p>
<p>Yes! We can now git things, we can curl things, and we can nginx things! Rawwrr!!! Let's kick some other processes to the curb... like that skank MySQL and that wet blanket Apache:<br />
<code>sudo update-rc.d mysql remove &&<br />
sudo update-rc.d apache2 remove && mkdir mycoolapp</code></p>
<p>Now for the fun part, let's get Mono up and running. We really want the latest version of Mono, and like Nuget, not all packages in Ubuntu stay current. The fix for this in the mono world is to just grab <a href="http://www.integratedwebsystems.com/2012/04/install-mono-2-11/" title="Nathan Bridgewater" target="_blank">this dudes</a> install script and go have a drink because it takes a bit to finish:<br />
<code>mkdir mono-2.11<br />
cd mono-2.11<br />
wget --no-check-certificate https://github.com/nathanb/iws-snippets/raw/master/mono-install-scripts/ubuntu/install_mono-2.11.sh<br />
chmod 755 install_mono-2.11.sh<br />
./install_mono-2.11.sh<br />
</code></p>
<p>Now to check that we have the current version, we just run the following:<br />
<code>/opt/mono-2.11/bin/mono -V</code></p>
<p>Cool! We're current, but what we really need is to just be able to run "mono -V" anywhere we want. We can do that by modifying our /etc/environment file:<br />
<code>sudo nano /etc/environment<br />
#then insert ":/opt/mono-2.11/bin"  at the end of that path string. Log out, log in for it to take effect.</code></p>
<p>I don't now about you, but all this sys-admin crap is putting me to sleep and I want to code. Back on our Widows/Dev box, we're going to new up an empty MVC4 project (up to you to figure out how to get MVC4 going on your box, I used Web Platform Installer). After the project is new'ed up:</p>
<ul>
<li>Add a controller</li>
<li>Add a view based on that controller</li>
<li>Hit F5 and make sure it works</li>
<li>Remove the EntityFramework.dll because we love our data and don't want to give our app a low self esteem</li>
<li>Once removed, hit F5 again</li>
</ul>
<p>If everything is still running, then do a file system deploy to a local folder of your choice. Go check out what was just deployed, specifically the '/bin' folder. We want to remove the Web.Infrastructure.dll because Mono already has this built into its GAC. High Five Mono! With that out of the way, we are going to copy that deployment over to the 'mycoolapp' folder on our Linux server using <a href="http://winscp.net/eng/index.php" title="Winscp" target="_blank">WinsCP</a>. While I don't have a WordPress plugin to read your mind, I hear you thinking "Rob, surely there are better ways to do this." and you are right. However, this post is long enough and that topic will likely go into its own post.</p>
<p>SSH back into your linux box, and 'cd mycoolapp'. "cd" into your "mycoolapp" directory, type in 'ls' to see the contents and make sure your app made it over. Once we see it, we can do a cassini like run of it by typeing out xsp4 and hitting enter. Try and hit your box on the port 8080 (xsp4 should tell you what it is running on) and see if you can see your app:</p>
<p><img src="http://files.datachomp.com/AppDev/mono/monoapp.png"></p>
<p>Yay! Our code works and we're so open source now that we can wear tight jeans at Starbucks and put Bon Iver on our ipod... just like those <a href="http://wekeroad.com/" title="Lead Rails Wanker" target="_blank">Rails wankers</a>! As for nginx and running our site as a Mono service, we can just use some of the nice documentation over at the Mono site:</p>
<p>Nginx config:<br />
<a href="http://www.mono-project.com/FastCGI_Nginx" title="FastCGI_Nginx" target="_blank">http://www.mono-project.com/FastCGI_Nginx</a></p>
<p>Mono as a service:<br />
<a href="http://yojimbo87.github.com/2010/03/14/mono-startup-script.html" title="Monoserve" target="_blank">http://yojimbo87.github.com/2010/03/14/mono-startup-script.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/running-asp-net-mvc4-on-ubuntu-12-04/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>TSQL Tuesday #28 – Jack of all Trades, Master of One</title>
		<link>http://datachomp.com/archives/tsql-tuesday-28-jack-of-all-trades-master-of-one/</link>
		<comments>http://datachomp.com/archives/tsql-tuesday-28-jack-of-all-trades-master-of-one/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 13:55:03 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=554</guid>
		<description><![CDATA[If you want the back story on what this topic is all about - http://sqlblog.com/blogs/argenis_fernandez/archive/2012/03/05/t-sql-tuesday-028-jack-of-all-trades-master-of-none.aspx]]></description>
				<content:encoded><![CDATA[<p>If you want the back story on what this topic is all about - <a href="http://sqlblog.com/blogs/argenis_fernandez/archive/2012/03/05/t-sql-tuesday-028-jack-of-all-trades-master-of-none.aspx">http://sqlblog.com/blogs/argenis_fernandez/archive/2012/03/05/t-sql-tuesday-028-jack-of-all-trades-master-of-none.aspx</a>  <-- ha webforms</p>
<p>Argenis went on some blabfest about how life got better for him after he started to really focus on SQL Server. He's a SQL Server certified Master, is incredibly helpful and one of the reasons I don't over commit myself to specific mastery. "But Rob, how can you say that? MCM's are reveled by everyone!!!" It's true. I take nothing away from a MCM and it is one of the few certs that are actually respected. But it's also not for me. Most of my shining moments as a DBA have nothing to do with a mastery of say quirky transaction scope of full text indexes or being the Chuck Norris of international merge replication scenarios and everything to do with knowing how things work on the whole. The more I know on the whole, especially with concepts, the better a DBA I am. When I'm getting Win-Auth errors, I don't need to be a Kerberos God ("When someone asks if you're a Kerberos God, you say YES!") to start to troubleshoot, but I need to know enough to ask the right questions. Being a jack of all trades typically lets me know when I'm in over my head and need to call in an expert - like my good friend Google or Argenis... which brings me to my next point:</p>
<p>As someone with an insatiable appetite for pizza...err learning, technology simply moves too fast and brings me too much joy to try to really master a facet of a single product. That is not a global rule, that is my personal choice and more importantly a personal defense mechanism from burnout. That is another thing that is fun about technology. There are usually many correct paths to success and interweaving those paths can build some really incredible software... which brings me to my final point:</p>
<p>As someone with no shortage of ego (I am a DBA afterall!) if you want to go down the path of being a jack of all trades, you better be friends with Masters and put your ego to the side and ask for help. There are few things more dangerous than not asking for help when you need it. We all write code that doesn't work the first time, we all have asked silly questions before, and we (as individuals) don't know everything.</p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/tsql-tuesday-28-jack-of-all-trades-master-of-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I’m leaving SQL Server for Postgres</title>
		<link>http://datachomp.com/archives/im-leaving-sql-server-for-postgres/</link>
		<comments>http://datachomp.com/archives/im-leaving-sql-server-for-postgres/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 00:05:25 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://datachomp.com/?p=526</guid>
		<description><![CDATA[Ok, well I'm not leaving SQL Server professionally (or financially!) but another relational database platform has clearly captured my heart. That platform is Postgres! Through a combination of relentless potshots at MySQL and emotional bribes where I feign interest in Rails, I was able to trick Rob Conery and the Tekpub team into not only [...]]]></description>
				<content:encoded><![CDATA[<p>Ok, well I'm not leaving SQL Server professionally (or financially!) but another relational database platform has clearly captured my heart. That platform is <a href="http://www.postgresql.org/">Postgres</a>! Through a combination of relentless potshots at MySQL and emotional bribes where I feign interest in Rails, I was able to trick <a href="http://wekeroad.com/2012/03/08/something-borrowed-something-new/">Rob Conery</a> and the Tekpub team into not only moving Tekpub to Postgres but also let me record a <a href="http://tekpub.com/productions/pg">Postgres series</a> with them. In this series, we share the data love on a platform that is open, fast and incredibly flexible. The ease at which Postgres addresses many of the day to day issues I deal with as a SQL Server DBA is mouthwatering to say the least. Luckily for you, it isn't just about me or DBAs which is why the head App Dev(il) himself <a href="http://wekeroad.com/2012/03/08/something-borrowed-something-new/">Rob C</a> came along for the ride! He is quick to ask questions and to put in his tidbits and raise issues that would relate to you, the developer. That's right friends, it isn't just a series that shakes the hand of Postgres, we walk up and give it a big sloppy kiss. So check it out and have fun watching "The Robs" bring you a double felony of database knowledge.</p>
<p><a href="http://tekpub.com/productions/pg">Hello Postgres</a><br/><br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/Rl_-lKxSBm4?feature=player_embedded" frameborder="0" allowfullscreen></iframe></p>
<p>Show notes and scripts will be put up on GitHub when I get back in town.</p>
]]></content:encoded>
			<wfw:commentRss>http://datachomp.com/archives/im-leaving-sql-server-for-postgres/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 4.979 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-03-10 01:40:45 --><!-- Compression = gzip -->
