Skip to content

Instantly share code, notes, and snippets.

View jforge's full-sized avatar

jforge

  • Germany, Bargteheide
  • 00:55 (UTC +02:00)
View GitHub Profile
@jforge
jforge / jwt-decode.sh
Created June 12, 2024 11:30 — forked from angelo-v/jwt-decode.sh
Decode a JWT via command line
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904
function jwt-decode() {
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq
}
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
jwt-decode $JWT
@jforge
jforge / iperf-multicasting
Last active June 11, 2024 09:30 — forked from jayjanssen/gist:5697813
Testing multicast with iperf
this is a sample of output:
root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 226.94.1.1
Joining multicast group 226.94.1.1
Receiving 1470 byte datagrams
UDP buffer size: 122 KByte (default)
------------------------------------------------------------
@jforge
jforge / reset-pi-passwd.md
Created May 6, 2024 11:58 — forked from jlollis/reset-pi-passwd.md
Reset Forgotten Raspberry Password

Reset Forgotten Raspberry Pi Password

Remove SD Card

The first step is to turn off the Raspberry so you can remove the memory card without worry.

If the Raspberry Pi is not connected to a screen, the only way to turn it off is to unplug it. Otherwise, you can go through the GUI to turn it off properly, via the menu, before unplugging it.

Once the Raspberry Pi is turned off, you can insert the card into your computer and go to the next step.

@jforge
jforge / Meteo.py Example
Created November 12, 2023 14:38 — forked from ChristianTremblay/Meteo.py Example
Example of using BAC0 to create a BACnet device. (Meteo parser not included)
import atoma, requests
import BAC0
import re
from meteo_parser import MeteoGC
from bacpypes.basetypes import EngineeringUnits, DateTime
from bacpypes.primitivedata import CharacterString, Date, Time
from BAC0.core.devices.create_objects import (
create_AV,
@jforge
jforge / ForkMITLicensedProject.md
Created November 10, 2023 06:56 — forked from fbaierl/ForkMITLicensedProject.md
HOWTO fork a MIT licensed project

No, you are not allowed to change the copyright notice. Indeed, the license text states pretty clearly:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

But you are allowed to add a copyright notice.

If you want to keep the MIT license, which is what I would advise you to do, you only need to add a single line to the license file, before or after Copyright (c) 2012 Some Name with your own copyright notice. The final LICENSE file will look like this:

The MIT License (MIT)

@jforge
jforge / shelly_gen2_mqtt.yaml
Created November 5, 2023 12:03 — forked from arfoll/shelly_gen2_mqtt.yaml
shelly gen 2 mqtt
## configuration.yaml
automation: !include automation.yaml
switch: !include switches.yaml
binary_sensor: !include binary_sensors.yaml
sensor: !include sensors.yaml
## automation.yaml
- id: shellies_get_status
alias: Shellies Get Status
description: ''
docker images | grep -v REPOSITORY | awk 'BEGIN{OFS=":"} {print $1,$2}' | xargs -L1 docker pull
@jforge
jforge / watch.sh
Created July 28, 2023 18:08 — forked from JarredMack/watch.sh
Bash file watcher
#!/bin/sh
############
# Usage
# Pass a path to watch, a file filter, and a command to run when those files are updated
#
# Example:
# watch.sh "node_modules/everest-*/src/templates" "*.handlebars" "ynpm compile-templates"
############
description: >
MQTT demonstrator for Shellies and Tinkerforge components
metadata:
name: shelles and tinkerforge
provider: jforge
version: 1.0.0
parameters:
host:
node {
// https://registry.hub.docker.com/_/maven/
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.