Skip to content

Instantly share code, notes, and snippets.

View audstanley's full-sized avatar
📡
Send me a message on aprs: KM6LZF

Richard Stanley audstanley

📡
Send me a message on aprs: KM6LZF
View GitHub Profile
# This is the nebula example configuration file. You must edit, at a minimum, the static_host_map, lighthouse, and firewall sections
# Some options in this file are HUPable, including the pki section. (A HUP will reload credentials from disk without affecting existing tunnels)
# PKI defines the location of credentials for this node. Each of these can also be inlined by using the yaml ": |" syntax.
pki:
# The CAs that are accepted by this node. Must contain one or more certificates created by 'nebula-cert ca'
ca: /workspace/certs/ca.crt
cert: /workspace/certs/lighthouse1.crt
key: /workspace/certs/lighthouse1.key
#blocklist is a list of certificate fingerprints that we will refuse to talk to
#!/bin/bash
# get SeaweedFS
curl -s https://api.github.com/repos/chrislusf/seaweedfs/releases/latest | grep "browser_download_url.*tar.gz" | cut -d : -f 2,3 | tr -d \" | grep "linux_amd64\.tar\.gz" | wget -qi -
# get Nebula
curl -s https://api.github.com/repos/slackhq/nebula/releases/latest | grep "browser_download_url" | cut -d : -f 2,3 | tr -d \" | grep "nebula-linux-amd64\.tar\.gz" | wget -qi -
{
"name": "🐶 The Doge Pool",
"description": "We are trying to pay off student loans",
"ticker": "🐶 DOGE",
"homepage": "https://www.audstanley.com"
}
@audstanley
audstanley / types.go
Created April 17, 2021 17:46
Example of our structs for backend.
package handlers
import "math/big"
// in redis Db: 2 (each product)
// Db: 7 (pcb)
// Db: 8 (wires)
// Db: 9 (diodes)
// Db: 10 (caps)
type Product struct {
package handlers
import (
"context"
"fmt"
"math/rand"
"time"
jwt "github.com/form3tech-oss/jwt-go"
"github.com/gofiber/fiber/v2"
@audstanley
audstanley / README.md
Created March 9, 2021 08:21 — forked from yorickdowne/README.md
Ubuntu Desktop 20.04 with mirrored ZFS boot drive

Overview

Ubuntu Desktop 20.04 supports a single ZFS boot drive out of the box. I wanted a ZFS mirror, without going through an entirely manual setup of Ubuntu as described by OpenZFS

This adds a mirror to an existing Ubuntu ZFS boot drive after the fact.

ZFS requires native encryption to be added at pool / dataset creation. These instructions are not suitable for creating an encrypted ZFS boot disk, please use the full instructions linked above for that. You can, however, add an encrypted dataset after the fact: You could encrypt just the portion of your file system that holds secrets.

Note: If your use case is running docker instances, and not a full-fledged Ubuntu install, then take a look at TrueNAS SCALE, which will manage the ZFS parts for you.

def depthFirstSearch(problem):
from pprint import pprint
"""
Search the deepest nodes in the search tree first.
Your search algorithm needs to return a list of actions that reaches the
goal. Make sure to implement a graph search algorithm.
To get started, you might want to try some of these simple commands to
understand the search problem that is being passed in:
*** FAIL: test_cases/q1/pacman_1.test
*** Solution not correct.
*** student solution length: 162
*** student solution:
West West West West West West West West West West West West West West
West West West West West West West West West West West West West West
West West West West West South South South South South South South
South South East East East North North North North North North North
East East South South South South South South East East North North
North North North North East East South South South South East East

// install the "REST Client" extension in VSCode. @baseUrl=co.audstanley.com

GET http://{{baseUrl}}/coffeeorders HTTP/1.1

###

POST http://{{baseUrl}}/coffeeorders HTTP/1.1 content-type: application/json

#!/usr/bin/python3
# written by Richard Stanley
import RPi.GPIO as GPIO
import argparse
from time import sleep
from math import ceil
from os import path
import sys
# an example of running the scipt: