Skip to content

Instantly share code, notes, and snippets.

@masonjames
masonjames / unslopify.md
Last active May 7, 2026 23:33
unslopify workflwow for repoprompt
id DE38DEE7-10BB-43D4-B74F-CF47E30CE946
name Unslopify
icon wand.and.stars
tooltip Deep cleanup audit with safe implementation
description Audit and clean code slop across focused lanes: dead code, weak types, cycles, error hiding, legacy paths, bad comments, and obvious duplication.

Unslopify Mode

@lxe
lxe / bun-middleware.ts
Last active November 15, 2025 14:12
bun-middleware.ts
// TODO: somehow enforce ordering at compile time
type WriteOnly<T> = {
-readonly [K in keyof T]: T[K]; // TODO: Typescript can't block setters like this natively :)
};
type RouteHandler<T extends string> = ( // TODO: Extract from Bun... I think it has this built in
req: Bun.BunRequest<T>,
server: Bun.Server,
) => Response | Promise<Response>;
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active May 10, 2026 06:15
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@ithilelda
ithilelda / PXE boot with GRUB2.md
Last active April 2, 2026 10:47
actually working pxe boot with grub2 on bios (client setup)

PXE Boot Setup with GRUB2 Tutorial

There are many tutorials on the internet that tell you how to setup a PXE Boot server with PXELINUX. There are however other options to replace PXELINUX like GRUB2 and iPXE. In this tutorial, I'm going to teach you how to setup a PXE Boot Environment with GRUB2, and later add menu entries to boot many popular OSes.

Notice: I'm not going to repeat the part where you setup the DHCP and TFTP server. Such section in other tutorials still applies to this scenario.

Making the GRUB2 image to be loaded by NIC

think the GRUB2 image as the same as PXELINUX's pxelinux.0 file. Your DHCP server must point to it, and it must be available on your TFTP server. Instead of shoving a blob down your throat and telling you that it just works, I'm going to walk you through the process of making one yourself by using an readily available linux installation.

zt_logo

Setting up ZeroTier as a default ethernet interface

Step 1: Install ZeroTier

Install ZeroTier on your gateway, join your network and authorize it, and then configure it as a basic IPv4 NAT router

/etc/sysctl.conf

@sheepla
sheepla / suggest.sh
Last active March 18, 2024 03:39
Web検索のサジェストキーワードを取得する.sh
#!/bin/sh
# suggest.sh -- get suggestion keywords from several site
#
# Usage:
# suggest SITE KEYWORDS...
# SITE:
# youtube(yt), archwiki(aw), duckduckgo(d), wikipedia(w), amazon(a)
# Example:
# suggest wikipedia Linux
@adamelliotfields
adamelliotfields / windows-ssh-no-password-with-keys-wsl2.md
Last active May 8, 2026 02:07
Windows SSH Server with Password-less Key Authentication and Default WSL2 Shell

I wanted to be able to SSH into my Windows laptop directly into Linux. I also wanted to disable password authentication and only allow public key (RSA in my case) authentication.

Scott Hanselman wrote a blog post on how to make your default WSL2 distro your default shell for SSH. Windows OS Hub published an article on using public key authentication. These were both helpful resources.

I'll assume you're already familiar with using SSH keys. If not, this article at DigitalOcean is very informative.

Add your public key to your authorized keys file

First thing you want to do is create the file $HOME\.ssh\authorized_keys. If you run into issues, it could be due to incorrect file ownership.

use bytes::{Buf, Bytes, BytesMut};
use opentelemetry::sdk;
use opentelemetry::sdk::propagation::TraceContextPropagator;
use opentelemetry::sdk::trace::{Builder, Sampler};
use opentelemetry::trace::TracerProvider;
use opentelemetry::{global::set_text_map_propagator, KeyValue};
use std::convert::TryFrom;
use std::env::var;
use std::net::SocketAddr;
use std::process::Stdio;
@ninlith
ninlith / build.txt
Last active February 12, 2025 04:55
Hybrid UEFI/BIOS multiboot USB drive
# Hybrid UEFI/BIOS multiboot USB drive
# Install required packages
sudo apt install gdisk grub2-common grub-efi-amd64-bin grub-pc-bin qemu-system
# Create an empty disk image
target_size=3.6G # $(lsblk -b --output SIZE -n -d /dev/sdX) for drive size
qemu-img create -f raw boottitikku.img "$target_size"
# Create a GUID Partition Table (GPT)
@plar
plar / ubuntu_disk_encryption.sh
Last active November 6, 2021 19:07
Ubuntu_Full_Disk_Encryption_Howto_2019 (shell commands)
sudo -i
export DEV="/dev/sda"
export DEV="/dev/nvme0n1"
export DM="${DEV##*/}"
export DEVP="${DEV}$( if [[ "$DEV" =~ "nvme" ]]; then echo "p"; fi )"
export DM="${DM}$( if [[ "$DM" =~ "nvme" ]]; then echo "p"; fi )"
# export SDD_PASS=secret123
sgdisk --print $DEV
sgdisk --zap-all $DEV