Skip to content

Instantly share code, notes, and snippets.

View jdoss's full-sized avatar
😎
My hovercraft is full of eels

Joe Doss jdoss

😎
My hovercraft is full of eels
View GitHub Profile
@jdoss
jdoss / move_BTRFS_subvolume_to_a_new_disk.md
Created August 17, 2023 17:16
Move your BTRFS /home subvolume to a new disk

Move your BTRFS /home subvolume to a new disk

Or in my case, to many disks. I have 4x Samsung 990 Drives that I want to setup in RAID10 with BTRFS and move my /home directory over to these disks. Here are the steps I took to get everything setup and moved over. I went with RAID10 on BTRFS, but you can use this guide to move any subvolume to a new disk, whatever the setup might be.

All of this was done on Fedora 38 workstation. Your millage may vary.

WARNING: BACKUP YOUR DATA BEFORE DOING THIS!

Seriously, back up your data first if you care about it. I use restic and my fancy restic-systemd-units to take incremental backups to my TrueNAS Scale server and to a local secondary hard drive in my workstation. I will probably be moving to incremental local backups with snapper in the future.

@jdoss
jdoss / Corefile
Created April 14, 2023 16:50 — forked from m1keil/Corefile
DNS based service discovery for Nomad (Using CoreDNS)
.: {
log
loadbalance
# auto: automatically pick up file changes
auto service.nomad {
directory local/zones
reload 1s
}
}
@jdoss
jdoss / samsung_ssd_upgrade.sh
Last active July 6, 2023 17:15
Samsung SSD 980 PRO Firmware 3B2QGXA7 to 5B2QGXA7 Upgrade on Linux
#!/bin/bash
# MIT License
#
# USE AT YOUR OWN RISK! FIRMWARE UPGRADES HAVE RISKS!
#
# Copyright (c) 2023 Joe Doss
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@jdoss
jdoss / README.md
Created August 26, 2022 13:55
Espanso YAMLs for fun and profit.

This is a collection of my non work specific Espanso snippets. Enjoy!

License

MIT License

Copyright (c) 2022 Joe Doss

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@jdoss
jdoss / akmod-sign-modules.sh
Created April 24, 2022 19:56
Sign NVIDIA kernel modules genreated by akmods
#!/bin/bash
# Script based on https://github.com/larsks/akmod-sign-modules. Use the systemd
# drop-in to call this script during akmods@${KERNEL_VERSION}.service
#
# Compression support based on https://unix.stackexchange.com/questions/438954/signing-a-compressed-kernel-module-for-use-with-secure-boot
#
# See also https://gist.github.com/xenithorb/df08970b9e70bb3c6576e1fd91460afe
set -eu
@jdoss
jdoss / LUKS_and_TPM2_with_Fedora.md
Last active October 26, 2024 20:15
Decrypt LUKS volumes with a TPM on Fedora Linux

Decrypt LUKS volumes with a TPM on Fedora Linux

This guide allows you to use the TPM on your computer to decrypt your LUKS encrypted volumes. If you are worried about a cold boot attack on your hardware please DO NOT use this guide with your root volume!

Preflight Checks

Verify that you have a TPM in your computer:

# systemd-cryptenroll --tpm2-device=list
PATH DEVICE DRIVER
@jdoss
jdoss / devel_services_pod.sh
Created February 22, 2022 23:17
Quickly launch Elasticsearch, Redis, and PostgreSQL inside a Podman pod.
#!/bin/bash
set -e
ELASTICSEARCH_VERSION=7.5.2
ELASTICSEARCH_PORT=9200
REDIS_VERSION=6.0.1
REDIS_PORT=6379
@jdoss
jdoss / start-owncast.sh
Last active July 21, 2022 11:48
Quick Owncast setup with Podman.
#!/bin/bash
set -e
DOMAIN=example.com
OWNCAST_VERSION=latest
CADDY_VERSION=latest
## Create Pod
podman pod create --replace --name owncast-pod \
@jdoss
jdoss / cgroupsv2.yml
Created September 2, 2020 17:45
Enable cgroups v2 (non hybird) on FCOS
systemd:
units:
- name: enable-cgroups-v2.service
enabled: true
contents: |
[Unit]
Description=Enable cgroups v2 (systemd.unified_cgroup_hierarchy)
ConditionFirstBoot=true
After=ignition-complete.target
Before=default.target
@jdoss
jdoss / Containerfile
Last active October 20, 2020 22:07
Python 3.8 support for Fedora CoreOS
FROM quay.io/fedora/fedora:32-x86_64
MAINTAINER "Forem Systems Engineering <[email protected]>"
LABEL maintainer="Forem Systems Engineering <[email protected]>"
USER root
RUN dnf upgrade -y \
&& dnf install autoconf bison curl git gzip make patch tar \
wget xz file gcc-c++ bzip2-devel gdbm-devel gmp-devel glib2-devel \
libcurl-devel libxml2-devel libxslt-devel libffi-devel ncurses-devel \
openssl-devel readline-devel redhat-rpm-config -y \