Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
Created Jun 13, 2022 — forked from hempnall/
Calling C++ code from Rust

Start off with some Rust source code :

#[link(name = "extern")]
extern {
	fn hello();

BH1SCW / gpgcryptic.txt
Created Apr 29, 2022 — forked from cliffano/gpgcryptic.txt
gpg cryptic errors
View gpgcryptic.txt
I started getting the error below after upgrading to gpg (GnuPG) 2.1.21 .
gpg: signing failed: Timeout
gpg: signing failed: Timeout
This was confusing at first, but the timeout was caused by gpg showing a password prompt that takes the full screen of the terminal, and after a period of time, it returned to the command line showing the timeout error.
I didn't notice the password prompt at first because I was working on multiple terminals and only saw the timeout error at the end.
Another error that I encountered earlier was:
Created Apr 28, 2022 — forked from grwlf/
echo -n 'nat-hole-punch' | socat STDIN "UDP-SENDTO:$RELAY:$PORT,sourceport=$PORT"
mosh-server new -p "$PORT" | sed -n 's/MOSH CONNECT [0-9]\+ \(.*\)$/\1/g p'
BH1SCW / gist:6d8480f85ec8e796c3fa3d81f8e1133c
Created Apr 28, 2022 — forked from kwilczynski/gist:dc69ed5acb27a19ec1e29914895d7666
Install lei for kernel development using lore directly on Ubuntu
View gist:6d8480f85ec8e796c3fa3d81f8e1133c
apt install -y vim
apt install -y wget
apt install -y sqlite3 (used by a test, not needed for the build to complete)
apt install -y curl
apt install -y git
apt install -y build-essential
apt install -y pkg-config
BH1SCW / gist:94d4f43c62cdc4a6f57066e4e274472b
Created Apr 12, 2022 — forked from Cyan4973/gist:5b835641c134b8d6e7c3
Takayuki's Streaming example 2 (simplified)
View gist:94d4f43c62cdc4a6f57066e4e274472b
// LZ4 streaming API example 2 (ring buffer)
#include "lz4.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
Created Mar 25, 2022 — forked from githubutilities/
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
Created Jan 19, 2022 — forked from george-hawkins/
Running virtualized x86_64 and emulated arm64 Ubuntu cloud images using QEMU

QEMU arm64 cloud server emulation

This is basically a rehash of an original post on CNXSoft - all credit (particularly for the Virtio device arguments used below) belongs to the author of that piece.

Download the latest uefi1.img image. E.g. ubuntu-16.04-server-cloudimg-arm64-uefi1.img from

Download the UEFI firmware image QEMU_EFI.fd from

Determine your current username and get your current ssh public key:

BH1SCW / gist:aa038b889dd10d8c24b4bb6647fe835d
Created Jan 17, 2022 — forked from brandonros/gist:9086f20135233b1fcf10212cc0830d31
OBD-II data/parameter identifier groups to log for ECU tuning
View gist:aa038b889dd10d8c24b4bb6647fe835d
1. general (rpm, speed, gear, time)
2. engine load (actual + target)
3. torque (actual + target)
4. accelerator pedal angle
5. throttle body angle
6. boost (actual + target)
7. wastegate duty cycle
8. fuel trims (short term)
9. fuel pressure (low + high)
10. ignition timing (all cylinders + average)
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \
BH1SCW / clash.service
Created Dec 19, 2021 — forked from akillcool/clash.service
clash auto start and update subcribe configuration
View clash.service
# edit and save this file to /usr/lib/systemd/system/clash.service
WorkingDirectory="your home directory"/.config/clash
ExecStart="your home directory"/.config/clash/
ExecStop="your home directory"/.config/clash/
Environment="HOME=your home directory"