Skip to content

Instantly share code, notes, and snippets.

meeas /
Last active November 15, 2023 16:14
For installing Debian Sid with LUKS2 encrypted BTRFS filesystem with Systemd-boot and rEFInd bootloaders plus an option for dualboot to Windows

For directly installing Debian Sid not supported by the Debian installer, namely:

  • Single LUKS2 encrypted partition which contains the full installation
  • Single BTRFS filesystem (integrated home partition)
  • Encrypted swapfile in BTRFS subvolume (supports laptop suspend but not hibernate)
  • Uses systemd-boot bootloader (instead of Grub2, also optional rEFInd instructions)
  • Minimal Gnome install (plus instructions for any other DE you wish)
  • Proper user groups for common security tools like sudo-less Wireshark, etc...
  • Optional removal of crypto keys from RAM during laptop suspend
  • Optional configurations for laptops (including fingerprint readers)
Hakky54 /
Last active August 18, 2022 11:56
Cheat Sheet - Http Client SSL TLS Configuration for Java Kotlin and Scala with example http requests
kristoferjoseph / single-file-web-component.html
Last active November 22, 2023 01:17
Single file Web Component
View single-file-web-component.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Single File Web Component</title>
<template id=single-file>
h1 {
michalc /
Last active May 12, 2023 08:16
Use libsqlite3 directly from Python with ctypes: without using the built-in sqlite3 Python package, and without compiling anything
# From, which is itself inspired by
from contextlib import contextmanager
from collections import namedtuple
from ctypes import cdll, byref, string_at, c_char_p, c_int, c_double, c_int64, c_void_p
from ctypes.util import find_library
from sys import platform
def query(db_file, sql, params=()):
andrebrait /
Last active December 5, 2023 06:23
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

Checksum / assert.jq
Last active August 12, 2022 20:21
Assertion library for jq
View assert.jq
# A simple assertion library for jq (
# Author: Srinath Sankar
def assert(level; expr; msg):
if expr then
. |= . + [{ level: level, message: msg }]
skybldev /
Last active March 20, 2022 16:39
A script that content-aware-scales (or seam carves) a video.
#!/usr/bin/env bash
inputFile=$1 # input file
outputFile=$2 # output file
outputRes=$3 # output resolution in WIDTHxHEIGHT
fps=$4 # fps for both input and output
useLeftoverFrames=0 # whether or not to process already split frames
# create temp dir if it doesn't exist yet
if [[ ! -d ".lqrtemp/" ]]; then
echo ":: Creating temporary directory .lqrtemp/..."
romainl /
Last active September 8, 2023 21:32
Off the beaten path

Off the beaten path

What is &path used for?

Vim uses :help 'path' to define the root directories from where to search non-recursively for files.

It is used for:

  • gf, gF, <C-w>f, <C-w>F, <C-w>gf, <C-w>gF,
  • :find, :sfind, :tabfind,
g0xA52A2A /
Last active June 4, 2023 23:30
Vim autoreply

A modified version of Romain's gist.

See prior revisions for functionality closer to the original. This is now a simplification that aims only to provide prompts that would typically follow basic commands.

function! ExpandCommand(pattern) abort
  let aliases =
 \ { 'cn' : 'cnext'
SQLadmin /
Last active August 22, 2023 06:54
Automate xtrabackup for FULL/Incremental and restore
# This is my production backup script.
set -e
set -u
usage() {
echo "usage: $(basename $0) [option]"
echo "option=full: Perform Full Backup"