Object Pool Pattern

Hi 👋 In this article we’ll talk about the Object Pool pattern in Golang. The Object Pool pattern is a design pattern used in situations when constructing objects is a costly operation, for example building an HTTPClient or DatabaseClient object can take some time. By having a pool of resources, the resources are requested from the pool when needed and then returned when not needed so they can be reused later....

August 21, 2022 · 5 min · Denis Nuțiu

Go Pattern: Sorting a slice on multiple keys

Hi 👋 In this article I want to highlight a simple pattern for sorting a slice in Go on multiple keys. Given the following structure, let’s say we want to sort it in ascending order after Version, Generation and Time. type TheStruct struct { Generation int Time int Version int } The way we sort slices in Go is by using the sort interface or one of the sort.Slice functions. To sort the slice after the above criteria we’ll call slice....

May 12, 2022 · 2 min · Denis Nuțiu

How to connect Ethernet devices to WiFi via WDS

Hi 👋, In this blog post I will show you how to connect an Ethernet only device to Wi-Fi using an extra router and the WDS functionality. I initially wanted to install the TP Link Archer T4U WiFi adapter driver on my Ubuntu 20.04 PC but unfortunately the driver is no longer supported. Since I really needed high internet speed for my PC, I decided to connect it via an Ethernet cable and buy another TP-Link router to use in WDS mode....

March 6, 2022 · 2 min · Denis Nuțiu

How to make RØDE audio interface work on Linux

Hi 👋, I have recently updated the firmware of my RODE audio interface from 1.12.x to 1.13, and the device was no longer working properly on Linux, it had trouble with the microphone. I found out that it was an audio sampling issue. dmesg -kH [feb21 16:20] usb 1-9.3: 1:1: cannot set freq 44100 to ep 0x82 [ +0,005008] usb 1-9.3: 1:1: cannot set freq 44100 to ep 0x82 [ +0,005019] usb 1-9....

February 21, 2022 · 1 min · Denis Nuțiu

Container log monitoring on Microk8s with Loki, Grafana and Promtail

Hi 👋 This is a short tutorial describing how to monitor your Kubernetes cluster container logs using Loki stack. But why? Because it is easier to view, filter your logs in Grafana and to store them persistently in Loki rather than viewing them in a terminal. Let’s get started! Assuming you already have Microk8s installed, enable the following addons: You can enable an add-on by running microk8s enable. Ex: microk8s enable dns...

February 17, 2022 · 3 min · Denis Nuțiu

How to install a specific Python version on Linux

Hello, 👋 In this article I will show you how to install Python versions on Linux using the following methods: compiling from source, dead snakes ppa and pyenv. To make things easier, if you want to follow along in an environment that you can break, you can create a local Kubernetes cluster using Minikube. Next, I’m going to use the following yaml file to create an Ubuntu pod: apiVersion: v1 kind: Pod metadata: name: ubuntu labels: app: ubuntu spec: containers: - image: ubuntu command: - "sleep" - "604800" imagePullPolicy: IfNotPresent name: ubuntu restartPolicy: Always Save the above yaml in a file ubuntu_pod....

February 5, 2022 · 2 min · Denis Nuțiu

BME680 Home Assistant Integration

Hi 👋, In this short article I will highlight how to use the BME680 Home Assistant integration with a BME680 Sensor. Please note that I’m running Home Assistant core on Raspbian OS. Raspberry Pi Setup Before connecting the sensor, you will need to enable the I2C interface on your Raspberry Pi and install some additional tools that are useful for debugging. To enable the I2C interface execute: sudo raspi-config Then go to Interfacing options->I2C and select yes....

January 16, 2022 · 4 min · Denis Nuțiu

How to document a project with MkDocs 📹

Hello, Welcome my third video tutorial, this time, on how to get started with MkDocs. In this video I try to give you a basic overview of MkDocs and a configuration consisting of the material theme and search plugin. Config The MkDocs configuration used in the video. site_name: My Cool Project Documentation theme: name: material features: - search.suggest - search.highlight - content.tabs.link plugins: - search nav: - Introduction: "index.md" - Tutorial: - Tutorial Subsection: "pages/tutorial/tutorial_subsection....

October 16, 2021 · 2 min · Denis Nuțiu

Running Linux GUI Applications in Windows

Hi 👋, This is a quick tutorial on how to run Linux graphical interface application in Windows using X Server’s forwarding feature. The first step is to download and install the VcXsrv Windows X Server on your 💻 Windows machine. Then, start VcXsrv with the following configuration: Ensure that VcXsrv is not blocked in Windows Firewall, it should be allowed in Public and Private networks. You may also use more restrictive firewal settings as explained in /wsl-windows-toolbar-launcher#firewall-rules....

October 2, 2021 · 1 min · Denis Nuțiu

Improving the throughput of a Producer ✈

Hello 👋, In this article I will give you some tips on how to improve the throughput of a message producer. I had to write a Golang based application which would consume messages from Apache Kafka and send them into a sink using HTTP JSON / HTTP Protocol Buffers. To see if my idea works, I started using a naïve approach in which I polled Kafka for messages and then send each message into the sink, one at a time....

August 28, 2021 · 4 min · Denis Nuțiu