Skip to content

Instantly share code, notes, and snippets.

View fentas's full-sized avatar
🐷
Oink.

Jan Guth fentas

🐷
Oink.
View GitHub Profile
@hkboujrida
hkboujrida / build_kernel_wsl2.sh
Created August 8, 2023 17:33
build wsl2 kernel
#!/bin/bash
WSL_COMMIT_REF=linux-msft-wsl-5.15.90.4
apt update && apt install -y git build-essential flex bison libssl-dev libelf-dev bc dwarves
mkdir src
cd src
git init
git remote add origin https://github.com/microsoft/WSL2-Linux-Kernel.git
git config --local gc.auto 0
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +${WSL_COMMIT_REF}:refs/remotes/origin/build/linux-msft-wsl-5.15.y
// homerunner is Brad's shitty Docker wrapper after he got tired of running
// HA nine-VM Kubernetes clusters. Earlier versions of this tried to use podman
// and fancy cloud-init and CNI stuff but then I decided to go to the other
// extreme and write something super specific to what I need and super dumb:
// run my containers from gcr.io, and use my home Ceph cluster for mounts/state.
//
// This primarily runs Home Assistant, HomeSeer, an MQTT server, and some cameras.
// And some omitted misc stuff.
package main
@superseb
superseb / rke2-commands.md
Last active April 29, 2024 15:05
RKE2 commands

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@jerblack
jerblack / tee.go
Last active April 29, 2024 08:50
Golang: Mirror all writes to stdout and stderr in program to log file
package main
import (
"fmt"
"io"
"log"
"os"
)
func main() {
@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active April 28, 2024 11:25
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@maledorak
maledorak / dmenu_hotkeys.py
Last active May 29, 2023 07:27
i3 hotkeys in dmenu or rofi
#!/usr/bin/env python3
import os
import sys
from re import compile
from subprocess import run, Popen, PIPE
__author__ = "Mariusz 'Maledorak' Korzekwa"
__credits__ = ["Mariusz 'Maledorak' Korzekwa"]
__license__ = "CC BY 4.0"
@superseb
superseb / rancher2customnodecmd.sh
Last active October 1, 2022 13:56
Add custom node to Rancher 2.0 (from v2.0.0-alpha26 and up)
#!/bin/bash
docker run -d -p 80:80 -p 443:443 --name rancher-server rancher/rancher:latest
while ! curl -k https://localhost/ping; do sleep 3; done
# Login
LOGINRESPONSE=`curl -s 'https://127.0.0.1/v3-public/localProviders/local?action=login' -H 'content-type: application/json' --data-binary '{"username":"admin","password":"admin"}' --insecure`
LOGINTOKEN=`echo $LOGINRESPONSE | jq -r .token`
# Change password
@blacklee
blacklee / ffmpeg-to-480p.sh
Created February 19, 2016 13:43
ffmpeg convert video to 480p
ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4
@perguth
perguth / package.json
Last active August 29, 2015 14:27
scripts part of the `package.json` of a test project
"dependencies": {
"hyperboot": "^2.1.1"
},
"devDependencies": {
"browser-sync": "^2.8.2",
"browserify": "^11.0.1",
"catw": "^1.0.1",
"hyperboot": "^2.1.1",
"tap": "^1.3.2",
"uglifyjs": "^2.4.10",
@vratiu
vratiu / .bash_aliases
Last active April 26, 2024 03:47
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset