Setup WordPress on Ubuntu Desktop AMI

After fresh install of Ubuntu 13 Desktop…

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install apache2
sudo a2enmod rewrite
sudo apt-get install libapache2-mod-php5
sudo service apache2 restart
cd /var/www
sudo nano index.php

Add <?php phpinfo(); ?> to index.php to test php. [path to your machine]/index.php

sudo apt-get install mysql-server
sudo apt-get install php5-mysql
sudo apt-get install phpmyadmin
sudo apt-get install unzip

Visit [path to your machine]/phpmyadmin and create database for WP.

Download latest wordpress zip into /var/www and extract files there.

I’ll use /var/www as wordpress install on this AMI instance. I deleted the index.html and index.php. Fire up [path to your machine]/readme.html and follow WP installation instructions.

Hope this helps…

Setup sublime text 2 to work with SML

While trying out SML, I chose sublime text 2 as editor for it. There is no default syntax support for SML so l found one… has SML language definitions for sublime.

You need to make a small update to sublime to find the path to sml: Preferences > Package Settings > Package Control > Settings – User:

"default_extend_env": {
"PATH": "/usr/local/smlnj-110.75/bin/"

Command B on Mac will run the SML build. Make sure your sml files have .sml extensions.


Wire ASP.NET 4 WEB API RTM with Autofac

It took me a little while to get this working but here is how I got Autofac working with the new ASP.NET MVC 4 Web API.

Call this setup method in Application Start event in global asax.

private static void SetupAutofac()
var builder = new ContainerBuilder();
builder.RegisterModule(new MessagingModule());
var container = builder.Build();
GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container);
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

This sets up all API and regular controllers while injecting all the properties in them. The module (MessaagingModule) sets up the Autofac container.

FxCop error CA0001 on build server

My Windows 2003 TeamCity build server started acting up all of a sudden. The exception didn’t say a whole lot but it turned out I need to register msdia100.dll to shut it up. It resided on my dev machine here:
“C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\msdia100.dll”

Register this dll on your build machine as:

regsvr32 msdia100.dll

Stack at the exception:

Exception of type 'Phx.FatalError' was thrown.
at Phx.FatalError.Dispatch()
at Phx.Logging.Diagnostics.DiagnosticMessage.LogMessage(Severity severity, DiagnosticInfo diagnosticInfo, SourceContext sourceContext, String descriptionString)
at Phx.PE.PEUtilities.UserError(String infoMessage)
at Phx.Pdb.ReaderImplementation.Open(Boolean loadTypeOnly)
at Phx.PEModuleUnit.LoadPdb()
at Phx.PE.ReaderPhase.CheckSymbolicInformation()
at Phx.PEModuleUnit.LoadGlobalSymbols()
at Phx.PEModuleUnit.LoadEncodedIRUnitList()
at Phx.PEModuleUnit.GetEnumerableContributionUnit()
at Microsoft.FxCop.Engines.Phoenix.PreScanPass.GetFunctionUnits(PEModuleUnit peModuleUnit)
at Microsoft.FxCop.Engines.Phoenix.PreScanPass.Execute(ModuleUnit moduleUnit)
at Phx.Passes.PassList.DoPassList(ModuleUnit moduleUnit)
at Microsoft.FxCop.Engines.Phoenix.PhoenixAnalysisEngine.AnalyzeInternal()
at Microsoft.FxCop.Engines.Phoenix.PhoenixAnalysisEngine.Analyze()
at Microsoft.FxCop.Common.EngineManager.Analyze(Project project, Boolean verboseOutput)

Simplest git repository setup on windows server

Git is awesome, you should know that. I had to setup a central git repository for a small team in a Windows shop. The simplest setup to get started is as follows.

On the Windows Server:

  • Install git (
  • Create and share a folder where you will use it as central repository (C:\repositories\myproject). Setup whatever permissions you want to setup on the shared folder.
  • Run git bash and:

cd myproject
git init --bare

On your Windows Workstation

  • Map the shared folder (mypoject) on the server to a drive (ie: z) on your workstation
  • Install git (
  • Create a folder where you will work on the project.
  • Run git bash and:

cd /c/projects
mkdir myproject
cd myproject
git init
touch readme.txt
notepad readme.txt # add some content
git add -A
git commit -m 'initial checkin'
git remote add origin file:///z/repositories/myproject
git push origin master
git branch -a

This is it…