Skip to content

Instantly share code, notes, and snippets.

@oldsj
oldsj / yubi.md
Created January 4, 2023 16:11
YubiKey SSH + Git Signing

SSH

  1. Download YubiKey Manager
  2. Set a FIDO2 PIN under Applications -> FIDO2
  3. Install the latest openssh brew install openssh
  4. Make sure your shell is using the latest openssh from brew: which ssh-keygen
  5. Generate a key: ssh-keygen -t ed25519-sk -O resident -O application=ssh:YourKeyName
  6. Make sure to repeat the process on at least 1 other YubiKey
  7. Copy both public keys to each server you want to login to

Signing git commits

@oldsj
oldsj / gradingEnv.js
Last active January 25, 2021 19:01
Grading Environment Bookmarklet
//bookmarklet-title:OpenGradingEnvironment
javascript:(function(){var homeworkURL = document.querySelector("body > div > main > div:nth-child(2) > div > div.ui.stackable.divided.two.column.grid > div > a").href;window.open("https://grading-environment.adhoc.pizza/new?homeworkURL="+encodeURIComponent(homeworkURL),'_blank')})();
@oldsj
oldsj / labels.json
Last active January 7, 2021 21:09
github labels for git-labels
[
{
"name": "blocked :no_entry:",
"color": "000000",
"description": "Blocked on other issues or external dependencies"
},
{
"name": "bug :beetle:",
"color": "f47648",
"description": "Something isn't working"
#!/bin/sh
### BEGIN INIT INFO
# Provides: expand_rootfs
# Required-Start:
# Required-Stop:
# Default-Start: 3
# Default-Stop:
# Short-Description: Expand the root filesystem to fill partition
# Description:
### END INIT INFO
@oldsj
oldsj / Dockerfile.rust
Created December 3, 2020 18:17
An Ideal Dockerfile for Rust
FROM rust:slim as builder
WORKDIR /app
RUN rustup default nightly
RUN rustup target add x86_64-unknown-linux-musl --toolchain=nightly
WORKDIR /app/gcpizza
COPY Cargo.toml Cargo.lock ./
COPY src ./src
RUN cargo build --target x86_64-unknown-linux-musl --release
#!/usr/bin/env bash
set -euo pipefail
LATEST_RELEASE=$(hub release -L 1)
LATEST_BASE_VER=$(echo ${LATEST_RELEASE} | cut --delimiter . --fields 1)
LATEST_REVISION=$(echo ${LATEST_RELEASE} | cut --delimiter . --fields 2)
PROPOSED_BASE_VER=$(date +%Y%m%d)
PROPOSED_REVISION=1
if [[ ${PROPOSED_BASE_VER} == ${LATEST_BASE_VER} ]] && \
{
"cities": [{
"Hartford": {
"url": "http://hartford.gov/",
"cal_url": "http://hartford.gov/events",
"events": [{
"date": "05/24/2020",
"description": "Our First Event!1!!"
}]
}
#!/usr/bin/env python3
import json
import logging
import os
import requests
import sys
import time
base_url = "https://api.digitalocean.com/v2"

Keybase proof

I hereby claim:

  • I am oldsj on github.
  • I am oldsj (https://keybase.io/oldsj) on keybase.
  • I have a public key ASBjqHGaFAE-1ez_5fr58dTq0e8VnCiynq55PZlJ4iYBHAo

To claim this, I am signing this object:

LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin QEMU_AUDIO_DRV=none
/usr/bin/qemu-system-x86_64 -name ok-sc-cs01 -S -machine pc-i440fx-xenial,accel=kvm,usb=off
-bios /home/ubuntu/OVMF.fd -m 8192 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1
-uuid 3d87eda6-dbf7-4045-a783-31a1ef72b8ba -nographic -no-user-config -nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-ok-sc-cs01/monitor.sock,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-drive file=/srv/salt-images/ok-sc-cs01/system.qcow2,format=qcow2,if=none,id=drive-ide0-0-0,cache=none,aio=native
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1
-netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=28