Skip to content

Instantly share code, notes, and snippets.

View yaleman's full-sized avatar
🦀
Terribl. Really terribl.

James Hodgkinson yaleman

🦀
Terribl. Really terribl.
View GitHub Profile
@yaleman
yaleman / gist:f048f8fdf4a8860c08ef30d934f4c3f1
Created September 7, 2022 23:02
trash dinosaur, needs to be in the headers of all my code...
/:\
/;:.\
//;:. \
///;:.. \
__--"////;:... \"--__
--__ "--_____--" __--
___ """--_______--"""
`-._~-. / /_ "~o\ :Y
\ \ / : \~x. ` ')
] Y / | Y< ~-.__j
@yaleman
yaleman / routemap.json
Created July 10, 2022 13:19
Example kanidm route map for #913
{
"routelist": [
{
"path": "/",
"method": "GET"
},
{
"path": "/robots.txt",
"method": "GET"
},
@yaleman
yaleman / gist:fee9bdcee02a3d97fb5fe389bde11d8c
Created June 29, 2022 04:36
running a kanidm container

from outside the container:

./insecure_generate_tls.sh
docker run --rm -it -p8443:8443 \
	-v /tmp/kanidm/:/tmp/kanidm/ \
	ghcr.io/kanidm/kanidmd:devel bash

from inside the container

@yaleman
yaleman / nagios.example.com.conf
Created August 10, 2021 05:18
Kanidm LDAP auth for Nagios behind Apache
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName monitoring.example.com
ServerAdmin admin@example.com
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/monitoring.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/monitoring.example.com/privkey.pem
ScriptAlias /cgi-bin "/usr/local/nagios/sbin/"
@yaleman
yaleman / gist:fdd528fae3ec68d5cb91f0a685ae3764
Created April 5, 2021 23:48
Bitwarden Extension Safari Crash report
#####################################################################################################################
# Snipped out relevant part
#####################################################################################################################
Application Specific Information:
Enabled Web Extensions:
com.bitwarden.desktop.safari (LTZ2PFU5D6) (Version: 1.49.1 - Display Version: 1.49.1) Bitwarden - Free Password Manager
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '<cert(0x11c2e4730) s: *.badssl.com i: COMODO RSA Domain Validation Secure Server CA> does not conform to NSSecureCoding'
terminating with uncaught exception of type NSException
abort() called
@yaleman
yaleman / pvemanager-patch.diff
Created April 3, 2021 01:10
Mod for /usr/share/pve-manager/js/pvemanagerlib.js on Proxmox VE to fix UI width issues
--- /usr/share/pve-manager/js/pvemanagerlib.js.dist 2021-04-03 10:48:43.163503735 +1000
+++ /usr/share/pve-manager/js/pvemanagerlib.js 2021-04-03 10:53:39.855772027 +1000
@@ -38407,7 +38407,7 @@
var ui = me.query('#userinfo')[0];
if (Proxmox.UserName) {
- var msg = Ext.String.format(gettext("You are logged in as {0}"), "'" + Ext.String.htmlEncode(Proxmox.UserName) + "'");
+ var msg = Ext.String.format(gettext(' {0}', Ext.String.htmlEncode(Proxmox.UserName) ));
ui.update('<div class="x-unselectable" style="white-space:nowrap;">' + msg + '</div>');
} else {
@yaleman
yaleman / setup_logging.py
Created April 1, 2021 22:49
Logging configurator for loguru
def setup_logging(logger_object, debug):
""" handles logging configuration """
if debug:
loguru_format = '<green>{time:YYYY-MM-DD HH:mm:ss}</green> | <level>{level: <8}</level> | <cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>' #pylint: disable=line-too-long
logger_object.remove()
logger_object.add(sys.stdout, format=loguru_format, level="DEBUG")
else:
loguru_format = '<level>{message}</level>'
logger_object.remove()
@yaleman
yaleman / terrible_python_pip_install_thing.py
Created March 22, 2021 01:24
Try importing a package and then attempt to install it if it's not there
#!/usr/bin/env python3
# This'll try and install the required packages.
for import_attempt in range(100):
try:
import requests
import click
from loguru import logger
continue
except ImportError as error_message:
@yaleman
yaleman / docker-compose.yml
Last active February 23, 2021 09:38
Splunk + minio minimal
version: "3.6"
services:
splunk:
platform: linux/amd64
container_name: splunk
image: splunk/splunk:latest
ports:
- "8000:8000"
environment:
$ sudo -u vector RUST_BACKTRACE=full vector -vvv --config-yaml /etc/vector/vector.yaml
Dec 19 12:49:48.569 INFO vector::app: Log level is enabled. level="vector=trace,codec=trace,file_source=trace,tower_limit=trace,rdkafka=trace"
Dec 19 12:49:48.571 INFO vector::app: Loading configs. path=[("/etc/vector/vector.yaml", Some(YAML))]
Dec 19 12:49:48.630 DEBUG vector::tls::settings: Fetching system root certs.
Dec 19 12:49:48.630 INFO vector::topology: Running healthchecks.
Dec 19 12:49:48.630 INFO vector::topology: Starting source. name="host_metrics"
Dec 19 12:49:48.630 INFO vector::topology: Starting source. name="local_journald"
Dec 19 12:49:48.630 INFO vector::topology: Starting transform. name="journald_remove_fields"
Dec 19 12:49:48.631 INFO vector::topology: Starting transform. name="journald_coercer"
Dec 19 12:49:48.631 INFO vector::topology: Starting transform. name="host_metrics_transformed"