Skip to content

Instantly share code, notes, and snippets.

View itzmeanjan's full-sized avatar
😎
Working ...

Anjan Roy itzmeanjan

😎
Working ...
View GitHub Profile
@itzmeanjan
itzmeanjan / README.md
Last active May 7, 2026 02:41
ML-DSA Known Answer Tests and Git Patch to Generate KATs from ML-DSA "Official" Reference Implementation
@itzmeanjan
itzmeanjan / Cargo.toml
Last active April 7, 2026 01:32
😎 Parallel Matrix Multiplication on GPU, using Rust Vulkan Compute API of `vulkano` 🚴🏼
[package]
name = "gpu-matrix-multiplication"
version = "0.1.0"
edition = "2024"
rust-version = "1.85.0"
[dependencies]
vulkano = "=0.35.1"
vulkano-shaders = "=0.35.0"
rand = "=0.8.4"
@itzmeanjan
itzmeanjan / linux-machine-setup.sh
Last active February 24, 2026 10:05
Quickly setup AWS EC2 linux instance - ready for running tests and benchmarks
#!/bin/bash
# System update
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get autoremove -y
# Install system development tools
sudo apt-get install build-essential -y
sudo apt-get install cmake -y
@itzmeanjan
itzmeanjan / google-benchmark-with-libpfm.md
Last active January 8, 2026 12:09
Using Performance Monitoring Unit(s), when benchmarking with google-benchmark.

Background

I'm demonstrating following on a machine, running Ubuntu 22.04 with GNU/Linux kernel 5.19.0.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
@itzmeanjan
itzmeanjan / setup_vulkan_sdk.sh
Created December 16, 2025 06:34
Setup Vulkan SDK on Ubuntu
#!/usr/bin/bash
# Script version of "Getting Started with the Linux Tarball Vulkan SDK" guide @ https://vulkan.lunarg.com/doc/sdk/1.4.335.0/linux/getting_started.html.
# Targets Ubuntu, tested to be working on Ubuntu 25.10.
# Source of truth for Vulkan SDK version and checksum @ https://vulkan.lunarg.com/sdk/home#linux.
EXPECTED_SHA256_CHECKSUM="ccab8047f33ef848e3928c7fdd19987b35da3085ad20178f473acc230fa3c5f2"
VULKAN_SDK_VERSION="1.4.335.0"
VULKAN_SDK_TARBALL_DOWNLOAD_URL="https://sdk.lunarg.com/sdk/download/${VULKAN_SDK_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz"
VULKAN_SDK_TARBALL=$(realpath vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz)
@itzmeanjan
itzmeanjan / README.md
Last active September 21, 2025 05:58
Compute Logarithm and Exponentiation Tables for Fast Multiplication and Inversion over GF(2^8)
  1. Clone this gist repository.
  2. Setup python virtual environment.
# `cd` into this gist
python3 -m venv .
source bin/activate
  1. Fetch dependencies.
python -m pip install -r requirements.txt
@itzmeanjan
itzmeanjan / requirements.txt
Last active August 29, 2025 17:10
Using Content Addressable Identifier (CID) for Fun and Profit
blake3==1.0.5
pillow==11.3.0
@itzmeanjan
itzmeanjan / newton_fractal.cpp
Last active February 27, 2025 17:31
🤖 Computing Newton Fractal on GPGPU + CPU, using SYCL DPC++ 🔥
#include <CL/sycl.hpp>
#include <chrono>
#include <complex>
#include <iostream>
using namespace sycl;
typedef std::complex<double> cmplx;
constexpr uint Y = 1 << 11;
@itzmeanjan
itzmeanjan / README.md
Created February 22, 2025 07:08
Populate Ethereum Name Service (ENS) JSON Database from List of Labels

How to ?

  1. Download ENS labels JSON database from https://github.com/adraffy/ens-labels.git (retrieved at commit d1d85346).
  2. Download this gist and unzip. Then move the downloaded labels.json file inside the unzipped project directory.
  3. Inside unzipped project directory, create a Python virtual environment.
python -m venv .
source bin/activate
  1. Download dependencies using pip.
@itzmeanjan
itzmeanjan / test_montgomery_arithmetic.py
Last active October 22, 2024 05:08
Montgomery Modular Arithmetic for 256 -bit `secp256k1` Prime Field
#!/usr/bin/python3
from math import ceil
from typing import List, Tuple
from random import randint
def bit_count(num: int) -> int:
'''
Same as len(bin(num)[2:])