Endianness

Let’s talk about byte ordering. You look at your packet bytes in Wireshark and see this data for a 16-bit integer field: If the data is said to be big-endian, then it is 0x0c4a = 3146 in decimal. If the data is said to be little-endian, then it is 0x4a0c = 18956 in decimal. So, […]

Zabbix 7.0 Proxy Load Balancing

One of the new features in Zabbix 7.0 LTS is proxy load balancing. As the documentation says: Proxy load balancing allows monitoring hosts by a proxy group with automated distribution of hosts between proxies and high proxy availability. If one proxy from the proxy group goes offline, its hosts will be immediately distributed among other […]

More Mocking with Pytest

In my Basic Mocking with Pytest post I showed simple cases. Now let’s do more mocking. First I’ll create the environment for my code: $ mkdir more-mocking$ cd more-mocking$ python3 -m venv venv$ . venv/bin/activate(venv)$ pip install -U pip wheel…Successfully installed pip-24.0 wheel-0.43.0(venv)$ pip install pynetbox pytest…Successfully installed certifi-2024.2.2 charset-normalizer-3.3.2 idna-3.7 iniconfig-2.0.0 packaging-23.2 pluggy-1.5.0 pynetbox-7.3.3 […]

Datetimes with Timezones in Python

First, let’s show how the commonly-used plain datetime.datetime.now() gets the local time but does not have a timezone: >>> import datetime >>> now = datetime.datetime.now() >>> type(now) <class ‘datetime.datetime’> >>> now datetime.datetime(2024, 2, 17, 12, 47, 40, 34210) >>> print(now) 2024-02-17 12:47:40.034210 >>> now.tzinfo is None True >>> Let’s add timezone to it, using the […]