Debian has been my primary Linux distribution of choice since 2003. That’s twenty years! How time flies! I haven’t ever worked as full-time server administrator but running and operating various kinds of systems have always been part of my skills, and it has made it possible for me to leverage wide range of tooling required […]
Capturing Packets on Windows with Packet Monitor (Pktmon)
As https://learn.microsoft.com/en-us/windows-server/networking/technologies/pktmon/pktmon puts it: Packet Monitor (Pktmon) is an in-box, cross-component network diagnostics tool for Windows. It can be used for packet capture, packet drop detection, packet filtering and counting. Nice thing about it is that it is present by default on all modern Windows versions, so you can do a quick packet capture when […]
Parametrizing Test Functions with Pytest
I will first create a class that is used for representing the Zabbix protocol flags (zabbix_flags.py): Subclassing enum.IntFlag is very suitable for this purpose, and enum.auto() can be used to represent the flag values. I have four test functions to check that the flag values work as expected (test_zabbix_flags.py): Let’s create a virtual environment and […]
Python Versions
Even though I’ve used Python programming language on-and-off since about year 2000, I only started paying more attention to specific Python versions around 2016 when I gradually started using Python more seriously in devops. When dealing with different runtime environments it is crucial to know which features are available in which Python versions. This page […]
Using Tmux
A long time ago I discovered screen. It made it possible to start applications in Linux and then disconnecting the SSH session, without stopping the applications. It was magic: otherwise the the applications just terminated if the SSH connection was lost. Then I heard about tmux. It was like screen on steroids! I could split […]
Serial Console Server on Raspberry Pi
Short one: How to make a serial console server (or terminal server) with a Raspberry Pi and USB-serial adapter. Update in December 2024: It seems the newer ser2net versions use /etc/ser2net.yaml as the configuration file. This is an example of an accepter line: Connect the serial port to whatever device you want to use for […]
Data Buffering in Zabbix Proxy
One of the features of Zabbix proxy is that it can buffer the collected monitoring data if connectivity to Zabbix server is lost. In this post I will show it happening, using packet capture, or packet analysis. Zabbix setup and capturing Zabbix proxy traffic This is the setup in this demo: For simplicity, the agent […]
LLD Filtering with Macros in Zabbix
When configuring monitoring and using templates in Zabbix you often see low-level discovery (LLD) used for finding out the monitored components or features of a host. In this post I will explain how user macros and regular expressions are used in LLD for filtering the discovery results. I’m using the Network Generic Device by SNMP […]
Count Lines of Python Code
I have created a new application called lopc (Lines of Python Code). It is available for install with pip on PyPI (https://pypi.org/project/lopc/), and the source code is available on GitHub: https://github.com/markkuleinio/lopc The app really only counts the number of non-empty and non-comment lines of *.py files in the given directories. These are some features of […]
Python f-String Formatting Codes
Here is my short list about the common f-string formatting codes in Python: >>> score = 123.728 >>> f”{score}” ‘123.728’ Minimum field length: >>> f”{score:>10}” ‘ 123.728’ >>> f”{score:<10}” ‘123.728 ‘ >>> f”{score:^10}” ‘ 123.728 ‘ Number of decimals: >>> f”{score:.2f}” ‘123.73’ >>> f”{score:10.2f}” ‘ 123.73’ >>> f”{score:<10.2f}” ‘123.73 ‘ Padded with a character: >>> […]