Skip to content

Instantly share code, notes, and snippets.

View vladak's full-sized avatar

Vladimir Kotal vladak

  • Europe
View GitHub Profile
@vladak
vladak / circuit_python_logging.md
Last active December 16, 2022 19:42
CircuitPython logging vs CPython logging

CircuitPython logging vs CPython logging

Note: this was written before support for multiple handlers per logger was added to CircuitPython logging.

Logger hierarchy

In CPython, there is a hierarchy of loggers. Each logger except the root logger has a parent. When a log record is handled for particular logger, the hierarchy is traversed until either the propagate flag of given logger is found to be False, or root logger is encountered.

@vladak
vladak / snmp_exporter-service.md
Created September 11, 2022 20:34
SNMP exporter service

SNMP exporter service

This is meant for Debian/Ubuntu.

wget -O /tmp/snmp_exporter.tgz \
    https://github.com/prometheus/snmp_exporter/releases/download/v0.20.0/snmp_exporter-0.20.0.linux-armv7.tar.gz
sudo mkdir -p /srv/snmp_exporter
sudo chown pi:pi /srv/snmp_exporter
@vladak
vladak / 1-grafana-truenas.md
Last active September 11, 2022 20:38
TrueNAS dashboard for Grafana

TrueNAS dashboard for Grafana

This setup is basically using the configuration from https://crashlaker.github.io/2021/10/09/truenas_snmp_exporter.html

It assumes Prometheus as data backend. Also, nas.local is the NAS machine hostname used throughout this Gist.

This note is a bit of a experiment with Gists.

The end result looks like this: grafana-NAS

@vladak
vladak / solokey-ssh.md
Last active October 2, 2024 19:33
Solokey setup for SSH

This is meant for Ubuntu 20.04.4 LTS and Solokey Somu

The purpose of the key is backup key (in case all my Yubikeys and smart phone get lost), hence the resident SSH key and 2FA setup for the Github account.

Initial setup

python3 -m venv env
. ./env/bin/activate
@vladak
vladak / sun-booklet.md
Last active April 27, 2022 07:05
Sun Microsystems - What we must do

Sun Microsystems - What we must do

A 2005 booklet with mission statement from Scott McNealy.


What we must do.

Participate or perish ?

@vladak
vladak / 1-pf-grafana.md
Last active May 12, 2023 09:37
setup for PF monitoring in Grafana

Presenting PF counters in Grafana

using https://yetiops.net/posts/openbsd-snmp-exporter/

The goal is to present basic metrics such as bytes passed through the external interface of the router. The main idea is to run SNMP on the OpenBSD router that can get the metrics from PF. Then SNMP exporter from Prometheus will convert the data to Prometheus format that can be scraped by Grafana.

The constraint is that this should be done in reasonably secure way: the IoT devices are in separate VLAN, however the router should have miminal exposure. Using snmpd with privilege separation and in flight data protection is sufficient. Further, the data collection and graphing will be done on single machine.

The result looks like this: Grafana PF dashboard

@vladak
vladak / freebsd-ktls-build.md
Last active February 4, 2022 10:17
FreeBSD KTLS build
@vladak
vladak / openssl-1.x-FIPS.md
Last active October 19, 2021 12:25
OpenSSL 1.x FIPS signature

OpenSSL 1.x FIPS embedded signature test

This gist contains my notes about how the FIPS selftest signature check works in OpenSSL 1.x. Assumes basic awareness of the OpenSSL FOM (FIPS Object Module). My focus for this case is Solaris on SPARC.

The goal is to examine some of the inner workings of FIPS signature verification.

The FOM is built as fipscanister.o using designated code and linked into common OpenSSL build. When the libcrypto.so library is loaded, the FOM will perform self test. If the self test fails, the running program is abort()ed.

@vladak
vladak / openbsd-octeon.md
Last active September 27, 2024 20:30
OpenBSD octeon

OpenBSD octeon notes

These are my personal notes on how to run/use OpenBSD on Ubiquiti Edgerouter, specifically for Edgerouter 4. I installed OpenBSD bunch of releases back and keep upgrading. Perhaps some of the issues highlighted below would not happen on fresher install.

Console

Use the Cisco RJ45 Male to DB9 Female console cable + the Aten USB to serial converter.

from Ubuntu

@vladak
vladak / freebsd-vbox.md
Last active January 3, 2022 17:26
FreeBSD on VirtualBox
# pre-flight check
VBoxManage list ostypes | grep FreeBSD

# new VM
VM=FreeBSD
zfs create tank/vm/vkotal/$VM
VBoxManage createvm --basefolder /tank/vm/vkotal --name $VM --ostype FreeBSD_64 --register

# CPU