CI with MVC4 and Linux? No Problem

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 TeamCity from JetBrains.

On our Ubuntu box, after we finish the easy as candy install, we're going to want to install Mono. Check out this previous post on how to do that and set it up in your /etc/environment.

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 :

sudo apt-get install openjdk-7-jre
wget - http://download.jetbrains.com/teamcity/TeamCity-7.0.2a.tar.gz
tar xfz TeamCity-7.0.2a.tar.gz
cd Teamcity
sudo ./bin/runAll.bat start

Pretty easy right? Lets check out our web interface:TeamcityWelcome

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 Troy Hunt's post. You can also install Ruby on this server and have a wonderfully awesome auto-deployment method via Capistrano. 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.

Rock out with your Procmon out

If you are not a fan of Sysinternals tools then you clearly do not have your geek merit badge. While I have always kept a local copy in the past, there is now a cool and easy way to get to Sysinternals and it is via
Start + run + \\live.sysinternals.com\tools

If you are already a gigantic nerd like me and have various login scripts that run, it is way easy to simply map that share by throwing the following into your login scripts:

net use s: \\live.sysinternals.com\tools

Tekpub – Full Throttle with Rob Sullivan show notes

The question emails are starting to pile in (which is a good thing!) so this post is basically a way to centralize links/answers. In the show, I say a few times "we'll see this later" (like with SQL Server Profiler) and we never see it... that was mostly my fault. For some reason I kept thinking I would be able to squeeze 5 hours of content into 1 hour and was wrong. If there are aspects of SQL Server that you would like to see more of, as well as real world problems that you may have and would like to see solutions to, then let Tekpub know. We'll see if we can hack out real world solutions wrapped in a warm blanket of statistics and opinion.

Questions:
How do you get the stats to appear in the "messages" window?
Those stats come from the following commands:
SET STATISTICS IO ON;
SET STATISTICS TIME ON;
If you don't want to turn it on for every query/window, you can do what I do and set them to always be on in Management studio, you can do this by :
Tools -> Options -> Query Execution -> SQL Server -> Advanced
then check:
SET STATISTICS IO ON;
SET STATISTICS TIME ON;

Lock Pages in Memory, is that always good?
No, and perhaps I glossed over that section too much or technology changes too fast. While Lock Pages in Memory can be a wonderful setting, there are of course times when it can be pretty bad. You can read more about that here: http://sqlserverperformance.wordpress.com/2011/02/14/sql-server-and-the-lock-pages-in-memory-right-in-windows-server/

Why no filtered index on Posts?
In our first scenario, to get the front page up... we just went with the index that the engine suggested.. That got us up and running which is great, but there is room for improvement. To me, filtered indexes are more of a business rule decision and with enough time, if we saw that the load was heavy and predictable enough, we would have likely thrown a filtered index to satisfy the front page query.

What were you using for "Intellisense" in management studio? I am not extremely big on intellisense in general, however, I am kind of big on formatting and having a variety of administrative snippets at my finger tips. I use a 3rd party tool called Red-Gate SQL Prompt and have it moderately customized. Keep in mind, I really only use this type of product on data sets I am not very familiar with like the one in this demo. On datasets that I know pretty well, I find intellisense to really just get in the way and make me angry.

And the database? I am still working on a way to make the DB available. It is roughly 40GB raw, and 4GB compressed. If having the data is a big deal to you, hit me up on email and we can work something out (S3,FTP, yada yada yada)

Tech used in the series:
Visual Studio 2010 / MVC3 / EF 4.1
SQL Server 2008 R2 / Management Studio
Red Gate SQL Prompt "Intellisense" and "snippets" in Management Studio
SQL Sentry Plan Explorer The fun/effective way to view execution plans
EF Profiler The SQL Server friendly way to profile EF
CPU-Z A tried and true hardware enthusiasts way of checking hardware specs.

Source code: https://github.com/DataChomp/StackOverFaux

My subversion ignore list for Visual Studio / Anhksvn

Disclaimer: I didn't write/create these exclusions...I copied them off Stackoverflow.com Sadly, I didn't bookmark the link and upon quick search, there were too many svn links for me to filter through.

UPDATE: Jim motivated me to actually spend the extra time to track down the actual links I used.  Link1 and  Link2

I use  AhnkSVN as my visual studio source control plugin.  I right click on the solution,  select 'subversion',  select 'solution properties'.  That brings up a box and you will want to click 'add'.  From there,  select  svn.Ignore  and copy/paste the below:

Solution Level:

*.csproj.user Bin obj Obj Release debug Debug release

Note: I don't use Reshaper, if you do, there are other exclusions you will want to add

In Tortoisesvn,  my exclusion list is :

*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store *.csproj.user Bin obj Obj Release debug Debug release *.suo

When you go into your TortoiseSVN settings,  on the 'general' tab,  copy/paste that into the  'Global Ignore Pattern:' box.

SQL Server Variety Hour

Thanks to everyone who came to the OKCSQL  last night and endured my presentation.  We covered a lot of cool stuff and since I didn't have any links in my slides, I figured I would link up the stuff we talked about:

WhoIsActive - http://sqlblog.com/blogs/adam_machanic/archive/2010/10/21/who-is-active-v10-00-dmv-monitoring-made-easy.aspx

SQLioSim- http://support.microsoft.com/kb/231619

SQL SourceControl- http://www.red-gate.com/products/sql-development/sql-source-control/

.Net Reflector- http://www.red-gate.com/products/dotnet-development/reflector/

LinqPad- http://linqpad.net/

EF Profiler- http://efprof.com/

RavenDB- http://ravendb.net/

Virtualization - http://www.vmware.com/

Virtual Victory – AWS gives out a year of usage

Amazon has just done something amazing... Amazingness... They are essentially doing a conditional year free of their services. While I am a huge fan of VMWare, what Amazon is offering is something completely unmatched by VCloud or MS Azure.  (Please see Craig's comment as this claim has the possibility of being debunked. Thanks Craig!)

So what can I do with this you might ask? Here are some ideas: (I am doing these off the top of my head so feel free to criticize them by suggesting a better ideas)

1. If you have never played with Linux/Ruby or anything else, here is a good/free way to to dabble without the 'will this mess up my system' fear. Microsoft is continuing their adoption of features from these platforms and it can only benefit you to see these ideas they are using from Ruby(gems) or Apache(modularization). The more you know, the more you grow.

2. NOSQL? What is a NOSQL? Want a simple way to learn about NOSQL? Then try out Amazon's simpleDB. They have various demos and such you can run and play with and start trying to see what all the hype is about. Remember fellow fearful DBA's, NOSQL stands for "Not Only SQL" not for No - SQL as in SQL Void.

3. Embrace the awesome of Amazon S3. Ever wonder why Dropbox/JungleDisk and various other companies can give you so much storage for so cheap? Amazon S3 is pretty much the answer to that question. I typically use the cheapest hosting plans possible and S3 as a CDN to smoke/mirror performance.

4. SQL Server testing - Microsoft provides trial software for pretty much all their projects. If you are curious about ... say playing with some feature of replication or maybe wondering about online indexing ... Fire up 1 or more instances of EC2 and actually try it. You no longer have an excuse to put it off.

5. .Net testing or running a service - With shared hosting, I don't have a way of keeping an ongoing on demand service per say... So why not have a micro instance where you can deploy services and such. For example, say you need to add SMS services to your app.... Sign up for Twilio, create a little service, throw it on your free AWS EC2 instance and poll every hour or so. Most shared hosting sites don't really support SQL Server SSIS... so why not have an AWS EC2 instance that fires up at night and starts some SSIS packages?

Now, some of this isn't without a learning curve, but we are in the software development industry... if we can't navigate learning curves or don't even pursue learning to begin with we add more nails to our career coffin as well as start becoming the problem.

SSL – a secure way to waste money

It seems like every place I go, companies are dropping an incredible amount money on an overpriced Verisign certificate which essentially proves nothing. I am not going to tirade on Verisign's prices, product, or just the general crappy nature of the company... but I will list alternatives:

The current ones I use and it rocks:
For http SSL I use: Start Com
For other services/protocols I tend to use:
CA Cert Org

I don't think cacert is any better/worse than startcom, I just mostly use cacert for internal stuff out of habit and I generally like the group.

Equally excellent CA's that are not free:
Dynadot.com
Rapidssl.com
Geotrust.com

AppDev Tools I Use

This is a living document of Application Development Tools I use:
TortoiseSVN -
Notepad++
VMWare
Visual Studio

MonoDevelop
ProjectLocker
ELMAH
Xenu

All your errors are belong to us – ELMAH

So I've been working on a step by step on ELMAH and how to set it up for F5Compliant ... when today I came across Scott Mitchels tutorial on ASP.NET

http://www.asp.net/learn/hosting/tutorial-14-cs.aspx

One thing he seems to have left out is using SQLite.  Since moving from my in house servers to online hosting, I am still often surprised by the DB limitations faced.  Before I went with a hosted solution, it just felt commonplace to spin up a new DB for X project and go.   With many shared hosting plans, one becomes a little miserly with their DB's as more DB's with the hosting plan incur more cost.   SQLite seems to fill that void quite nicely.  One thing to be aware of though is that SQLite requires full trust in order to run, so you will probably need to contact your hosting provider for them to set the permissions.   I use SoftSysHosting and their team takes care of this incredibly fast which is nice.

MSDN on the down low bandwidth

For the most part, I find online MSDN to be a complete and utter slow pain in the compiler. It appears that MS has fixed this by offering 'low bandwidth' view for both MSDN and Technet. I am pleased to have this information tool back.

You can trigger this by click on the "Switch on low bandwidth view" link on MSDN or Technet.