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 / 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 <[email protected]> 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"
@bketelsen
bketelsen / Dockerfile.spin
Created March 16, 2022 09:57
Reproduce glibc error - spin
FROM rust:1.59-slim-buster
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y wget git pkg-config libssl-dev make && rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
RUN wget https://github.com/WebAssembly/binaryen/releases/download/version_105/binaryen-version_105-x86_64-linux.tar.gz
RUN tar -zxvf binaryen-version_105-x86_64-linux.tar.gz
RUN ls -la /tmp/binaryen-version_105/bin
RUN cp /tmp/binaryen-version_105/bin/* /usr/local/bin/
@bketelsen
bketelsen / cleanup.sh
Created July 4, 2021 12:43
cleanup detritus from dev work
β”‚ File: .zsh/includes/cleanup.sh
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────
1 β”‚ cleanup () {
2 β”‚ find ~/src -name 'node_modules' -type d -prune -exec rm -rf '{}' +
3 β”‚ find ~/src -name '.next' -type d -prune -exec rm -rf '{}' +
4 β”‚ cargo sweep -r -t 30 ~/src
5 β”‚ brew cleanup
6 β”‚ is_bin_in_path docker && docker system prune -a -f --volumes || echo "skipping docker"
7 β”‚ }
8 β”‚ # https://stackoverflow.com/questions/6569478/detect-if-executable-file-is-on-users-path
TRACE manifest_directory="/Users/bjk/dotfiles/." manifests="git" Comtrya execution started
DEBUG OS Detected OS="Mac OS"
TRACE Building Contexts
DEBUG context="user" key="name" value="Brian Ketelsen"
DEBUG context="user" key="username" value="bjk"
DEBUG context="user" key="home_dir" value="/Users/bjk"
DEBUG context="user" key="config_dir" value="/Users/bjk/Library/Application Support"
TRACE manifest_load{manifest="main.yaml"}: manifest="main.yaml"
TRACE manifest_load{manifest="main.yaml"}: absolute_path="/Users/bjk/dotfiles/shell/starship/main.yaml"
TRACE manifest_load{manifest="main.yaml"}: template="actions:\n - action: file.copy\n from: starship.toml\n to: \"{{ user.home_dir }}/.config/starship.toml\"\n template: false\n - action: package.install\n list:\n - starship"
@bketelsen
bketelsen / comtrya.txt
Created March 10, 2021 11:52
trace output
❯ comtrya --trace
TRACE manifest_directory="/Users/bjk/cdots/." manifests="" Comtrya execution started
TRACE Building Contexts
DEBUG context="user" key="name" value="Brian Ketelsen"
DEBUG context="user" key="username" value="bjk"
DEBUG context="user" key="home_dir" value="/Users/bjk"
DEBUG context="user" key="config_dir" value="/Users/bjk/Library/Application Support"
TRACE manifest="copy.yaml"
TRACE absolute_path="/Users/bjk/cdots/file/copy.yaml"
TRACE template="actions:\n # This will be rendered with contexts\n - action: file.copy\n from: some-file\n to: some-path\n\n # This will not be rendered with contexts\n - action: file.copy\n from: some-file\n to: some-path\n template: false\n"
extern crate dispatch;
use dispatch::{Queue, QueuePriority};
use std::fs::File;
use std::fs::{self, DirEntry};
use std::io;
use std::io::prelude::*;
use std::path::Path;
use std::process::exit;
2020/11/24 09:15:02 daemon: serving on /home/bjk/.cache/encore/encored.sock
2020/11/24 09:15:02 sqldb: serving on 127.0.0.1:35929
2020/11/24 09:15:02 dash: serving on http://127.0.0.1:42971
2020/11/24 09:15:02 runtime: serving on 127.0.0.1:39515
2020/11/24 09:15:18 secret: fetching secrets for showrunner-46b2
panic: unhandled ast.Expr type: <nil>
goroutine 98 [running]:
encore.build/parser/parser/nameresolve.(*checker).expr(0xc000999510, 0x0, 0x0)
/home/eandre/encore-build/parser/parser/nameresolve/nameresolve.go:511 +0x1322