Skip to content

Instantly share code, notes, and snippets.

@paralin
paralin / self-improving-ai.md
Created February 22, 2025 19:58
Self-improving AI: we have it, it's here. Here's how it works.

This document contains my simplified understanding of how this works.

it is by no means an exhaustive explanation and is meant to get the "vibe" of what's happening while glossing over implementation detail.


  1. Ask deepseek R1 to think about something.
  2. It thinks about it for a long time, spending $$$ on compute.
  3. It eventually comes to a conclusion.
  4. Take the question + the conclusion and generate a "thought trace" which is the "correct" version or the "shortest version" of the "thought process"
@paralin
paralin / Go Git CLI Extensions
Last active July 13, 2024 20:34
git utilities written in Go
Copyright 2024 Christian Stewart <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH TH
@sikanhe
sikanhe / ReactCompilerPlugin.ts
Last active April 12, 2025 03:37
React Compiler plugin for ESBuild
import { readFileSync } from "node:fs"
import * as babel from "@babel/core"
import BabelPluginReactCompiler from "babel-plugin-react-compiler"
import type { Plugin } from "esbuild"
import QuickLRU from "quick-lru"
export function ReactCompilerEsbuildPlugin({
filter,
sourceMaps,
runtimeModulePath,
@paralin
paralin / minimize-go-wasm-size.md
Last active September 27, 2024 08:13
Minimizing Go wasm binaries size: a multi-pronged approach

My approach to smaller Go wasm binaries:

  • protoc-gen-go-lite: Removes dependency on reflection, making your binaries lighter.
  • goweight: Analyze the size of your binaries. This is a fork with added wasm support.
  • goda: Use to find why something is imported by executing:
    goda graph "reach(.:all, gonum.org/v1/gonum/mat)" | dot -Tsvg -o graph.svg
    
  • wasm-opt: Optimize wasm binaries for size with the command:
@q3k
q3k / hashes.txt
Last active November 11, 2024 17:38
liblzma backdoor strings extracted from 5.6.1 (from a built-in trie)
0810 b' from '
0678 b' ssh2'
00d8 b'%.48s:%.48s():%d (pid=%ld)\x00'
0708 b'%s'
0108 b'/usr/sbin/sshd\x00'
0870 b'Accepted password for '
01a0 b'Accepted publickey for '
0c40 b'BN_bin2bn\x00'
06d0 b'BN_bn2bin\x00'
0958 b'BN_dup\x00'
@thesamesam
thesamesam / xz-backdoor.md
Last active April 7, 2025 09:15
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@paralin
paralin / x2x-on-macos.md
Created December 27, 2023 22:56
x2x on MacOS

X2X on MacOS

It works! Sort of.

Using X2X from MacOS

  1. Install XQuartz
  2. Set up your Linux host with X11, x2x, and a SSH server.
  3. Add your host to ~/.ssh/config so you can use ssh myhost to connect.
  4. Open XQuartz. Select in the top menu: Applications -> Terminal
@paralin
paralin / gist:d4acde4dae926d62fc56169be3cb27f4
Created August 23, 2023 22:00
llama.cpp docker cublas make it go fast
docker rm -f rocm
sudo docker run -d \
--name=rocm \
--privileged \
-v /dev:/dev \
-v /mnt/persist/work/rocm:/home/rocm-user \
--security-opt seccomp=unconfined \
--group-add video \
rocm/rocm-terminal \
bash -c "sleep infinity"
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 8, 2025 13:49
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@TinHead
TinHead / shell.nix
Last active November 17, 2022 01:26
my nix-shell attempt
{ pkgs ? import <nixpkgs> { } }:
let
fhs = pkgs.buildFHSUserEnvBubblewrap {
name = "SkiffOS-fhs";
targetPkgs = pkgs: (with pkgs;
[
bc
binutils
bzip2