Skip to content

Instantly share code, notes, and snippets.

View b-'s full-sized avatar
❄️
learning nix

bri b-

❄️
learning nix
View GitHub Profile
@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- / 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.
@b-
b- / json.json
Last active July 8, 2019 20:06 — forked from EvaLovlac3/json.json
[
{
"type": "A",
"name": "@",
"value": "SOMEIP"
},
{
"type": "A",
"name": "*",
"value": "SOMEIP"
@b-
b- / !!
Last active October 20, 2022 14:35 — forked from cmlsharp/!!
# Add this to your ~/.config/fish/config.fish
# Syntax:
# To just rerun your last command, simply type '!!'
# This forked version supports "sudo !!" via two functions.
function !!
eval $history[1] $argv
end function
function sudo
if test $argv