fd Blog

Daniel Hilgarth on software development

Setting Up SSH Port Forwarding for Atlassian Stash

To setup SSH port forwarding for Atlassian Stash on Ubuntu, perform the following steps:

  1. Change default port for SSH access in the file /etc/ssh/sshd_config to something other than 22.
  2. Restart SSH:

     # sudo restart ssh
  3. Install haproxy:

     # sudo apt-get install haproxy

Setting Up PostgreSQL for Confluence

These are the steps to setup a new Confluence database or to move a Confluence database to a new server. The steps are the same for other Atlassian products. The only difference is the role name and the database name.

How to Register a MSSCCI Source Control Plugin on a 64 Bit Machine

More a reminder for myself than anything else:

To register a MSSCCI source control plugin (nowadays called Source Control Plug-in) on a 64 bit machine, the instructions in the MSDN are missing some crucial information:
All registrations in HKLM\Software need to be performed inside HKLM\Software\Wow6432Node

The full file to register a sample plugin looks like this:

Windows Registry Editor Version 5.00

"MSSCCI Sample"="Software\\Your Company\\Your Product"


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Your Company\Your Product]
"SCCServerName"="MSSCCI Sample"

"ProviderRegKey"="Software\\Your Company\\Your Product"

"MSSCCI Sample"="Software\\Your Company\\Your Product"


"SCCServerName"="MSSCCI Sample"

"ProviderRegKey"="Software\\Your Company\\Your Product"

"ProviderRegKey"="Software\\Your Company\\Your Product"



"ProviderRegKey"="Software\\Your Company\\Your Product"

Setup a Virtual Machine With Ubuntu Server

Setting up a virtual machine with Ubuntu Server is very simple.

  1. Download VMware Player
  2. Download Ubuntu Server ISO. I downloaded Ubuntu Server 13.04.
  3. Create a new virtual machine using VMware Player:
    1. Select “Create A New Virtual Machine”
    2. Choose “Installer disc image file” and select the downloaded ISO. It should detect the Ubuntu version and offer “Easy Install”.
    3. Enter your name and the details of the initial user account
    4. Provide a name and location for the virtual machine
    5. Start installation

Install Xamarin in vs 2013 Preview 1

As far as I know, Xamarin hasn’t yet released an installer for Visual Studio 2013 Preview 1.
Until they do, you can follow these simple instructions:

  1. Install Xamarin in Visual Studio 2012
  2. Copy the files from c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Xamarin\ to c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Xamarin\
  3. Copy the folders Android and ios from inside c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\CSharp\ to c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplates\CSharp\
  4. Copy the folders Xamarin.Android and ios from c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ItemTemplates\CSharp\ to c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\
  5. Execute the following command from a command prompt with elevation: "c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" /setup /nosetupvstemplates

That’s it. You should now have a fully functional Xamarin setup in VS 2013!

Unit-testing With AutoFixture, NCrunch and Global State

Trying to unit-test code that relies on global state can be a frustrating experience. Global state is shared among tests, making the tests no longer independent. This can lead to subtle bugs in the test suite, e.g. a scenario where tests seem to fail randomly when executed in bigger batches, but pass when executed alone. Tracking down - and eliminating - the state sharing can be both time consuming and frustrating.

A Fluent Repository: Immutability

It has been pointed out that the implementation of the Fluent Repository base class I showed in Part 2 has a big flaw:
You need a new instance of the repository for each query, because the base class is mutable and thus it appends the query conditions to the internally stored IQueryable<T>. That’s not obvious and in fact counter-intuitive and because of that, it is bad.