Tuesday, July 30, 2013

PuppetConf 2012 video collection

Probably hugely outdated by now, but still very interesting to me is this page on the Puppet website listing all the talks of PuppetConf2012.

One talk the really caught my attention was the talk by Gene Kim about DevOps was really interesting. Sure, this talk doesn't necessarily have anything to do with puppet and is more about DevOps, but I liked it so much because it talks about some of the stuff I see going on in my company. One of the points that he briefly mentions and that Puppet allows you to do, is include the machine configuration into the source code. Oh yes - so if Dev includes a puppet file in the source code, Ops can just take that, spin it up and get the app running.

We do have something like that in place, where we have a scripted deployment of the application that is checked into source control, but it won't do it 'from scratch'.



This guy has written award winning books - check them out here.

Wednesday, July 24, 2013

PuPHPet - Online GUI PHP configuration tool for Puppet and Vagrant

Interested in using Puppet and Vagrant for the LAMP stack? Check this out:


This website provides a GUI for setting up a VM with LAMP stack tailored to your wishes. The result is a puppet config that lets you spin this thing up in minutes.

Saturday, July 20, 2013

Cool stuff to look out for: Puppet and Vagrant

A while ago my ex-colleague sent me a blog about a guy who started a company and started out by setting up his OTAP environment using Puppet and Vagrant. Let's quickly look at what these projects are:

Puppet

"Puppet Enterprise is IT automation software that gives system administrators the power to easily automate repetitive tasks, quickly deploy critical applications, and proactively manage infrastructure, on-premises or in the cloud." - https://puppetlabs.com/puppet/puppet-enterprise/

So it's a piece of software that lets you control 'the state of resources' on your 'nodes', which will probably VMs. You can see in the video's that a puppet master ( a box that controls the puppet boxes ) uses a configuration file to set the box's network config ( IP stuff ) and for instance the installed mods ( LAMP, node and/or other db engines).

Vagrant

"Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. To achieve its magic, Vagrant stands on the shoulders of giants. Machines are provisioned on top of VirtualBox, VMware, AWS, or any other provider. Then, industry-standard provisioning tools such as shell scripts, Chef, or Puppet, can be used to automatically install and configure software on the machine." - http://docs.vagrantup.com/v2/why-vagrant/index.html

The way these things come together is that you can script the creation of one ( or a WHOLE lot ) of VMs and then configure them using puppet to either take on a certain role ( test your load balancing for instance ) or make them perform a certain task.

Really awesome stuff if you ask me. Things like that should be possible with Windows Azure I suppose, so I need to get up to speed with that stuff too.




Tuesday, July 16, 2013

You are using common.logging ... right?

I thought everyone would be using common.logging right now for logging purposes, but just because I like it so much, I decided to write about it a bit.

Logging is of course a cross-cutting concern that you want to be able to do from everywhere within the layers of your application. Common.logging provides an abstraction between the library and the actual loggin implementation of the application. That's why you'll find that a lot of .NET libraries reference common.logging. This enables users of the library to hook up that common.logging to their own logging implementation in the actual application and see what the library is logging.

So I turned my invoice example into a nice n-tier application with a:
- Domain layer ( cross cutting )
- Data access layer
- Console application layer
- Utilities ( cross cutting )



This is Visual Studio 2012 'show on code map' - could be Ultimate only though ...

All of these projects are referencing common.logging. But only one project ( namely the 'presentation' layer  - console application in this case ) references common.logging.nlog ( an adapter for common.logging onto nlog ) and of course NLog itself:



Finally tweak your web.config or app.config for funneling all the common.logging stuff into the NLog targets you desire:



  
    
      
In every class you want to have a field like so:

private static readonly ILog log = LogManager.GetLogger();
Which allows you to access the log and get a nice prefix of what class is logging. I've decorated my 'GetRandomInvoice' method and the extension method with a few logging calls, and here's what you get:
10:07:31 ConsoleApp.Business.InvoiceService New random invoice is being created ...
10:07:31 ConsoleApp.Business.InvoiceService New random invoice creation is done!
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Computer' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Printers' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Paper' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Some more computer supplies' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Other stuff' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Product id 54' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Product id 64' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Product id 20' is being made to length 15
10:07:31 ConsoleApp.Utilities.StringExtensions String 'Total:' is being made to length 15
10:07:31 ConsoleApplication1.Program Generated invoice looks like this: 
Invoice - Id:1 Date:13-7-2013
----------------------------------
Computer         USD 899,00
Printers         USD 49,99
Paper            USD 12,50
Some more co...  USD 12,50
Other stuff      USD 12,50
Product id 54    USD 90,59
Product id 64    USD 70,13
Product id 20    USD 87,36
----------------------------------
Total:           USD 1231,00
As they say on .NET Rocks! Learn it, love it, use it.

Saturday, July 13, 2013

Installing SQL Server 2012 on windows server 2012: additional sources

Today I was installing SQL Server 2012 on my Windows Server 2012 instance and I ran into a bit of problems. Right out of the box, it didn't work because SQL Server couldn't locate .NET 3.5 stuff.

Installing .NET 3.5 ( 'Add roles and features' ) didn't either just by clicking. I needed to specify a location for alternative sources. I found the answer on this blogpost how to deal with the problem.


Awesome! I was asked to look into NDepend

Just the other day I was approached by Patrick Smacchia who was asking whether I would be willing to have a look at his product NDepend. I'm really excited about the opportunity and can't wait to get started with it.



I think I'll start by listening to the man himself talking to Scott Hanselman about code metrics:
http://www.hanselminutes.com/163/software-metrics-with-patrick-smacchia

Wednesday, July 10, 2013

Intersting blog: dutchdatadude.com

Already a while ago we had a presentation at work by Jeroen ter Heerdt who is a Technology Advisor Data Platform with Microsoft in the Netherlands. He gave a cool presentation about upcoming stuff in SQL Server and BI coming from Microsoft. Mainly he talked about PowerPivot and GeoFlow.




He also blogs, find it here.