Skip to content

Instantly share code, notes, and snippets.

View bjoern-r's full-sized avatar

Björn bjoern-r

  • Berlin; Germany
View GitHub Profile
@bjoern-r
bjoern-r / 103.conf
Last active March 4, 2024 04:04
Proxmox VE (privileged) lxc container for running kodi with GPU, keyboard and sound
arch: amd64
cores: 2
hostname: kodipriv
memory: 2048
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=56:94:2A:9A:8E:1B,ip=dhcp,ip6=auto,type=veth
ostype: ubuntu
parent: before_first_boot
rootfs: encrypted_zfs:subvol-103-disk-0,size=8G
swap: 512
lxc.cgroup2.devices.allow: c 226:* rwm
@bjoern-r
bjoern-r / Huawei_E3372_openwrt.md
Last active February 2, 2024 13:34
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update
@bjoern-r
bjoern-r / boot.cmd
Created January 30, 2024 16:34
fixed Armbian sunxi orangepi zero bootscript to boot from different partition than 1st
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#
setenv load_addr "0x45000000"
setenv overlay_error "false"
# default values
setenv verbosity "1"
setenv console "both"
@bjoern-r
bjoern-r / ipsec2wireshark.py
Last active December 13, 2023 22:02 — forked from rectalogic/ipsec2wireshark.py
Parse spis and keys from "ip xfrm state" output and generate a Wireshark ESP decryption config that can decrypt an ESP capture.
#!/usr/bin/env python
"""
Runs "ip xfrm state" and outputs lines to be added to ~/.wireshark/esp_sa
This process must be run using sudo.
This allows Wireshark to decrypt ipsec traffic captured with 'sudo tcpdump -vni any -U -w /tmp/esp.pcap "ip proto 50"'
"""
import sys
import subprocess
@bjoern-r
bjoern-r / xmlrpc-client.sh
Last active March 5, 2023 06:16
simple shell xmlrpc client that uses bash & curl
#!/bin/bash
# author jiyin@redhat.com
TEMP=`getopt -o vt: --long target -n 'example.bash' -- "$@"`
if [ $? != 0 ] ; then echo "getopt fail, terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
Usage() {
@bjoern-r
bjoern-r / startstopo5gs.sh
Created February 21, 2022 20:53
Simple script to start/stop/restart open5gs 5G SA services using systemd
#!/bin/sh
#### amf.yaml ausf.yaml nrf.yaml nssf.yaml pcf.yaml smf.yaml udm.yaml udr.yaml upf.yaml
NFLIST={amf,susf,nrf,nssf,pcf,smf,udm,udr,upf}
dostart() {
for nf in $NFLIST; do
echo systemctl start open5gs-${nf}d
done
}
@bjoern-r
bjoern-r / joeyl.sh
Last active May 10, 2022 07:58
script to control GB Cart reader/Writer BennVenn Joey Jr on linux
#!/bin/bash
#set -x
for drive in sd{a,b,c,d,e,f}
do
rdisk=$drive
## Warning: this will spin up the disk!
## TODO: just check for USB and or Vendor ID
if dd if=/dev/$rdisk bs=512 skip=0 count=1 status=none | grep -q BENNVENN ; then
@bjoern-r
bjoern-r / remove-subscription-banner.sh
Created April 6, 2022 10:03
remove Proxmox PVE Subscription banner cronjob
#!/bin/sh
#### add a crontab for this script
# crontab -e
# # m h dom mon dow command
# 23 0 * * * /root/remove-subscription-banner.sh
if ! fgrep -q 'void({ //Ext.Msg.show({' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; then
#echo "patching ..."
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
@bjoern-r
bjoern-r / create_start_minichroot.sh
Created April 8, 2019 19:45
Script to create a minimal chroot with busybox, dropbear and dtach and allow ssh access on port 5022
#!/bin/bash
CHROOTDIR=/opt/minichroot
mkdir -p ${CHROOTDIR}/bin
mkdir -p ${CHROOTDIR}/lib64
mkdir -p ${CHROOTDIR}/etc/dropbear
mkdir -p ${CHROOTDIR}/dev
mkdir -p ${CHROOTDIR}/tmp
@bjoern-r
bjoern-r / etc_mosquitto_conf.d_sonoff.conf
Last active October 16, 2021 20:58
sonoff POW into influxdb
#listener 1883 192.168.178.25
listener 1883
log_dest syslog
log_dest stdout
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
connection_messages true