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 / 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 / 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 / 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 / 103.conf
Last active July 23, 2024 02:52
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 / 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 / quectel-5g-connect.sh
Created September 29, 2021 12:43
Script to connect a Quectel 5G modem with qmicli
#!/bin/bash
# Set traps to catch exite signals
trap stopservice SIGINT
trap stopservice SIGKILL
trap stopservice SIGTERM
function stopservice {
if [[ ! -z ${DATA_HANDLE} && ! -z ${CLIENT_CID} ]]
then
@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 / BatteryVoltageGuard.ino
Created April 14, 2020 18:52
Simple Arduino sketch to control a relais to switch a relais if the voltage read from the adc is below a certain level
/*
Battery Guard
Use an arduino nano and connect the input voltage with an voltage divider to A0
I used 9kOhm and 1kOhm to get a /10 divider to be able to measure up to 50V
Switch points are for a 12v AGM battery.
The relais is controlled via D7.
*/
#define NUM_READINGS 10
#define RELAIS_PIN 7
#define ADC_REF 5.0
@bjoern-r
bjoern-r / codimd-oauth2.md
Last active November 2, 2019 18:14
CodiMD docker with Oauth2 via

CodeiMD authentication via Oauth2 with django-oidc-provider

install django-oidc-provider

create application in django-oidc-provider

Configure allowed callback urls:

https://pad.server.com/auth/oauth2/callback
http://pad.server.com/auth/oauth2/callback

Configure scopes:

@bjoern-r
bjoern-r / busybox-static-chroot.md
Last active April 9, 2019 06:30
busybox static chroot

create user

usermod -G chrootlogin joe

add to sshd_config

change file /etc/ssh/sshd_config

Subsystem sftp internal-sftp