Check for substring in shell

Note to myself 🙂 Unlike bash, sh does not support  easy way of checking for substrings: if [[ $IMAGE_TAG == *alpine* ]]   Solution #!/bin/sh IMAGE_TAG_SUFFIX=-alpine-beta echo $IMAGE_TAG_SUFFIX | grep -i “.*alpine.*” > /dev/null 2>&1 if [ “$?” -eq “0” ]; then echo “Alpine”; else echo “Not Alpine”; fi

Using Kafka with Kerberos authentication from .Net Core

Issues nuget version of librdkafka (as of 0.11.5) does not support Kerberos authentication out of box, so custom library needs to be build and injected into deployed binaries. Running on Linux requires keytab file, while it does not supported on Windows, where current principal is used to identify client. Building librdkafka with Kerberos support This […]

Mega switch

note line numbers // line num: 74 #region Switch Statement switch (key) { case 10: { // … // line num: 1767 case 430: { // … }  

Mind shift

function callback(route) { map.add(route); // display trip distance in Km $("#tripDistance").text(Globalize.format((route.distance() / 1024, "n0" ))); $("#tripDistance").attr("title", "Approximate distance"); map.repaint(); }