Skip to content

Instantly share code, notes, and snippets.

@tmpfs
tmpfs / node-npm-firejail.md
Last active September 18, 2025 07:41
node/npm firejail

It's far from perfect but adds some additional security for what's accessible on the file system, restricts executables and access to environment variables.

Add wrapper executables (for node and npm) to a PATH that is ahead of NVM_BIN:

#!/usr/bin/env bash

set -eu

bin_path="$NVM_BIN"
@tmpfs
tmpfs / pi-nas.md
Last active August 25, 2025 11:50
Raspberry Pi 5 w/ Pimoroni Base Duo 8TB NAS

Hardware

  • Raspberry Pi 5
  • Official active cooler
  • Official Pi 5 power supply
  • Pimoroni Base Duo NVMe HAT
  • Kingston NV3 NVMe M.2 4TB Disks - 2280 (x2)
  • SD Card
  • NVMe -> USB Dongle
  • SD Card -> USB Dongle
```rust
extern crate ndk_context;
extern crate jni;
use jni::JNIEnv;
use jni::objects::JObject;
use ndk_context::android_context;
use std::sync::Once;
static INIT: Once = Once::new();
{
"round": 1,
"sender": 1,
"receiver": null,
"body": {
"Round1": {
"e": {
"n": "25506611559190840766611135176925143942182486124027350735220455156308730740202684985624269096832823248497626874229550097919316346890511663288782691040785791787282972901582752312676698187528277316072666313083717005689593717808163373411161172026782480505863641393659447898284378219700898511364022407991756906622269110767397789618828489807241919070876929202336892541815083910799464502769284315308379587531060574025015503034003494220249701299469016124975503053689514557063246554742126570420876840243650650385816506230224467858372867589161056979409834064671300432566036728867356515632605807712122120075624593584560424703621"
},
"dlog_statement": {

Prerequisites

  • rust stable
  • cargo-lipo
  • cargo-just
  • cargo-ndk

Compiling for Android:

void function() {
;
(function() {
/* LavaPack runtime goes here */
})();
const __modules__ = [
[
0,
{
"normalize-path": 5,
@tmpfs
tmpfs / threshold-signatures-wasm.md
Last active September 6, 2021 01:49
Research to build threshold-signatures for WASM

Trying to build threshold-signatures for the target wasm32-unknown-unknown the first issue encountered is this error:

warning: depend/secp256k1/contrib/lax_der_parsing.c:7:10: fatal error: 'string.h' file not found
warning: #include <string.h>
warning:          ^~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `secp256k1 v0.15.5`
@tmpfs
tmpfs / sketch.js
Last active August 24, 2021 01:03
Sketch for bundler output
// Use an IIFE to restrict scope pollution
void function() {
// Bundle the computed (merged) policy file
var __policy__ = { resources: { /* Policy resource definitions */ } };
// Unsafe handling for trusted code (eg: LavaMoat)
var __unsafe__ = {};
function __unsafe_require__(id, module, exports) {
if (__unsafe__[id]) {
### Keybase proof
I hereby claim:
* I am tmpfs on github.
* I am muji_tmpfs (https://keybase.io/muji_tmpfs) on keybase.
* I have a public key ASCRLHctO4vZaY6eWgUilLEg9Biwjk5klp_EX-Vu8bFo7wo
To claim this, I am signing this object:
This is a test gist so I can build a little gist short code partial <3.