Skip to content

Instantly share code, notes, and snippets.

View jbayer's full-sized avatar

James Bayer jbayer

View GitHub Profile
@jbayer
jbayer / README.md
Created September 4, 2026 16:35
Update golang release available in Flox example

Using a newer Go than the Flox catalog carries

This walks through what we did in this directory to build Go 1.26.8 with Flox when the catalog only offered 1.26.7, and then how to turn that one-off build into a package your whole organisation can install on every architecture it supports.

The same recipe works for any nixpkgs package whose newest catalog version lags upstream. Go is just the worked example.

@jbayer
jbayer / policy.yml
Created September 13, 2025 00:12
Ngrok IP Policy to restrict proxy connections to only FluidCloud
on_tcp_connect:
- actions:
- type: restrict-ips
config:
enforce: true
allow:
- 44.241.238.243/32
@jbayer
jbayer / one-switch-one-vm.tf
Created June 20, 2025 19:25
Example Hyper-V with Terraform
terraform {
required_providers {
hyperv = {
version = "1.0.3"
source = "registry.terraform.io/taliesins/hyperv"
}
}
}
provider "hyperv" {
@jbayer
jbayer / read-jwt.sh
Created May 19, 2025 15:20
Read Base64 encoded JWT
#!/bin/bash
# Split the JWT into parts (header.payload.signature)
# TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvbiBEb2UiLCJpYXQiOjE1MTYyMzkwMjJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
# Name of the required environment variable
REQUIRED_VAR="TOKEN"
# Check if the variable is not set or empty
if [[ -z "${!REQUIRED_VAR}" ]]; then
@jbayer
jbayer / example.txt
Last active March 9, 2025 17:25
Using yt-dlp to create a short clip
jamesbayer@mac ~ % mkdir /tmp/clip
jamesbayer@mac ~ % cd /tmp/clip
jamesbayer@mac clip % touch put-the-clip-in-this-dir
jamesbayer@mac clip % ls
put-the-clip-in-this-dir
jamesbayer@mac clip % docker run -it -v /tmp/clip:/tmp/clip --entrypoint /bin/sh jauderho/yt-dlp:latest
/downloads # cd /tmp/clip
/tmp/clip # ls
put-the-clip-in-this-dir
/tmp/clip # /usr/local/bin/yt-dlp --download-sections "*1:57-5:50" -f bestvideo+bestaudio --merge-output-format mp4 -o two-hands.mp4 https://www.youtube.com/watch?v=MR8F8GbOcwc
@jbayer
jbayer / v1.17.json
Created September 26, 2024 00:31
Activity Export API response improvements
{
"client_id": "3f210722-7210-98e8-1f0d-e6a39ffb29c6",
"namespace_id": "root",
"timestamp": 1653350457,
"mount_accessor": "auth_userpass_bb52979d"
}
@jbayer
jbayer / nslookup.txt
Created July 11, 2022 18:20
HCP Vault DNS Example
nslookup your-cluster-name-here.vault.your-project-id-here.aws.hashicorp.cloud
Server: 192.168.86.1
Address: 192.168.86.1#53
Non-authoritative answer:
Name: your-cluster-name-here.vault.your-project-id-here.aws.hashicorp.cloud
Address: 34.215.184.84
Name: your-cluster-name-here.vault.your-project-id-here.aws.hashicorp.cloud
Address: 54.185.0.185
Name: your-cluster-name-here.vault.your-project-id-here.aws.hashicorp.cloud

Keybase proof

I hereby claim:

  • I am jbayer on github.
  • I am jambay (https://keybase.io/jambay) on keybase.
  • I have a public key ASBNEqvKihkY657SPA0MAd-d9y6lUrXSkVw-i8_Zv2iAIQo

To claim this, I am signing this object:

@jbayer
jbayer / waypoint-k8s-do.yml
Created November 1, 2020 19:06
Waypoint 0.1.4 k8s yaml for Digital Ocean
---
apiVersion: v1
kind: Service
metadata:
name: waypoint
namespace: default
spec:
ports:
- port: 9701
@jbayer
jbayer / cf-cli-output.txt
Created August 10, 2016 14:51
cf push error when omitting app name
$ cf push -m 64M
FAILED
Manifest file is not found in the current directory, please provide either an app name or manifest
NAME:
push - Push a new app or sync changes to an existing app
USAGE:
Push a single app (with or without a manifest):
cf push APP_NAME [-b BUILDPACK_NAME] [-c COMMAND] [-d DOMAIN] [-f MANIFEST_PATH] [--docker-image DOCKER_IMAGE]