My house

At the moment I am trying to translate an image in my head into a photograph and since this process and the alternatives fascinate me I thought I would describe it here. 

I am trying to take a picture visualising the mood of an old hut placed near a local beach, however as I try to find the correct image I have come up with multiple alternatives which I feel convey some of the intent.  It is however very interesting to see that small changes in crop or weather makes the feeling of the image slightly different. This slight change does make it hard to pinpoint the exact feeling I am looking for which of course is part of the challenge.

I am still trying to find the right way to portray this view however looking at the results I am starting to lean towards a collection of images, the area lends itself to the imagination.

Running dotnet core web application in Ubuntu Core

For a current project I am looking into running a dotnet core web application in Ubuntu Core this does require some extra work compared with running in docker or on bare metal. To illustrate the project I will use a simple dotnet webapi and a fresh install of Ubuntu 17.10 the snap will be deployed and used in the same operating system. In an effort to ensure consistent build we will be using an lxc container for our builds. This makes the process less dependend on operating system, the guide should be usable with only minor adjustments on other linux distros.


It is possible to do the entire development process in a continer, however for this purpose i prefer to develop on my active OS and only deploy to a snap. That means that we will need to install dotnet core on our system. The process for this varies slightly depending on your distribution and I will limit this guide to Ubuntu. If you are using another distro Microsoft have documentation on how to install on all supported distributions.

Dotnet Core

The following commands should install dotnet core sdk on a system running Ubuntu 17.04 or 17.10 if you are running an alternative version the Microsoft documentation have repository links for other versions.

curl | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

sudo sh -c 'echo "deb [arch=amd64] zesty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install -y dotnet-sdk-2.0.0

LXC containers

To have a clean build environment we need to install and prepare an lxc container. The following commands should install lxc and create a container with dotnet Core sdk and snapcraft tools.

sudo apt-get install -y lxc
sudo lxc launch ubuntu:16.04 snapcraft -c security.privileged=true
sudo lxc config device add snapcraft homedir disk source=/home/$USER path=/home/ubuntu
sleep 5 # wait for container to initilize
sudo lxc exec snapcraft -- apt update 
sudo lxc exec snapcraft -- apt install -y snapcraft curl
sudo lxc exec snapcraft -- sh -c 'curl | gpg --dearmor > /home/ubuntu/microsoft.gpg'
sudo lxc exec snapcraft -- sudo mv /home/ubuntu/microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg 
sudo lxc exec snapcraft -- sudo sh -c 'echo "deb [arch=amd64] xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

sudo lxc exec snapcraft -- apt update 
sudo lxc exec snapcraft -- apt install -y dotnet-sdk-2.1.3

The commands in the rest of this project will assume that you have Visual Studio Code installed on your system. If you prefer another editor you can replace all calls to code with your editor of choice.

Project definition and build config

As previusly mentioned we will create a basic webapi and use that as an example for our snap.

The following commands will initialise a basic webapi in the folder dotnetSnap/src it will also create a Makefile and open that in Visual Studio Code.

mkdir -p dotnetSnap/src
cd dotnetSnap/src
dotnet new webapi
touch Makefile
code Makefile

Since snapcraft's make plugin calls make all we need to ensure that make all runs our build step. In this case we want our dotnet project to be published as a self-contained application targeting x64 Ubuntu. After snapcraft runs make all it will run make install which copies the binaries to a folder under bin in the snap.

all: build

    @dotnet publish --self-contained -o bin/publish \
    -c Release --runtime ubuntu.16.04-x64 
    @mkdir -p $(DESTDIR)/bin
    @cp -r bin/publish $(DESTDIR)/bin/
    @rm -rf bin

With our dotnet project ready for deployment we will shift our focus towards Snapcraft. The setup required here is fairly limited and the following commands should create a new snap project in your dotnetSnap folder.

cd ..
snapcraft init
code snap/snapcraft.yaml

The snapcraft defintion needs some minor editing to make it usable for our purpose. Mainly we need to add an app that runs the application which have the default name of src we also need to define a part which include our build step.

We are using the make plugin which calls:

make all
make install

This will compile and publish our project to the snap's binary folder. We also add libunwind8 and libicu55 which are required for the dotnet application to function properly.

Our snapcraft.yaml will look like this:

name: Dotnet_snap # you probably want to 'snapcraft register <name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: A simple example snap for dotnet in snaps
description: A simple example snap for dotnet in snaps
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

    command: bin/publish/src

    plugin: make
    source: src/
      - libunwind8
      - libicu55

Building installing and running

When we have configured our application we use the following command to build the project.

sudo lxc exec snapcraft -- sh -c "cd /home/ubuntu/dotnetSnap; snapcraft"

This will create Dotnet_snap_0.1_amd64.snap which can be installed on your system using:

sudo snap install Dotnet_snap_0.1_amd64.snap --devmode

We should now be able to run our api using

sudo Dotnet_snap.testapi

Hopefully this guide have provided some help in running your dotnet core applications in a snap, the code from my project is available on github.

35 pictures from a year with a x100t

Roughly a year ago I sold my trusty k7 dslr and replaced it with a x100t with the intention of challenging myself to stick with one focal length for a year. 
With a year gone by and my replacement dslr arriving I thought I would sum up my experience with a few examples.

I will begin with my impressions from the x100t, which have served me exceptionally well during the last year. It is a small mirrorless "advanced" point and shoot with a fixed 23mm lens which due to the aps-c sensor makes it a 35mm equivalent. 
The camera is a joy to use and even though it's somewhat soft on large apertures it does render beautiful colours. The autofocus is a bit slower than dslr alternatives but it's still usable. The lack of speed does cause  some issues when photographing moving subjects.

The few minor niggles with the camera is more than made up for with it's simplicity, it's pocketable size and it's tactile interface. It's the first camera I've managed to bring with me on a daily basis allowing me to capture countless moments which I otherwise would have walked pass.   It's also been a perfect companion during the first year of my sons life although as he grows up he have started to outrun the autofocus causing some issues.

To summarise my experience with the x100t id say that it is an excellent all-round camera and a perfect way to capture family events and trips. Even though there are some small issues with it I will keep my x100t as a lightweight travel companion.

This finally brings me to the last year which have been captured in a much greater extent than I would have thought. Here are 35 examples in chronological order which hopefully will highlight the cameras versatility.

Moving to Squarespace

I do realise that most of my previous posts have been about hosting changes and to continue the tradition this post will discuss my recent move to SquareSpace.

This change is another step in my ongoing process of simplifying my online presence. SquareSpace will allow me to use one host for everything apart from source code. I will continue to use a combination of bitbucket and github as hosting solutions.

The move will replace my current solution which consist of a static blog hosted on s3 and a photography portfolio on smugmug. The benefits of this setup is it's adaptability and the level of control. However since I seldom use these benefits a simple managed solution will lower the threshold for posting.

Another major benefit with moving is having a web frontend for editing and publishing, something that further simplifies the process. I do believe that I could achieve similar results using a completely self hosted solution, however I personally don't feel that I have the time or the interest to build such a solution.

Once I had decided on moving to a managed solution I was somewhat spoiled for choice since there are a lot of alternatives. I ended up with Squarespace for a few reasons, mainly I found that the service included all the things I required. It's also a reputable hosting service with a lot of support from photographers and influencers that I follow.

So after a few days of testing the Squarespace platform I decided to make the move, this entailed a fairly limited amount of work. Mainly moving relevant old posts to this new system and deciding on good way to display my pictures.
There are two things I will miss with this move, a complete solution for syntax highlighting and a nice way to display my book reviews. I am however looking further into these things to try and find a solution for that.

Photography hosting

You might have noticed the extra link in the menu point towards photography. The link is pointing towards my newly created photography gallery which I have decided to host and create on SmugMug. I’ve been thorn between creating a generator to host the photographies directly on this site and using a service. But as I have decided I though it might be a good idea to go through some of the reasons for my choice.

The main reason is simplicity, I am at best a amateur photographer and even though I enjoy fiddling with websites I don’t really have the time to perfect a portfolio gallery for my hobby. So with a simple hosted solution I do get more time to actually take pictures instead of fine tuning javascript. Another reason is cost, hosting pictures requires bandwidth and storage space both of which could easily cause trouble for a hobby site. Finally using a fairly large provider like smugmug me to have a very simple work-flow. Now I can publish new images directly from my editor, instead of having to run separate scripts to regenerate a static gallery.

There are of course some drawbacks, mainly the fact that visitors to my page now gets transferred to another host to view my images. There will also be an inevitable difference in the general style of the photography page and this one which could cause some confusion. With third party hosting I have less control over the amount of tracking that my visitors is subjected to. On this site I only use the basic analytics from cloudflare, while I believe that smugmug adds some extra tracking as well. Another issue is the amount of javascript smugmug deems necessary to handle the hosting, which of course is caused by the general nature of there themes.

Hopefully this change will allow me to get better at sharing my pictures with the world.

UPDATE 2017-06-12

After writing this article I have been asked (by to bluemelon) look into there service. And even though there service is in some ways limited in comparison with smugmug they have compensated this with a more flexible price. This makes bluemelon interesting alternative especially if you are looking for a smaller initial solution without making major sacrifices in core functionality.