Skip to content

Instantly share code, notes, and snippets.

View hoshinolina's full-sized avatar

Hoshino Lina hoshinolina

View GitHub Profile
@hoshinolina
hoshinolina / arkit.md
Last active November 13, 2026 18:43
ARKit/FaceKit notes

Introduction

ARKit face tracking is shrouded in a ton of myth and mystique.

I reverse engineered the internal face tracking API, and this is how it actually works.

Disclaimer

This is based on reverse engineering the API of Apple's face detection framework and testing it with my own code. Some of it is educated guesswork based on names and strings. I did not reverse engineer the details of how ARKit/FaceKit works, but given what I've seen, I'm quite confident in the overall big picture.

@hoshinolina
hoshinolina / gen_keys.py
Last active May 31, 2026 01:33
Generator for allkeysgenerator.com passwords/keys
#!/usr/bin/python3
"""
Generator for "encryption keys" created at https://www.allkeysgenerator.com/
For some reason people have been using this now-defunct website which generates
keys **server-side**. It turns out it uses an absolutely terrible RNG that
just uses a single float seed and increments the value by a constant for each
character and each individual key. The entropy of any individual key is only
about 10 bits.
@hoshinolina
hoshinolina / log.txt
Created May 12, 2026 15:02
"ARKit" (FaceKit) face tracking on macOS logs
FKTracker: (AppleCVA) [com.apple.AppleCVA:FaceKit] Creating FaceKit with options: { "failure_fov_modifier" = "0.5"; "network_failure_threshold_multiplier" = 1; "num_tracked_faces" = 1; "rgb_only" = 1; "robust_tongue" = 1;}
FKTracker: (AppleCVA) [com.apple.AppleCVA:FaceKit] CVAFaceTracking created (0x78b035cc0).
FKTracker: (AppleCVA) [com.apple.AppleCVA:FaceKit] Color camera resolution: 640 x 480
FKTracker: (AppleCVA) [com.apple.AppleCVA:FaceKit] Color camera intrinsics: (400.000 0.000 319.500), (0.000 400.000 239.500), (0.000 0.000 1.000)
FKTracker: (AppleCVA) [com.apple.AppleCVA:FaceKit] Color camera extrinsics: (1.000 0.000 0.000 0.000), (0.000 1.000 0.000 0.000), (0.000 0.000 1.000 0.000)
FKTracker: (AppleCVA) [com.apple.AppleCVA:FaceKit] new track for user (0x78aad81b8 uuid=unset) at (358,327), bbox size (130,130)
FKTracker: (AppleCVA) [com.apple.AppleCVA:FaceKit] request faceprint for user (0x78aad81b8 uuid=unset) at (355,325), bbox size (128,128), pose=0.985485 0.0158968 -0.169016 58.621
// ==UserScript==
// @name YT Chat Show original language
// @namespace http://github.com/hoshinolina
// @version 2026-03-27
// @description Show Translated + Original message in YT chat
// @author Hoshino Lina
// @match https://*.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
#include <assert.h>
#include <drm/drm_fourcc.h>
#include <fcntl.h>
#include <gbm.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
@hoshinolina
hoshinolina / asahi_linux_paypal_fix.user.js
Last active May 6, 2026 00:39
Asahi Linux PayPal Block Fix
// ==UserScript==
// @name PayPal Asahi Linux Fix
// @version v1.0
// @description Fix PayPal banning Asahi Linux
// @author Asahi Lina
// @match https://www.paypal.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=paypal.com
// @grant unsafeWindow
// ==/UserScript==
@hoshinolina
hoshinolina / mastodon_move_notes.md
Last active September 27, 2025 05:14
Mastodon move notes

Notes on moving a Mastodon instance to a new server

Stuff to move

  • App
  • Config
  • Redis/Valkey
  • Media
  • Postgres
-- As explained on: https://bennett.dev/auto-link-pipewire-ports-wireplumber/
-- Link two ports together
function link_port(output_port, input_port)
if not input_port or not output_port then
return nil
end
local link_args = {
["link.input.node"] = input_port.properties["node.id"],
## RGB10A8 2-plane
Texture
Dimension: 2D
Layout: Compressed
Channels: unknown 4C (XXX)
Type: XR
Swizzle R: B
Swizzle G: G
Swizzle B: R