The Purpose of Life – Do More.

Two weeks ago I wrote about a little learning-by-doing-project. I wanted to build an app that analyses my car dashboard and extracts the total km.

I eventually got it working. You can see my pretty imperfect code on Github. Please don’t be too judgemental 🙂 I’m very aware of the shortcomings especially

  • missing unit tests
  • poor logging and error handling
  • missing automation scripts for provisioning, decommissioning, deployment etc

Eventually, I will add those, but keep in mind that my primary goal was learning and that certainly worked quite well. It was refreshing to learn something new and to create something even if it is not particularly useful.

That brings me to another topic and an article that I read this week written by Darius Foroux: The purpose of life is not happiness: it’s usefulness.

Capture

He talks about how misguided we often walk through life in the pursuit of happiness and how much more fulfilling a life can be if you just try to be useful. Do more. Have an impact on people’s life.

I definitely can relate to that. Sometimes I buy stuff because I think it makes me happy. It does at first, but it often wears out quickly. Contrary when I do stuff the satisfaction of the accomplished work creates more sustainable happiness. Anyway, I don’t want to repeat Darius‘ thoughts here. Read the article, I really liked it.

 

Advertisements

Learning by Doing – An AWS Project

Like in many jobs it is not easy for mine to squeeze in the regular learning to stay on top of new technologies, techniques, process etc. It’s too easy to get busy with the seemingly urgent topics of the day.

There are three strategies that work best for me to keep my self up to date:

  1. Get half an hour learning in before you start your workday. I try to do that every day during breakfast before I even start up my work computer. Once I start my computer it’s over, I get pulled into emails or even worse: slack conversations. As 30 minutes is not a lot of time I usually spent it reading a technology book. And yes, sometimes it is not even 30minutes because the baby wants to be fed or the lawn needs to be watered, but every minute counts. Even if you spend just 10minutes reading every day, it is more than an hour of reading every week.
  2. Go to conferences. Build a conference calendar for your year. Conferences are great for both getting high-level and in-depth knowledge about technologies and they give you the opportunity to meet other users and experts in the field.
  3. Come up with a small project that allows you to use some of those new things you want to learn. I don’t know about you but I learn best by doing stuff. So sometimes I look at my day and try to think which thing that I’m doing I can solve with a completely over-engineered solution merely for the purpose of learning something 🙂

This article is about one of those projects.

The „problem“

I’m thinking of selling my current car next year and instead of buying a new one lease a one instead. One of the parameters that affect the cost of leasing is the distance you plan to drive every year for the duration of the contract. My guess is it will be a bit less than 25000km, but I’d like to know for sure as I don’t want pay more than needed but also don’t want to drive more than what is allowed in the leasing contract.

The non-technology solution that I’m using right now and which works perfectly fine consists of a pencil and a post-it note:

Foto 19.07.18, 10 39 11

Every once in a while I write down the date and the total distance in kilometers (the German word on top says „mileage“). If I do this long enough I should have a pretty good idea what amount of kilometers to put into the leasing contract.

The over-engineered solution

Wouldn’t it be nice if I simply could take a picture and the mileage got recorded somewhere on the internet? Yes, of course, that would be nice and also I can do this all with AWS and a bit of Golang and Dropbox.

So, here is what I’m planning to do:

dashboard analyser

When I’m sitting in my car, I will take a picture of the dashboard which includes the mileage.

Foto 09.07.18, 11 26 04

I’ll take that picture and upload it to Dropbox. Dropbox will shoot a message to AWS API Gateway that something changed on the monitored folder. API GW triggers a Lambda function that merely publishes a message to a topic on AWS Simple Notification Service.

Another Lambda function subscribes to that topic. When it gets triggered it calls Dropbox to get the latest files that got created, saves them to AWS S3 and deletes them on Dropbox. It also saves a Dropbox cursor to a table in Dynamo DB. A cursor is a pointer to a certain state of the folder when you last looked at it. So if you pass that cursor into a  future list_folder call of Dropbox’s API you get the files that changed since when you called that function the last time. Lambda gets the Dropbox API key from AWS Secretsmanager.

When the image is stored on S3 a third Lambda function is called which utilizes the AWS Rekognition Service to extract the mileage from the dashboard.  After extracting the data it saves it to a different table in DynamoDB and deletes the file on S3.

Eventually, I want to build a simple UI that allows me to view the data somewhat graphically. For that, I’ll utilize all the same service that I used above.

ui design

S3 will serve a static webpage with some Javascript which will asynchronously call API Gateway. API GW triggers a Lambda function that simply accesses the data in DynamoDB that we previously saved there.

So far I have the basic AWS infrastructure set up and the first Lambda function is done. Now I’m working on the second one and then finally it gets to the most interesting piece of use the Rekognition API.

Over the next couple of weeks, I likely post some details of this project. I hope you’ll find this interesting!

Devops Tools

DevOps has many levels of complexity. The cultural shift and the organizational structure are the hardest ones in my opinion.

Another one is simply the wealth of tools in that space. I really like the page that XebiaLabs put together. They formatted it like the periodic table of elements which helps you to select tools for a certain domain, e.g. repository management.

devopstools

Unfortunately the page is not quite complete, nevertheless, it is a good starting point.

The Problem With Quick and Dirty

The last couple of weeks have been pretty busy. Privately our little daughter is rightfully consuming a lot of time and also we have been in the final phase of planning our big garden project which now will commence in May. For work, I’ve been traveling a fair bit being in the US now the second time in a month and on top of that was in Prague last week. Besides that, we are entering a time of change, which is good, but also intense.

I want to keep my schedule with posting something every Monday 6pm and really today I only will manage it with a cheat. I definitely missed German time 6pm, but I can still make Seattle time 6pm!

Recently on Twitter, I found this quote:

“The problem with quick and dirty is that the dirty remains long after the quick has been forgotten” – Steve C. McConnell

Steve McConnell is the author of Code Complete which you can order on Amazon (affiliate link)

It is a book full of wisdom for programmers and one of those books that I like to have a hard copy of. Its content remains true for a very long time.

Back to the quote: „Quick and Dirty“ is so appealing when you are acting under constant time pressure. Everybody seems to be happy at first. The developer can move on to the next task and the product owner gets the feature, extension, bug fix or what-so-ever quickly.

The problem is that just after delivering the item the next urgent thing is lurking around the corner and the quick win is soon to be forgotten. What remains, however, is the hack. Worst case it will cause a bug in future because of unconsidered use-cases or untested side-effects. Best case it will make your system less maintainable, less performant, less readable, less extensible, … the list could go on.

The collection of hacks that your system is built on over time when you have delivered too often „quick and dirty“ is going to make it harder and harder to maintain and extend the application. It will become more error-prone and you will deliver slower and slower until you eventually will have to go into a painful and resource consuming rewrite of large parts of your application.

Don’t be tempted by quick and dirty. Try to do things right and you will be faster in the long run. Constant investment into the architectural health of your system will pay off.

Wir sind die Herren unserer eigenen Zukunft

Ende Februar habe ich den folgenden Artikel auf Spiegel.de gelesen: Firma bietet Flüge an, ohne Abzuheben

firstairlines-spiegel

Zusammenfassend geht es darum, dass eine Japanische Firma Personen mit wenig Zeit und / oder wenig Geld einen Städtetrip innerhalb von zwei Stunden für 50$ anbietet. D.h. es wird ein Hin- und Rückflug simuliert und dazwischen eine virtuelle 360°-Stadtführung angeboten.

Nichts daran ist irgendwie schlimm. Das Angebot erscheint lediglich etwas skuriel und ist ansonsten wohl vollkommen harmlos. Ich konnte mich allerdings nicht dagegen wehren an Filme wie Bladerunner und Total Recall zu denken in denen durch den Einsatz von Gentechnolgie, Gedankenmanipulation, Virtuelle Realität, Identitätsfälschung, Bionik, etc.  eher düstere Zukunftsvisionen gezeichnet werden.

blade-runner

Während in den 80er Jahren viele dieser Technologien und Denkansätze sehr futuristisch wirkten, hat sich das meiner Meinung nach mittlerweile sehr geändert. Vieles ist ansatzweise machbar. Noch mehr ist denkbar.

Der Fortschritt der Technik wird sich nicht verhindern lassen. Vielleicht wird er durch Krisen verlangsamt, kaum aber wird er aufgehalten. Krisen könnten so machen Fortschritt gar beschleunigen.

Wenn sich der Fortschritt also nicht aufhalten lässt, was trennt uns von einer düsteren, post-apokalyptischen Zukunft? Wir. Der Mensch. Unser Umgang mit Technologien jeglicher Art wird unsere Zukunft bestimmen. Werden wir es lernen verantwortungsvoll mit der Macht umgehen die wir besitzen oder werden wir weiter versuchen Gott zu spielen und zwangsläufig damit scheitern?