Skip to content

Instantly share code, notes, and snippets.

View qrkourier's full-sized avatar

Kenneth Bingham qrkourier

View GitHub Profile
@qrkourier
qrkourier / x11vnc.service
Created December 11, 2022 16:48
x11vnc systemd user service unit
# ${HOME}/.config/systemd/user/x11vnc.service
[Unit]
Description=Attach Running x11 Server as SPICE Server
[Install]
WantedBy=default.target
[Service]
ExecStart=/usr/local/bin/x11spice
Restart=always
# ansible playbook illustrating two approaches to change a list of users' uid:gid and
# update homedir files owner and mode to match
- hosts: all
vars:
user_dict:
bob: 2001
alice: 2002
user_list:
- bob
- alice
@qrkourier
qrkourier / host.v1
Created June 17, 2022 12:13
OpenZiti service configs for RKE control plane ports
{
"address": "127.0.0.1",
"allowedPortRanges": [
{
"high": 10256,
"low": 10256
},
{
"high": 4789,
"low": 4789
@qrkourier
qrkourier / miner.sh
Last active October 21, 2021 16:01
configure and launch coin miners on Linux
#!/bin/bash -u
#
_help(){
cat >&2 <<-EOF
Usage: $1 [OPTION] ...
-g use Nvidia GPU(s)
-a ALGORITHM mining algorithm (e.g., scrypt, equihash)
-u BITCOIN_ADDRESS your Nicehash wallet address
@qrkourier
qrkourier / ovirt-private-ca.md
Last active October 11, 2021 07:57
Install a Server Certificate For oVirt Manager UI

Install server certificates issued by a private CA in oVirt4 Manager and Host

  • generate a signing request on the system where oVirt Manager is running (the engine server)
openssl req -new -sha256 -key /etc/pki/ovirt-engine/keys/apache.key.nopass -out /tmp/engine.csr
  • Submit the CSR to the issuer and wait. Or, if you are the issuer and you happen to be using FreeIPA/IdM, you may issue the certificate with ipa-admintools. For example,
@qrkourier
qrkourier / export-ziti-ca.zsh
Last active September 21, 2021 19:22
ZSH script for MacOS to export the well-known (CA) certs of a Ziti controller as importable PEM and DER files
#!/usr/bin/env zsh
#
# get the well-known CA certs of a Ziti controller as importable PEM and DER files
#
# EXAMPLE
#
# $ ./export-ziti-ca.zsh 13.36.15.32
# SUCCESS: certificates exported in /tmp/export-ziti-ca-13-36-15-32/:
# total 16K
# -rw-rw-r-- 1 kbingham kbingham 1.7K Sep 20 12:47 NetFoundry.der
@qrkourier
qrkourier / export-ziti-ca.bash
Last active September 21, 2021 19:22
BASH script for Linux to export the well-known (CA) certs of a Ziti controller as importable PEM and DER files
#!/usr/bin/env zsh
#
# get the well-known CA certs of a Ziti controller as importable PEM and DER files
#
# EXAMPLE
#
# $ ./export-ziti-ca.sh 13.36.15.32
# SUCCESS: certificates exported in /tmp/export-ziti-ca-13-36-15-32/:
# total 16K
# -rw-rw-r-- 1 kbingham kbingham 1.7K Sep 20 12:47 NetFoundry.der
@qrkourier
qrkourier / csv2aws.bash
Created September 13, 2021 21:40
Source the CSV IAM credential download in BASH
#!/usr/bin/env bash
set -o pipefail -e -u
[[ ${#@} -eq 1 && "$1" =~ .csv$ ]] || {
echo "ERROR: need a CSV file to convert" >&2
exit 1
}
CSV_FILE="$1"
#!/usr/bin/env python3
#
# blame(@qrkourier)
#
from jira import JIRA
import os
import sys
from argparse import ArgumentParser
import webbrowser
# 1) define one or more Restic repo paths
typeset -A RESTIC_REPOS
RESTIC_REPOS[gdrive]=rclone:gdrive-backup:
RESTIC_REPOS[KX1T]=/media/kbingham/KX1T/backups
#RESTIC_REPOS[bigExternalDrive]=/media/kbingham/bigExternalDrive/backups
# 2) create an exclude file with lines like:
# **/*cache/