Replace a key in a ruby hash
If you have a perfectly good hash, that you got from another function, but for some reason, you need to change the key(s) in it, there is a simple one liner: So, you have to […]
Multi line if condition in python
While the if syntax is pretty clear, you can’t really use a multi line condition in python, because of the indentation mechanism. Solution? use parenthesis. Usually frowned upon, but in this case necessary, unless you […]
The Ansible cookbook cookbook
Instead of going through endless long guides, here is a short, yet effective to the point Ansible guide: Installation I’m assuming Linux, cause.. cause. simple Will do the trick. no need to be root. Will […]
Managing multiple clusters with kubectl
Installing kubectl is being done to work with a Kubernetes cluster. More often then not, you’ll have to manage multiple clusters, production and staging, multiple production of multiple staging, or your local minikube with other, […]
Ruby lambdas
Ruby lambdas are typical lambda: you can assign them to a variable, call them and use them as closures. To declare a lambda:option 1, using the lambda keyword: This is fairly simple, and in order […]
Creating new Spring Boot application – from scratch
I love Spring boot. I love Java, Kotlin and Gradle. In this post I’m going to use Java and Gradle – I’m not a big fan of Maven. You can just download a startup project […]
Getting socket info from a socket descriptor
This is one of the most common questions: given a socket descriptor, how can I tell the socket info (that is, IP and port) of the socket? Well, since there are two types of networks […]
C# extension methods
C# extension methods are a little bit like magic: it enables you to add functionality to an already existing object, without creating a new class. If we have a string object, that we use as […]
Changing bash prompt
So, our bash prompt usually includes the full path. If you’re ssh-ing to a remote host, I can see some cases where you need to know all the time your current directory. But when working […]
Vagrant:tips and tricks and why you should use it
Virtualbox is awesome. It’s awesome because you can experiment with dummy machines, and clear them once you are done. It’s awesome because it’s cloud neutral – there is no need to select a vendor, and […]