Skip to content

Instantly share code, notes, and snippets.

@al-swaiti
al-swaiti / gist:2a15f917f40a9d6ac19a1f2e3484c54a
Created June 8, 2026 19:16
المستشار الناقد المحايد — مؤسَّس على المنهج القرآني في قول الحق والنصيحة الصادقة
# ⚖️ المُحاسِب — AL-MUHASIB: The Quranic Critical Advisor
> **Version**: 1.0 | **Updated**: 2026-06-08 | **Built with**: OMNI-ARCHITECT v6.0
>
> **المستشار الناقد المحايد** — مؤسَّس على المنهج القرآني في قول الحق والنصيحة الصادقة
---
## 📊 BLOCK 1: التحليل الاستراتيجي
{
"high_level_description": "A breathtaking wide-screen 16:9 fine-art masterpiece: a broken, weathered wooden pier vanishes in perfect perspective across an impossibly glassy, jewel-teal lake at blue-hour twilight. The dopamine-inducing composition exploits the full cinematic width — the pier's leading line commands the entire horizontal expanse, drawing the eye from the textured foreground boards all the way to the infinite horizon where molten coral and amber light erupts through a dramatic gap in towering violet storm clouds. The warm cloud-break fires a column of gold-rose reflection straight down the water's central axis toward the viewer. Distant layered mountain ranges dissolve into atmospheric haze at each far edge of the wide frame. The image radiates pure cinematic grandeur — the kind of visual that fills a monitor edge to edge with something sublime.",
"style_description": {
"aesthetics": "Hyper-realist fine-art landscape photography optimised for 16:9 cinematic display — the visual languag

🚀 Deploy FLUX.2-Dev as MCP Server on Modal (Step-by-Step Guide)

Deploy FLUX.2-Dev image generation on Modal with MCP support, so AI agents (Claude, Cursor, VS Code Copilot) can generate images for you!

What you'll get:

  • 🎨 FLUX.2-Dev running on H200/H100 GPU
  • 🌐 Web UI at your-url.modal.run
  • 🤖 MCP endpoint for AI agents
  • ⚡ ~15-20s per image generation
@al-swaiti
al-swaiti / guide.md
Last active January 18, 2026 09:41
TKG-kerenl

The Ultimate Guide to Building a High-Performance Linux Kernel with TKG

This guide provides a comprehensive, expert-level walkthrough for compiling a custom Linux kernel using the linux-tkg project. It is intended for enthusiasts and power users who want to move beyond generic distribution kernels to unlock the maximum performance, responsiveness, and low-latency potential of their hardware, particularly for desktop and gaming workloads.

The Philosophy: Why Build a Custom Kernel?

The kernel shipped by your Linux distribution is a masterpiece of compatibility, designed to run on everything from ancient laptops to multi-socket servers. This "one-size-fits-all" approach means it's not specifically optimized for your hardware or your use case.

By building a custom kernel, you are making a deliberate trade-off: sacrificing universal compatibility for specialized performance. You are creating a kernel that is explicitly engineered for your CPU, your hardware, and your workloads.

@al-swaiti
al-swaiti / gist:4f7a8fbcbb3baeda5ffd5c5cde525654
Last active August 20, 2025 22:53
arch linux btrfs -grub
@al-swaiti
al-swaiti / gist:2f571ffd506090d92bcb3cf9afb33066
Last active August 8, 2025 20:56
Arch Linux BTRFS + LUKS2 Recovery Guide with Timeshift Snapshots

Arch Linux BTRFS + LUKS2 Recovery Guide with Timeshift Snapshots

This guide covers how to recover a broken Arch Linux system using BTRFS snapshots (Timeshift) when your system won't boot or is corrupted. Based on a real recovery scenario with an encrypted NVME drive setup.

System Configuration Example

  • Drive: /dev/nvme0n1 (931.5GB)
  • Partitions:
    • /dev/nvme0n1p1 - 512MB EFI boot partition (FAT32)
  • /dev/nvme0n1p2 - 931GB encrypted partition (LUKS2)
# --- الخطوة 1: تعريف الأدوات الوهمية (Dummy Tools) ---
# في تطبيق حقيقي، قد تتصل هذه الدوال بواجهات برمجية (APIs) حقيقية
def get_weather(text_input):
"""أداة وهمية لمعرفة الطقس في مدينة ما"""
# منطق بسيط جدًا لاستخراج اسم المدينة (للتوضيح فقط)
if "in" in text_input:
city = text_input.split("in")[-1].strip()
return f"The weather in {city} is sunny and pleasant."
return "Please specify a city, for example: 'weather in Riyadh'."
@al-swaiti
al-swaiti / convert-chunks.py
Created September 11, 2024 16:29
GGUF-Convert-Chunks
import os
import torch
import gguf
import numpy as np
import argparse
from tqdm import tqdm
from safetensors.torch import load_file, save_file
CHUNK_SIZE = 100 # Number of tensors to process in each chunk
QUANTIZATION_THRESHOLD = 1024
@al-swaiti
al-swaiti / qunata.py
Last active August 4, 2024 20:41
quantization of "pixart sigma"
# https://huggingface.co/PixArt-alpha/PixArt-Sigma-XL-2-1024-MS/tree/main/transformer
# https://huggingface.co/blog/quanto-diffusers
#python -m venv quanta or conda whatever
#source ./quanta/bin/activate >>> default (bash shell)
# pip install --force git+https://github.com/huggingface/diffusers.git
# pip install torch optimum.quanto
#run first part to create model
@al-swaiti
al-swaiti / improve_fonts.md
Created September 5, 2023 13:35 — forked from YoEight/improve_fonts.md
Improve fonts archlinux

Improve Fonts

Newest

Make your Arch fonts beautiful easily! This is what I do when I install Arch Linux to improve the fonts.

You may consider the following settings to improve your fonts for system-wide usage without installing a patched font library packages (eg. Infinality):

Install some fonts, for example:
sudo pacman -S ttf-dejavu ttf-liberation noto-fonts