Skip to content

Instantly share code, notes, and snippets.

View thimslugga's full-sized avatar
🏠
Working from home

Adam Kaminski thimslugga

🏠
Working from home
View GitHub Profile
@thimslugga
thimslugga / build-kernel.sh
Last active February 9, 2025 15:53
Build Custom Amazon Linux 2023 Kernel from Source
#!/bin/bash
set -e
# https://github.com/orgs/amazonlinux/repositories
# https://github.com/amzn/amzn-drivers/issues/241#issuecomment-1282274014
# https://www.artembutusov.com/how-to-rebuild-amazon-linux-kernel-in-amazon-linux
# https://docs.aws.amazon.com/linux/al2023/ug/kernel-hardening.html
# https://kspp.github.io/
# https://github.com/a13xp0p0v/linux-kernel-defence-map
#https://github.com/a13xp0p0v/kernel-hardening-checker/
@thimslugga
thimslugga / rsync.sh
Created February 7, 2025 10:56
Remote Sync Scripts
!#/bin/bash
SRC_DIR=/Volumes/storage/Media/Movies
DST=rsync://<server>:30026/movies
EXCLUDE_FILE=.rsync_exclude
if [ "$1" == "test" ]; then
RSYNC_START="/opt/homebrew/bin/rsync --dry-run"
else
RSYNC_START="/opt/homebrew/bin/rsync"
@thimslugga
thimslugga / Containerfile
Created December 16, 2024 20:13
Container Images
FROM --platform=$BUILDPLATFORM alpine:latest
WORKDIR /
RUN \
apk --no-cache add \
ca-certificates \
tzdata \
shadow \
su-exec
@thimslugga
thimslugga / pythonenvs.md
Created December 12, 2024 00:28 — forked from ziritrion/pythonenvs.md
Python package managers and environments

uv

Experimental but very promising pip replacement that handles package managing as well as virtual environments and Python version management.

uv comes included with uvx, an alias for uv tool run. uvx allos you to install and execute command-line tools on an ephemeral environment.

Python versions

Note that you don't have to actively install a Python version! uv will automatically fetch the required Python version for your project.

@thimslugga
thimslugga / setup-pypi-mirror.md
Last active December 6, 2024 23:15 — forked from aschmu/pypi-mirror.md
Setup a PyPi Mirror

Setup PyPi Mirror

This guide describes how to create a local PyPI mirror for use in isolated networks without internet access. We'll use bandersnatch to dump packages, a web server to serve them, and devpi to enable search functionality.

This is possible using devpi, web server, bandersnatch and volume to store the packages.

  • Dump all pypi packages with bandersnatch,
  • Serve them for install via web server
  • Enable the search feature by mirroring the web server using devpi.
@thimslugga
thimslugga / emporia-vue-v3.yaml
Created November 11, 2024 12:54 — forked from bradsjm/emporia-vue-v3.yaml
Emporia VUE V3 ESPHome Configuration
substitutions:
name: emporia-vue-v3
friendly_name: Emporia Vue V3
area: "Garage"
# Circuit Labels used for publishing to Home Assistant
circuit_1: "Dryer" #"Circuit 1"
circuit_2: "AC Blower/Heat" #"Circuit 2"
circuit_3: "AC Condenser" #"Circuit 3"
circuit_4: "Water Heater" #"Circuit 4"
@thimslugga
thimslugga / init.vim
Created October 20, 2024 20:46 — forked from onixus74/init.vim
vim-like-vscode
" VIM-VSCODE
"*****************************************************************************
" VIM-PLUG CORE
"*****************************************************************************
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "elixir,eelixir,html,javascript,typescript,python,ruby,yaml"
let g:vim_bootstrap_editor = "nvim" " nvim or vim
@thimslugga
thimslugga / sles-ec2-stonith-debug.sh
Last active September 26, 2024 00:06
Enable debugging for external/ec2 stonith resource
#!/bin/bash
# Check if script was run as non-root user
function is_root() {
if [[ ${EUID} -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
}
is_root
@thimslugga
thimslugga / rocky-linux-nm-cloud-setup.sh
Created August 23, 2024 14:10
Setup NM Cloud Setup Plugin on Rocky Linux 9
#!/usr/bin/env bash
sudo dnf install -y NetworkManager-cloud-setup
sudo systemctl enable --now nm-cloud-setup.service
sudo systemctl enable --now nm-cloud-setup.timer
sudo mkdir -pv /etc/systemd/system/nm-cloud-setup.service.d
cat <<'EOF' | sudo tee /etc/systemd/system/nm-cloud-setup.service.d/00-override.conf