Skip to content

Instantly share code, notes, and snippets.

View bketelsen's full-sized avatar
💭
Making tools to make the tools.

Brian Ketelsen bketelsen

💭
Making tools to make the tools.
View GitHub Profile
@bketelsen
bketelsen / incus-startup.service.d-override.conf
Created July 15, 2024 13:07
Incus 6.3 dropins to fix move of /usr/lib/incus/*
[Service]
ExecStart=
ExecStart=/usr/libexec/incus/incusd activateifneeded
@bketelsen
bketelsen / incremental.sh
Last active June 29, 2024 22:32
incremental btrfs snapshots sent to remote synology
#!/bin/env bash
set -e
# This script is used to create incremental snapshots of the given btrfs volume.
# capture today's date
today=$(date +%Y%m%d)
# use yesterday's as base for incremental snapshot
yesterday=$(date -d "yesterday" +%Y%m%d)
@bketelsen
bketelsen / feature.sh
Created February 8, 2024 19:05
install "features" intended for devcontainers locally
#!/bin/bash
# install a "feature" from the devcontainers/features repo outside of a container
# requires git, jq
# for this to work well, you should already have a user with uid/gid 1000
FEATUREROOT="${FEATUREROOT:-"/opt/features"}"
FEATUREREPO="${FEATUREREPO:-"https://github.com/devcontainers/features"}"
echo $FEATUREROOT
@bketelsen
bketelsen / gui.yaml
Created November 29, 2023 15:20
wayland+x11 in incus
config:
raw.idmap: both 1000 1000
security.nesting: "true"
user.user-data: |
#cloud-config
package_update: true
package_upgrade: true
package_reboot_if_required: true
packages:
- pulseaudio-utils
@bketelsen
bketelsen / 1-nix.sh
Created June 1, 2023 15:20
Get Going with Nix Development Environments
#!/bin/bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
@bketelsen
bketelsen / lxdnix.sh
Created May 26, 2023 01:22
lxdnix.sh
#!/bin/sh
# Installs the Nix package manager (https://nixos.org/nix/) inside an LXD
# container.
#set -o xtrace
image=images:ubuntu/jammy
if [ "$#" -eq 1 ]
@bketelsen
bketelsen / Containerfile
Created May 26, 2023 00:08
building apx for silverblue
FROM golang
WORKDIR /tmp
RUN git clone --recursive https://github.com/vanilla-os/apx && cd apx
COPY Makefile /tmp/apx/Makefile
RUN cd apx && make build && make install
{
"aliases": {
"bluefin": "cd ~/projects/ublue/bluefin",
"cdfleek": "cd ~/projects/ublue/fleek",
"fleeks": "cd ~/.local/share/fleek",
"gcb": "git checkout -b",
"gitmain": "git checkout main && git pull",
"projects": "cd ~/projects",
"ublue": "cd ~/projects/ublue"
},
@bketelsen
bketelsen / tailscale-ext.sh
Created February 9, 2023 19:00
systemd-sysext for tailscale
#!/usr/bin/env bash
set -euo pipefail
dir="$(mktemp -d)"
pushd .
cd "${dir}"
tarball="$(curl 'https://pkgs.tailscale.com/stable/?mode=json' | /home/bjk/.nix-profile/bin/jq -r .Tarballs.amd64)"
version="$(echo ${tarball} | cut -d_ -f2)"
Jan 16 09:14:38 vanilla vso[2119]: usr/sbin/vcstime
Jan 16 09:14:38 vanilla vso[2119]: usr/sbin/vdpa
-- Boot 82bbc5073776440dbf3090d1f03c197d --
Jan 16 09:26:31 vanilla systemd[1]: Starting VSO Auto Update...
Jan 16 09:26:31 vanilla vso[783]: WARNING: ___apt___ does not have a stable CLI interface. Use with caution in scripts.
Jan 16 09:26:31 vanilla vso[783]: Ign:1 http://archive.ubuntu.com/ubuntu kinetic InRelease
Jan 16 09:26:31 vanilla vso[783]: Ign:2 https://apt.syncthing.net syncthing InRelease
Jan 16 09:26:31 vanilla vso[783]: Ign:3 https://pkgs.tailscale.com/stable/ubuntu kinetic InRelease
Jan 16 09:26:31 vanilla vso[783]: Ign:4 http://ppa.launchpad.net/vanilla-os/stable/ubuntu kinetic InRelease
Jan 16 09:26:31 vanilla vso[783]: Ign:5 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease