June 25, 2022
#AWS
#CLI
If you are using aws configure sso to populate your ~/.aws/credentials file and you get the following error when you try and reauthorize, then you can …
Read Article →
June 24, 2022
#CLI
If you need to match a string in a file, then grep is your friend.
An example of using grep
Let’s take a file called somefile.txt
this
is
a
test …
Read Article →
June 23, 2022
#AWS
#CLI
If you want to invoke an AWS Lambda from your CLI, then the best option is to have the AWS CLI installed.
Getting started with the AWS CLI – AWS …
Read Article →
June 22, 2022
#CLI
#Linux
Sometimes you might want to exit a command if a variable is not set in Bash.
You can do this as follows:
if [ -z "$VARIABLE_NAME" ]; then echo …
Read Article →
June 21, 2022
#CLI
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 …
Read Article →
June 20, 2022
#AWS
#CLI
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 …
Read Article →
June 19, 2022
#AWS
#CLI
If you have tried calling the AWS CLI and got the following error:
Unknown options: --cli-binary-format
Then it is because you are using the AWS CLI …
Read Article →
June 18, 2022
#Python
If you need to generate a random string that looks something like this: VUNBXJ-230411, then you can use the following random generator:
import random, …
Read Article →
June 17, 2022
#CLI
#Linux
If you need to check the version and flavour of the running Linux instance, then you can try the below commands:
cat /etc/os-release
lsb_release -a …
Read Article →
June 16, 2022
#Terraform
If you are using S3 as the backend for your state management in Terraform , then you can create environment specific configuration files where you …
Read Article →
June 15, 2022
#Terraform
Sometimes your infrastructure may be out of sync with your Terraform state because resources may have been amended or deleted manually.
For this you …
Read Article →
June 14, 2022
#C++
There isn’t really a standard way to get the length of array in C. This means you need to do some additional work to achieve getting the length …
Read Article →
June 13, 2022
#Terraform
If/Else statements are conditional statements that perform decisions based on some known state, or variable.
Terraform allows you to perform these …
Read Article →
June 12, 2022
#Javascript
If you need to redo a Udemy course and you would like to reset the course’s progress, then you can use the following Javascript snippet below. …
Read Article →
June 11, 2022
#C
The challenge
Define a function that takes in two non-negative integers aa_a_ and bb_b_ and returns the last decimal digit of aba^b_a__b_. Note that …
Read Article →
June 10, 2022
#AWS
#CLI
If you have tried to delete a Security Group, or VPC, or various other resources and you get the dreaded Network interface is in use by another …
Read Article →
June 9, 2022
#CLI
#Node
#NPM
We typically install an npm package as follows:
npm install <package_name>
But how do we uninstall an npm package?
How to uninstall an npm …
Read Article →
June 8, 2022
#CSS
#HTML
Often you need to reference an HTML/CSS Color Code in RGB or Hex. This is known as rgb color codes.
Below is an easy-to-use table to find the …
Read Article →
June 7, 2022
#C++
The challenge
Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or …
Read Article →
June 6, 2022
#Javascript
If you need to sort an array of objects by their property values using Javascript, then you don’t need to look further than the built-in sort …
Read Article →
June 5, 2022
#CLI
#Python
If you need to count down a specific amount of time, say for example, when a token is set to expire, then a countdown timer will be useful.
Step 1 – …
Read Article →
June 4, 2022
#Terraform
Terraform state reflects the most up to date reference of the infrastructure.
Sometimes you may need to remove a resource from the Terraform state …
Read Article →
June 3, 2022
#Terraform
Running terraform destroy will tear down the whole stack associated to some terraform code.
However, sometimes you might only want to remove a …
Read Article →
June 2, 2022
#Terraform
Provision the DynamoDB Table
resource "aws_dynamodb_table" "dynamodb-terraform-state-lock" {
name = …
Read Article →