Skip to content

Instantly share code, notes, and snippets.

View tmcolby's full-sized avatar

Tyson Colby tmcolby

View GitHub Profile
@tmcolby
tmcolby / readme.md
Last active February 2, 2020 20:43
raspberrypi systemd-nspawn

https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
chroot improved.

on arch - i needed qemu-user-static AUR. it takes FOREVER to biuld.
the conf files were absent and so systemd-binfmt (instead of binfmt-support) was failing to load. followed this and resolved: https://github.com/computermouth/qemu-static-conf/blob/master/README.md

create loopback of the raspberrypi.img file
sudo losetup -P -f --show some/path/to/raspbian.img
assuming loop0, mount the boot and rootfs
sudo mkdir-P /mnt/rpi

@tmcolby
tmcolby / readme.md
Created August 11, 2020 14:47
step-ca: nginx reverse proxy with TLS passthrough

Use-case:
I have two servers running on my host instance.
The first, step-ca running on local port 1442.
The second, an ACL server running on local port 2443.
Each server terminates TLS directly.

I want both servers accessable from the public internet on port 443.
In this case, I have two DNS A records pointing to the same public IP address of the host instance.

I want requests to the CA @ https://ca.mydomain.io to be passed through to localhost:1443.

@tmcolby
tmcolby / git reset to master.md
Last active September 23, 2020 20:34
git reset to master including submodules

git reset --hard HEAD
git clean -f -d
git checkout master
git fetch origin master
git reset --hard origin/master
git pull
git submodule update
git submodule update --init --recursive
git submodule foreach git reset --hard HEAD
git submodule foreach git clean -f -d

@tmcolby
tmcolby / api.py
Created August 13, 2021 19:35
simple web server that allows a host to post a file transfer
from flask import Flask, abort, request
from werkzeug.utils import secure_filename
import os
import requests
import json
# change this to set where you want the file to be saved
UPLOAD_FOLDER = "./"
# change this to only allow files with a given extension to be accepted