Skip to content

Instantly share code, notes, and snippets.

@jeremyd2019
jeremyd2019 / find_fast_cwd_arm.c
Last active March 23, 2025 15:02
prototype code to find fast cwd pointer on arm64
#include <windows.h>
/* hacks on top of hacks ... */
#define _PEB _NOT__PEB
#define PEB _NOT_PEB
#define PPEB _NOT_PPEB
#define _TEB _NOT__TEB
#define TEB _NOT_TEB
#define PTEB _NOT_PTEB
#include <winternl.h>
#undef _PEB
{ÿxosPc0 serial#f050412cc7e4c7e22c7ee7d08699826b subid 0xc4
xenv cs2 ok
Power supply: OK
DRAM0 OK (9)
DRAM1 OK (8)
@nacx
nacx / inverse-cidr.py
Created October 10, 2014 08:12
Compute the inverse list of CIDR blocks
"""Use it like this: main('192.168.1.0/24')"""
IPV4_MIN = 0
IPV4_MAX = 0xFFFFFFFF
def not_network(ipv4_address, ipv4_netmask):
assert IPV4_MIN <= ipv4_address <= IPV4_MAX
assert IPV4_MIN <= ipv4_netmask <= IPV4_MAX
def hostmask_netmask(m):
@eznix86
eznix86 / alpine-remove-desktop.sh
Last active March 23, 2025 14:52
This is the inverse of setup-desktop in Alpine Linux
# copy and paste to /sbin/remove-desktop
#!/bin/sh
PREFIX=
: ${LIBDIR=$PREFIX/lib}
. "$LIBDIR/libalpine.sh"
usage() {
cat <<-__EOF__
@akdetrick
akdetrick / rvm-to-rbenv.md
Last active March 23, 2025 14:51
Guide to switching to rbenv bliss from RVM hell

RVM to rbenv

Why? @sstephenson explains it best here.


1) remove RVM from your system

This should get rid of the rvm dir and any installed rubies:

$ rvm implode
@probonopd
probonopd / Wayland.md
Last active March 23, 2025 14:51
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

@imba-tjd
imba-tjd / .Cloud.md
Last active March 23, 2025 14:48
☁️ 一些免费的云资源

  • IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装。PaaS提供语言环境和框架(可以自己选)。SaaS只能使用开发好的软件(卖软件本身,如税务会计、表格文字处理)。BaaS一般类似于非关系数据库,但各家不通用
  • 云服务的特点:零前期成本 & 按需付费 & 弹性(类似于租,可随时多加、退掉;但没有残值)、高可用(放在机房中,不同AZ间水电隔离)

其他人的集合

from mcp.server.fastmcp import FastMCP
import time
import signal
import sys
# Handle SIGINT (Ctrl+C) gracefully
def signal_handler(sig, frame):
print("Shutting down server gracefully...")
sys.exit(0)
@mberman84
mberman84 / gist:931fb7acf8c99279a54053328c2f074a
Created March 12, 2025 20:50
claude_desktop_config.json
{
"mcpServers": {
"count-r": {
"command": "python",
"args": [
"C:\\Users\\mberm\\count-r-server\\server.py"
],
"host": "127.0.0.1",
"port": 8080,
"timeout": 30000
@jmatsushita
jmatsushita / README
Last active March 23, 2025 14:43
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.