Skip to content

Instantly share code, notes, and snippets.

View nothub's full-sized avatar
💭
̵̨̹̜̹̭̥̘̫̱̭̭̯̣̯̳̝̫̝͔̀̅ͫͫͦ̍̏ͧ̂̅̓ͩ̑̿̇̄͜͟᙭̷̣͙͕͒͒ͪ̓̀̃ͯͬ̿͆̍̿̐͂̎̃̀͢

Florian Hübner nothub

💭
̵̨̹̜̹̭̥̘̫̱̭̭̯̣̯̳̝̫̝͔̀̅ͫͫͦ̍̏ͧ̂̅̓ͩ̑̿̇̄͜͟᙭̷̣͙͕͒͒ͪ̓̀̃ͯͬ̿͆̍̿̐͂̎̃̀͢
View GitHub Profile
@nothub
nothub / bans.json
Created July 6, 2024 11:00
factorio bans
[
{
"username": "xxsurvivexx",
"reason": "griefing"
},
{
"username": "zerofix45",
"reason": "griefing"
},
{
@nothub
nothub / cloud-init.yaml
Created June 9, 2024 00:31
cloud-init janitor
#cloud-config
users:
- name: janitor
groups: sudo
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: true
ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJwI2xmLrw4APecukfuLt+nrUNVFzzND/vENsQUTuyQP hub@desktop"
@nothub
nothub / discord-install.sh
Created June 5, 2024 13:10
discord installer / updater
#!/usr/bin/env sh
set -o errexit
set -o nounset
f="$(mktemp).deb"
curl -Lo "${f}" 'https://discord.com/api/download/stable?platform=linux&format=deb'
if ! file "${f}" | grep -F 'Debian binary package' > /dev/null; then
Dec 30 18:04:51 box systemd[1736]: Started cortile.service - window tiling manager.
Dec 30 18:04:52 box cortile[82796]: LOAD /home/hub/.config/cortile/config.toml [cortile v2.3.1-f7d514e, built on 2023-12-10T19:35:52Z]
Dec 30 18:05:13 box systemd[1736]: Stopping cortile.service - window tiling manager...
Dec 30 18:05:13 box systemd[1736]: cortile.service: Main process exited, code=exited, status=1/FAILURE
Dec 30 18:05:13 box systemd[1736]: cortile.service: Failed with result 'exit-code'.
Dec 30 18:05:13 box systemd[1736]: Stopped cortile.service - window tiling manager.
Dec 30 18:05:13 box systemd[1736]: Started cortile.service - window tiling manager.
Dec 30 18:05:14 box cortile[83153]: LOAD /home/hub/.config/cortile/config.toml [cortile v2.3.1-f7d514e, built on 2023-12-10T19:35:52Z]
Dec 30 18:05:38 box cortile[83153]: panic: runtime error: invalid memory address or nil pointer dereference
Dec 30 18:05:38 box cortile[83153]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x73762e]
@nothub
nothub / render.sh
Created November 25, 2023 18:12
render docker-compose layout
#!/usr/bin/env bash
IFS=$'\n' read -rd '' -a services <<<"$(find "/opt/services" -mindepth 1 -maxdepth 1 -type d -printf '%f\n')"
for service in "${services[@]}"; do
echo "rendering ${service}"
sudo docker run --rm -it \
-v "/opt/services/${service}:/input:ro" \
-v "${PWD}:/output" \
pmsipilot/docker-compose-viz render -f -m image -o "/output/${service}.png" -- "docker-compose.yaml"
done
@nothub
nothub / deathstar.sh
Last active May 3, 2023 16:30
~25kB container with cosmopolitan binary
#!/usr/bin/env sh
set -ex
cat > Dockerfile << "EOF"
FROM scratch
COPY deathstar.com /deathstar
CMD ["/deathstar"]
EOF
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
log() {
echo >&2 "$*"
}
@nothub
nothub / banlist.sh
Last active March 23, 2023 18:29
fetch and bundle factorio community banlists
#!/usr/bin/env bash
set -euo pipefail
output=${1:-"config/server-banlist.json"}
dl() {
local arr
arr=("$(curl --silent --show-error --fail --location "${1}" | jq "${2}")")
echo "${arr[@]}"
[Unit]
# curl -L -O https://github.com/tracer4b/nomi-ceu/releases/download/1.3.5/nomi-ceu-server-1.3.5.zip \
# && mkdir -p /opt/server \
# && unzip nomi-ceu-server-1.3.5.zip -d /opt/server \
# && rm -f nomi-ceu-server-1.3.5.zip \
# && echo "eula=true" > /opt/server/eula.txt \
# && chown -R mc:mc /opt/server \
# && systemctl daemon-reload \
# && systemctl start nomi.service \
@nothub
nothub / Makefile
Created August 6, 2022 12:03
develop svelte (and other node crap) in containers
help:
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# test build requirements
REQUIRED_BINS := podman
$(foreach bin,$(REQUIRED_BINS),\
$(if $(shell command -v $(bin) 2> /dev/null),$(),$(error please install missing build requirement: `$(bin)`)))
.ONESHELL:
# this will be evaluated to set the shell, even when not called explicitly