Random Bash

Hey everyone, recently I developed quite an interest in Bash so I’ve been trying to learn it. Unlike other things, this time it wasn’t much-structured learning rather just some random tidbits I picked on here and there. In this post I’ll share those things so that together we can demystify this fancy language. Also, some things might just be about Linux in general rather than bash specific. #!/bin/bash You might have seen that a lot of bash scripts begin with #!/bin/bash. So what exactly is this? ...

July 19, 2021 · 5 min · Arsh Sharma

Using Kyverno To Enforce EKS Best Practices

Hey folks, in this post we’ll see how you can use Kyverno to enforce some best practices for your EKS cluster. For those not familiar, Kyverno is a Kubernetes native policy engine that aims to make your life easy when managing clusters. To know more you can read my previous post on Kyverno where we discuss the project and its internals in detail. With that out of the way, let’s get started! EKS best practices recommend the use of separate IAM roles for different use cases. For example, for dev and prod environments you should prefer to have separate IAM roles which can configure objects in those environments. Now the problem that arises with this is how do you make sure that the IAM role which has permission for the dev environment doesn’t accidentally create objects in the production environment? If you have the roles configured properly it would obviously not allow this to happen but with Kyverno not only can you fool-proof this but also make sure that if someone does try this, then it gets reported. ...

June 21, 2021 · 5 min · Arsh Sharma

Channels In Golang

This is the final post in my “Do You Concur?” series. If you’ve not checked the other two out it is highly recommended you do that before reading this one. With that out of the way let’s get started! What Are Channels? A channel in Go can be best understood by comparing it with a box. It is a box where goroutines can put and take out the data. So essentially channels help your goroutines to share data. One goroutine can send a value into the channel and another goroutine can receive those values. A very simple code snippet demonstrating this is: ...

May 27, 2021 · 3 min · Arsh Sharma

Race Conditions In Golang

This post is the second in my series of articles on Concurrency in Go. In this post, we’ll understand what a race condition is, the why and how of it, and finally, we see some code that creates a race condition, and then we will learn to fix that race condition with the help of Mutexes. So let’s get started! The What, Why And How Of A Race Condition A race condition in Go occurs when two or more goroutines have shared data and interact with it at the same time. This is best explained with the help of an example. ...

May 24, 2021 · 6 min · Arsh Sharma

Concurrency In Golang

I recently started learning more about concurrency in golang and so as with other things I learn, I decided to write about it. This article will be a part of a short series I plan to write about concurrency in Go. So let’s get started! Concurrency Vs Parallelism Before we start looking at some code, I think it would be better to know what concurrency actually is. But even before we do that let us first talk about parallelism because it is a word that often comes up when talking about concurrency. ...

May 19, 2021 · 5 min · Arsh Sharma