Categories
World

The US government is failing

I’m deeply disturbed by how the US is trying to be a “modern” country but is failing in so many ways.

Minority groups are still struggling, oppressed and criticized. Gun violence and mass shooting are a DAILY occurence and despite all these tragedies the US government is unable to act and improve the situation significantly. Racism, inequality, equitable treatment are far from addressed, despite EVERYTHING the US has been through including George Floyd and Martin Luther King (60 years ago!).

The US fails at separating church and state and the two party system is flawed. I personally think that this “blue”/“red” divide is completely counter productive and prevents the US government from achieving anything meaningful. It’s so called democracy barely gives the people meaningful choices to vote on, but not the ability to say yes or no to larger and impactful issues. 

Why do people only get to vote whether they’re republican or democrat – by electing specific candidates? Why not also give US citizens the option on voting directly on things that actually matter to them! For example: abortions, healthcare and education.

Categories
Dev

Deploying a virtual machine using AWS CloudFormation

Recently I started using Amazon AWS and quickly realized that provisioning virtual machines, security policies and other network configurations is done one by one, which is tedious and needs to be automated. I had two options: either create a custom script to provision every single service or learn how to use CloudFormation.

CloudFormation is a provisioning tool for AWS resources that requires a YAML/JSON formatted file inside which cloud infrastructure is described. This definitely seems like the better option, but being completely new to AWS the learning curve is steep and it is difficult to understand the terminology, the various components and how to combine them. Even the graphical user interface, the “CloudFormation Designer” is not that easy to use for new users.

Screenshot of the CloudFormation visual designer software. It allows to drag and drop components or modify JSON/YAML format.
Screenshot of CloudFormation Designer

What did I do? First I learned how to provision all the components manually one by one, which took more time than I would like to admit, but was essential for me to understand the components and which ones depend on another. Eventually manually provisioning resources became easier and all the different services became familiar, that allowed me to transition my set up to CloudFormation. It was a long process. Hopefully this article will allow others to use CloudFormation much sooner.

Categories
Dev

Git: How to replace the master branch

It happens to all of us, we accidentally commit something into a git repo that we didn’t mean to, even worse we also pushed it to the main repository on GitLab or GitHub.

TL;DR — too long; didn’t read

Replace the current “master” branch with another “backup” branch.

Local: git branch -f master backup

Remote: git push origin +backup:master

via: StackOverflow
Categories
Dev

How to quickly replace environment variables in a file

We know storing credentials or other sensitive values in a configuration file (e.g. Kubernetes yaml file) is bad, but how can we get values easily replaced without having to do a complicated string substitution or writing a custom Python script?

I often have personal environment variable files for projects that I use to store credentials and configurations in. Before working on a project I would the corresponding configuration file into the shell session. However, these files cannot be stored in git repositories or shared with coworkers or bots. Even worse, sometimes the repositories have files in them that need to be changed, which is dangerous, because it’s easy to accidentally commit these files.

Well as it turns out, there already is a good solution and it is called envsubst. We can use envsubst to substitute environment variable placeholders inside configuration files and we can even pipe it into other commands like Kubernetes’ kubectl.

envsubst < config.txt
Categories
Dev

Prefix CLI output

When interacting with the command line or writing automated scripts it’d be useful to prefix the output with the date or something equivalently useful. If you are a Linux or Terminal user you’ve probably come across the pipe symbol | , which for example allows you to apply grep filters, but it is not entirely clear how to prefix constant strings or dynamically evaluated commands like the date.

Categories
Computer Science

Setting up your DEV machine in ONE script

A new computer is great 💻🎉 – It’s a clean slate. It’s snappy. It’s great… but it is missing all the tools I rely on every day! My work requires me to jump around in a variety of tools and technology stacks, hence I need to install a lot of different tools and be able to support different development environments.

Existing package manager for CLI tools

Over time developers load command line tools like people are buying toilet paper these days. From maven, via tl;dr, stopping at kubectl to tmux. We use all of those little nifty tools. Hence setting up a new machine can seem scary task at times, but fear not! For CLI tools we solved that problem long long ago with Homebrew, or as you probably know it: brew
(The windows folks probably know Chocolatey)

You can install maven for example by running: brew install maven

Fear not! The same tool that installs CLI tools can install (almost) all our applications!

me

Brew can do more!

Categories
Computer Science

Set up GitLab CI with an iOS project that uses Cocoapods

We all write tests for our applications and keep them in version controlled systems like GitLab or GitHub. However, how can we configure GitLab to run Unit and UI tests for us?

I couldn’t find a lot of documentation explaining how to set up continuous integration for iOS on GitLab, therefore I am writing this article.

Victor Peschenkov explains in his article how to use GitLab CI with Fastlane. My article focuses on how to run everything yourself.

Categories
Software / Games

Deploy static websites using GitLab CI

One of my favorite tools of 2017 is GitLab. I guess my enthusiasm about it even helped convince my company to switch over to GitLab. In this post I am describing how to automize the deployment of mlp.skofgar.ch using a GitLab CI Pipeline Job.

GitLab offers an one-stop solution for almost anything™ that we might need as a software developer. There’s a ton of bells and whistles from issue tracking to continuous integration (CI), continuous deployment (CD), monitoring. GitLab could easily replace Jenkins, Jira, GitHub, wiki systems, bug trackers and deployment monitoring services. It even integrates with Kubernetes.

Enough with praises – I recently cleaned up my neural network project that I worked with Camila on and wanted to facilitate the deployment process. However, since I don’t run a large container management system and don’t control all the details of the server I was going to put it on (my website is hosted by Cyon), I needed a different way.

Categories
Photos

More panoramas

Oregon

Here are some drone pictures of my drive through Oregon

Categories
Photos

Columbia Basin – 360° Farm

I was visiting family in Washington and created the following 360° panoramas with my Drone.

The first shot was taken with an altitude of 500 meters above ground. It gives a brief overview of the area: