Skip to content

Instantly share code, notes, and snippets.

View KellerFuchs's full-sized avatar

Queer Supervillainess KellerFuchs

  • In a /usr/local close to you.
View GitHub Profile
@KellerFuchs
KellerFuchs / PROTOCOL.md
Last active September 11, 2016 17:22
#!ctl protocol

Rationale

Older versions of hashbangctl(1) used to be called through sudo(8), with all users being allowed to call that command without password.

This is not optimal, both for security reasons and because it would make it very complex for hashbangctl(1) to outlast the user's session (for instance, in the case of user deletion).

Alternatives

@KellerFuchs
KellerFuchs / squeak.sh
Last active July 28, 2017 15:54
BIGSQUEAKERBOX Bash prompt
_hostname=( bigsqueakerbox compooter lightningtrappedinpoisonedglass )
_user_1=( loud soft big smol kyuuuut )
_user_2=( shekken shekkie squeak )
sample() {
local n=$((RANDOM % $# +1))
echo "${!n}"
}
prompt() {
@KellerFuchs
KellerFuchs / keybase.md
Created September 19, 2017 17:10
keybase.md

Keybase proof

I hereby claim:

  • I am kellerfuchs on github.
  • I am kellerfuchs (https://keybase.io/kellerfuchs) on keybase.
  • I have a public key whose fingerprint is 700E 88FC 14B5 3311 1AD7 A40F 1D7C 08C6 CC26 3D74

To claim this, I am signing this object:

@KellerFuchs
KellerFuchs / custom.sh
Last active September 20, 2017 15:14
etckeeper-less branch
#!/usr/bin/env bash
function silent_ssh {
local connectionString="$1"
local commands="$2"
if [ -z "$commands" ]; then
commands=`cat`
fi
ssh -T $connectionString "$commands"
}
@KellerFuchs
KellerFuchs / apt.yml
Last active September 26, 2017 17:46
Installing apt repos and keys and packages
# -*- eval: (ansible) -*-
- apt_repository:
filename: "{{ item }}"
repo: "{{ packages[item].repo | mandatory }}"
update_cache: no
notify: apt update
- apt_key:
keyring: "{{ item }}.gpg"
id: "{{ packages[item].key.id | mandatory }}"
@KellerFuchs
KellerFuchs / tmp_pg.sh
Created March 25, 2018 18:51
Overengineered and overly-portable script for doing stuff in a temporary pgsql database
#!/bin/sh -e
# Adapted from the Hashbang userdb testing script:
# https://github.com/hashbang/userdb/blob/master/test.sh
run() {
normal='\e[0m'
yellow='\e[33m'
printf "${yellow}%s${normal}\n" "$*" >&2
@KellerFuchs
KellerFuchs / tilde-irc.socket
Created May 31, 2018 18:26
Socket-activated SSH forwarding
[Socket]
ListenStream=127.0.0.1:6666
Accept=true
[Install]
WantedBy=sockets.target
@KellerFuchs
KellerFuchs / .gitignore
Last active September 23, 2018 19:54
Reproducing testcase for apt_key bug
/.vagrant
/log
*.retry
@KellerFuchs
KellerFuchs / ssh_config
Created October 25, 2018 18:48
SSH ProxyJump example
# Let's say you only want to connect to tilde.town through #!,
# for example because the firewall at work blocks tilde.town
Host tilde.town
User lycaops
ProxyJump sf1.hashbang.sh
# Your #! configuration
Host *.hashbang.sh
User opslyca
Inspired by @alicegoldfuss: https://twitter.com/alicegoldfuss/status/997268087429713922
Her palms are sweaty, knees weak, arms are heavy
There's errors on her console already, kubernetes
but on the surface she looks calm and ready
to redeploy, but etcd keeps on glitchin'
losing her commands, the whole node grows so loud.
She opens a shell, but the pods won't go down.
The SLA runs out, time's up, outage, blow!
Escalate to high severity, oh there goes availability.