Skip to content

Instantly share code, notes, and snippets.

View Lysak's full-sized avatar
🎯

Dmytrii Lysak

🎯
View GitHub Profile
@Lysak
Lysak / aiven-postgresql-18-free-cli.md
Created July 25, 2026 07:37
Create Aiven Free PostgreSQL 18 via CLI (avn) when the web console hides preview versions

How to create a Free-tier Aiven PostgreSQL 18 service using the avn CLI (when it's missing from the web UI)

Last verified: 2026-07-25 Tags: Aiven, PostgreSQL 18, Aiven CLI, avn, free tier, free-1-1gb, preview version, managed Postgres, database provisioning TL;DR: As of this writing, Aiven's web console only lets you pick PostgreSQL up to version 17 on the Free plan, because PG 18 is still tagged preview. The Aiven CLI has no such restriction — you can create a Free PostgreSQL 18 service directly with avn service create.

Why this is needed

Aiven's Free plan (free-1-1gb) is normally created through the web console, but the console's version picker only offers PostgreSQL versions that Aiven has promoted out of preview status. At the time of writing, PostgreSQL 18 is available but still marked preview, so it does not show up as a selectable option in the UI — even though the underlying platform fully supports provisioning it.

@Lysak
Lysak / obs-macbook-m1pro-config.md
Last active July 23, 2026 16:31
OBS Studio config for MacBook Pro M1 Pro — optimal recording settings

OBS Studio — optimal config for MacBook Pro M1 Pro (32GB, Retina 3456x2234)

Scenario: local recording only (no streaming). Source — macOS Screen Capture (Apple ScreenCaptureKit), full-display capture.

Instructions for an AI agent

If you were handed this gist, apply the settings below to the user's OBS config:

  • ~/Library/Application Support/obs-studio/basic/profiles/<Profile>/basic.ini
  • ~/Library/Application Support/obs-studio/basic/scenes/.json
@Lysak
Lysak / README.md
Last active July 18, 2026 15:43
Keep Discord running during work hours only on macOS (launchd; schedule set at the top of the script)

Keep Discord running during work hours only (macOS · launchd)

@Lysak
Lysak / README.md
Last active June 23, 2026 06:12
Fix: Codex SQLite logs ~640 TB/year SSD write issue (openai/codex#28224) - aka fix codex ssd issue

Fix: Codex SQLite logs ~640 TB/year SSD write issue

Fixes openai/codex#28224.

Codex writes millions of TRACE-level rows per day to ~/.codex/logs_2.sqlite via insert-and-prune churn, rapidly consuming SSD write endurance.

Files

  • block-logs-trigger.sh — watcher script
  • com.codex.block-logs-trigger.plist — macOS LaunchAgent
@Lysak
Lysak / replaces-cloudflare-blocked-font-awesome-fonts-on-swappa.user.js
Last active June 17, 2026 12:38
Replaces Cloudflare-blocked Font Awesome fonts on Swappa
This file has been truncated, but you can view the full file.
// ==UserScript==
// @name Swappa Font Awesome Fix (Embedded Original Fonts)
// @namespace https://github.com/Lysak
// @version 2026-06-17
// @description Uses locally embedded Swappa Font Awesome webfonts to bypass Cloudflare font challenges
// @author Dmytrii Lysak
// @match https://swappa.com/*
// @match https://*.swappa.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=swappa.com
// @run-at document-start
@Lysak
Lysak / httrack.sh
Created April 16, 2026 18:02
httrack.sh
httrack "https://example-2026.localhost/" \
-O "example-2026.localhost" \
-%v \
--robots=0 \
-%P \
-n \
-F "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
@Lysak
Lysak / 4read.org.sh
Last active April 6, 2026 05:46
Download files from 4read.org website
mkdir -p ~/audiobooks
cd ~/audiobooks
for i in $(seq -w 1 17); do
curl -fL "https://s1.reasd.org/7292/OUZA_${i}_rendered.mp3" \
-o "Отель 'У загиблого альпініста' ${i}.mp3"
done
@Lysak
Lysak / smoke-script.js
Last active March 30, 2026 07:26
smoke-script.js
/* smoke-script.js
* – plynulý kouř, fade-in/fade-out
* – pozastaví se, když HERO2 není v záběru (IntersectionObserver)
* – probuzení záložky/telefonu už neodskakuje
*/
(function () {
const smokeURL = './images/Smoke-Element-white.png';
/* ---------- laditelné parametry ---------- */
const smokeSpeed = 1.4;
@Lysak
Lysak / backup-postgres-docker.txt
Created March 16, 2026 21:54
backup-postgres-docker.txt
Готове автоматизоване рішення для бекапу баз postgres.
Зараз часто використовую цей невеличкий контенер там де апки використовують базу на PosgreSQL.
Для додавання у docker-compose.yml
  postgres-backup:
    image: prodrigestivill/postgres-backup-local
    container_name: pg-backup
    restart: always
    environment:
      POSTGRES_HOST: ${POSTGRES_HOST}
@Lysak
Lysak / Task.php
Created February 19, 2026 16:13
php test task
<?php
//
// //count(array_filter($this->getUsers(), fn($user) => $user['city_id'] === $cityId));
class Test
{
/**
* Example:
* [