Skip to content

Instantly share code, notes, and snippets.

vmx /
Last active Jan 20, 2023
Filecoin PreCommit1 phase labelling

This is the pseudocode on how the labelling in PC1 works. It's for the 32GiB sector size production parameters.


  • node: A "node" refers to a 256-bit (32 bytes) value of the padded input data. A 32 GiB sector as 1m nodes.
  • label: A "label" refers to a 256-bit (32 bytes) value of one of the layers. It's the result of hashing the node index, layer index, replica ID and multiple labels together.


  • parent_file: That's a pre-generated file (it's fixed and the same for everyone) that contains a list of random 32-bit integers that are used as offsets to read from a file.
  • padded_data: A 32GiB file that has the padding already applied. "Padding" in this case means that each 0th and 1st bit is zero. It could be validated as:
vmx /
Created Jan 18, 2023
IPLD Shallow dive 2023-01-18
title tags description slideOptions
IPLD Shallow Dive
IPLD, Launchpad
Launchpad V8 presentaiton 2023-01-18
width theme
vmx /
Created Oct 12, 2022
Takes a file and indents at `(` and `[`.
# SPDX-License-Identifier: MIT
# Takes a file and indents at `(` and `[`.
import sys
def main(argv=None):
if argv is None:
argv = sys.argv
vmx / Cargo.toml
Created Sep 30, 2022
Multiexp Halo2/sppark comparison
View Cargo.toml
name = "halo2_sppark_msm"
version = "0.1.0"
edition = "2021"
halo2_proofs = "0.2.0"
pasta-msm = "0.1.3"
vmx /
Last active May 23, 2022
OSGeo wiki LDAP migration debgging
  1. I'm opening a new Firefox window
  2. I'm going to
  3. I click on Log in on top right corner, which gets me to
  4. It redirects to
  5. (BTW: It's 2022-05-23 9:54 CEST)
  6. I enter:
    • Username: Vmische
    • Password: :)
    • Keep me logged in: No
  7. I press "Log in" which gets me to
vmx /
Created Jan 21, 2022
Make GDB skip Rust's standard library files
# This script defines a command called `skiprustc` which skips all Rust
# standard library source files when debugging. Just drop this file into your
# `~/.gdbinit.d` directory.
# In order to enable it automatically whenever you debug Rust, you can add
# this hook to your `.gdbinit`:
# define hookpost-run
# skiprustc
# end
vmx /
Created Jan 12, 2022
Trying to serialize a CID as enum
use std::fmt;
use serde::{de, ser, Deserialize, Serialize};
pub const ENUM_NAME: &str = "enumname";
pub const ENUM_VARIANT_NAME: &str = "enumvariantname";
//#[derive(Debug, PartialEq, Deserialize, Serialize)]
#[derive(Debug, PartialEq)]
pub struct Cid(String);
vmx /
Last active May 10, 2022
Get some power/energy metrics while running Filecoin proofs/sealing
# From
cleanup() {
# kill all processes whose parent is this process
sudo pkill -P $$
for sig in INT QUIT HUP TERM; do
trap "
vmx /
Created Oct 11, 2021
Installing Nvidia drivers on Debian testing 2021-10-11

Current (2021-10-11) Debian testing cannot install Nvidia drivers properly. There [bug report 994860], which contains [a patch].

Here are the steps I took to apply that patch and make things work.

Download the fix-kernel514.patch from this Gist.

Then run these commands:

$ sudo apt install nvidia-installer-cleanup glx-alternative-nvidia update-glx glx-diversions glx-alternative-mesa  nvidia-support nvidia-kernel-common  nvidia-modprobe xserver-xorg-core libvdpau1
vmx /
Created Aug 25, 2021
Multiexp and FFT OpenCL/CUDA kernel
// Defines to make the code work with both, CUDA and OpenCL
//#ifdef __NVCC__
#ifdef __CUDACC__
#define DEVICE __device__
#define GLOBAL
#define KERNEL extern "C" __global__
#define LOCAL __shared__
#define GET_GLOBAL_ID() blockIdx.x * blockDim.x + threadIdx.x
#define GET_GROUP_ID() blockIdx.x