Skip to content

Instantly share code, notes, and snippets.

View olragon's full-sized avatar
👨‍💻
I may be slow to respond.

Long Nguyen olragon

👨‍💻
I may be slow to respond.
  • Ho Chi Minh City, Viet Nam
View GitHub Profile
@olragon
olragon / do3think-3p1200-pd-industrial-camera.md
Created October 18, 2026 06:37
Do3Think 3P1200-PD — headless Python tools for a USB3 Vision industrial camera (Aravis, no OpenCV): capture, white balance, live view, manual-lens DoF

Do3Think 3P1200-PD — headless Python tools for a USB3 Vision industrial camera

Python tools for driving a Do3Think 3P1200-PD (12.6 MP, 4088×3072, BayerGB8, USB3 Vision, manual C-mount lens) headless on Linux and macOS. They were written for a repair bench, where a camera above a mainboard has to produce frames whose colour is right. A brown capacitor that reads olive, or a red wire that reads black, leads to a wrong repair decision.

Everything goes through Aravis, the free, cross-platform GenICam implementation. Its GObject-introspection API is the same on macOS and Linux, so the same files run on both. There is no OpenCV: debayering and image I/O go through ffmpeg, and the maths

Upgrading Mautic 6.0.7 → 7.0.1 (Docker, MariaDB 11.8)

Environment

  • Docker: PHP 8.3-fpm + nginx + supervisord
  • MariaDB 11.8 (shared container)
  • Previous upgrade: 5.2.3 → 6.0.7 already completed

Gotcha: Unsigned FK Column vs Signed PK

Migrations Version20250828070131 (sms_messages) and Version20250923135527 (push_notifications) add a translation_parent_id column as unsigned int with a self-referencing FK to the id column, which is signed int.

Upgrading Mautic 5.2.3 → 6.0.7 (Docker, MariaDB 11.8)

Environment

  • Docker: PHP 8.3-fpm + nginx + supervisord
  • MariaDB 11.8 (shared Coolify-managed container)
  • Volumes: config, media, plugins, themes, var, translations

Gotcha 1: Plugin Volume Override

After swapping the html/ source to 6.0.7, the Docker volume mount for plugins/ still contains 5.2.3 plugins. These reference the session Symfony service which was removed in Symfony 6.

@olragon
olragon / mautic-docker-guide-gist.md
Created March 13, 2026 15:06
Mautic 5 Docker Setup Guide — single container with nginx, PHP-FPM, cron, CKEditor build, and Remix Icons

Mautic 5 Docker Setup Guide

Complete guide to running Mautic 5.x in a single Docker container with nginx, PHP-FPM, and cron — designed for low-traffic marketing automation (< 50k contacts).

Architecture

Reverse Proxy (Traefik/nginx) → Container (nginx:80 → PHP-FPM:9000)
                                       ↓
                                 External MariaDB 11+
@olragon
olragon / bun-avx-proxmox.md
Last active March 3, 2026 09:04
Bun segfaults on Proxmox VM — the $6.75 AVX rabbit hole

Bun Segfaults on Proxmox VM — the $6.75 AVX Rabbit Hole

2026-03-03 — debugging war story

The Problem

Deploying a Bun app to a Proxmox VM. Everything works locally. On the VM:

panic(main thread): Segmentation fault at address 0x419E4000000
@olragon
olragon / colima-macports-macos1013.md
Created February 25, 2026 11:02
Installing Colima (Docker) via MacPorts on macOS 10.13 High Sierra — 7 patches for QEMU 10.2.1 + Lima 2.0.3

Installing Colima via MacPorts on macOS 10.13 (High Sierra)

Machine: MacBookPro6,2 (mid-2010 15"), macOS 10.13.6 High Sierra, darwin 17.7.0 MacPorts: with clang-mp-17, python3.14, Go 1.24.8 Result: Colima 0.10.1 + Lima 2.0.3 + QEMU 10.2.1 — fully working Docker on macOS 10.13

The Problem

sudo port install colima fails because QEMU 10.2.1 and Lima 2.0.3 use macOS APIs that don't exist on 10.13. Seven custom patches are needed across QEMU and Lima Portfiles, plus a python3 symlink fix.

@olragon
olragon / color.py
Created December 19, 2025 08:03
camera-3P1200-PD-
#!/usr/bin/env python3
import gi
gi.require_version('Aravis', '0.8')
from gi.repository import Aravis
import numpy as np
import cv2
import sys
import time
import json
import os
@olragon
olragon / tm-selectable.js
Last active March 22, 2025 05:14
TamperMonkey Script to force text selectable
// ==UserScript==
// @name Blagu - Text Selectable
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Enables text selection, right-click and copy/paste on website by removing protections
// @author You
// @match *://*.5office.vn/*
// @match *://*.officesaigon.vn/*
// @grant none
// @run-at document-start
@olragon
olragon / benchmark-bun-deno-node.md
Created August 29, 2023 03:49
Benchmark Bun, Deno & NodeJS web servers
Framework Average Get (/) Params, query & header Post JSON
uws (node) 98,742.06 117,931.1 106,347.08 71,948
hyper-express (node) 82,449.5 118,198.57 88,546.88 40,603.05
bun (bun) 81,971.373 99,946.51 78,488.13 67,479.48
elysia (bun) 79,643.103 98,266.18 76,637.37 64,025.76
vixeny (bun) 79,508.623 96,996.36 79,585.35 61,944.16
stricjs (bun) 79,120.123 97,804.01 78,028.85 61,527.51
hono (bun) 75,293.96 95,430.31 70,915.01 59,536.56
bun-web-standard (bun) 73,925.933 88,856.78 70,520.02 62,401
@olragon
olragon / readme.md
Created August 21, 2023 02:51
Obsidian - Clip Link to Daily bookmarklet
  1. Go to https://caiorss.github.io/bookmarklet-maker/
  2. Input Title, paste to Code, replace YOUR_VAULT_NAME_HERE, change or replace YOUR_FOLDER_HERE_OR_REMOVE (eg: Daily/)
window.open(`obsidian://new
	?vault=YOUR_VAULT_NAME_HERE
	&append=1
	&file=${encodeURIComponent('YOUR_FOLDER_HERE_OR_REMOVE' + new Date(new Date().getTime() - (new Date).getTimezoneOffset()).toISOString().split('T')[0])}
	&content=${encodeURIComponent(`\n## ${document.title}\nLink: [${window.location.href}](${window.location.href})`)}
`)