Skip to content

Instantly share code, notes, and snippets.

Avatar
🔌
plugged in

e.g. magical unicorn lovelaced

🔌
plugged in
View GitHub Profile
@lovelaced
lovelaced / matrix_users_auth_provider.sh
Last active December 29, 2022 21:46
find matrix users who don't use the google auth provider
View matrix_users_auth_provider.sh
#!/bin/bash
# Print the usage of the script if the SERVER_URL or ADMIN_TOKEN arguments are not provided
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 SERVER_URL ADMIN_TOKEN"
exit 1
fi
# Get the SERVER_URL and ADMIN_TOKEN from the command line arguments
SERVER_URL="$1"
@lovelaced
lovelaced / parachain_devops.md
Last active February 24, 2023 05:20
Best practices: administrate a Substrate-based chain
View parachain_devops.md

Best practices for maintaining & running substrate-based (para)chain (wip)

  • Ensure all of your systems are kept up-to-date, especially with security updates.
  • Ensure you can fully bootstrap a new system from scratch easily if needed.
  • Upload archive chain backups frequently. Potentially make these available to the community down the road.
  • Have database recovery methods in place.
  • Use infrastructure as code. Never modify anything manually on your servers.
  • Ensure you have a monitoring stack set up WITH alerts (alertmanager/grafana alerts/bots etc).
  • Keep alerts actionable, otherwise they become noise.
  • If a service crashes, make sure it automatically restarts in some way (via systemd or kubernetes).
View webcam-adj.sh
#!/bin/bash
v4l2-ctl --set-ctrl=exposure_auto=1
v4l2-ctl --set-ctrl=white_balance_temperature_auto=0
v4l2-ctl --set-ctrl=exposure_absolute=900
#v4l2-ctl --set-ctrl=contrast=26
v4l2-ctl --set-ctrl=white_balance_temperature=4900
@lovelaced
lovelaced / ezviz_s6.md
Last active September 10, 2020 19:51
Use the EZVIZ S6 as a wifi webcam
View ezviz_s6.md

Using the EZVIZ S6 as a wifi webcam

I bought a cheap EZVIZ S6 "action cam" and wanted to use it as a recorded and/or livestreaming PoV cam.
Ideally, it would be available as a video capture device without an sd card and also a native Linux video device.

So I did it. Here's how you can do it:

Make sure you have a working wifi card and an ethernet connection (because your wifi card will have to connect to the camera, so you need to use ethernet for internet).

Download motion

View monitor.json
{
"version": "2.0",
"columns": 2,
"tiles": [
{"type": "PORT", "label": "Am I on fire?", "params": {"hostname": "127.0.0.1", "port": 8080}},
{"type": "HTTP-STATUS", "label": "SSL certificate is valid", "params": { "url": "https://banmebit.ch" }},
{
"type": "PING",
"label": "Localhost",
"params": { "hostname": "127.0.0.1" }
@lovelaced
lovelaced / matrix_login.sh
Last active June 15, 2020 20:35
Logging into matrix via curl
View matrix_login.sh
#!/bin/bash
MATRIX_SERVER="$2"
USER="$3"
PASSWORD="$4"
curl -XGET "https://$MATRIX_SERVER/_matrix/client/r0/login"
curl -XPOST -d '{"type":"m.login.password", "user":"$USER", "password":"$PASSWORD}' "https://$MATRIX_SERVER/_matrix/client/r0/login"
View randmatrixmsg.sh
#!/bin/bash
# Adjust homserver, room, and accesstoken to your particular setup
msgtype=m.text
homeserver="$2"
room="$3"
accesstoken="$4"
while true; do
@lovelaced
lovelaced / README.md
Last active August 31, 2019 13:48
apps/freeside/
View README.md

All you need to do is create an image in GIMP which is 160x80 (the Freeside logo is exactly these dimensions when scaled down).

Export this image in RAW format with type BMP.

Add whatever you want to the image and the clock will appear in the top right and the "invisible" battery marker will be in the top right - it will turn black when semi-low and red when low.

Watch time can be set by pressing top right button (may need a long press if it doesn't work right away).

@lovelaced
lovelaced / ff_last_accessed.sh
Created July 17, 2018 22:29
get the URL of the last accessed (most recently loaded?) loaded tab in firefox
View ff_last_accessed.sh
export opentabs=$(find ~/.mozilla/firefox*/*.default/sessionstore-backups/recovery.jsonlz4);
python3 <<< $'import os, json, lz4.block
f = open(os.environ["opentabs"], "rb")
magic = f.read(8)
jdata = json.loads(lz4.block.decompress(f.read()).decode("utf-8"))
f.close()
last_recent = 0
for win in jdata.get("windows"):
for tab in win.get("tabs"):
View keybase.md

Keybase proof

I hereby claim:

  • I am lovelaced on github.
  • I am valka (https://keybase.io/valka) on keybase.
  • I have a public key ASDQY41Yxoh__1AOC6PL5LmT-cIpBFRnEjdHn0vZGVxPoAo

To claim this, I am signing this object: