Skip to content

Instantly share code, notes, and snippets.

View GalaxyGorilla's full-sized avatar

Sascha Kattelmann GalaxyGorilla

View GitHub Profile
@GalaxyGorilla
GalaxyGorilla / Vagrantfile
Last active November 3, 2025 19:18
Vagrantfile for embedded development using e.g. Yocto or Buildroot
# Vagrantfile — Ubuntu 24.04 ARM64 for Yocto/Buildroot on macOS (Apple Silicon)
# VMware Fusion/Workstation; clean, reproducible, zsh+vim environment
DATA_DISK_SIZE = ENV.fetch('DATA_DISK_SIZE', '128G')
GIT_USER_NAME = ENV.fetch('GIT_USER_NAME', 'Sascha Kattelmann')
GIT_USER_EMAIL = ENV.fetch('GIT_USER_EMAIL', 'sascha.kattelmann@stritzinger.com')
required_plugins = %w[vagrant-scp vagrant-exec vagrant-ssh]
required_plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
@GalaxyGorilla
GalaxyGorilla / gist:149899b62ef30d3b0b3447e457cda667
Created July 10, 2024 14:33
CycloneDX GRiSP Update Example
{
"bomFormat": "CycloneDX",
"specVersion": "1.5",
"serialNumber": "801841df-1cff-490a-8160-5ef9fdf515fb",
"version": 1,
"metadata": {
"timestamp": "2024-07-10T14:32:59Z",
"tools": [
{
"name": "rebar3_sbom",
@GalaxyGorilla
GalaxyGorilla / prom_to_json
Last active February 3, 2023 09:09
Erlang escript to convert prometheus text format to an Erlang structure suitable to throw into JSON converters. Untyped metrics are ignored.
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -sname prom_to_json
main([File]) ->
{ok, Bin} = file:read_file(File),
io:format("~p~n", [prom_to_json(Bin)]).
prom_to_json(Bin) ->
Bin1 = normalize_line_breaks(Bin),
@GalaxyGorilla
GalaxyGorilla / gist:02e1f563ca545803a8106ce17e35bf8f
Created January 29, 2021 10:52
RT2 success case zebra 'debug mpls'
2021/01/29 11:48:56 ZEBRA: Setting netlink socket receive buffer size: 212992 -> 180000000
2021/01/29 11:48:56 ZEBRA: Setting netlink socket receive buffer size: 212992 -> 180000000
2021/01/29 11:48:56 ZEBRA: Setting netlink socket receive buffer size: 212992 -> 180000000
2021/01/29 11:48:56 ZEBRA: zebra 7.6-dev-20210122-00-g005d4ebfa starting: vty@2601
2021/01/29 11:48:56 ZEBRA: [EC 100663299] buffer_flush_available: write error on fd 2: Bad file descriptor
2021/01/29 11:48:56 ZEBRA: [EC 100663304] ERROR: Command returned Warning Config Failed on config line 1: log file zebra.log
2021/01/29 11:48:56 ZEBRA: [EC 100663299] buffer_flush_available: write error on fd 2: Bad file descriptor
2021/01/29 11:48:56 ZEBRA: 0: IF lo IP 2.2.2.2/32 address add/up, scheduling MPLS processing
2021/01/29 11:48:56 ZEBRA: 0: IF eth-sw1 IP 10.0.1.0/24 address add/up, scheduling MPLS processing
2021/01/29 11:48:56 ZEBRA: 0: IF eth-rt4-1 IP 10.0.2.0/24 address add/up, scheduling MPLS processing
@GalaxyGorilla
GalaxyGorilla / gist:e5ab38f2d3d1114b689abe7d3b4e6731
Created January 29, 2021 10:51
RT2 success case OSPF 'debug sr'
2021/01/29 11:48:56 OSPF: RI (ospf_router_info_init): Initialize Router Information
2021/01/29 11:48:56 OSPF: EXT (ospf_ext_init): Register Extended Link Opaque LSA
2021/01/29 11:48:56 OSPF: EXT (ospf_ext_init): Register Extended Prefix Opaque LSA
2021/01/29 11:48:56 OSPF: ospfd 7.6-dev-20210122-00-g005d4ebfa starting: vty@2604
2021/01/29 11:48:56 OSPF: RI (ospf_router_info_register): Register Router Information with scope Area(10)
2021/01/29 11:48:56 OSPF: RI (initialize_params): Initialize Router Info for Area scope
2021/01/29 11:48:56 OSPF: SR: Segment Routing: OFF -> ON
2021/01/29 11:48:56 OSPF: SR (ospf_sr_start): Start Segment Routing
2021/01/29 11:48:56 OSPF: |- Created new SR node for 2.2.2.2
2021/01/29 11:48:56 OSPF: SR (ospf_zebra_label_manager_connect): Successfully connected to the Label Manager
@GalaxyGorilla
GalaxyGorilla / gist:e5ec1c6ed6e683cdf1da6973f188aea3
Created January 29, 2021 10:43
RT2 failed case zebra 'debug mpls'
2021/01/29 11:33:24 ZEBRA: Setting netlink socket receive buffer size: 212992 -> 180000000
2021/01/29 11:33:24 ZEBRA: Setting netlink socket receive buffer size: 212992 -> 180000000
2021/01/29 11:33:24 ZEBRA: Setting netlink socket receive buffer size: 212992 -> 180000000
2021/01/29 11:33:24 ZEBRA: zebra 7.6-dev-20210122-00-g005d4ebfa starting: vty@2601
2021/01/29 11:33:24 ZEBRA: [EC 100663299] buffer_flush_available: write error on fd 2: Bad file descriptor
2021/01/29 11:33:24 ZEBRA: [EC 100663304] ERROR: Command returned Warning Config Failed on config line 1: log file zebra.log
2021/01/29 11:33:24 ZEBRA: [EC 100663299] buffer_flush_available: write error on fd 2: Bad file descriptor
2021/01/29 11:33:24 ZEBRA: 0: IF lo IP 2.2.2.2/32 address add/up, scheduling MPLS processing
2021/01/29 11:33:24 ZEBRA: 0: IF eth-sw1 IP 10.0.1.0/24 address add/up, scheduling MPLS processing
2021/01/29 11:33:24 ZEBRA: 0: IF eth-rt4-1 IP 10.0.2.0/24 address add/up, scheduling MPLS processing
@GalaxyGorilla
GalaxyGorilla / gist:806b5317a2f991b33a5f4d72106165d8
Created January 29, 2021 10:41
RT2 failed case OSPF 'debug sr'
2021/01/29 11:33:24 OSPF: RI (ospf_router_info_init): Initialize Router Information
2021/01/29 11:33:24 OSPF: EXT (ospf_ext_init): Register Extended Link Opaque LSA
2021/01/29 11:33:24 OSPF: EXT (ospf_ext_init): Register Extended Prefix Opaque LSA
2021/01/29 11:33:24 OSPF: ospfd 7.6-dev-20210122-00-g005d4ebfa starting: vty@2604
2021/01/29 11:33:24 OSPF: RI (ospf_router_info_register): Register Router Information with scope Area(10)
2021/01/29 11:33:24 OSPF: RI (initialize_params): Initialize Router Info for Area scope
2021/01/29 11:33:24 OSPF: SR: Segment Routing: OFF -> ON
2021/01/29 11:33:24 OSPF: SR (ospf_sr_start): Start Segment Routing
2021/01/29 11:33:24 OSPF: |- Created new SR node for 2.2.2.2
2021/01/29 11:33:24 OSPF: SR (ospf_zebra_label_manager_connect): Successfully connected to the Label Manager
OSPF Segment Routing database for ID 2.2.2.2
SR-Node: 5.5.5.5 SRGB: [16000/23999] SRLB: [15000/15999] Algo.(s): SPF MSD: 8
Prefix or Link Node or Adj. SID Label Operation Interface Nexthop
------------------ --------------------- -------------------- --------- ---------------
5.5.5.5/32 SR Pfx (idx 50) Swap(16050, 16050) eth-sw1 10.0.1.3
Swap(16050, 16050) eth-rt4-1 10.0.2.4
Swap(16050, 16050) eth-rt4-2 10.0.3.4
Inbound Label Type Nexthop Outbound Label
----------------------------------------------------
15000 SR (OSPF) 10.0.2.4 implicit-null
15001 SR (OSPF) 10.0.2.4 implicit-null
15002 SR (OSPF) 10.0.3.4 implicit-null
15003 SR (OSPF) 10.0.3.4 implicit-null
15006 SR (OSPF) 10.0.1.3 implicit-null
15007 SR (OSPF) 10.0.1.3 implicit-null
16020 SR (OSPF) lo -
16030 SR (OSPF) 10.0.1.3 16030
2021/01/25 13:56:07 OSPF: RI (ospf_router_info_init): Initialize Router Information
2021/01/25 13:56:07 OSPF: EXT (ospf_ext_init): Register Extended Link Opaque LSA
2021/01/25 13:56:07 OSPF: EXT (ospf_ext_init): Register Extended Prefix Opaque LSA
2021/01/25 13:56:07 OSPF: ospfd 7.6-dev-20210122-00-g005d4ebfa starting: vty@2604
2021/01/25 13:56:07 OSPF: MPLS-TE(ospf_mpls_te_new_if) Add new Inactive interface lo to MPLS-TE list
2021/01/25 13:56:07 OSPF: MPLS-TE(initialize_linkparams) Initialize Link Parameters for interface lo
2021/01/25 13:56:07 OSPF: MPLS-TE(initialize_linkparams) Could not find corresponding OSPF Interface for lo
2021/01/25 13:56:07 OSPF: OSPF MPLS-TE: Abort update TE parameters: no Link Parameters for interface
2021/01/25 13:56:07 OSPF: OSPF MPLS-TE New IF: Add new LP context for lo[0/17]
2021/01/25 13:56:07 OSPF: MPLS-TE(ospf_mpls_te_new_if) Add new Inactive interface eth-sw1 to MPLS-TE list