Skip to content

Instantly share code, notes, and snippets.

View potat-dev's full-sized avatar
🥔
Котик крутится, лабы мутятся

Denis Churilov potat-dev

🥔
Котик крутится, лабы мутятся
View GitHub Profile
@potat-dev
potat-dev / quaternions.py
Last active July 3, 2026 16:16
Simple library to calculate Quaternion rotations in Python. No external libraries required!
import math
from typing import Self
from dataclasses import dataclass
from math import cos, sin, sqrt
@dataclass(slots=True)
class Vector:
x: float
y: float

Collection of Useful Things

Docker One Line Install

curl -fsSL get.docker.com | sh

List Files And Directories

@potat-dev
potat-dev / traefik-setup.md
Last active July 6, 2026 09:27
Simple Traefik Wildcard Templated Setup

Traefik Setup

My Traefik v3 configuration for homelab, without docker provider, only file-based templated dynamic configuration, static configuration and docker compose. My use case is a single domain and multiple subdomains, and this configuration generated a single wildcard certificate for all of them.

File structure

/root/traefik
├── .env
├── compose.yml
@potat-dev
potat-dev / immich-lxc.md
Last active May 17, 2026 11:25
Immich LXC ZFS mount configuration

Here is the complete, professional deployment guide for the split-storage Immich architecture. This adheres strictly to the security principle of keeping the Proxmox host clean while isolating the database/thumbnails on the SSD and heavy media on the ZFS HDD array.


Phase 1: Proxmox Host Preparation (Storage & Security)

Run these commands directly on the Proxmox host shell.

1. Create a Dedicated Unprivileged User To prevent mapping the container to a privileged host user, create a "dead" user with no login access.

@potat-dev
potat-dev / immich-lxc.md
Created May 15, 2026 17:40
Immich LXC ZFS idmap configuration

Since you are comfortable with the configuration and want a professional, proper systems administration approach, mitigating the security risk of idmap is straightforward.

The security risk exists only if you map the container to a privileged or shared host user (like your primary personal account, UID 1000, which might have sudo access or own sensitive host configurations). If a bad actor breaks out of the container via a Docker/LXC exploit, they land on the host with the permissions of that mapped UID.

To completely mitigate this risk, you create a "Black Hole" or "Empty Room" configuration. You punch a hole through the LXC isolation, but you make sure the hole leads to a user that has absolutely zero power on the host system.

Here are the exact methods to lock this down:

1. The "Dedicated Dead User" Strategy (Primary Mitigation)

Do not map the LXC container to UID 1000. Create a dedicated, unprivileged system account on the Proxmox host that exists solely to own this dataset.

As a Senior DevOps Engineer and Architect, I can tell you that you've hit one of the most common limitations of the GitLab CI YAML engine: GitLab does not natively support deep-merging dictionaries inside an array element (which is what workflow:rules is).

If you define a rule as a list item (e.g., - if: ...) and use !reference, GitLab treats that list item as a single block. You cannot easily inject or override variables inside it at the point of reference.

However, we can elegantly bypass this limitation by using what I call the "Nested Hash Extension" pattern.

Instead of defining your rules as an array in the common repo, we define them as a nested hash (dictionary). We then leverage GitLab's extends keyword (which does support deep-merging dictionaries, unlike arrays) to merge your custom variables in the child repository, and finally inject the resulting hash into workflow:rules using !reference.

@potat-dev
potat-dev / totally-not-a-virus.ps1
Last active June 17, 2025 22:02
PowerShell script to download and run the latest zapret-discord-youtube release
# Config
$repo = 'Flowseal/zapret-discord-youtube'
$installDir = Join-Path $env:LOCALAPPDATA 'zapret'
# Fetch the latest GitHub release info
Write-Host "Checking latest release..."
$apiUrl = "https://api.github.com/repos/$repo/releases/latest"
$release = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing
# Look for a .rar asset in the release
@potat-dev
potat-dev / mal-catppuccin-macchiato.css
Created May 10, 2025 03:41
Catppuccin Macchiato Theme for MyAnimeList Modern
/**
* Catppuccin Macchiato Theme for MyAnimeList Modern
* Created wuth ❤ by potatdev
*/
:root {
--base: #24273a;
--mantle: #1e2030;
--crust: #181926;
--text: #cad3f5;
@potat-dev
potat-dev / philosiphers.go
Created March 16, 2025 05:21
Dining philosophers problem in Golang
package main
import (
"context"
"fmt"
"os"
"sync"
"time"
)
@potat-dev
potat-dev / image-to-webp-compressor.py
Last active February 23, 2025 01:44
Batch compression of images to Webp with specified quality
import os
import signal
import argparse
from PIL import Image
from pathlib import Path
from tqdm import tqdm
from multiprocessing import Pool, cpu_count, current_process
SUPPORTED_FORMATS = (
".jpg",