Skip to content

Instantly share code, notes, and snippets.

View derjohn's full-sized avatar

derjohn derjohn

View GitHub Profile
@derjohn
derjohn / helium-run-on-crankk.sh
Last active April 22, 2025 13:06
helium-run-on-crankk
docker run -d --name miner --restart=unless-stopped --network=host --env GW_KEYPAIR=ecc://i2c-1:96?slot=0 \
--env GW_ONBOARDING=ecc://i2c-1:96?slot=15 \
--env GW_REGION=EU868 \
--env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
--env RUST_BACKTRACE=1 \
--env GW_LISTEN=0.0.0.0:1680 \
--device /dev/i2c-1 \
quay.io/team-helium/miner:gateway-latest helium_gateway server
@derjohn
derjohn / gist:415c8e270e41f7f5312e5be10256f692
Last active November 22, 2024 11:47
FreeNAS TrueNSD FreeBSD Firewall Script
#!/bin/bash
/sbin/ipfw -q -f flush #flush all other rulez
/sbin/ipfw add 10 allow all from me to me
/sbin/ipfw add 20 allow all from 80.69.32.0/20 to me
/sbin/ipfw add 21 allow all from me to 80.69.32.0/20
/sbin/ipfw add 22 allow all from 10.22.0.0/22 to me
/sbin/ipfw add 23 allow all from me to 10.22.0.0/22
/sbin/ipfw add 24 allow all from 37.24.211.168/29 to me
@derjohn
derjohn / update-huawei-matebook-firmware-linux.md
Last active November 18, 2024 07:22
Update your Huawei Matebook Pro X (and others) from the Linux shell with fwupd

Huawei Matebook BIOS update with Linux

Tested with Huawei Matebook X Pro (MACH-WX9) This is more or less a step by step tutorial, written 02/2021. Sadly at the moment Huawei does not ship a package in Linux Vendor Firmware Service.

WARNING

Please note that you can damage ("brick") your device if something goes wrong or is done incorrectly. This is for the advanced user! I can only say that I flashed the new firmware 0.1.33 to my MACH-WX9 successfully.

Original docs

dennemann.blog THX!!!

@derjohn
derjohn / gist:957c8f43fe8247b48e4cd5f6127ff8d0
Last active September 23, 2024 12:16
X11 / Wayland "Type for me" instead of pasting the clipboard. Good for services that don't accept CTRL-V
#!/bin/sh
# Hint: Wayland uses ydotool instead
# FYI: Multiline a special thing, because keyboard do not send the newline style that Linux wants
# To workaround that tr and sed are in place
# I bind that command to shift-alt-N because that's neither occupied by a Windows nor a KDE default hotkey.
xdotool sleep 0.100 type --clearmodifiers -- "$(xsel -bo | tr \\n \\r | sed s/\\r*\$//)"
blueprint:
name: Remote - Müller Lint Tint - Z2M MQTT v1
description: Control lights with a Müller-Lint Tint Switch.
domain: automation
input:
remote:
name: Remote mqtt topic
description: This must be the TOPIC from zigbee2mqtt. For example z2m/remote_1
selector:
text:
blueprint:
name: Muller Licht Remote (Zigbee2MQTT)
domain: automation
input:
remote:
name: Remote mqtt topic
description: This must be the TOPIC from zigbee2mqtt. For example z2m/remote_1
selector:
text:
target_light_1:
@derjohn
derjohn / controllino-nebra-fix-incomplete-crossgrade.sh
Last active November 3, 2023 11:19
Resurrect a Conelcom Controllino Helum Miner that _only_ listens to port 22222/ssh
#!/bin/sh
# This can only be done if the device is accessible via ssh on port 22222.
# (so, usually only Nebra can do that or you have to open the controllino and inject your ssh pubkey to /boot/config.json)
# Obviouly portr 22222 must be reachable from internet, because the management VPN is also stuck
# default looks like
# "os": {
# "sshKeys": [
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDKeee0Y4o4QhVudeJ4I8Ol4idvYXlEkzxNrU1DWDkeZ",
# ]
# },
@derjohn
derjohn / run-unsigned-jnlp.sh
Created September 15, 2023 14:38
Runs unsigned jnlps or those with a weak signature. Like the jviewer kvm shit from supermicro.
#!/bin/sh
JNLP=${1:-'./jviewer.jnlp'}
javaws -nosecurity -noupdate -verbose -property deployment.security.level=ALLOW_UNSIGNED -property deployment.security.itw.ignorecertissues=true -jnlp ${JNLP}
@derjohn
derjohn / balkongarangensolarparts.txt
Created September 4, 2023 11:02
Balkonsolar bzw. Garagensolar Partslist
Parts List Balkonsolar bzw. Garagendachsolar
1.) Panels
2x Panel 455W DAH
2.) Sicherung + Halter
2xhttps://www.ebay.de/itm/334727013860
3.) Einspiesekabel Schuko
https://www.ebay.de/itm/275435763226
@derjohn
derjohn / daemon.json
Last active July 13, 2023 14:25
Docker Config with IP address range that does not collide with the Wifi of Deutsche Bahn DB
/etc/docker/daemon.json
{
"bip" : "172.70.0.1/16",
"fixed-cidr" : "172.70.16.0/20",
"log-level" : "info",
"default-address-pools" : [
{"base" : "172.80.0.0/16", "size" : 24 },
{"base" : "172.90.0.0/16", "size" : 24 }
]