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 / 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
@bketelsen
bketelsen / dpkg-buildpackage.txt
Created January 11, 2023 09:52
output from dpkg
bjk in apx_managed in apx on  vendor via  v1.19.4
❀ ❯ dpkg-buildpackage --no-sign
dpkg-buildpackage: warning: debian/changelog(l11): unrecognized line
LINE: apx (1.3.4) kinetic; urgency=medium
dpkg-buildpackage: warning: debian/changelog(l19): unrecognized line
LINE: apx (1.2.5) kinetic; urgency=medium
dpkg-buildpackage: warning: debian/changelog(l25): unrecognized line
LINE: apx (1.2.4) kinetic; urgency=medium
dpkg-buildpackage: warning: debian/changelog(l29): ignoring invalid week day 'Wen'
LINE: -- Mirko brombin <send@mirko.pm> Wen, 16 Sep 2022 23:26:34 +0200
@bketelsen
bketelsen / benchmark_template.rs
Created April 5, 2022 19:06
benchmark_template.rs
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use bartholomew::content::Content;
use std::path::PathBuf;
fn doit(n: u64) -> Result<(), anyhow::Error> {
let doc: String = r#"title = "The Goals of Bartholomew"
description = "We have plans. Big plans. Actually, they're small plans."
date = "2021-12-23T17:05:19Z"