↓ Skip to main content

Technical

Scenario: Molecule

Scenario: Molecule

·3 mins
A scenario in Molecule is a configuration that defines how a role should be tested. It consists of a set of instructions and parameters that determine how a role is provisioned, converged, and verified. The purpose of scenarios is to allow for flexibility in testing a role by allowing multiple testing configurations to be defined and executed. You can have as many scenarios as you like and Molecule will run one after the other.
Ansible Variables

Ansible Variables

·3 mins
Variables are a crucial part of Ansible and are used to store values that can be used across playbooks, roles, and tasks.
Python Virtual Enviroments

Python Virtual Enviroments

·3 mins
Continuing from the blog, Virtual environments are isolated Python environments that allow you to manage dependencies separately for each project, providing a controlled and reproducible environment…
SSL/TLS

SSL/TLS

·2 mins
Secure Socket Layer and its successor TLS (Transport Layer Security) are cryptographic protocols that provide encryption, integrity, and authentication for network communication.
Testinfra

Testinfra

·2 mins
Testinfra is a Python-based framework for infrastructure testing. It allows you to write tests for your infrastructure and verify that everything is working as expected.
Python: When not to use it?

Python: When not to use it?

·2 mins
Python is a versatile and widely-used programming language, but there are certain scenarios when it may not be the best choice. Here are some examples of when not to use Python:
Python: Multi-Args

Python: Multi-Args

·2 mins
In Python, you can define a function with a variable number of arguments using the and syntax in the function definition.
Python: Inheritance

Python: Inheritance

·2 mins
Inheritance is a mechanism in object-oriented programming (OOP) that allows you to create new classes that are derived from existing classes.
Apache Karaf

Apache Karaf

·2 mins
Apache Karaf - I had only heard of it and never had practical exposure to this technology. Main questions in my mind were - What purpose does it serves? and Who uses it?
AWK

AWK

·1 min
awk is an interpreted language. The basic function of awk is to search files for lines that contains certain patterns. When the input line matches the pattern(s), awk performs specified actions on that line.
PKI

PKI

·2 mins
PKI is the core of security for most organizations, and at its heart is a couple of keys that together allows the encryption/decryption of the traffic exchanged.
Tip #Maven

Tip #Maven

·1 min
A decent developer trick is to ensure your maven points to the right JAVA version, and if you have freshly installed maven it will be pointing to the default available.
Hashicorp vault

Hashicorp vault

·1 min
“HashiCorp Vault is an identity-based secrets and encryption management system.”
Static IP’s in QEMU VM’s

Static IP’s in QEMU VM’s

·2 mins
Continuing from where I left in the blog before. If you are using looking to configure a static IP for your machines (may be your use case is similar to mine) this blog might be useful for you.
Vagrant-OSX

Vagrant-OSX

·1 min
In the previous blog, I was left with the error that had little information for me to debug. I realized since I migrated most of the files from my previous laptop it might be causing an issue.
Vagrant OSX

Vagrant OSX

·4 mins
Having just bought an M1 – MacBook Pro the issue are mounting. The premier challenge was to get my Vagrant boxes configured with provider virtualbox to run.
Gradle

Gradle

·1 min
Open source build automation tool FLEXIBLE and builds any type of software Run on JVM and must have a JDK installed to use it. Gradle models its buils as DAGs pf tasks. Build is graph of tasks Tasks consists of Actions Inputs Outputs Lifecycle Tasks Clean Check Assemble Build Build Configuration Clean Task Gradle evaluates and executes build scripts in three phases Initialization Configuration Execution
Go Modules

Go Modules

·1 min
If you are like me and getting errors while trying to compile your go lang code without having a go.mod in v1.18
Ansible: On Windows 10 Pro

Ansible: On Windows 10 Pro

·2 mins
Life is bringing it own challenges as I have moved to the United States of America. One of the immediate tech challenge has been using the loaner windows box and still be productive.
SSH Protocol

SSH Protocol

·2 mins
💬 What is SSH protocol? 💬 It is also referred to as Secure Shell, is a method for secure remote login from one computer to another. It is an alternative to telnet and rlogin
Kafka: Deploy & Test

Kafka: Deploy & Test

While I continue to learn more about architecture and design of kafka, a quickstart to deploy & test kafka is a must. Step 1: Add Chart Repo # In my local system it is already present which was confirmed by the listing
Spinnaker: Install & Configure

Spinnaker: Install & Configure

·12 mins
Spinnaker is an open-source continuous delivery platform which provides two core set of features Application Management Application deployment Applications , clusters , and server groups are the key concepts Spinnaker uses to describe your services. Key Concepts # Some of the key concepts in the spinnaker universe are covered as under
Event Streaming

Event Streaming

·2 mins
While reading Apache Kafka it was interesting analogy that they described Event streaming is the digital equivalent of the human body’s central nervous system. — Apache Kafka It draws a great parallel between how the central nervous system allows for real time event generations and consumption in terms of reflex actions. The examples are well explained and captured here.
Adding Node to a cluster

Adding Node to a cluster

In this blog, I will try add a new node to the already running cluster. My Cluster # root@master>k get nodes NAME STATUS ROLES AGE VERSION mydevmachine001830.samarthya.me Ready <none> 22h v1.23.1 mydevmachine002687.samarthya.me Ready <none> 41d v1.23.1 mydevmachine003277.samarthya.me Ready <none> 131d v1.23.1 mydevmachine003278.samarthya.me Ready <none> 131d v1.23.1 mydevmachine003417.samarthya.me Ready <none> 4m55s v1.23.1 mydevmachine003968.samarthya.me Ready <none> 131d v1.23.1 mydevmachine003969.samarthya.me Ready control-plane,master 131d v1.23.1 mydevmachine003970.samarthya.me Ready <none> 131d v1.23.1 mydevmachine003979.samarthya.me Ready <none> 29m v1.23.1 Steps to follow # Install docker Install kubeadm, kubectl & kubelet Join the cluster using the token Check the node has joined the cluster Step 1: Install docker # sudo yum install -y yum-utils sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo When adding repo make sure the repo has been added successfully to the machine
The inevitable

The inevitable

·1 min
India is a complex country, the diversity is ever present and ever growing. What got me going in my deep meditative thinking is having a discussion with my Dad. We have evolved from the just enough generation to over the edge generation. Things that were uncommon during my growing up years and now the basic necessity of this generation.
Documenting GO

Documenting GO

·1 min
Documentation is a huge part of writing any software. In java you have JavaDoc, which most of the developers adhere to. It is healthy and rich way of exposing the source documentation.
K8S RBAC

K8S RBAC

·2 mins
What? # Role Based Access Control(s) is a way of regulating access to entities like storage, network etc. RBAC authorization uses rbac.authorization.k8s.io API group. API Objects # There are 4 kind of kubernetes object
SCM for git clone

SCM for git clone

·7 mins
Having used SCM plugins for quite sometime, I thought - WHY I have never used them to clone a repository and while I employ the personal access token (NOW)- The weapon of choice, I have never tried it myself.
Helm Test

Helm Test

The only advice I can give to folks who are building helm charts from scratch, is always keep it incremental and do not try to do everything at one go. At least build a decent few before you even try to attempt such a thing, else you will only end up WASTING your precious time on trivial issues which could have been avoided by incremental build, rather than the big bang approach.
Zabbix Agent

Zabbix Agent

·3 mins
In this blog I will walk you through basic steps needed to deploy a Zabbix 5 Agent on a Centos Machine. The Zabbix Release is available here. Machine # root@node4>cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) Download and install the RPM
CALICO CNI failures

CALICO CNI failures

In my cluster things went haywire all of a sudden without a proper showcase, I tried multiple things but it was just not working. Specifically my core-dns and calico-kube-controllers were not coming up and were constantly showing not ready and CrashLoop respectively
Personal Access Token

Personal Access Token

·1 min
In case you are still using the basic/auth it is time to move to personal access token. Official documentation is the best guide. Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub Enterprise Server when using the GitHub API or the command line.
Building your artifact(s)

Building your artifact(s)

·7 mins
Everything starts form a single source file and as the time goes by, it gradually transforms into multiple modules, bulky source files and a source control repository. Mostly by this time the team has already adopted a a build tool, and a repository to publish the versioned artifacts. Journey is similar for every project successful or not.
Maven Profiles

Maven Profiles

·2 mins
The concept of profiles let’s a developer define what he wants to build and what to do in specific cases. In this blog I will talk about the problem that I solved using profiles.
Ingress

Ingress

·4 mins
All right, it has been sometime since I last wrote my blog, and it has been disappointing not to have found enough time to collate and put my thoughts in a simple worded doc; better late then never. So, here I am trying to reignite the pursuit of writing at least once a week.
Om

Om

·1 min
योगस्थः कुरु कर्माणि सङ्गं त्यक्त्वा धनञ्जय ।
JUNIT5: Learning how to write the code the right way!

JUNIT5: Learning how to write the code the right way!

·2 mins
JUnit was developed by Kent Beck and Erich Gamma. Its first version was released in 1997. JUnit 5 = JUnit Platform + JUnit Jupiter + JUnit Vintage — https://junit.org/junit5/docs/current/user-guide/ It is powerful testing framework, with many modules. These modules are part of three sub-projects
Cracking CISM

Cracking CISM

·2 mins
I recently gave CISM and I believe it is easily crackable. For those who are pursuing this certification the mantra is similar (or at least the one that I followed)
Java Stream: Examples

Java Stream: Examples

·3 mins
Streams are convenient way to reduce the line of codes, but an understanding them is equally challenging. I write this blog, after realising a desperate attempt at solving a trivial problem just took overwhelming time. (Could be that I am getting old, but never late to learn things again)
Smallest Integer

Smallest Integer

·1 min
Code available here. The ask was to identify the smallest possible integer (> 0) in the array of integers. Example # 1. [-1,2] -> 1 2. [-1,-2] -> 1 3. [1,3] -> 2 I was initially thinking of using sets and then finding out the missing one, but then reaized it is simpler and I do not need sets
ReactJS: A new app `tns`

ReactJS: A new app `tns`

·2 mins
I need to write an app for a friend and what better way to brush up old concepts and write a fresh blog in doing so. So here I am, trying to put together some old and new skills together to help create a simple webapp that will have a dashboard and basic login enabled.
Secrets

Secrets

·4 mins
To manage sensitive information you create secrets k create secret --help Create a secret using specified subcommand. Available Commands: docker-registry Create a secret for use with a Docker registry generic Create a secret from a local file, directory or literal value tls Create a TLS secret Usage: kubectl create secret [flags] [options] Use "kubectl <command> --help" for more information about a given command. Use "kubectl options" for a list of global command-line options (applies to all commands). type specifies the type of secret you are creating (options are as shown above). As I need to create only key value pairs for my dummy secret file I need to know a way of how to facilitate that, and the option -h helped me there
Quotes

Quotes

·1 min
“There are a thousands excuses for failure but never a good reason..” — Mark Twain “Losers make excuses, winners make progress.” — Introduction: The Miracle of self discipline.
oAuth: 2.0

oAuth: 2.0

·4 mins
What is OAuth? # From the official definition It is protocol for Authorization It allows authorization flows for web applications, desktop applications, mobile apps etc.
CISSP: Next target

CISSP: Next target

·1 min
I just finished my upgrade to Safe Certification and now will be going for CISSP certification. Wish my luck guys! Some quotes # Effective security plans anticipates change, focuses on specific and achievable objectives, potential problems, and serves as the basis of decision making. Operational plans are the shortest and most frequently updated Tactical plans are mid term plans and supports strategical plans. Strategic plans are the long term plans (usually 5 years) and usually includes risk assessment. Data classification is the primary means by which data is protected based on its need for secrecy, sensitivity and confidentiality. Data classification is the process of organizing objects, subjects, items into groups of similarities (value, cost, vulnerability, risk, power, privilege) Stratify the process of organizing and securing data based on assigned labels of importance and sensitivity. Data classification also addresses how data is removed and destroyed. Security policy is used to assign responsibilities, define acceptable risks, define roles, specify audit requirements and indicate compliance. Security policy are not optional rather mandatory. Three types of security policies are regulatory, advisory and informative.
Identity

Identity

·1 min
What is an identity? # Identity is the link that correlates the subject and the authentication process. Without a valid identity the system has no way of establishing who the subject is? Identity enables the subject to be identified and validated, and only once it has been established and authorized it is accountable for any actions taken in the system.
GoLang: Hash

GoLang: Hash

·2 mins
Previously I talked about files, encoding in golang. In this LTD (learn to do) I will talk about hash package in general. https://blog.samarthya.me/wps/2021/01/30/golang-encoding/ Help # https://golang.org/pkg/hash/#Hash https://golang.org/pkg/crypto/#Hash.New https://golang.org/src/crypto/crypto.go?s=364:378#L6 https://golang.org/pkg/crypto/#pkg-subdirectories Package crypto collects common cryptographic constants. — Official golang documentation const ( MD4 Hash = 1 + iota // import golang.org/x/crypto/md4 MD5 // import crypto/md5 SHA1 // import crypto/sha1 SHA224 // import crypto/sha256 SHA256 // import crypto/sha256 SHA384 // import crypto/sha512 SHA512 // import crypto/sha512 MD5SHA1 // no implementation; MD5+SHA1 used for TLS RSA RIPEMD160 // import golang.org/x/crypto/ripemd160 SHA3_224 // import golang.org/x/crypto/sha3 SHA3_256 // import golang.org/x/crypto/sha3 SHA3_384 // import golang.org/x/crypto/sha3 SHA3_512 // import golang.org/x/crypto/sha3 SHA512_224 // import crypto/sha512 SHA512_256 // import crypto/sha512 BLAKE2s_256 // import golang.org/x/crypto/blake2s BLAKE2b_256 // import golang.org/x/crypto/blake2b BLAKE2b_384 // import golang.org/x/crypto/blake2b BLAKE2b_512 // import golang.org/x/crypto/blake2b ) Let’s try out a simple MD5 hasher.
GoLang: Hex Output

GoLang: Hex Output

·3 mins
In last few blogs I have written about reading commandline parameters reading files and using the os package. In this blog, I will combine some these items to read a file byte by byte using the bufio package func’s.
GoLang: Program Banner

GoLang: Program Banner

·2 mins
In the last blog I talked about command line arguments os.Args[]. In this I will try and create a sample banner program that shall Take 3 arguments n - Number of times a message has to be repeated. m - The message that needs to be shown. d - If debug message needs to be shown. I am going to use the flags package.
GoLang: Command line arguments

GoLang: Command line arguments

·1 min
Reading the golang official documentation is fun, today I saw the Variables in package os var Args []string It allows you to hold command line arguments and a simple main program that can help you validate this.
Files: GoLang

Files: GoLang

·2 mins
In the last blog, I tried reading a file in GoLang. My repository in GitHub has all the code that I write (link) Now, I will extend the same program to write to the same file.