Skip to content

Instantly share code, notes, and snippets.

@schtobia
schtobia / signkernel.sh
Last active Dec 20, 2021
sign a kernel with your own MOK key
View signkernel.sh
#! /bin/bash
KERNEL_FILE="$1"
KEY_FILE="${KEY_FILE:-/var/lib/shim-signed/mok/MOK.priv}"
CERT_FILE="${CERT_FILE:-/var/lib/shim-signed/mok/MOK.pem}"
[ ! -r "$KERNEL_FILE" ] &&
{
echo "Usage: $0 <kernelfile>". >&2;
exit 1;
@schtobia
schtobia / kas-poky-tegra.yml
Last active Mar 13, 2022
kas file for meta-tegra
View kas-poky-tegra.yml
header:
version: 8
machine: jetson-xavier-nx-devkit
distro: poky
target:
- core-image-base
repos:
meta-tegra:
@schtobia
schtobia / mokdeploy.sh
Last active Apr 13, 2020
Generate and deploy a key for Secure Boot
View mokdeploy.sh
#! /bin/bash
openssl req -new -x509 \
-newkey rsa:4096 \
-keyout MOK.priv \
-outform DER \
-out MOK.der \
-days 36500 \
-subj "/CN=$(getent passwd $UID | cut -d: -f 5 | cut -d, -f1)" \
-nodes \
-addext "extendedKeyUsage=codeSigning,1.3.6.1.4.1.311.10.3.6,1.3.6.1.4.1.2312.16.1.2"
@schtobia
schtobia / docker-compose.yaml
Last active Sep 23, 2020
Folding At Home docker-compose file
View docker-compose.yaml
---
version: "3.7"
services:
foldingathome:
image: johnktims/folding-at-home:latest
ports:
- "7396:7396"
environment:
TZ: "${TZ:-UTC}"
restart: unless-stopped
@schtobia
schtobia / profiles.json
Last active Oct 25, 2019
Windows Terminal Settings
View profiles.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"keybindings":[],
"profiles":
[
{
"acrylicOpacity": 0.5,
"background": "#012456",
"colorScheme": "Campbell",
@schtobia
schtobia / docker-compose.yml
Last active Mar 27, 2020
Home Assistant docker-compose
View docker-compose.yml
---
version: '3.7'
services:
mqtt:
image: eclipse-mosquitto:latest
hostname: mqtt
init: yes
volumes:
- mosquitto_config:/mosquitto/config
- mosquitto_log:/mosquitto/log
@schtobia
schtobia / docker-compose.yml
Last active Jul 1, 2020
Motioneye docker-compose file
View docker-compose.yml
---
version: "3.7"
services:
motioneye:
image: ccrisan/motioneye:master-armhf
init: true
ports:
- "8081:8081"
- "80:8765"
environment:
@schtobia
schtobia / aria2.daemon.sh
Last active Aug 14, 2019
firejail aria2
View aria2.daemon.sh
#! /bin/bash
RUNDIR="${XDG_DOCUMENTS_DIR:-$HOME/.local/share}/aria2"
SESSION_FILE="$RUNDIR/aria2.session"
LOG_FILE="${LOG_FILE:-$RUNDIR/aria2.log}"
[ ! -d $RUNDIR ] && mkdir $RUNDIR
[ ! -d $RUNDIR ] && { echo "Cannot create runtime dir $RUNDIR." >&2; exit 1; }
# if log size is not readable or too large, recreate it empty
[ "$LOG_FILE" != "-" ] && truncate -s0 $LOG_FILE
[ ! -r $LOG_FILE -a "$LOG_FILE" != "-" ] && { echo "Cannot create log file $LOG_FILE." >&2; exit 1; }
@schtobia
schtobia / ctags.md
Last active Dec 18, 2019
Generating a ctags file for libstdc++
View ctags.md

Generating a ctags file for libstdc++

Ripped off Stackoverflow and adapted to be version independent.

  • call the following script regularly via crontab

  • add the following line to $HOME/.vimrc:

    set tags+=$HOME/.cache/cpp_tags
    
@schtobia
schtobia / backup
Last active May 3, 2021
Backup a primary user without referring to a username
View backup
#! /bin/bash
DATE="$(date -u '+%Y%m%dT%H%M%SZ')"
IFS=':' read -r -a PASSWD_ENTRY <<<"$(getent passwd 1000)"
IFS=':' read -r -a GROUP_ENTRY <<< "$(getent group 1000)"
USERNAME=${PASSWD_ENTRY[0]}
HOME=${PASSWD_ENTRY[5]}
GROUP=${GROUP_ENTRY[0]}
# shellcheck disable=SC1090
[ -r "$HOME"/.config/user-dirs.dirs ] && . "$HOME"/.config/user-dirs.dirs
TARGET_DIR=${XDG_DESKTOP_DIR:-$HOME}