Skip to content

Instantly share code, notes, and snippets.

@meeas
meeas / DebianSid_on_LUKS-BTRFS_with_systemd-boot.md
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
View DebianSid_on_LUKS-BTRFS_with_systemd-boot.md

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
Hakky54 / cheat_sheet_http_client_ssl_configuration_for_java_kotlin_scala.md
Last active August 18, 2022 11:56
Cheat Sheet - Http Client SSL TLS Configuration for Java Kotlin and Scala with example http requests
View cheat_sheet_http_client_ssl_configuration_for_java_kotlin_scala.md
@kristoferjoseph
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">
<head>
<meta charset="UTF-8">
<title>Single File Web Component</title>
</head>
<body>
<template id=single-file>
<style>
h1 {
@michalc
michalc / sqlite.py
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
View sqlite.py
# From https://stackoverflow.com/a/68876046/1319998, which is itself inspired by https://stackoverflow.com/a/68814418/1319998
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
andrebrait / keychron_linux.md
Last active December 5, 2023 06:23
Keychron keyboards on Linux + Bluetooth fixes
View keychron_linux.md

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
Checksum / assert.jq
Last active August 12, 2022 20:21
Assertion library for jq
View assert.jq
# A simple assertion library for jq (https://github.com/stedolan/jq)
# Author: Srinath Sankar
def assert(level; expr; msg):
if expr then
.
else
. |= . + [{ level: level, message: msg }]
end;
@skybldev
skybldev / lqr.sh
Last active March 20, 2022 16:39
A script that content-aware-scales (or seam carves) a video.
View lqr.sh
#!/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
romainl / path.md
Last active September 8, 2023 21:32
Off the beaten path
View path.md

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
g0xA52A2A / Vim_autoreply.md
Last active June 4, 2023 23:30
Vim autoreply
View Vim_autoreply.md

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
SQLadmin / xtrabackup_full_increment_restore.sh
Last active August 22, 2023 06:54
Automate xtrabackup for FULL/Incremental and restore
View xtrabackup_full_increment_restore.sh
#!/bin/bash
# This is my production backup script.
# https://sqlgossip.com
set -e
set -u
usage() {
echo "usage: $(basename $0) [option]"
echo "option=full: Perform Full Backup"