New things to learn

Nice article about some framework that we should all learn and as much as I know a few this list of classics certainly has a few that I should learn before the end of the year.

https://hackernoon.com/12-frameworks-java-web-developers-should-learn-in-2018-edae59315244

Which one are you learning?

Advertisements

SOLID Principles

It is always a good reminder when you read this type of article. Producing good code that can be easily maintained is very important.

https://blog.bitsrc.io/solid-principles-every-developer-should-know-b3bfa96bb688

  • S: Single Responsibility Principle
  • O: Open-Closed Principle
  • L: Liskov Substitution Principle
  • I: Interface Segregation Principle
  • D: Dependency Inversion Principle

Coding Style has an impact

This presentation has a series of coding habits that can cause problems if applied blindly:

I have seen many of these bad habits and I have quite often used them because they are my habits as well. I am unsure how we can lose these habits easily because some are embedded in the team and getting the entire team to change is not easy.

I like that he explains the fact that some of these start small and grow to be a problem. You have to be very attentive and make sure you don’t start on the wrong path.

Homebrew issues

I have been getting an error every time I try to install a new homebrew package and I found a quick and easy solution to it.

The problem looks like this:

user1$ brew install kubernetes-helm
Warning: git 2.15.1 is already installed
Error: Git must be installed and in your PATH!
Error: The following formula:
 python, 
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
 xcode-select --install

Git is available on my system without issues so I was puzzled about this “invalid” error.

I found that if you set this variable:

export HOMEBREW_NO_ENV_FILTERING=1

It would allow brew to update and then install new packages without an issue.

Very simple workaround.

Updating Bash on my Mac

Some applications started to require a newer version of the bash shell on my Mac. Apple ships a version of 3.2 but Bash is up to version 4.4 and Apple is not able to ship a newer version because Bash 4 uses a GPLv3 license.

I found this quick solution where you use homebrew to install the latest Bash version and changing the terminal configuration to use this new shell.

If you don’t have homebrew it is quite easy with this one command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then you simply have to execute:

brew install bash

Changing the terminal configuration is easy because it is on te first tab of the preferences. Where it says “Shells open with” change from “Default login shell” to “Command (complete path)” and enter this string:

/usr/local/Cellar/bash/4.4.19/bin/bash

Obviously your version may vary depending on what is the latest one available.

 

Reference:
https://apple.stackexchange.com/questions/193411/update-bash-to-version-4-0-on-osx
https://brew.sh/

When kube-dns does not resolve

We have been seeing this intermittently in our different kubernetes clusters, kube-dns is not resolving some hosts names and it is causing failures with some batch jobs or containers that are dependent on others to start.

We know that the networking is working because we are able to reach services or containers with IPs. So I had to stop blaming flannel.

Our Linux architect noticed that br_netfilter module was loaded but not the xt_physdev one.

On each node he fixed it with these commands (first and last ones to verify the loaded modules and second to load the missing module):

[root@server ~]# lsmod | grep br_
br_netfilter 22209 0
bridge 136173 1 br_netfilter

[root@server ~]# modprobe xt_physdev

[root@server ~]# lsmod | grep br_
br_netfilter 22209 1 xt_physdev
bridge 136173 1 br_netfilter

Everything started to work perfectly after that little fix.