Skip to content

Instantly share code, notes, and snippets.

View erenfro's full-sized avatar
💭
Rocking my Docker Swarm Cluster!

Eric Renfro erenfro

💭
Rocking my Docker Swarm Cluster!
View GitHub Profile
@erenfro
erenfro / rhino-setup.sh
Created June 21, 2024 06:22
Rhino Linux alter Calamares BtrFS Setup
#!/bin/bash
sudo sed -i /etc/calamares/modules/mount.conf -E \
-e 's/, autodefrag//' \
-e 's/compress=lzo/compress=zstd/' \
-e '/^mountOptions:$/ { r /dev/stdin' -e'd;}' <<EOF
btrfsSwapSubvol: /@swap
btrfsSubvolumes:
- mountPoint: /
# https://gitlab.com/apparmor/apparmor/-/wikis/unprivileged_userns_restriction
#
# Mentioned also in https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
#kernel.apparmor_restrict_unprivileged_unconfined=0
# This sysctl allows enabling or disabling all apparmor mediation/restrictions
# around unprivileged user namespaces. If set to off the other sysctls are
# ignored, rules in policy are ignored etc.
# Uncommenting this makes things "work":
#kernel.apparmor_restrict_unprivileged_userns=0
@erenfro
erenfro / certbot-renew
Last active June 14, 2017 16:21
Lets Encrypt Automation with SystemD
#!/bin/bash
script_name=$(readlink -e $0)
script_dir=$(dirname $script_name)
if [[ -d "${PWD}/pre.d" || -d "${PWD}/post.d" ]]; then
hook_dir="${PWD}"
elif [[ -d "${script_dir}/pre.d" || -d "${script_dir}/post.d" ]]; then
hook_dir="${script_dir}"
elif [[ -d "/etc/letsencrypt/pre.d" || -d "/etc/letsencrypt/post.d" ]]; then