Skip to content

Instantly share code, notes, and snippets.

@tvdstaaij
tvdstaaij / keybase.md
Created September 7, 2015 19:30
Keybase proof

Keybase proof

I hereby claim:

  • I am tvdstaaij on github.
  • I am tvds (https://keybase.io/tvds) on keybase.
  • I have a public key whose fingerprint is A82C 61DD DE12 021A 8080 63B4 479A 97D4 0943 D5B2

To claim this, I am signing this object:

@tvdstaaij
tvdstaaij / protobufjs-stringify-enums.js
Last active June 30, 2016 14:51
Convert ProtoBuf.js enum values to strings using reflection
var _ = require('lodash');
function stringifyEnums(message) {
_.forEach(message.$type.children, function(child) {
var type = _.get(child, 'element.resolvedType', null);
if (type && type.className === 'Enum' && type.children) {
var metaValue = _.find(type.children, {
id: message[child.name]
});
if (metaValue && metaValue.name)
@tvdstaaij
tvdstaaij / keybase-github.md
Last active September 4, 2016 09:13
Set up a Keybase managed PGP key for use with git and Github
@tvdstaaij
tvdstaaij / 5852.patch
Last active November 14, 2017 12:19
Arch Linux OpenCV 3.1.0 with Qt and CUDA
From 24dbb43c096691d0333cacf231e22f1369f8c826 Mon Sep 17 00:00:00 2001
From: Alexander Alekhin <alexander.alekhin@itseez.com>
Date: Tue, 22 Dec 2015 17:10:33 +0300
Subject: [PATCH] pkg-config: modules list contains only OpenCV modules (fixes
#5852)
---
cmake/OpenCVUtils.cmake | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
@tvdstaaij
tvdstaaij / PKGBUILD.patch
Created September 2, 2016 14:23
Arch Linux ibus-mozc-ut patch for kana as default input mode
--- PKGBUILD.orig 2016-09-02 14:28:07.722064884 +0200
+++ PKGBUILD.new 2016-09-02 14:30:38.228733627 +0200
@@ -138,6 +138,9 @@
cd "${srcdir}/mozc/"
+ # https://github.com/google/mozc/issues/381#issuecomment-242965044
+ sed -i 's/const bool kActivatedOnLaunch = false/const bool kActivatedOnLaunch = true/' src/unix/ibus/property_handler.cc
+
git submodule update --init --recursive
@tvdstaaij
tvdstaaij / rpi-install-cryptroot.sh
Last active December 5, 2023 21:45
Raspberry Pi headless full disk encryption with remote unlock
#!/bin/bash
# Based on guide: https://github.com/ViRb3/pi-encrypted-boot-ssh (rev cac7ac5)
#
# Some usage notes:
# - Definitions: "host" means the machine executing this script, "source" means the prebuilt Raspberry Pi OS image used as a base, "target" means the image or disk being provisioned
# - Assumes Debian host system, and execution as root. Running in a VM is highly recommended for safety reasons
# - Only tested with https://raspi.debian.net/tested-images/ Bullseye/Bookworm RPi4 images as source (should also work for RPi3)
# - Assumes target with boot and root partition on one disk
# - Assumes Raspberry Pi is connected with Ethernet and DHCP (i.e. no special network configuration in initramfs)
# - After booting for the first time, you can ssh as `root` using one of the keys authorized for Dropbear