Western Europe 2018 Trip – Part Two: London

I spent two and a half days in London catching up a kiwi friend and co-incidentally my Godparents whom happened to also be visiting at the same time.

During the two days I retraced many of my steps from my previous visit in 2013. Including staying in Kings Cross, visiting the V&A Museum, going for a walk down Southbank and trying to be a businessman in Canary Wharf. Continue reading “Western Europe 2018 Trip – Part Two: London”

Goals for 2020

  • Go to Europe
  • Read 12 Books
  • Save 20% of After Tax Income
  • Catch up on two years of trip blogging and photo editing

A Short Review of 2019

At the start of this year I set myself four goals:

Read 12 Books

I read 20 books! This is twice as many as 2018

Make a 5% return on savings and investments

I made a 5.2% average return (unweighted, includes investments held for less than 6 months) on my investments. Savings accounts much less as repeated rate cuts hurt my savings growth.

Travel to USA or Singapore/Asia

I went to Japan!

Buy a Mazda 3

I paid for my own wedding instead!

Like most years, what was expected at the start of the year and what transpired was very different. That said, 2019, despite a number of stressors, was a great year. Bring on the next decade and new adventures in marital bliss!

Git Cherry Picking Across Forked Repos and Empty Commits

Recently I found myself in a situation where I wanted to bring in a specific upstream commit into a forked repository. Although these repos share a common history, the two repos had diverged enough that it wasn’t a straight-forward cherry-pick between branches. Instead, with clones of the two repositories I managed to cherry-pick as follows:

git --git-dir=..//.git format-patch -k -1 --stdout  | git am -3 -k

To complicate things further, a few days later, I found myself wanting to do the same thing, however, this time a submodule and another file had diverged enough that the patch no longer applied correctly. To get around this I had to:

git --git-dir=..//.git format-patch -k -1 --stdout  | patch -p1 --merge

Manually fix any of the still broken changes, then create a new commit with the changes.

These two stack overflow questions helped to work both of these issues out: https://stackoverflow.com/a/9507417 and https://stackoverflow.com/a/49537226

Finally, I’ve also in recent months found myself wanting to create a completely empty commit to kick off a downstream build process… much like you may touch a file to change its timestamp. To do this you can simply run:

git commit --allow-empty -m "Redeploy"

Docker CFLAGS march=native and illegal hardware instruction

I’ve recently hit an interesting issue involving Docker containers and compiled C code crashing code with illegal hardware instruction errors.

In a nutshell the Docker image was built on a server using Jenkins. It has been running fine until the underlying host orchestration software and physical hardware changed.

My solution has been to remove the build of the C code from the Dockerfile and instead put in inside a script which runs when the container starts.

For my use case this solution will work, however, it will require the C code to be compiled every time the Docker container runs.

Digging a little deeper, it appears that the underlying root issue may be the use of the CFLAGS march=native flag in the C code’s underlying Makefile.

A few posts on Stack Overflow (in particular, https://stackoverflow.com/questions/54039176/mtune-and-march-when-compiling-in-a-docker-image), suggest that removing this flag may make little difference to the run time of the compiled code. Which, again depending on the use case, may be a good option to try as well to resolve these problems.

Photos: Singapore 2017

In November 2017, I travelled to Singapore for an series of academic conferences. Almost two years later, I’ve edited some of the photos from the trip.