Skip to content

Instantly share code, notes, and snippets.

@xenophonf
xenophonf / swap-lctrl-caps-lalt-lwin.reg
Created November 13, 2024 14:35
Swap Left Control/Caps Lock and Left Alt/Left Win in Windows (e.g., when using Apple keyboards)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:\
00,00,00,00,\
00,00,00,00,\
05,00,00,00,\
1d,00,3a,00,\
3a,00,1d,00,\
38,00,5b,e0,\
@xenophonf
xenophonf / nvm
Created October 18, 2024 13:48
A wrapper for nvm that makes it work in other shells (specifically, csh and tcsh)
#!/usr/bin/env bash
# load nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] || exit 0
\. "$NVM_DIR/nvm.sh"
# configure csh
if [ "$1" = "csh-env" ]; then
# use the 'default' version by default
@xenophonf
xenophonf / Every Angle.4.1.binds
Last active February 3, 2025 03:58
Every Angle (Beta)
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Every Angle" MajorVersion="4" MinorVersion="1">
<KeyboardLayout>en-US</KeyboardLayout>
<MouseXMode Value="Bindings_MouseYaw" />
<MouseXDecay Value="1" />
<MouseYMode Value="Bindings_MousePitch" />
<MouseYDecay Value="1" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="Keyboard" Key="Key_Grave" />
@xenophonf
xenophonf / certbot
Created March 13, 2023 03:10
All-in-one certbot wrapper for CentOS 7—make executable and copy to /usr/local/bin; alter plugins on line 29 to taste
#!/usr/bin/env bash
# stop immediately if the script fails
set -Eeuo pipefail
# use chronic if installed
export LANG=C
CHRONIC=$(command -v chronic)
# install required packages
#!/bin/bash
if [ "$_" = "${BASH_SOURCE}" ]
then
printf 'source this script, do not execute.\n' >&2
exit 1
fi
eval $(minikube docker-env --shell bash)
if [ -n "${DOCKER_CERT_PATH}" ] && [ "${DOCKER_CERT_PATH:0:1}" != '/' ]
@xenophonf
xenophonf / Angular Flight Standard Pro (modified).3.0.binds
Last active March 25, 2023 16:15
My modified Angular Flight Standard Pro Steam Controller bindings for Elite Dangerous
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Angular Flight Standard Pro (modified)" MajorVersion="3" MinorVersion="0">
<KeyboardLayout>en-US</KeyboardLayout>
<MouseXMode Value="Bindings_MouseYaw" />
<MouseXDecay Value="0" />
<MouseYMode Value="Bindings_MousePitch" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="Keyboard" Key="Key_Grave" />
<Secondary Device="{NoDevice}" Key="" />
@xenophonf
xenophonf / GraphicsConfigurationOverride.xml
Created November 25, 2020 02:26
My Elite: Dangerous graphics configuration
<?xml version="1.0" encoding="UTF-8" ?>
<GraphicsConfig>
<GalaxyMap>
<High>
<NebulasCount>300</NebulasCount>
<NebulasInBackgroundCount>400</NebulasInBackgroundCount>
<MilkyWayInstancesCount>35000</MilkyWayInstancesCount>
<LocalDustBrightness>1.0</LocalDustBrightness>
<MilkywayInstancesBrightness>0.05</MilkywayInstancesBrightness>
<MilkywayInstancesSize>0.3</MilkywayInstancesSize>
@xenophonf
xenophonf / install-synergy2-focal.sh
Created September 14, 2020 14:00
How to install Synergy 2.0.12 beta on Ubuntu 20.04 (Focal Fossa) LTS
#!/usr/bin/env bash
set -Eeuo pipefail
# Download the Synergy 2 beta installer for Ubuntu 16.04 to /tmp.
cd /tmp
sudo dpkg-deb -R synergy_2.0.12.beta_b1705+e5daaeda_amd64.deb synergy_2.0.12.beta
sudo mv synergy_2.0.12.beta/usr/lib/systemd/system/synergy.service synergy_2.0.12.beta/usr/lib/systemd/system/synergy.service.dpkg-new
# Renaming the desktop file might not be necessary.
sudo mv synergy_2.0.12.beta/usr/share/applications/synergy.desktop synergy_2.0.12.beta/usr/share/applications/synergy.desktop.dpkg-new
@xenophonf
xenophonf / 01-pre-install.sh
Last active July 8, 2022 21:17
K3s on Ubuntu 20.04 with root on encrypted ZFS
#!/bin/sh
# Run as user `ubuntu` from the Ubuntu Desktop installer's live environment.
sudo apt-add-repository universe
sudo apt update
passwd ubuntu
sudo apt install --yes openssh-server screen vim
ip addr show scope global | grep inet
@xenophonf
xenophonf / satosa-quickstart.md
Last active June 14, 2023 13:38
SATOSA Quick Start Guide Using SAMLtest

This deploys SATOSA 8.0.0, at the end of which an interested party could perform a basic, end-to-end test of the current SATOSA release using SAMLtest (https://samltest.id/). Run all commands in a root shell.

  1. Install Debian 11 (Bullseye). This is essentially the Docker image build process, only it uses the SATOSA release (etc.) on PyPI:
apt update
apt dist-upgrade -y
apt install -y \
    curl \
    git \