Skip to content

Instantly share code, notes, and snippets.

View junjihashimoto's full-sized avatar
🏠
Working from home

junji hashimoto junjihashimoto

🏠
Working from home
View GitHub Profile
@mwtian
mwtian / gist:0f473325a1ad5a74982fcf91737653b4
Last active May 13, 2025 06:05
Debugging Sui node memory growth

Debugging Sui node memory growth

When there is memory usage growth in the sui-node process (validator or fullnode), usually this is hard to reproduce and not unobserved on many other instances (otherwise the issue would have been fixed before the release). More infromation are usually needed to help us debug the issue.

Metrics

First, a few metrics can be checked to see if a particular stream is very large and keeps growing.

  • rocksdb_estimate_table_readers_mem
  • rocksdb_block_cache_usage
@jul1u5
jul1u5 / Gradually Typed Hasktorch.md
Last active September 3, 2021 09:49
Google Summer of Code 2021 Final Report

Report for GSoC 2021 (Gradually Typed Hasktorch)

This is the final report for the GSoC 2021 project - Gradually Typed Hasktorch. Gradually Typed Hasktorch is a new tensor API for Hasktorch. It has been initiated by my mentor, Torsten Scholak, and as part of GSoC I helped with streamlining this new API.

Student: Julius Marozas Mentor: Torsten Scholak

Index

@djfdyuruiry
djfdyuruiry / README.md
Last active October 8, 2024 04:54
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@abel0b
abel0b / install-linux-perf-on-wsl2.sh
Last active January 6, 2026 14:11
Install perf on WSL 2
apt install flex bison
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1
cd WSL2-Linux-Kernel/tools/perf
make -j8
sudo cp perf /usr/local/bin
@MarioHewardt
MarioHewardt / enable_ebpf_on_wsl2
Last active August 18, 2025 11:48
Enable EBPF on WSL2
By default, EBPF programs will not run on WSL2 due to required kernel modules missing. The following example error is an
indication of this problem:
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.84-microso
ft-standard/modules.dep.bin'
modprobe: FATAL: Module kheaders not found in directory /lib/modules/4.19.84-microsoft-standard
chdir(/lib/modules/4.19.84-microsoft-standard/build): No such file or directory
To fix this you need to rebuild the WSL2 kernel with the missing kernel modules. The below instructions are for Ubuntu 18.04 WSL2.
1. git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
@CMCDragonkai
CMCDragonkai / nix_ca_certificate_handling.md
Created October 16, 2018 07:02
Nix CA Certificate Handling #nix

Nix CA Certificate Handling

Some applications requires contacting HTTPS endpoints. In those cases you need to supply the CA certificates.

Most Nix applications won't package in the CA certificates, this is because they can make use of the OS provided CA certificate store.

The NixOS location for this is at: /etc/ssl/certs.

The OpenSSL library in Nixpkgs is compiled to use that path if there is no environment variables such as SSL_CERT_FILE.

@bobvanderlinden
bobvanderlinden / rails_in_nix-shell.md
Last active March 10, 2023 03:13
Running Rails through nix-shell

Use the following to generate gemset.nix:

nix run nixpkgs.bundix --command bundix

Then run:

nix-shell
@Icelandjack
Icelandjack / Constraints.org
Last active May 28, 2025 21:28
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.

@gallais
gallais / ImperativeDSL.hs
Created July 26, 2016 23:31
Small well-scoped and well-typed by construction imperative DSL
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE PolyKinds #-}
module ImperativeDSL where
@maxim
maxim / gh-dl-release
Last active December 31, 2025 12:22
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#