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.

 

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!

Hosting WordPress on AWS vs. WordPress.com

Last week I posted a tutorial on how you can run WordPress on AWS. In this post, I will explore a bit whether it is actually worth going down that path or whether it is better to just use WordPress.com

This is not going to be highly scientific and likely colored by my opinion. You will have to decide for yourself which option is better for you, but maybe some of my thoughts will help you make a decision. Also, I’m not sponsored by either Amazon or WordPress.com.

For those who don’t want to read the full article here is the summary:

As so often in life the answer is: It depends. You can get more flexibility for cheaper out of AWS. On WordPress.com, you have less headache operating your own server, but less flexibility unless you pay for the more expensive plans. I’d say that for 90+% of people the WordPress.com option is the better option. The only exception is if you need a lot of storage and/or plugins. In that case, you might be better off with AWS.

Now in more detail. Let’s first go over a couple of advantages to host your blog on AWS:

  • It is relatively cheap. For 5$ a month you get 20GB storage and 1TB data transfer (that is plenty for a small blog)
    • you still pay extra for a domain and you don’t get a free one. For a common one that is maybe 10$ a year.
  • full flexibility: no ads, you can install all plugins you want
  • you can host your blog in the geographical region you prefer
  • if you have other stuff running on AWS you can easily integrate with that.

Some disadvantages of hosting on AWS

  • you are responsible for updating everything to keep things modern AND secure
    • the OS and all applications that are running on your Linux instance
    • need to maintain the SSL certificate (can be done automatically)
    • update WordPress regularly and all installed plugins
  • As you scale you will pay more.

Now, let’s take a look at the plans that are offered by WordPress.com. The first advantage, of course, is that you can get started for absolutely free. As of today, this blog is running on the free version and I merely set up a forward from stefansiebel.de to stefansiebel.wordpress.com. Not nice, but works great. In this mode, I would be able to scale to as many readers as I can get. That is already one clear advantage compared to hosting your blog yourself on AWS.

plans

The basic plan is available to you for 4€ and gives you three main advantages. You get a custom domain, no more ads are displayed and you double your storage for images from 3GB to 6GB. To be honest for 4€ a month that wouldn’t be enough value for me to consider (except maybe if I’m running out of storage).

The Premium plan essentially allows you to monetize your site and supports video. Again, additional storage is offered. You’ll probably need it if you want to store videos. The thing is that I don’t quite see why I would upload videos to WordPress. Youtube or Vimeo are the better platforms for that and you can embed video into posts even in the free version of WordPress.com.

Finally, the Business plan gives you the full flexibility. Only the business plan lets you install plugins. It comes with a very high price tag of 25€ a month. It gives you a ton of other advantages as well including unlimited storage and personal support. In my opinion that is only worth it if you are actually running a business and in that case the price is probably not too high. As I wrote already in the summary at the beginning of the article you are likely better off using AWS if the only thing you need is more storage and the ability to install plugins. You should have a minimum of technical expertise though if you are going for that option.

I hope this was helpful. There are plenty of other options available as well that you might want to consider. How are you hosting your WordPress Blog?

 

Hosting WordPress on AWS

There are a ton of options out there to host WordPress including simply running it for free on wordpress.com. That’s the option that I chose for the moment to host this blog.

One option that I’m simply interested in is hosting a WordPress instance on AWS. AWS offers amazing capabilities, but also requires a fair amount of knowledge. So how hard is it to get a WordPress instance up and running?

Not hard at all, as it turns out. Let’s take a quick look into it.

Setting up WordPress using AWS Lightsail

selectlightsail

I’m going to assume you already set up your own AWS account and logged into the AWS Management Console. Click on Services and select Lightsail under the Compute category.

On the Lightsail homepage, select to create an instance.

createinstance

You may pick the region in which you want to run your instance. I picked Frankfurt as I live close to Frankfurt. Then select a platform (Linux) and an application, in our case WordPress! Further down on the same page you can pick a custom name for your instance but if you don’t plan to host a ton of sites the default name will just do fine. You also get to choose an instance plan. I’d recommend going with the cheapest option first except you expect a lot of traffic on your blog. You can scale later if needed.

When you are ready, click the create button and just moments later your instance is up and running and you can see it on your homepage.

fresh instance

In the background, the Bitnami WordPress AMI will be used to create an EC2 instance on AWS.

Next thing you want to do is assigning a static IP address. This way your blog is always reachable via just that IP address and also you can, later on, create a DNS Zone in order to assign a domain.

ipTo do this click on your instance and navigate to the networking tab. Simply choose to create a static IP.

ip static

That’s it. We are ready … believe it or not, we have our WordPress instance up and running and it is reachable through a static IP.

wordpress initial page

Isn’t it amazing how quick that was?! So what are the next steps? One thing that needs to be done is to retrieve the credentials for the WP-Admin.

Getting your WP-Admin credentials

In order to get the login credentials for WP-Admin we need to log into our instance via SSH. Lightsail makes that really really easy and allows you to connect via your browser. It works for me when I use Google Chrome. So go back to your instance and click on the connect tab.

connect

Now choose to connect using SSH. Lightsail will open a new browser window and automatically log you in securely.

ec2console

When the machine got instanciated the username and password for WP-Admin were saved on the disk of the machine. You can view it by typing in the following command.

cat ./bitnami_credentials

Now go to http://your-static-ip/wp-admin and you can login using the credentials from the file. It is recommended to delete the bitnami_credentials file and also to change the default password.

We could start customizing WordPress now, but the next thing I’d recommend to do is securing your blog. Right now it is only possible to connect via HTTP. So when you login credentials will be sent over the wire unencrypted. You might think that for your small blog that doesn’t matter but believe me it does.

Assigning a Domain Name

In order to secure the site and implement SSL we first have to assign a domain name. We will do this by configuring a DNS zone. Go to your Lightsail homepage and then click on the networking tab. Now create a DNS Zone.

dnszone

Enter the domain that you want to route to your newly created WordPress instance. If you don’t have a domain yet, you first need to register one. Either through Amazon Route53 or any other domain provider. I register all domains with united-domains.de.

Once the DNS Zone is created you can specify A-records so that the DNS knows to which IP to route traffic when a browser calls the domain. Below is my setup for the purpose of this example.

arecord.PNG

The IP address is the static IP we configured earlier. Finally, you need to configure the DNS name servers at your domain provider. Check the documentation of your provider should you have questions. Once that is done as well you will have to wait until the DNS setting propagates and the domain actually routes traffic to your WordPress instance.

Jens Neuhaus posted a fantastic write up for creating and installing an SSL certificate using Let’s Encrypt. You can find his post here: SSL for AWS Lightsail WordPress. I followed his instructions one by one and it worked flawlessly.

wordpresssecured.PNG

This was a rather long post, so thanks for bearing with me. I hope you find it useful. Also, I’m planning on comparing this kind of hosting to hosting your blog on WordPress.com. Stay tuned.

AWS Summit Berlin 2018

Last week I visited AWS Summit Berlin 2018 and I really enjoyed it even though some presentations were very AWS marketing heavy. I guess that is fair given that it is a free event.

awssummit

I learned that this year it was the first time that they scheduled it for two full days. Hence the sessions were a good mix of more high-level presentations and some technical deep-dives. I enjoyed both kinds of presentations.

You also had the opportunity to talk to lots of AWS employees and partners which probably was useful for those coming with very concrete topics. For me, I only took the time to learn what some of those companies are doing which definitely was time well spent as well.

If you asked me my three main takeaways here is what I’d like to call out.

1. Don’t start with solutions, start with problems that your customers are having.

This reads so obviously and still, often we are not working like that. Instead of first deeply understanding the need of the customer and the problem that we’d like to solve we are suggesting a premature solution and later are surprised by the fact that we are not meeting „customer expectations“ or rather haven’t solved any real problem or have solved it in a way that doesn’t work for the customer.

To resolve this you can use different methodologies. Design Thinking is one of them, Working Backwards is how AWS fills this concept with life.

It was also pointed out that this process needs to become part of an organizational flow in which you start with Design Thinking, you then work on solving the problem with Agile Teams and operate those solutions with DevOps in mind.

2. Generalists vs. Specialists 

In a session about Artificial Intelligence and Machine Learning, the presenter made a point about generalists eventually becoming more important than specialists if you are talking about building successful solutions.

Take experts in artificial intelligence for example. There are only a few true experts in this field available globally. However, there is a huge demand for knowledge of AI / ML in the industry. The way AWS reacted on this is to offer three layers of AI / ML related services. First, the very basic level. It offers you the greatest flexibility, but it also requires you to understand the underlying models and math. The second layer gives you access to frameworks. You still need to understand the ML concept, but you can rely on algorithms doing the actual work. The third layer consists of application services which have a specific purpose and are pre-trained by AWS. E.g. voice recognition, image recognition etc.

So in above example, people who are not experts in AI / ML can apply ML to their solution because of the application services that are being offered by others. The specialist is not needed in that case. Who is needed is someone with a brought view on technology who is able to understand problems and find solutions given existing technology.

I still think there always will be the need for specialists, but I found that point of you refreshing and interesting.

The presenter also shared a fitting quote from Robert A. Heinlein:

“A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”

3. Learn

This one is more personal for me. Sometimes it is easy to become complacent. You know what you know and you are good at what you are doing. But what are you really doing? You’re are slowly killing your future. It is important to continue learning and stay curious. Why?

  • You open yourself up for new opportunities
  • You find better ways
  • Shed light on blind spots
  • Keep up with technology (vs. being left behind)
  • Fuel your personal growth
  • It is simply more interesting

Learn to Learn and be Curious:

  • Dedicate time for learning and being curious. It needs to become part of your daily routine.
  • Do so consistently
  • Outside of your comfort zone
  • A new language, a new framework,  new activity, a new anything
  • Visit random meetings / conferences / meetups
  • Increase entropy and collisions
  • Inspiration and new perspectives

Have you visited an AWS Summit in your country? What were your main takeaways?