Skip to content

Instantly share code, notes, and snippets.

View HurricanKai's full-sized avatar

Kai Jellinghaus HurricanKai

View GitHub Profile
@VictorTaelin
VictorTaelin / hvm3_atomic_linker.md
Last active March 22, 2025 00:56
HVM3's Optimal Polarized Atomic Linker

HVM3's Optimal Atomic Linker (with Polarization)

Atomic linking is at the heart of HVM's implementation: it is what allows threads to collaborate towards massive parallelism. All major HVM versions started with a better atomic linker. From slow, buggy locks (HVM1), to AtomicCAS (HVM1.5), to AtomicSwap (HVM2), the algorithm became simpler and faster over the years.

On the initial HVM3 implementation, I noticed that one of the cases on the atomic linker never happened. After some reasoning, I now understand why, and

@7rebux
7rebux / settings.json
Last active August 12, 2022 17:44
MonkeyType settings JSON
{
"theme":"chaos_theory",
"themeLight":"serika",
"themeDark":"serika_dark",
"autoSwitchTheme":false,
"customTheme":false,
"customThemeColors":[
"#323437",
"#e2b714",
"#e2b714",
@ZacharyPatten
ZacharyPatten / readme.md
Last active February 3, 2023 15:58
GitHub Repository Checklist (C#)

GitHub Repository Checklist (C#)

Have a repository on GitHub? Planning on making a repository on GitHub? This checklist is intended to introduce you to various features that may help you make the most of your GitHub repository with specific recommendations for C# repositories.

Checklist

These are only suggestions.
They may not be appropriate for all repositories.
They are in no particular order.
Click each item to expand for more information.

I had hoped to forward some documents based on past work to build interprocedural analysis (IPA) in systems like Bartok/Phoenix, but didn’t find anything that was both accurate and concise.
So here’s a sketch of how the system could (and I would argue, should) be built. UTC/NUTC does something fairly similar.
First, some goals
• Support concurrency where possible, since IPA instances can be quite large
• Support partitioning (dividing input set into two or more parts, analyzing each separately)
• Allow pluggable components for particular problem domains
• Keep procedural knowledge suitably compartmentalized, avoid duplication (eg don’t have multiple type systems or multiple IL analyzers)
@sos-dll
sos-dll / TypeHacks.Cast.cs
Last active November 13, 2020 21:30
✨ A brand new way for casting values/objects in C# by (ab)using .NET internals. Enjoy. (Tested on .NET 5.)
// Licensed under WTFPL.
using System;
namespace sos.dll
{
/* ☢ (̵A̸B̴)̸U̷S̶I̸N̸G̶ ̶ ̶.̸N̶E̴T̸ ̶ ̵I̸N̵T̸E̷R̷N̷A̴L̷S̸ ☢ */
public static unsafe partial class TypeHacks
{
/// <summary>
@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active April 19, 2025 14:37
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@jakub-g
jakub-g / async-defer-module.md
Last active March 24, 2025 07:50
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

@prucha
prucha / UnityMeshCreator.cs
Last active March 31, 2024 15:45
Unity: Creating a Mesh in code
using UnityEngine;
using System.Collections;
// This Unity script demonstrates how to create a Mesh (in this case a Cube) purely through code.
// Simply, create a new Scene, add this script to the Main Camera, and run.
public class UnityMeshCreator : MonoBehaviour {
GameObject _cube;
@Manouchehri
Manouchehri / cloudflare.sh
Last active April 16, 2025 11:55
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP