Skip to content

Instantly share code, notes, and snippets.

@charles-dyfis-net
charles-dyfis-net / flake.lock
Last active August 4, 2022 18:10
Flake check demonstration
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1659633244,
"narHash": "sha256-N+AXQHIyRO5D9T8xrTM+igkqJ90MKsftQJnfW5YNxac=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0b04c001b3c2e5009b688a15ae5903aa2293bc7c",
"type": "github"
@charles-dyfis-net
charles-dyfis-net / default.nix
Last active August 31, 2019 22:14
Work-in-progress Nix build for Planck
let
pkgs = import <nixpkgs> {};
inherit (pkgs) fetchurl unzip;
planckVersion = "2.24.0"; # when revving, please be sure to update the project-info.json with Maven deps
closureRelease = "20190301";
closureCompiler = pkgs.runCommand "closure-compiler-${closureRelease}" {
src = fetchurl {
url = "https://dl.google.com/closure-compiler/compiler-${closureRelease}.zip";
sha256 = "0n702ivm6mbvxpcjsj0dd71s26h5s9la5c6n5ybvj19xw1s3ii7p";
@charles-dyfis-net
charles-dyfis-net / standalone-nwipe.nix
Created September 23, 2018 21:13
nix recipe for nwipe compiled with musl rather than glibc
{ pkgs ? import <nixpkgs> { overlays = [
(self: super: {
systemd = null;
})
];}}:
let
lvm2WithoutSystemd = (pkgs.pkgsMusl.lvm2.override { utillinux = null; }).overrideAttrs(oldAttrs: {
configureFlags = oldAttrs.configureFlags ++ [
@charles-dyfis-net
charles-dyfis-net / do_gpg_setup.bash
Created August 30, 2018 15:17
gpg-agent yubikey / gpg tooling
do_gpg_setup() {
local ssh_add_err
if gpg-connect-agent /bye &>/dev/null && [[ -e "$HOME/.ssh_auth_sock" ]] && { ssh_add_err=$(SSH_AUTH_SOCK=$HOME/.ssh_auth_sock ssh-add -l 2>&1) || [[ $ssh_add_err = "The agent has no identities." ]]; }; then
export SSH_AUTH_SOCK=$HOME/.ssh_auth_sock
return # Nothing to do
else
[[ $orig_GPG_AGENT_INFO ]] && GPG_AGENT_INFO=$orig_GPG_AGENT_INFO gpg-connect-agent killagent /bye
[[ $GPG_AGENT_INFO ]] && GPG_AGENT_INFO=$GPG_AGENT_INFO gpg-connect-agent killagent /bye
fi
@charles-dyfis-net
charles-dyfis-net / fixed.sh
Last active March 13, 2018 16:24 — forked from dabura667/fixed.sh
Fixed pubkey command
curl \
--data-urlencode sig="`\
echo '{"body":{"key":{"eldest_kid":"0101a8dbef6ea8164aaa7a3616de95a1843c6e1996a5102c90200b54b41ba97de49b0a","fingerprint":"0a6a58a14b5946abde18e207a3adb67a2cdb8b35","full_hash":"99ed12fa1979ef175aecaaf3f0872f9e3ccfd30d1a8dcdf6e756ce0227ce4f80","host":"keybase.io","key_id":"a3adb67a2cdb8b35","kid":"0101a8dbef6ea8164aaa7a3616de95a1843c6e1996a5102c90200b54b41ba97de49b0a","uid":"03a69327bfbb7860c772345076484c19","username":"isislovecruft"},"type":"eldest","version":1},"ctime":1519428650,"expire_in":157680000,"prev":null,"seqno":1,"tag":"signature"}' | \
gpg -u '0a6a58a14b5946abde18e207a3adb67a2cdb8b35' -a --sign`" \
--data-urlencode type="eldest" \
--data-urlencode session="lgHZIDAzYTY5MzI3YmZiYjc4NjBjNzcyMzQ1MDc2NDg0YzE5zlqQo1vOAeEzgNkgNzBmMmUwYzk5M2FiMjNkODQ3N2E1YjE1YTFiOGIxMDLEIOVa/OtsvVcgT66tlmlrIbkALadXIktmr5D4I4HdH2cY" \
--data-urlencode csrf_token="lgHZIDAzYTY5MzI3YmZiYjc4NjBjNzcyMzQ1MDc2NDg0YzE5zlqQo1vOAAFRgMDEIIyPeDuHFq5EBgnha6MTZ8cSrgXO5XbEKP2QFOENmvD9" \
@charles-dyfis-net
charles-dyfis-net / do_gpg_setup.bash
Last active April 8, 2022 15:07
GnuPG/SSH agent setup for inclusion in bashrc on MacOS
do_gpg_setup() {
local ssh_add_err
if gpg-connect-agent /bye &>/dev/null && [[ -e "$HOME/.ssh_auth_sock" ]] && { ssh_add_err=$(SSH_AUTH_SOCK=$HOME/.ssh_auth_sock ssh-add -l 2>&1) || [[ $ssh_add_err = "The agent has no identities." ]]; }; then
export SSH_AUTH_SOCK=$HOME/.ssh_auth_sock
return # Nothing to do
else
[[ $orig_GPG_AGENT_INFO ]] && GPG_AGENT_INFO=$orig_GPG_AGENT_INFO gpg-connect-agent killagent /bye
[[ $GPG_AGENT_INFO ]] && GPG_AGENT_INFO=$GPG_AGENT_INFO gpg-connect-agent killagent /bye
fi

Keybase proof

I hereby claim:

  • I am charles-dyfis-net on github.
  • I am charlesdyfisnet (https://keybase.io/charlesdyfisnet) on keybase.
  • I have a public key ASCOejZFm8nDFRspHb_MCcH8yzHsuaNikgMBA7gZiSKMwAo

To claim this, I am signing this object:

This repository contains public keys for [email protected]

Trust it as much as you would said github repository in general.

Keybase proof

I hereby claim:

  • I am charles-dyfis-net on github.
  • I am charlesdyfisnet (https://keybase.io/charlesdyfisnet) on keybase.
  • I have a public key whose fingerprint is BFC8 512D B29E 8B72 4D93 6635 E315 6371 AAE4 CBCD

To claim this, I am signing this object:

@charles-dyfis-net
charles-dyfis-net / addhost.sh
Last active November 2, 2015 19:34
creating config files for nagios
#!/bin/bash
while IFS=, read -r host ip cont _ <&3; do
parent=${ip%.*}.1
TMPL=HOST-TEST.tmpl
FILE=$host.cfg
awk \
-v HOST="$host" \
-v CONT="$cont" \
-v PARENT="$parent" \
-v IP="$ip" \