Skip to content

Instantly share code, notes, and snippets.

@Syderitic
Syderitic / Secure_Encrypted_Storage_Setup.md
Last active April 26, 2025 01:16
Secure Encrypted Storage Setup with LUKS2, TPM2, FIDO2, and Btrfs

Secure Encrypted Storage Setup with LUKS2, TPM2, FIDO2, and Btrfs

Disclaimer: Use this guide at your own discretion. The author is not responsible for any data loss or security breaches that may occur. Always ensure you understand each step and its implications before proceeding.

This guide walks you through setting up a secure external drive, perfect for backing up sensitive data, securely handing over large data sets, or storing important files. It covers creating an encrypted drive that’s easy to unlock with trusted devices, such as a security key, while remaining highly secure if misplaced. Ideal for safeguarding personal data or business files, it offers practical recovery steps to ensure access even if you change devices.

By following this guide, you will have established a secure and user-friendly encrypted storage solution that leverages:

  • LUKS2 Encryption: Provides robust disk encryption.
  • TPM2 Integration: Enables automatic unlocking on trusted hardware.
  • FIDO2 Tokens: Offers flexible acc
@genyrosk
genyrosk / REISUB.md
Created November 3, 2022 18:52
REISUB: A gentle Linux restart

REISUB

If a Linux machine locks up or freezes completely, use REISUB to restart it more gently than pushing the Power Button.

Hold down Alt and the SysReq (Print Screen) keys, and then type R E I S U B, with 2-3 second delays between the key presses to give the commands a better chance to complete.

  • R: Switch the keyboard from raw mode to XLATE mode
  • E: Send the SIGTERM signal to all processes except init
  • I: Send the SIGKILL signal to all processes except init
  • S: Sync all mounted filesystems
import os
import subprocess
import shutil
from os import startfile
import codecs
# Check if FLAC.exe exists in PATH
if not shutil.which('flac') is not None:
print('\nSeems like FLAC.exe is missing...')
print('Please download FLAC from: https://xiph.org/flac/download.html')
@ScribbleGhost
ScribbleGhost / gist:00ce8f3c73f0ad3a7ac9b0578b375def
Created August 4, 2022 07:42
Remove the track title (track name) from an audio track in an MKV file
for /r %i in (*.mkv) do (mkvpropedit "%i" --edit track:a1 --set "name=")

hi, and goodbye

The past few weeks has not been fun on IRC, the drama based on false information and assumptions has been insane. I've almost entirely been silent on the drama because I know the fallout that would happen if I spoke up.

A quick TLDR - I'm quitting all IRC development. KiwiIRC project lead, IRCv3 technical board, supporting the multitude of IRC networks, the lot.

Many people seem to think that I am supporting one side in everything that is going on, so just to be clear: I am not supporting any side of the current freenode drama - there is so much false information going around from everywhere that it is impossible to support anybody.

Woo freenode drama

Some handy MKVToolNix commands

Extract chapter XML files for all MKVs:

for /r %i in (*.mkv) do (mkvextract "%i" chapters "%~ni".xml)

Remove all chapters from MKVs:

for /r %i in (*.mkv) do (mkvpropedit "%i" --chapters "")
@ScribbleGhost
ScribbleGhost / subtitle_extractor.bat
Last active January 26, 2023 03:24
Extract all subtitles from MKV video file, and make a copy of the video file without subtitles. Requires mkvmerge and subtitleedit CLI in PATH
@echo off
FOR %%A IN (*.mkv) DO (
echo %%~nxA
FOR /F %%I IN ('mkvmerge -i "%%A" ^| FIND /C "SubRip"') DO (IF %%I GTR 0 (echo SRT found in file) & (subtitleedit /convert "%%A" SubRip) else (echo SRT not found in file))
echo.&echo.
FOR /F %%I IN ('mkvmerge -i "%%A" ^| FIND /C "SubStationAlpha"') DO (IF %%I GTR 0 (echo ASS found in file) & (subtitleedit /convert "%%A" SubStationAlpha) else (echo ASS not found in file))
echo.&echo.
FOR /F %%I IN ('mkvmerge -i "%%A" ^| FIND /C "VobSub"') DO (IF %%I GTR 0 (echo. &echo. &echo. &echo. & echo VobSub - SUB/IDX found in file. You should use SubtitleEdit to convert the subtitles to a text-based format such as SRT) else (echo VobSub not found in file))
echo.&echo.
@ScribbleGhost
ScribbleGhost / Check a video file for subtitles, subtitle language and subtitle format
Created April 12, 2021 12:47
Check a video file for subtitles, subtitle language and subtitle format with ffprobe
ffprobe -loglevel error -select_streams s -show_entries stream=codec_name,index:stream_tags=language -of csv=p=0 %input%

Plex file hierarchy example

📂 ROOT
	┣📂 MOVIES
	┃ ┣ 📂 The Shawshank Redemption (1994)
	┃ ┃ ┣ 🎬 The Shawshank Redemption (1994).mkv
@idelem
idelem / titleUrlMarkdownClip.js
Last active March 5, 2025 13:13 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;