Skip to content

Instantly share code, notes, and snippets.

View nightsparc's full-sized avatar

nightsparc nightsparc

  • Munich, Germany
View GitHub Profile
@nightsparc
nightsparc / renew-gpgkey.md
Created May 18, 2020 19:56 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@nightsparc
nightsparc / zfs destroy (dry run)
Created October 9, 2020 10:03 — forked from dlangille/dry run
Doing a dry run of zfs destroy, and seeing what will be destroyed and how much space will be reclaimed
$ zfs destroy -nv system/usr/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
would destroy system/usr/jails/[email protected]
@nightsparc
nightsparc / ZFS Snapshot Deletion
Created January 10, 2021 17:22 — forked from alexjj/ZFS Snapshot Deletion
Delete all ZFS Snapshots
zfs list -H -o name -t snapshot | xargs -n1 zfs destroy
@nightsparc
nightsparc / gist:8ce7a3f118c3a1a47e03fed317e9d335
Created September 22, 2021 21:05 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@nightsparc
nightsparc / cpp_legacy_inheritance_vs_std_variant.md
Created April 29, 2022 16:32 — forked from olibre/cpp_legacy_inheritance_vs_std_variant.md
C++ legacy inheritance vs CRTP + std::variant
@nightsparc
nightsparc / read_kvp.sh
Created May 25, 2022 12:33
Read key value pairs from a file
# @brief Helper to read key value pairs
# @details
# Read kv in the form <key>=<value>
# The script cleans whitespaces first and will remove any newlines
# @see https://stackoverflow.com/a/27918723/1267320
read_kvp()
{
file="$1"
while IFS="=" read -r key value; do
# clean whitespaces
@nightsparc
nightsparc / README
Created June 17, 2022 14:00
Start Virtualbox VM via systemd
See https://www.pragmaticlinux.com/2020/10/start-a-virtualbox-vm-on-boot-with-systemd/
@nightsparc
nightsparc / ForceUSBtoTTY.md
Created July 4, 2022 17:19 — forked from edro15/ForceUSBtoTTY.md
[How To] Force a specific USB device to a certain TTY

Scenario:

  • multiple USB devices plugged via hub to a host (Linux OS based),
  • multiple services/programs interacting with TTY running on top (e.g. GPSd)

Problem:

At boot TTY are randomly assigned to devices causing depending services/programs instabilities. They could indeed fail to start because of different TTY configurations.

Solution:

@nightsparc
nightsparc / remote-unlock-zfs-with-dropbear.md
Last active October 12, 2024 00:20
Remote unlocking of native-encrypted ZFS-on-root on Debian/Ubuntu using Dropbear SSH

Introduction

The following describes a way to remote unlock a server with natively-encrypted ZFS-on-root. It uses Dropbear SSH to start a SSH server in the initramfs listing on a specified port.

All server commands are executed as root on Debian 10. For Ubuntu, sudo su or adding sudo to all command should be sufficient.

Requirements

The following requires the recent ZoL 2.x, which adds support to Unlock encrypted root filesystem via SSH, making it merely a no-brainer to unlock the data set (besides setting up Dropbear).

@nightsparc
nightsparc / FixCtrlBackspace.ahk
Last active December 28, 2022 13:04 — forked from AdrienVR/FixCtrlBackspace.ahk
AutoHotkey script to fix Ctrl+Backspace (delete previous word) in File Explorer and Desktop (AHK V1)
; source: https://gist.github.com/AdrienVR/4136db1bfb0d3d3490b0d1e23e56daf9
; context: http://superuser.com/a/636973/124606
#NoEnv
; Reloard script if not used
; https://www.autohotkey.com/docs/v2/lib/_SingleInstance.htm
#SingleInstance force
; https://www.autohotkey.com/docs/v2/lib/SendMode.htm
SendMode Input