This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# | |
# A simplified 'token-demo'. | |
# Driven by a number of envieonment variables, | |
# this code example illustrates the extraction of a token from the Stack keycloak server | |
# and then the invokation of a (non-CSRF) API endpoint using that toekn. | |
# | |
# Tested with Python 3.12.3 and requires 'requests' (and tested with 2.32.2). | |
# Last tested 6th June 2024 against the legacy Fragalysis Stack. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installed on a RPi 5 (libre-translate.local/192.168.0.6) | |
To create API keys enter the container: - | |
docker exec -it <container> bash | |
The use 'ltmanage' to list the keys: - | |
./venv/bin/ltmanage keys | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Simple class to generate keypad codes for Borg door locks. | |
Run this code to generate random 4 and 5 digit codes. | |
Each random code is generated once with, and once without using the X and Z buttons. | |
See https://borglocks.co.uk | |
""" | |
import random | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Here we assume you've installed the GitPython package | |
# and you're running this code from a repository clone. | |
from typing import Optional | |
from git import Repo | |
from git.refs.tag import TagReference | |
repo: Repo = Repo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get username and emails from a Keycloak realm | |
# assuming you've installed httpie and jq | |
# | |
# - https://httpie.io | |
# - https://jqlang.github.io/jq/ | |
# Armed with a keycloak URL | |
# And realm and realm manager password | |
URL=example.com | |
REALM=blob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"folders": [ | |
{ | |
"path": "squonk2-python-cl-tools" | |
}, | |
{ | |
"path": "squonk2-admin" | |
}, | |
{ | |
"path": "squonk2-deck" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"folders": [ | |
{ | |
"path": "Diamond/fragalysis-backend" | |
}, | |
{ | |
"path": "Diamond/dls-fragalysis-stack-kubernetes" | |
}, | |
{ | |
"path": "Diamond/fragalysis-stack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import os | |
import base64 | |
# Use the Python requests module | |
# (you'll need to have PIP-installed this - it's not part of core Python) | |
import requests | |
# The keycloak credentials (sensitive). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"folders": [ | |
{ | |
"path": "squonk2-data-manager-job-tester" | |
}, | |
{ | |
"path": "squonk2-data-manager-job-decoder" | |
}, | |
{ | |
"path": "squonk2-data-manager-job-utilities" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"folders": [ | |
{ | |
"path": "squonk2-account-server.wiki" | |
}, | |
{ | |
"path": "squonk2-account-server" | |
}, | |
{ | |
"path": "squonk2-account-server-ansible" |
NewerOlder