Skip to content

Instantly share code, notes, and snippets.

View termermc's full-sized avatar

Ian termermc

View GitHub Profile
@psviderski
psviderski / .env.example
Last active September 15, 2026 03:56
PostgreSQL HA with Patroni on Uncloud
POSTGRES_PASSWORD=replace-with-a-strong-password
REPLICATION_PASSWORD=replace-with-a-different-strong-password
ADMIN_PASSWORD=replace-with-another-strong-password
@xeubie
xeubie / next-gen-sqlite.md
Last active October 31, 2026 19:01
The next-gen SQLite won't look like SQLite

SQLite was thought of as a toy for many years until we all realized it was actually nice to use a database as a library, even server-side. And yet...

  1. It's a big dependency, despite what you think. In no universe is 150,000 lines of C code "lightweight".
  2. Like with all SQL databases, you have an impedance mismatch: the way you store data in memory is completely different than the table structure a SQL database forces on you, leading to tons of glue code.
  3. It's mutable, so it can't undo or time travel, and it can't read while a write is happening (even in WAL mode...reads can't happen during checkpointing!).

To solve these problems, I'm building a database called xitdb:

  1. At only about 4,000 lines of code with no dependencies, xitdb is actually lightweight. You could reimplement it in another language pretty easily.
  2. It exposes rich data structures rather than a SQL interface, so the API is very similar to the in-memory data structures you already use in your program.
@psviderski
psviderski / _mariadb-galera-cluster-uncloud.md
Last active September 15, 2026 02:42
MariaDB Galera cluster PoC deployment using Uncloud

MariaDB Galera Cluster PoC with Uncloud

Install Uncloud CLI locally firts: https://uncloud.run/docs/getting-started/install-cli

# Create a 3-machine Uncloud cluster
uc machine init -n machine1 root@server1
uc machine add -n machine2 root@server2
uc machine add -n machine3 root@server3
@franksacco
franksacco / session-handler-life-cycle.md
Last active October 31, 2026 04:30
A complete overview of PHP session handler life cycle

A complete overview of PHP session handler life cycle

The purpose of this document is to provide a complete overview of the PHP session handler life cycle updated to version 7.0 or above. In particular, I want to emphasize what methods and in what order are called when the native PHP functions are used for session management.
I created this document because the information on the web and the official documentation are very superficial on this topic, in particular on what concerns the implementation of a safe and stable session handler.

@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@vmassuchetto
vmassuchetto / youtube-dl-cron.sh
Last active August 14, 2026 19:31
Shell script cron job to download YouTube videos from your subscription feed
#!/bin/bash
#
# Script to keep downloading YouTube videos to your computer using youtube-dl:
# http://rg3.github.io/youtube-dl/
#
# Put it to work:
#
# sudo wget "https://gist.github.com/vmassuchetto/10338703/raw" -O /etc/cron.hourly/youtube-dl-cron.sh
# sudo chmod +x /etc/cron.hourly/youtube-dl-cron.sh