Posts

nodeenv: Isolated node runtimes on MacOS

nodeenv allows to create isolated node runtimes per project which resembles to virtual environments in python world. In enterprise projects, where multiple projects are built against different versions of node runtime and dependencies, it is advantageous to have nodeenv to install multiple versions of node runtimes at project level. Install nodeenv brew install nodeenv or pip install nodeenv List available node runtime versions nodeenv --list Create latest node version as virtual environment nodeenv .nodeenv Create a specific node version as virtual environment nodeenv --node=14.15.0 .nodeenv Activate a virtual environment source .nodeenv/bin/activate Verify node and npm version node --version npm --version Install a package scoped to the virutal environment npm install -g cypress Deactivate or exit from virtual environment deactivate_node Delete the virtual environment rm -rf .nodeenv

GitOps - Viewing and Creating git tags

In a team following continuous delivery based on git tags or otherwise popularly known as GitOps, there will be a frequent need to list the existing tags in a repository in chronological order so that a new tag can be created based on recent commit (HEAD) from master / main branch. The following chained command will list all the remote tags in chronological order along with latest commit, so that new release tags can be quickly created through command line. List all annotated tags name with the commit SHA in chronological order along with recent commit id git fetch origin && git checkout master && git pull && git ls-remote --tags --sort=creatordate origin && git log -n 1 Create a new tag based on master / main branch or specific commit SHA and push the tag to remote server tag_name="production-v1.0" && git tag -a $tag_name master -m "Production version 1.0" && git push origin $tag_name

Creating python virtual environments on Mac OS with pyenv

Using pyenv Install pyenv through homebrew: brew install pyenv List installed versions of python: pyenv versions List available versions of python that can be installed: pyenv install --list Virtual environment for python 3: Install a specific version of python: pyenv install 3.9.0 NOTE for Big Sur (MacOS 11) users: If the install command fails, then try the command as SYSTEM_VERSION_COMPAT=1 pyenv install 3.9.0 Uninstall a version of python: pyenv uninstall 3.9.0 Switch to specific version of python in local terminal window: pyenv local 3.9.0 Switch to specific version of python globally: pyenv global 3.9.0 Switch to specific version of python using environment variable: export PYENV_VERSION=3.9.0 Get pyenv root directory: pyenv root Access the python installation: pyenv exec python --version Create a virtual environment from specific python version: pyenv exec python -m venv .venv Source the virtual environment source .venv/bin/activate Virtual environment for python 2: Install ...

Empowering Backend Engineering Team

Image
I am writing this blog to share the ideas and concepts which will empower the backend developer, devops engineer and QAs. Terraform Presentation Slide These ideas are not tied or limited to particular framework or libraries or cloud providers, instead these can be in many different ways using different tool sets which the team might already be familiar with. To achieve these end goals, the backend application and devops toolsets should be complementing each other in various aspects. I am going to list out the desired features I would like to have in my project / team under various categories. I have also created the following sample repositories on github to showcase these ideas in a simplified way. Sample Java Spring Boot application with Maven: https://github.com/harishkannarao/MySpringBoot Sample QA Acceptance tests with Gradle: https://github.com/harishkannarao/gradle-qa-acceptance-tests Sample Infrastructure as Code in AWS with Terraform: https://github.com/ha...

Install and Switch multiple versions of Java JDK on Linux or MacOS

While working on enterprise level, we often have java projects running on older versions of java for legacy reasons. Hence it is not very uncommon for a developer to have multiple versions of JDK installed in their machines and easy way to switch different versions of JDK on demand for running the build. This blog explains the steps needed to setup and configure multiple JDK versions on Mac OS. Get the architecture of the Machine from Terminal using: uname -m Create a directory for installation: mkdir -p $HOME/tools/java Download java binaries: Download java 25 and 21 binary for Linux / Mac OS operating system with the correct architecture type to directory $HOME/tools/java Download URL https://adoptium.net/en-GB/temurin/releases?mode=filter&os=any&arch=any Extract and rename java binaries: find $HOME/tools/java -type f -name OpenJDK25*.tar.gz | xargs -I {} mv {} $HOME/tools/java/OpenJDK25.tar.gz find $HOME/tools/java -type f -name OpenJDK21*.tar.gz | xargs -I {} mv {} $HOM...

Docker Community Edition download without login

Docker recently changed their download mechanism, which prevented users from downloading the Community Edition without log in. In my opinion, the registration and login should be an optional step instead of a mandatory field. Hence I am listing the download link for Mac OS and Windows OS that allows downloading the Docker Community Edition without having to register an account with login. Mac OS: https://download.docker.com/mac/stable/Docker.dmg Windows OS: https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe

Kotlin / Ktor / Jdbi Json / Api / Free Marker / VueJs

Image
About this blog A brief reason for writing this blog. I am a server side http api / web developer predominantly using JVM based languages. Recently I started using Kotlin programming language (developed by JetBrains) with Spring Boot Framework on AWS cloud to build an enterprise solution (including both API and small web portal for internal Admins) to serve data for the mobile apps. I loved Kotlin as a programming language for Server Side development. So I was curious to explore Ktor Framework (developed and sponsored by JetBrains) for Server Side Web Development (API & Webpages). Hence I created a sample repository in Git Hub to play with Ktor Framework to experiment with various enterprise grade features offered by Ktor Framework. Please read this blog in conjuction with my Kotlin repository available at https://github.com/harishkannarao/kotlin High Level Components Diagram API The API development was very very simple with Jackson / Google GSON integration. The...