Skip to content

Instantly share code, notes, and snippets.

View szampardi's full-sized avatar

Silvano Zampardi szampardi

View GitHub Profile

Brother DCP-L2540DW on Arch Linux

Printer

The printer driver can be installed with the brother-brgenml1 AUR package.

@szampardi
szampardi / meshtastic_pio_heltec_v2.0.md
Created April 30, 2026 08:13 — forked from KunYi/meshtastic_pio_heltec_v2.0.md
build meshtastic firmware for heltec LoRa 32 v2.0

Build meshtastic firmware (2.5.16.c3d60342) for Heltec LoRAa 32 v2

$ mkdir -p /tmp/pio
$ cd /tmp/pio
$ virtualenv .
$ source bin/activate
$ pip install -U platformio
$ git clone https://github.com/meshtastic/firmware.git --recurse-submodules # pull source code
$ cd firmware
@szampardi
szampardi / README.md
Created September 1, 2025 13:23
archlinuxarm raspberrypi broken brcmfmac

ref https://archlinuxarm.org/forum/viewtopic.php?f=9&t=17095#p73046

I had the exact same problem. It seems to be related to the combination of some AP models and Raspberry Pi and is caused by a new feature which is supposed to lower CPU usage.

This worked for me as a workaround:

  • Create a new config file "/etc/modprobe.d/brcmfmac.conf".
  • Add the following line "options brcmfmac feature_disable=0x2000".
  • Save and reboot.
@szampardi
szampardi / smbios_pve.sh
Last active March 24, 2025 07:11 — forked from xrobau/extract.sh
smbios/msdm pve
#!/bin/bash
# On the 'donor' machine, boot a live linux ISO (Ubuntu or whatever)
# and connect it to the internet. Then run these commands, which will
# dump the contents to sprunge.us so you can retrieve them easily. Or
# copy them manually, whatever.
mkdir -p /tmp/MSDM
cd /tmp/MSDM
for f in SLIC MSDM; do

[guide] keycloak authentication for proxmox

How to setup Proxmox to use Keycloak as authentication realm.

Proxmox Setup

root@proxmox:/etc/pve# cat domains.cfg
pam: pam
        comment Linux PAM standard authentication
@szampardi
szampardi / openvpn_statuslog_json.sh
Last active September 24, 2024 12:18
openvpn status.log routing table to json
#!/usr/bin/env bash
ovpn_statuslog_json() {
local _status_log=${1:-"/var/log/openvpn/status.log"}
local _grep_routing_table='^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'
local _sed_csv_lines_to_array='s/^/["/g;s/,/","/g;s/$/"]/g'
local _jq_template='{
"virtual_address": .[0],
"common_name": .[1],
"real_address": (.[2]|split(":")[0]),
#!/bin/bash -e
GOVERNOR=${2:-conservative}
n=0
case "${1}" in
s | set)
for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
printf 'CPU%d\t[ %s -> %s ]\n' ${n} $(<"/sys/devices/system/cpu/cpu${n}/cpufreq/scaling_governor") "${GOVERNOR}"
echo "${GOVERNOR}" >/sys/devices/system/cpu/cpu${n}/cpufreq/scaling_governor
n=$((n+1))
@szampardi
szampardi / renamer.go
Last active February 29, 2024 00:25
cleanup file and dir names in a given path
package main
import (
"flag"
"fmt"
"os"
"path"
"regexp"
"strings"
"unicode"
#!/usr/bin/env bash
_lang=nato
while getopts ":l:" opt; do
case "${opt}" in
l) _lang="${OPTARG}" ;;
esac
done
shift $((OPTIND - 1))
FROM alpine
RUN apk update; \
apk --no-cache upgrade; \
apk add --no-cache bash
SHELL ["/bin/bash", "-o", "pipefail", "-xec"]
RUN apk add --no-cache autoconf automake file gcc git libcap-static libcap-ng libcap-ng-dev libcap-ng-static libnsl-static libltdl-static libtool linux-headers lz4-dev lz4-static make musl-dev openssl1.1-compat-dev openssl1.1-compat-libs-static pkgconfig
WORKDIR /usr/local/src/openvpn
RUN git clone --branch=v2.5.8 --depth=1 https://github.com/OpenVPN/openvpn $(pwd)
RUN autoreconf -i -v -f; \
./configure --enable-static --enable-iproute2 --disable-shared --disable-plugins --disable-selinux-build --disable-tap --disable-lzo; \