Fixing Certificate Expiration on k3s

Did you just log in to your k3s cluster and find a certificate has expired? The Problem When k3s/kubectl fails because a cert expired you might see an error like: sudo systemctl status k3s You get something like this: [x509: certificate has expired or is not yet valid Check certificate dates from your kubeconfig: kubectl config view --minify --raw \ | yq -r '.users[0].user."client-certificate-data"' \ | base64 -d \ | openssl x509 -noout -dates With the result as: ...

December 25, 2025 · 2 min · Alex Popescu

Fixing Hugo on Cloudflare

Do you want to update your Hugo website on Cloudflare to use the latest version ? And you just did that and got a wierd error version 'GLIBC_2.33' not found (required by hugo) ? 19:27:47.373 Installing Hugo 0.152.2 19:27:48.269 hugo: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by hugo) 19:27:48.270 hugo: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by hugo) 19:27:48.270 hugo: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by hugo) 19:27:48.270 hugo: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by hugo) 19:27:48.274 Failed: build command exited with code: 1 19:27:49.294 Failed: error occurred while running build command The solution is simple: ...

December 10, 2025 · 1 min · Alex Popescu

xRDP TCP/IP Improvements

Is xRDP slow on your linux vm ? Here is an easy way to improve the TCP/IP performance: Configure the TCP send buffer size Edit the file /etc/xrdp/xrdp.ini and update tcp_send_buffer_bytes tcp_send_buffer_bytes=4194304 Restart the service: systemctl restart xrdp Configure the kernel network buffer size Change the network buffer size to a larger value with using the next command: sudo sysctl -w net.core.wmem_max=8388608 And create a new file /etc/sysctl.d/xrdp.conf with the following content: ...

December 9, 2025 · 1 min · Alex Popescu

AWS Lambda and CORS preflight response

Are you struggling with a frontend application that wants to use a backend AWS Lambda API ? Do you have the next CORS problem: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response The solution is simple: implement HTTP OPTIONS method respond with the next access control headers : Access-Control-Allow-Origin, Access-Control-Allow-Headers, Access-Control-Allow-Methods For example in python you can do something like this: def return_200(): return { 'statusCode': 200, 'headers': { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET,HEAD,OPTIONS,POST,PUT', 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization', 'Content-Type': 'application/json' }, 'body': json.dumps({'message': 'ok'}) } Documentation and links: Request header field content-type - https://answers.netlify.com/t/request-header-field-content-type-is-not-allowed-by-access-control-allow-headers-in-preflight-response/54410

December 9, 2024 · 1 min · Alex Popescu

Almost Wrong Way To Send Docker Containers logs To ELK

In this article, we’ll walk through setting up a Docker-based ELK (Elasticsearch, Logstash, and Kibana) stack to collect, view, and send Docker logs. services: elasticsearch: image: elasticsearch:7.17.24 environment: - discovery.type=single-node volumes: - ./elasticsearch_data/:/usr/share/elasticsearch/data mem_limit: "1g" redis-cache: image: redis:7.4.0 logstash-agent: image: logstash:7.17.24 volumes: - ./logstash-agent:/etc/logstash command: logstash -f /etc/logstash/logstash.conf depends_on: - elasticsearch ports: - 12201:12201/udp logstash-central: image: logstash:7.17.24 volumes: - ./logstash-central:/etc/logstash command: logstash -f /etc/logstash/logstash.conf depends_on: - elasticsearch kibana: image: kibana:7.17.24 ports: - 5601:5601 environment: - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 depends_on: - elasticsearch ElasticSearch Just create a folder named elasticsearch_data for storing data. ...

October 16, 2024 · 3 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

Using Serilog with Azure Log Stream

Continuing of our previous article here, let’s explore how to show the logs in Azure Log Stream. Integrating Serilog To begin, incorporate Serilog into your project using Visual Studio or the .NET CLI: # Using Visual Studio Install-Package Serilog.AspNetCore # Using .NET CLI dotnet add package Serilog.AspNetCore Configuring Serilog Add the necessary configuration settings in your appsettings.json file, resembling the structure below: "Serilog": { "Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File"], "MinimumLevel": "Debug", "WriteTo": [ { "Name": "Console" }, { "Name": "File", "Args": { "path": "Logs/applog-.txt", "rollingInterval": "Day" } } ], "Enrich": ["FromLogContext", "WithMachineName"], "Properties": { "ApplicationName": "Your ASP.NET Core App" } } Deploying Your App to Azure Deploy your application to Azure using the steps outlined in our previous article: ...

December 6, 2023 · 2 min · Alex Popescu

Configuring CTCI Device on Windows with WiFi Adaptor

Have you ever struggled with setting up a CTCI device on Windows 10/11 with a WiFi adapter? Fear not! This guide will walk you through the process using the versatile Microsoft Loopback Adapter. Now you can using Microsoft Loopback Adaptor. Install Microsoft Loopback Adapter Begin by installing the Microsoft Loopback Adapter, also known as the Microsoft KM-TEST Loopback Adapter. You can follow a similar method outlined here Configuring After successful installation, proceed to configure the Loopback adapter with the IP address 192.168.100.1. Simultaneously, set up the CTCI device (aka [REDACTED]) with the IP address 192.168.100.2. ...

November 27, 2023 · 1 min · Alex Popescu

Overriding appsettings.json on Azure Web App

This article demonstrates how to override app settings values on Azure Web App by creating a straightforward RESTful Web API service, deploying it to Azure Web App, and then overriding specific settings. Web API Creation To start, create a simple .NET 6 application (the latest LTS version at the time of writing) using the following command: dotnet new webapi -o TestApi Next, add a sample settings in appsettings.json: "Position": { "Title": "Editor", "Name": "Joe Smith" } Create an options object to map these setting object in a file named PositionOptions.cs: ...

October 23, 2023 · 3 min · Alex Popescu

Toying with IBM Cloud Transient Servers

Last week I was toying with IBM Cloud tranzient servers, and got to setting a webhook url to be notified if the server needs to be reclaimed. In case the name doesn’t tells you anything, Transient Virtual Servers is the IBM Cloud equivalent to AWS Spot Instances. Creating a tranzient servers is easy enough trhough IBM Cloud portal, setting the webhook URL is not. It’s available only through API here In order to use SoftLayer, we need to generate a key. ...

June 4, 2023 · 2 min · Alex Popescu