set -euo pipefail
2023-04-17Use set -euo pipefail
in the beginning of your bash files. Here is a comic explaining why: https://wizardzines.com/comics/bash-errors/
If you use Zigbee2MQTT, this is a quick way to find all your connected devices:
# print friendly names of all devices
mosquitto_sub -h $HOST -t "zigbee2mqtt/bridge/info" -C 1 | jq '.config.devices[].friendly_name'
# with the friendly names, you can for example turn a light on:
mosquitto_pub -h $HOST -t "zigbee2mqtt/$FRIENDLY_NAME/set" -m '{"state": "ON", "brightness": 255}'
Play SomaFM from shell
2022-08-11Simple shell alias to play your favorite internet radio.
"I can't read that", "Could you zoom in a bit?" – sharing your entire ultra wide screen with more than 3000 pixels across is a burden for your colleagues who watch on a full HD display. Make their and your life easier by sharing just a section of your screen.
An underrated feature of KeePass2 is its trigger system. It allows a lot of custom behaviour. Let's use it to make working with multiple kdbx files enjoyable!
Want to use both, dark and light theme, but need a simple way to toggle between them? Search no more.
JWT with Django REST framework
2020-08-18Django REST framework already provides an easy way to issue JSON Web Tokens. But what if you only want to validate tokens issued by another server?