Skip to content

Instantly share code, notes, and snippets.

View lzlrd's full-sized avatar
🛍️
Keeping the digital till running.

Diab Neiroukh lzlrd

🛍️
Keeping the digital till running.
View GitHub Profile
@VictorTaelin
VictorTaelin / spec.md
Created February 26, 2025 15:51
SupTT Spec

The Interaction Calculus

The Interaction Calculus (IC) is term rewriting system inspired by the Lambda Calculus (λC), but with some major differences:

  1. Vars are affine: they can only occur up to one time.
  2. Vars are global: they can occur anywhere in the program.
  3. There is a new core primitive: the superposition.

An IC term is defined by the following grammar:

@davepeck
davepeck / RESOLVE.md
Last active March 22, 2025 03:54
A Tiny Python script to convert Bluesky handles to DIDs, and DIDs to handles

A command-line script to convert between Bluesky DIDs and handles

This small Python script makes it easy to convert from ATProto DIDs to their associated handles and back again:

$ ./resolve.py handle @davepeck.org
did:plc:caznr5mgvjft4mu4p2vpttfx
$ ./resolve.py did did:plc:caznr5mgvjft4mu4p2vpttfx
davepeck.org
@sorend
sorend / Update firwmware WD Black SN770 firmware on Arch Linux.md
Last active May 12, 2025 07:37
Update firmware WD Black SN770 firmware on Arch Linux

Update firmware WD Black SN770 firmware on Arch Linux

Been having problems with my new SN770 drive, and decided to check if I can firmware update it on Linux. WD only provides a Windows tool, Western Digital Dashboard to download and install firmwares, but, it's possible to find the firmware and install it using Linux tooling as well.

1. Check that nvme-cli is installed:

❱ sudo pacman -S nvme-cli
@Balder1840
Balder1840 / wsl2_love_openwrt.md
Last active March 19, 2025 03:03
Run OpenWrt as a custom distro in WSL2 (WSL2下直接运行openwrt)

Here is an instruction to start openwrt as a custom WSL2 distro.
I didn't start it as a gateway in my local because I don't have windows 11 installed, and you know the poor network mode in windows 10 and wsl2.

Found a way to set WSL's network mode to bridged here and have successfully configured it as a gateway in my local.

But anyway, I think it should work under windows 11 and wsl2, since you can config it as bridged mode.
Have fun!

1. Prerequisites

1.1. Import openwrt's rootfs.tar.gz as a custom WSL2 distro

you can download from the official site

@erfanoabdi
erfanoabdi / compatibility_matrix_checker.py
Last active March 30, 2023 05:26
kernel defconfig compatibility matrix checker script
import xml.etree.ElementTree as ET
# Parse the compatibility matrix XML
compatibility_matrix = ET.parse('<path to compatibility_matrix xml>')
# Extract the kernel version and required configs from the XML
kernel_version = '4.19.191'
required_configs = []
for kernel in compatibility_matrix.findall('.//kernel'):
if kernel.attrib['version'] == kernel_version:
@spenserhale
spenserhale / git-batch-push.sh
Last active May 6, 2025 06:06
When your repo exceeds upload limit (GitHub 2GB), you can push in batches so you can store up to total size limit. (100GB) (Warning uses force push, ideally should be used for setting up new remote, once)
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=250
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else
@alonlavian
alonlavian / vpc-inside.py
Created August 7, 2022 08:09
Describe resources inside an AWS VPC
import logging
import boto3
from argparse import ArgumentParser, HelpFormatter
from botocore.exceptions import ClientError, ProfileNotFound
# logger config
logger = logging.getLogger()
logging.basicConfig(level=logging.INFO,
format='%(message)s')
@mavaddat
mavaddat / Invoke-DownloadAppxPackage.ps1
Last active October 12, 2023 17:00
This correctly downloads neutral and x64 packages but untested for arm and 32bit systems. The path must point to a folder.
# Usage (for one URI):
<#
Import-Module -Name Invoke-DownloadAppxPackage.ps1
$URI = 'https://www.microsoft.com/store/productId/9P6RC76MSMMJ' # From Windows Store 'share'
if( Get-Command -Name Get-AppxPackageDownload -CommandType Function ) {
Get-AppxPackageDownload -Uri $URI -Path $env:TEMP # Use -Force to skip confirmation
} else {
Write-Host 'Get-AppxPackageDownload function not found'
}
@CarbonGhost
CarbonGhost / a_optifine-alternatives.md
Last active January 22, 2025 21:06
CarbonGhost's recommended OptiFine alternatives

CarbonGhost's OptiFine alternatives

This is my personal list of OptiFine replacements. Although other lists exist, this list aims to be an simple feature replacement list that aims not to overwhelm you.

This list was written with 1.18 and 1.17 in mind, but many mods should still be available for 1.16 and 1.15. The critiques of OptiFine aren't relevant to a specific version of the game.

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.