Skip to content

Instantly share code, notes, and snippets.

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

Kyle Harding klutchell

🏠
Working from home
View GitHub Profile
@klutchell
klutchell / s3fs.service
Created October 6, 2019 18:14
systemd unit file for s3fs fuse auto-mount
Description=S3FS FUSE mount
Documentation=https://github.com/s3fs-fuse/s3fs-fuse
Wants=network-online.target
After=network-online.target
AssertPathIsDirectory=/mnt/s3fs
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/s3fs mybucket:/bucketdir /mnt/s3fs -o url=https://nyc3.digitaloceanspaces.com -o use_cache=/tmp -o allow_other -o use_path_request_style -o uid=1000 -o gid=1000
@klutchell
klutchell / encfs.service
Created October 6, 2019 18:15
systemd unit file for encfs fuse auto-mount
Description=Encfs FUSE mount
Documentation=https://vgough.github.io/encfs/
Wants=s3fs.service
After=s3fs.service
AssertPathIsDirectory=/mnt/encfs
[Service]
Type=simple
Environment=ENCFS6_CONFIG=%h/.encfs6.xml
ExecStartPre=/bin/mountpoint /mnt/s3fs
@klutchell
klutchell / duplicity.service
Last active May 19, 2023 17:01
scheduled duplicity backups with systemd
# description:
# - once per day perform backup of $HOME
# - every 14th backup will be a full backup (~2 weeks)
# - delete all backups older than the 4th most recent full backup (~8 weeks)
# - exclude files larger than 100M
# usage:
# 1. install duplicity.service in ~/.config/systemd/user/
# 2. install duplicity.timer in ~/.config/systemd/user/
# 3. create ~/.duplicity and define DEST, GPG_KEY_ID, and PASSPHRASE
@klutchell
klutchell / docker-compose.yml
Last active May 7, 2024 04:04
simple linuxserver/duplicati docker-compose stack
version: "3"
services:
duplicati:
image: linuxserver/duplicati
container_name: duplicati
environment:
PUID: ${PUID}
PGID: ${PGID}
TZ: ${TZ}
--- poky/meta/recipes-kernel/linux/kernel-devsrc.bb 2020-12-01 11:02:39.510292328 -0500
+++ meta-balena-warrior/recipes-kernel/linux/kernel-devsrc.bb 2020-12-16 14:11:36.146363392 -0500
@@ -104,7 +104,9 @@
fi
if [ "${ARCH}" = "arm64" ]; then
- cp -a --parents arch/arm64/kernel/vdso/vdso.lds $kerneldir/build/
+ if [ -f "arch/arm64/kernel/vdso/vdso.lds" ]; then
+ cp -a --parents arch/arm64/kernel/vdso/vdso.lds $kerneldir/build/
+ fi
@klutchell
klutchell / Dockerfile
Last active April 1, 2021 14:14
python3-slim (buildroot)
#syntax=docker/dockerfile:1.2
FROM klutchell/buildroot-base:2020.11 as build
# copy common config
COPY common.cfg ./.config
# hadolint ignore=SC2215
RUN --mount=type=cache,target=/cache,uid=1000,gid=1000,sharing=private \
make olddefconfig && make source && make
@klutchell
klutchell / Dockerfile
Last active April 6, 2021 12:29
buildroot dashboard
ARG BR_VERSION=2020.11
# hadolint ignore=DL3029
FROM --platform=$BUILDPLATFORM klutchell/buildroot-rootfs-amd64:$BR_VERSION as rootfs-amd64
# hadolint ignore=DL3029
FROM --platform=$BUILDPLATFORM klutchell/buildroot-rootfs-arm64:$BR_VERSION as rootfs-arm64
# hadolint ignore=DL3029
FROM --platform=$BUILDPLATFORM klutchell/buildroot-rootfs-arm32v7:$BR_VERSION as rootfs-armv7
@klutchell
klutchell / registry.sh
Last active November 1, 2021 13:17
Given a DockerHub repo and tag, return a list of identical manifest tags
#!/usr/bin/env bash
# only supports hub.docker.com for now
registry="${1:-"https://registry.hub.docker.com"}"
# limited to 100 for hub.docker.com
page_size="${2:-100}"
# avoid reading all pages if at least one match is found
quick=1
@klutchell
klutchell / bump-submodule.sh
Last active February 14, 2022 18:34
Bump a submodule to the provided tag using commits in versionist syntax
#!/usr/bin/env bash
module_path="${1}"
tag="${2}"
tag() {
if [[ $1 == v* ]]
then
echo "${1/v/}"
else