Skip to content

Instantly share code, notes, and snippets.

View nightsparc's full-sized avatar

nightsparc nightsparc

  • Munich, Germany
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / xreadkeys.c
Created April 20, 2020 12:42 — forked from javiercantero/xreadkeys.c
A X11/Xlib program that reads the KeyPress and KeyRelease events from the window and prints them to the standard output. Used to debug the keyboard within X.
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
Display *display;
Window window;
XEvent event;
int s;
#!/bin/sh
MODEM="$(mmcli -L | grep -o '/org/freedesktop/ModemManager1/Modem/[0-9]*' | head -1)"
BEARER="$(mmcli -m $MODEM --list-bearers | grep -o '/org/freedesktop/ModemManager1/Bearer/[0-9]*' | head -1)"
mkdir -p /run/systemd/network
connect() {
MODEM="$(mmcli -L | grep -o '/org/freedesktop/ModemManager1/Modem/[0-9]*' | head -1)"
# hardcode all the things !! (this is for mobile vikings)
@nightsparc
nightsparc / virtual_serial_ports.md
Created September 28, 2019 21:45 — forked from CMCDragonkai/virtual_serial_ports.md
Virtual Serial Ports #cli #serial #network

Virtual Serial Ports

We can use socat to create 2 virtual serial ports that are connected to each other locally. This can be useful for debugging serial port applications. Or simulating serial port communication. Or running 2 legacy programs that only communicate with each other over serial ports, such as old DOS games. And of course, for education, since serial communication is probably the most simple communication protocol there is, RS232 is considered at the bottom of the OSI stack, at the "Physical Layer". See: http://electronics.stackexchange.com/questions/31171/internet-vs-serial-communication

@nightsparc
nightsparc / shell_config.md
Created August 28, 2019 12:18 — forked from bahamat/shell_config.md
How are various shells configured, and in which order?

bash

login interactive files
N N $BASH_ENV
N Y ~/.bashrc
Y N /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile
Y Y /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile
@nightsparc
nightsparc / terminator.vbs
Created March 29, 2019 13:51 — forked from nistath/terminator.vbs
Script to start terminator on WSL from CMD or PowerShell
' Usage: terminator[.vbs] [path to starting directory]
' contents enclosed in square brackets optional
args = "-c" & " -l " & """DISPLAY=:0 terminator"""
' If there's a single argument, interpret it as the starting directory
If WScript.Arguments.Count = 1 Then
dir = WScript.Arguments(0)
Else
dir = ""