Skip to content

Instantly share code, notes, and snippets.

@defanator
defanator / vmware-fusion-serial-console-howto.txt
Created January 21, 2026 01:51
VMware Fusion serial console
Guide - https://community.broadcom.com/vmware-cloud-foundation/communities/community-home/digestviewer/viewthread?MessageKey=ccd772d2-c10e-4bbc-87f1-228fa577e19f&CommunityKey=0c3a2021-5113-4ad1-af9e-018f5da40bc0
VMX settings:
serial0.present = "TRUE"
serial0.yieldOnMsrRead = "TRUE"
serial0.fileType = "network"
serial0.fileName = "telnet://:7777"
After these are in place, boot the VM, make sure to add e.g. "console=ttyS0" to boot options, and
telnet to 127.0.0.1:7777 to interact with the VM.
@defanator
defanator / convert-p12-to-json.sh
Created December 1, 2025 17:49
Script to convert PFX / PKCS#12 bundle to JSON
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<EOF
usage: $(basename "$0") bundle.p12 outfile.json
EOF
exit 0
}
@defanator
defanator / alloy-collect-bundle.sh
Last active August 7, 2025 17:28
collect alloy support bundle from k8s deployment of grafana-k8s-monitoring helm
#!/usr/bin/env bash
# vim:sw=4:ts=4:et:
set -euo pipefail
SELF=$(basename "$0")
TS=$(TZ=UTC date "+%Y%m%d%H%M%S")
DESTDIR="alloy-support-bundles"
NAMESPACE="monitoring"
$ gdb ./print_time /tmp/print_time.22639.core
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.2) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@defanator
defanator / clock_gettime-gdb.txt
Last active June 5, 2025 13:11
watchmaker on 5.15.0-1083-aws aarch64 (abi.ptrauth_disabled=1), AWS t4g.medium
$ gdb ./clock_gettime /tmp/3472.core
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.2) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@defanator
defanator / compose.yml
Created May 14, 2025 12:55
alloy conversion from native loki to OTLP
networks:
grafana:
name: grafana
services:
loki:
container_name: loki
image: docker.io/grafana/loki:3.5.0
command: -config.file=/etc/loki/loki.yml
volumes:
@defanator
defanator / zigbee2mqtt.log
Created March 8, 2025 05:23
IKEA Rodret E2201 OTA update log
This file has been truncated, but you can view the full file.
[2025-03-07 15:14:47] info: z2m: Updating 'controls/rodret1' to latest firmware
[2025-03-07 15:14:53] info: z2m:mqtt: MQTT publish: topic 'z2m/controls/rodret1', payload '{"battery":100,"identify":null,"last_seen":"2025-03-07T15:14:53+00:00","linkquality":232,"update":{"installed_version":16777287,"latest_version":16777303,"state":"available"}}'
[2025-03-07 15:14:54] info: zhc:ota: [0x5cc7c1fffea5689e | RODRET Dimmer] Getting latest image, meta: {"fileName":"rodret-dimmer-soc_release_prod_v16777303_0a78457a-950c-4903-bfd1-67902aa66cf9.ota","fileVersion":16777303,"fileSize":268502,"url":"https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/IKEA/rodret-dimmer-soc_release_prod_v16777303_0a78457a-950c-4903-bfd1-67902aa66cf9.ota","imageType":4557,"manufacturerCode":4476,"sha512":"0f248c6036c323f5d56158b9451d1e73b1a7935b8628bdff6a58590ce2e6625b4bdd0772c5a1318eb8302ab6601170dfeed1ebc0e8eafe6de686e5b98f56c883","otaHeaderString":"GBL rodret_dimmer_soc\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00
@defanator
defanator / Vagrantfile
Created February 21, 2025 13:13
Vagrantfile for ARM macOS and VMWare Desktop/Fusion
Vagrant.configure("2") do |config|
config.vm.define "ubuntu2404_gyptazy", autostart: false do |cfg|
cfg.vm.box = "gyptazy/ubuntu24.04-server-arm64"
cfg.vm.box_version = "1.0.0"
cfg.vm.network "private_network", type: "dhcp"
#cfg.vm.synced_folder ".", "/vagrant"
cfg.vm.provision "shell",
inline: "printf \"%s\" \"vagrant ALL=(ALL:ALL) ALL\" >/etc/sudoers.d/vagrant-nopassw"
@defanator
defanator / output.txt
Created February 10, 2025 17:57
vagrant 2.4.3 issue with virtualbox 7.1.6
% vagrant
<internal:/opt/vagrant/embedded/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': ffi_prep_cif failed. status=0x2 (fatal)
from <internal:/opt/vagrant/embedded/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /opt/vagrant/embedded/gems/gems/ffi-1.17.0/lib/ffi.rb:5:in `rescue in <top (required)>'
from /opt/vagrant/embedded/gems/gems/ffi-1.17.0/lib/ffi.rb:2:in `<top (required)>'
from <internal:/opt/vagrant/embedded/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/opt/vagrant/embedded/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /Users/defan/.vagrant.d/gems/3.3.6/gems/virtualbox-0.8.6/lib/virtualbox/com/ffi/interface.rb:1:in `<top (required)>'
from <internal:/opt/vagrant/embedded/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/opt/vagrant/embedded/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
@defanator
defanator / nokia-router-cfg-tool.py
Created September 9, 2023 16:16 — forked from thedroidgeek/nokia-router-cfg-tool.py
Nokia/Alcatel-Lucent router backup configuration tool
#!/usr/bin/env python3
#
# Nokia/Alcatel-Lucent router backup configuration tool
#
# Features:
# - Unpack/repack .cfg files generated from the backup and restore functionnality
# in order to modify the full router configuration
# - Decrypt/encrypt the passwords/secret values present in the configuration