Were back and its nearly 2019

Using Hugo or Pygments

Welcome to the new blog of Ollie Castle, you will fine before this post a number of blog posts migrated from my old blog and after this the future of the my ramblings about technology, running, life and my new found love for meditation.

The SqlBuildTask failed unexpectedly

If you are working with the Entity Framework and database projects, you may encounter the following error: Error 11 04018: The “SqlBuildTask” task failed unexpectedly. System.MethodAccessException: Attempt by method ‘Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(System.String, System.Collections.Generic.Dictionary2<System.String,System.String>)' to access method 'Microsoft.Data.Tools.Components.Diagnostics.SqlTracer.ShouldTrace(System.Diagnostics.TraceEventType)' failed. at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(String filePath, Dictionary2 referenceMetadata) at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.CreateCustomSchemaData(String filePath, Dictionary2 referenceMetadata) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelper providedLogger, SqlTaskHost host, ErrorManager errors) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, TaskLoggingHelper providedLogger) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger) at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep() at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func1 step) at Microsoft. [Read More]

Switching user in visual studio

Switching companies means switching MSDN licenses, switching the login for visual studio on my own machine I cam across the following error: We were unable to establish the connection because it is configured for user olduser@old.com but you attempted to connect using user newuser@new.com. To connect as a different user perform a switch user operation. To connect with the configured identity just attempt the last operation again. A quick Google and I came across this stackoverflow question and the problem is solved in four simple steps: [Read More]

How many degrees of separation?

Designing and maintaining a code architecture will always be a game of pro’s and con’s where in many cases there is no right answer. In some companies it is design by committee in others its who has been there the longest or can shout the loudest. One topic which I have always found interesting and have never really come to a decision on is how many degrees of separation should exist within a code base. [Read More]

Access a git repository over https without a password

The recommended way to access github.com or bitbucket.org is through https instead of SSH. This is fine but if you use git on the command line you will be prompted to enter your password every time you run a command against the remote git repository. If you are running linux you can get around this by adding a file with your credentials onto the machine. You will then not be requested to enter your credentials again. [Read More]

Simple golang build and deploy script

There are many ways to build and deploy a golang application, the best method I have found so far is to use code ship which I will cover in a future article. The simplest method is to push your code to version control on your local development environment. Then log into the production server and run a script on the server which completes the following steps: Syncs the code from version control Complies the code Stops the application via the upstart script Moves the code to the production location Starts the application via the upstart script. [Read More]

Setup a basic golang build on ubuntu

One of the most simple ways to get started with serving a golang web application is to set-up the golang build environment on the server. This allows you to push your code to version control on your local development environment and then sync it down and build it on the server before deploying it. It should be noted that this is not the recommended approach in many cases and using a service like code ship is my preferred method but can be slightly more complex to configure so to get you up and running this method can be very convenient. [Read More]

Open sourcing sleepy fish

I have always been slightly concerned about showing people my code for fear of negative feedback but in reflection I cant ever lean unless I embrace what other people think. So a little pet project of mine sleepy.fish I have published on github.com as a public project. https://github.com/ollietrex/sleepyfish Its a golang application with full stack testing served using angularjs. If you have any comments or suggestions on how to improve the application I would love to hear. [Read More]

Golang nginx reverse proxy for ubuntu

If you have configured your golang application to run using upstart the best way to serve it to the world is behind a reverse proxy on a single server instance or haproxy using mutiple servers. To run an a golang application on a single server listening on port 8080 you will need to use nginx to proxy requests from the standard port 80. To install nginx on ubuntu first ensure that apache is not installed on the server and then install nginx [Read More]

Golang upstart script for Ubuntu

Golang rocks as a language, it complies your code to a single binary which can then easily be deployed to remote systems. The problem with it compared to .NET, Java or languages like PHP or Ruby is that it is not invoked by fast CGI or any another technologies. It instead needs to be run as a background process listening to a specific port. My choice of OS is Ubuntu deployed from code ship which means the best way to start the app and keep is running is upstart. [Read More]