Environment variables at build time with Docker

Introduction Do you need a certain environment variable at build time in Docker as opposed to runtime? There is an easy way to achieve this. Use Docker build arguments in combination with environment variables. An example of this is below of a React JS docker build that needs the environment variable REACT_APP_BACKEND_API and build time in the command npm run build. # Declare the build argument in the global scope ARG REACT_APP_BACKEND_API_ARG=TEST # Use an official Node runtime as a parent image FROM node:20-alpine # Set the working directory WORKDIR /app # Copy package....

August 1, 2024 · 2 min · Alex Popescu

Build Go with AIX

Introduction Did you ever wanted to program go in AIX ? Now you can. Installing GoLang on AIX First, add /opt/freeware/bin to the beginning of the current PATH. For example: export PATH=/opt/freeware/bin:$PATH Next install Go on AIX (and increase /opt and /var sizes if needed): chfs -a size=+512M /opt chfs -a size=+260M /var dnf install golang Create a sample program Next, let’s create a sample Go Hello World program: package main import "fmt" func main() { fmt....

July 19, 2024 · 1 min · Alex Popescu

Ubuntu Desktop with XRDP: A Quick Guide

Introduction Have you ever wanted to install Ubuntu Desktop and configure it with XRDP? Here’s a short guide to get you through it. Step 1: Installing Ubuntu Desktop Let’s start by installing Ubuntu Desktop. Just run this command: sudo apt -y install ubuntu-desktop Grab a coffee while your terminal goes wild with text. It takes some time for the packages to install. Step 2: Installing XRDP Next, install XRDP to allow remote access:...

June 15, 2024 · 1 min · Alex Popescu

Azure AD Authentication for C# WebAPI with Swagger

Introduction Have you ever wanted to add Azure AD authentication to a C# WebApi project for .NET 8? Now you can. The Code First, let’s create a new WebAPI project: dotnet new webapi --use-controllers Next, add the required package: dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer Next, we need to add the Azure AD settings in appsettings.json: "AzureAd": { "Instance": "https://login.microsoftonline.com/", "TenantId": "yyyy", "ClientId": "xxxxx" } Replace yyyy with the correct TenantId and xxxxx with the correct Azure SPN Client Id....

April 23, 2024 · 2 min · Alex Popescu

Automated Fake Database Population with Python

Introduction In this article, we’ll explore a Python script that leverages mimesis library to populate an (Azure) SQL database with fake data. The Code import logging import random import pandas as pd import pymssql import sqlalchemy from dotenv import dotenv_values from mimesis import Address, Datetime, Person from mimesis.enums import Gender from sqlalchemy import create_engine # Load environment variables config = dotenv_values(".env") # Configure logging to both console and file logFormatter = logging....

March 17, 2024 · 3 min · Alex Popescu