Skip to content

Instantly share code, notes, and snippets.

View b-'s full-sized avatar
🐧

bri b-

🐧
View GitHub Profile
@b-
b- / replace_link_with_wrapper.sh
Created January 31, 2025 20:44
wrapper script generator
@b-
b- / komodo-core.butane.yaml
Last active January 24, 2025 14:29
provision fedora coreos with ucore, komodo core, and komodo periphery as a systemd service
variant: fcos
version: 1.4.0
passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDx+KV/SW4RGIeKA2FHU9S7bZgnJMy77N6lBeo2n8sJ
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKvsoJVOLJ3FshnAF5sJTpCxjNu2MAcCsN/hq0/qIBAe
password_hash: $y$j9T$Pb/.....
storage:
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `nix.registry.nixpkgs.to.path' has conflicting definition values:
- In `/nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source/nixos/modules/config/nix-flakes.nix': "/nix/store/sssy7p3frs3vrr7ymcp7y016ykl1si7d-source"
- In `/nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source/nixos/modules/misc/nixpkgs-flake.nix': "/nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source"
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
@b-
b- / shmerge.sh
Created December 31, 2023 05:59
shmerge
#!/bin/bash
function shmerge() { git switch -c "$1" &&shift; git commit -am"$*" && gh pr create && echo "waiting 10s to start checks" ; sleep 10s; gh run view --exit-status && gh pr merge -d}
@b-
b- / fix-onepassword-gids.sh
Created December 3, 2023 00:03
fix onepassword gid for ublue-os custom image
#!/bin/bash
# fixes 1Password GID problems on ublue-os custom images
set -euxo pipefail
OPCLI_CONF=$(</usr/lib/sysusers.d/onepassword-cli.conf)
TARGET_OPCLI_GID="${OPCLI_CONF##g onepassword-cli }"
CURRENT_OPCLI_GID=$(getent group onepassword-cli | cut -d: -f3)
OP_CONF=$(</usr/lib/sysusers.d/onepassword.conf)
CURRENT_OP_GID=$(getent group onepassword | cut -d: -f3)
TARGET_OP_GID="${OP_CONF##g onepassword }"
@b-
b- / keybase.distrobox-assemble
Created October 15, 2023 16:42
keybase.distrobox-assemble
#! /usr/bin/env -S distrobox assemble create --file
[keybase]
image=ghcr.io/briorg/ubuntu-toolbox
#image=quay.io/toolbx-images/ubuntu-toolbox:22.04
init=false
nvidia=false
pull=false
root=false
replace=true
@b-
b- / keybase-nightly.sh
Last active October 6, 2023 02:27 — forked from RogueScholar/keybase-nightly.sh
POSIX script to update keybase package to latest nightly on Distrobox
#!/usr/bin/env bash
# Keybase publishes a JSON file concurrent with every nightly build upload to their public download web server,
# though they're real cute in the way they parse the timestamp as a UNIX epoch...in milliseconds :-/ That means
# we need to fuss with rounding errors in Bash built-in computations on top of using jq as a parser for the raw
# file instead of what I expected to be some quick "awk-to-humantime-to-apt" pipeline-foo. Still it came out
# fairly snappy and is solid as a rock.
# Set this up as a cron job at the interval of your choosing, it won't do anything until it sees that the
# installed version reported by apt has an older timestamp than the one in the JSON file. When that happens it
@b-
b- / after-install.sh.diff
Created October 5, 2023 18:43
1password after-install.sh modified for kinoite post-install
commit 857e68ddc3eb63b068a1eb16e57ed1e040203819
Author: bri <[email protected]>
Date: Thu Oct 5 14:40:43 2023 -0400
comment out stuff
diff --git a/after-install.sh b/after-install.sh
index 07f25cd..a5eb9e2 100755
--- a/after-install.sh
+++ b/after-install.sh
@b-
b- / set-addrgroup
Last active October 13, 2023 14:49
set-addrgroup for vyos
#!/bin/sh
#
# /config/scripts/dhcp-client/post-hooks.d/set-addrgroup
# To enable this script set the following variable to "yes"
RUN="yes"
if [ "$RUN" = "yes" ]; then
tmpfile=$(mktemp /tmp/dhcp-script.XXXXXXXX)
chmod -R 755 "${tmpfile}"
@b-
b- / 99-git-commit
Last active January 6, 2023 00:01 — forked from brav0charlie/99-git-commit_vyos.sh
VyOS Git Commit & Push on Commit
#!/bin/vbash
# shellcheck shell=bash
# file: 99-git-commit
# description: Saves config commands & config json to files, commits to local
# git repo. Repo stored in /config/user-data/$CONFIG_REPO. Completes
# process with a push to the remote repo.
#
# This script is intended to be used as a post-commit hook, allowing
# for automated config backup in a git repo.