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 / 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 / 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
@nightsparc
nightsparc / xorg.conf
Created June 23, 2023 09:49 — forked from wamberg/xorg.conf
Dual Monitor (one portrait, one landscape) xorg.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 270.29 (buildd@roseapple) Fri Feb 25 14:43:24 UTC 2011
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 1680 0
Screen 1 "Screen1" LeftOf "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "1"
@nightsparc
nightsparc / gpg-import-and-export-instructions.md
Created August 15, 2023 17:51 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@nightsparc
nightsparc / addbr0ubunmcli.md
Created December 17, 2023 10:04 — forked from plembo/addbr0ubunmcli.md
Add br0 to Ubuntu desktop using nmcli

Add a bridge interface to Ubuntu desktop using nmcli

Had to do this for some advanced networking with KVM, and couldn't figure out how to do it using the Nework Manager gui. Did find an article later that showed how to do it with nmtui, but it's so much easier to record what you did when using the cli.

Note: I now set net.ifnames=0 in grub for all my machines, to ensure my device names are "predictable" (so the first ethernet device will be "eth0" and not "ens1", "eno1 or anything else).

To see what everything looks like before starting: