Skip to content

Instantly share code, notes, and snippets.

View vladak's full-sized avatar

Vladimir Kotal vladak

  • Europe
View GitHub Profile
@vladak
vladak / openbsd-notes.md
Last active September 30, 2026 21:52
OpenBSD notes

OpenBSD notes

Automatic restart in case of troubles

The following is meant for stable machines, such as routers.

If the kernel panics, reboot automatically, i.e. do not enter ddb. Set ddb.panic=0 in /etc/sysctl.conf and run sysctl ddb.panic=0 for the change to take effect immediately.

Further, if the machine has a watchdog, use it. Enable watchdogd in /etc/rc.conf.local and set kern.watchdog.auto=0 in /etc/sysctl.conf.

@vladak
vladak / openbsd-sensors-SNMP.md
Last active September 26, 2026 20:29
Presenting OpenBSD sensors via SNMP

Presenting OpenBSD sensors via SNMP to Prometheus

The goal is to make OpenBSD sensors stored as metrics in Prometheus time-series database by scraping SNMP. For that the SNMP Prometheus exporter will be used.

Just like the PF counters (https://gist.github.com/vladak/5d2447ae774bc4886fe1ab549fff8d8b) the system sensors can be presented. These are defined in /usr/share/snmp/mibs/OPENBSD-SENSORS-MIB.txt and when the MIBs are copied to the system performing the SNMP walk, they can be displayed as follows:

snmpwalk -M +mibs -l authPriv -a SHA -A bae8aX3i -x AES -X AhChaBa8 -u grafana -v 3 gw \
    OPENBSD-SENSORS-MIB::sensorTable

where the mibs is a directory with the OpenBSD MIBs.

@vladak
vladak / WD-passport-studio.md
Last active September 14, 2026 19:13
WD My Passport Studio FW

My Passport Studio

I bought the My Passport Studio external hard drive on eBay in 2024 to provide Time machine backup to my old mac mini. Specifically I wanted something that can be connected over Firewire, to save the USB ports on the mac mini. This worked well until one day the drive died - performed I/O really slowly and made classical clicking sounds of stuck/failed hard drive head.

The disassembly of the enclosure is easy, just a bunch of screws. It is a nice enclosure, all alluminium. Replacing the internal drive with Samsung EVO SATA SSD yielded nothing - the drive was not detected. I tried bunch of other drives, esp. classic 2.5" 5400 RPM drive (from Seagate), however none worked.

When a spinning-rust drive is connected to the board, it will start spinning, so there is definitely power being passed to it, however it does not get detected. This is what Linux says:

[11948.216367] usb 1-1: new high-speed USB device number 5 using ehci-pci
@vladak
vladak / tailscale-dns-quad100-vs-global-dns.md
Last active July 11, 2026 14:22
Tailscale DNS resolution might actually be affected by ACLs

Tailscale: Quad100 vs. ACLs/grants

Consider the following Tailscale grant:

{
	"grants": [
		{
			"src": ["tag:foo"],
			"dst": ["tag:bar"],
 "ip": ["*"],
@vladak
vladak / openbsd-apu.md
Last active November 1, 2026 18:59
OpenBSD APU notes

OpenBSD APU notes

Install

serial console setup

@vladak
vladak / xstream.md
Last active February 11, 2026 15:51
xstream-1_4_21
@vladak
vladak / macmini-mid2011-eGPU.md
Last active October 28, 2026 22:26
macMini 2012 + eGPU

mac mini mid-2011 with eGPU

These are my notes on running mac mini mid-2011 with macOS HighSierra 10.13.6 with eGPU.

Hardware

original:

  • mac mini mid-2011
    • Intel Core i5 2,3 GHz
  • 16 GB DDR3 RAM
@vladak
vladak / rust-gotchas.md
Last active December 19, 2025 17:20
Rust gotchas

Learning Rust gotchas

That is, learning from C99.

Basics

  • by default variables are constant. To make a variable mutable, it has to have the mut keyword:
    • otherwise it would not compile
@vladak
vladak / jetkvm-dc-on.md
Last active July 23, 2026 11:47
JetKVM DC extension power on by default
@vladak
vladak / LG-DualUp.md
Last active April 10, 2025 11:23
LG DualUp notes