Skip to content

Instantly share code, notes, and snippets.

View api_backends.conf
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
@koaps
koaps / git-clearHistory
Created Apr 26, 2021 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
View git-clearHistory
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
View Raspberry Pi 4 Arm64 Kernel Cross-Compile.md

The Raspberry Pi foundation have now released a beta version of an official 64-bit Kernel which can be installed using the rpi-update script. The rpi-update script can be found at https://github.com/Hexxeh/rpi-update/blob/master/rpi-update or through the Raspbian repositories

Introduction

The objective of these instructions is to build a stock 64bit Linux Kernel for use on the Raspberry Pi 4B on a Debian x64 machine (Windows Subsystem for Linux in my case), and deploy on the Raspberry Pi.

Notes:

  • Transfer to Pi is using my NAS in this example, replace with shared drive/memory stick etc. as required.
    • (N: drive on Windows and /mnt/NAS on Linux in this example).
  • For a specific Kernel version replace the 4.19 with the wanted version in the git clone command.
    • Greater than 3GB RAM only currently available on Kernel 4.19
@koaps
koaps / 01-pre-install.sh
Created Feb 16, 2021 — forked from xenophonf/01-pre-install.sh
K3s on Ubuntu 20.04 with root on encrypted ZFS
View 01-pre-install.sh
#!/bin/sh
# Run as user `ubuntu` from the Ubuntu Desktop installer's live environment.
sudo apt-add-repository universe
sudo apt update
passwd ubuntu
sudo apt install --yes openssh-server screen vim
ip addr show scope global | grep inet
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@koaps
koaps / makefile
Last active Apr 23, 2019
Local Dev
View makefile
ALL_ACTIONS := build up down clean
ALL_TARGETS := proxy
DO_A := $(filter $(ALL_ACTIONS),$(MAKECMDGOALS))
DO_T := $(filter $(ALL_TARGETS),$(MAKECMDGOALS))
.DEFAULT_GOAL := all
actions := $(strip $(if $(DO_A), $(DO_A), up))
targets := $(strip $(if $(DO_T), $(DO_T), $(ALL_TARGETS)))
@koaps
koaps / Git.md
Last active Dec 2, 2018
Git Stuff
View Git.md

Git notes and commands

Author reset

git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "koaps" ]; then
     GIT_AUTHOR_EMAIL=koaps@users.noreply.github.com;
     GIT_AUTHOR_NAME="Koaps";
     GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL;
@koaps
koaps / Vagrantfile
Created Oct 22, 2018
Vagrant ZFS example
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Specify minimum Vagrant version and Vagrant API version
Vagrant.require_version '>= 1.9.1'
VAGRANTFILE_API_VERSION = '2'
# Require 'yaml' module
require 'yaml'