Blog Posts

How to Execute Linux Commands in Golang

July 4, 2022

If you want to execute linux commands in Golang, then you can use exec.


Read More

How to Check for Prime Numbers using Golang

July 3, 2022

If you need to check for Prime Numbers in Golang, then you can use the following method:


Read More

How to Raise a Number to a Power in Golang

July 2, 2022

If you need to raise a number to a power in Golang, then you can use the math.


Read More

How to get CPU Frequency in Linux

July 1, 2022

If you need to get the CPU Frequency in Linux, then you can run the following command:


Read More

How to Disable Warning with Python Pandas

June 30, 2022

How can python pandas disable warnings? If you need to disable warnings with Pandas on Python, then you can use the warnings module and ignore the filter as follows:


Read More

How to Get all Caps Alphabet as List in Python

June 29, 2022

If we take the following list: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] How do we extract only the UpperCase letters of a given word?


Read More

How to create an AWS Lambda in Terraform

June 27, 2022

Step 1 – Lambda Code in Python The following code expects a python file with the contents as follows in a file called python/script1.


Read More

[Solved] Instance Profile already exists in Terraform

June 26, 2022

If you get the Instance Profile already exists error when running your Terraform apply, then it is either because an instance profile with that name already existed in the account, or because the previous terraform destroy did not remove it.


Read More

How to Match Multiple Strings with grep

June 24, 2022

If you need to match a string in a file, then grep is your friend.


Read More

How to Invoke an AWS Lambda from the CLI

June 23, 2022

If you want to invoke an AWS Lambda from your CLI, then the best option is to have the AWS CLI installed.


Read More

How to Exit if a Bash Variable in Not Set

June 22, 2022

Sometimes you might want to exit a command if a variable is not set in Bash.


Read More

How to Force Gitlab pipeline to fail on condition

June 21, 2022

if you have a conditional in your Gitlab pipeline stage that checks if something has succeeded or failed, then you can use this to pass or fail your pipeline stage.


Read More

How to run AWS CLI commands based on AWS CLI Version in Bash

June 20, 2022

If you find yourself having the requirements to support both AWS CLI v1 and v2 simultaneously, then you can use the following conditional in Bash to only run the specific version required:


Read More

[Solved] Unknown options: –cli-binary-format AWS CLI

June 19, 2022

If you have tried calling the AWS CLI and got the following error:


Read More

How to Generate Random Strings with Dash in-between in Python

June 18, 2022

If you need to generate a random string that looks something like this: VUNBXJ-230411, then you can use the following random generator:


Read More

How to Check OS version and flavor in Linux

June 17, 2022

If you need to check the version and flavour of the running Linux instance, then you can try the below commands:


Read More

How to use a Backend-Config File for Terraform S3 State Configuration

June 16, 2022

If you are using S3 as the backend for your state management in Terraform, then you can create environment specific configuration files where you store the bucket, region among other things to be pulled in automatically when switching environments.


Read More

How to Refresh State in Terraform

June 15, 2022

Sometimes your infrastructure may be out of sync with your Terraform state because resources may have been amended or deleted manually.


Read More