Skip to content

Instantly share code, notes, and snippets.

@avkcode
avkcode / bad_for_business.md
Created January 13, 2026 17:17
Imperialism is bad for business

Imperialism is bad for business because empires torch cash on flags and garrisons while war, ugly as it is, at least closes the books. War pays better than peace if you sit in a U.S. or EU boardroom counting missile orders. The racket is simple: defense giants skim fat margins, politicians sell deterrence, factories run graveyard shifts, and China fingers the mineral valve that keeps every guidance chip alive. Profit climbs, but each new sanction turns procurement into luxury shopping. Imperial vanity still burns money on parades; the modern hustle is cheaper, sell weapons, pinch supply chains, and let rare earth chokepoints remind the Pentagon who brings the batteries.

The nineties and early 2000s proved free markets were the best self‑gift Europe and the United States ever wrapped: fewer tariffs, more trade, investors betting on code instead of colonies. Washington’s

@avkcode
avkcode / West_of_Eden.md
Last active January 14, 2026 03:16
West of Eden

Watch Netanyahu interview to the Economist.

Netanyahu represents a significant faction in contemporary geopolitics, one closely allied with the Trump wing of US politics and supported by a powerful consortium of donors. This coalition actively marshals substantial financial and media resources to shape global narratives. Their core project is to frame Israel’s strategic position not merely as a national conflict, but as the frontline in a broader civilizational clash. This framing serves a direct purpose: it consolidates a domestic base and secures unwavering international backing by simplifying complex regional rivalries into a binary struggle. The observation of Christian persecution is factually grounded, but its presentation here is a strategic choice. It aligns with the values of a targeted evangelical constituency and leverages their influence. This is less a neutral analysis of religious dynamics and more a demonst

@avkcode
avkcode / money.md
Created January 10, 2026 00:35
It's always about money.

Since Ahmadinejad’s presidency, Iran’s nuclear policy has repeatedly miscalculated: defiance brought heavy sanctions, partial diplomacy (JCPOA) was undermined by U.S. withdrawal, and later escalation to higher enrichment levels has only deepened isolation, economic strain, and setbacks - without securing lasting relief or security gains.

Year Political Action Economic Consequence
2015 JCPOA signed. Sanctions lifted. GDP grows 12.3% in 2016. Inflation falls to single digits.
2018 US unilaterally withdraws. "Maximum Pressure" begins. Rial loses 80% of value against USD by 2020. Oil exports plummet.
2021-2024 Accelerated uranium enrichment to 60%. Sanctions regime tightens. Barter trades with China increase. Formal trade atrophies.
2025 Stockpile now sufficient for several devices. Economy operates on a wartime, insular footing. Talent and capital flee.
@avkcode
avkcode / AI_stockpiling.md
Last active January 11, 2026 02:18
It's not an AI bet - it's AI stockpiling.

Start with Trump’s own words, not the fog from think tanks or retired officials selling books. He talks in deals, not in doctrines. He says what he wants, what he will trade, and what he does not care about. That makes him easier to read. There is no need to hunt for a secret grand strategy. The task is to follow his price list.

On that list, Taiwan and semiconductors sit near the top. The rest is set dressing. Chips are the new crude, the stuff that runs missiles, data centers, and factory lines. Taiwan is the hinge of that system. Whoever holds it sits on the throat of the chip supply chain. Trump may rant about migrants and walls, but the real hinge runs through East Asia’s fabs, ports, and shipping lanes.

On China and Taiwan, he has already said the quiet part. He claimed Xi Jinping told him China would not move on Taiwan while he was in office. Take that for what it is. A personal assurance, bounded by one man’s term. Not a doctrine. A clock. In that window, Washington tries to build out chip capacity

@avkcode
avkcode / git_duckdb.py
Created March 5, 2025 10:04
Git history => DuckDB exporter
#!/bin/python3
"""
Git History Exporter to DuckDB
Description:
This script exports the commit history of a Git repository into a DuckDB database.
It supports parallelized parsing, incremental processing for large repositories,
progress indicators, and summary statistics generation.
" ================================
" General Settings
" ================================
set nocompatible " Disable compatibility with Vi
syntax on " Enable syntax highlighting
filetype plugin indent on " Enable filetype-specific plugins and indentation
set encoding=utf-8 " Use UTF-8 encoding
set backspace=indent,eol,start " Allow backspacing over everything in insert mode
" ================================
#
# Конфигурация ядра для Kubernetes и производительности
#
# Control Groups (cgroups) - Группы управления ресурсами
CONFIG_CGROUPS=y # Включить контрольные группы (cgroups) для управления ресурсами в контейнерах.
CONFIG_CGROUP_CPUACCT=y # Включить учет CPU для cgroups, чтобы отслеживать использование CPU на группу.
CONFIG_CGROUP_DEVICE=y # Включить контроль доступа к устройствам в cgroups для ограничения использования устройств.
CONFIG_CGROUP_FREEZER=y # Включить возможность заморозки и возобновления задач в cgroup, полезно для приостановки контейнеров.
CONFIG_CGROUP_SCHED=y # Включить политики планирования для cgroups для управления распределением CPU.
import os
import subprocess
import sys
def pivot(rw_root, work_dir):
"""Set up overlay and pivot root."""
try:
subprocess.run([
'/bin/mount',
'-o', f'noatime,lowerdir=/,upperdir={rw_root},workdir={work_dir}',
@avkcode
avkcode / watcher.go
Last active March 4, 2025 05:54
Subscribe to k8s events and send it to NATS
// Kubernetes Event and Namespace Watcher with NATS Integration
//
// Overview:
// This program watches Kubernetes events and namespace resources and publishes
// relevant updates to a NATS messaging server. It uses the Kubernetes client-go
// library to interact with the Kubernetes API and the NATS Go client library to
// publish messages.
//
// Features:
// - Watches Kubernetes events (added, updated, deleted) across all namespaces.
@avkcode
avkcode / fetch_repos.py
Created February 26, 2025 13:47
Fetch public repos for specified Github account
import os
import requests
def get_public_repos(username):
url = f"https://api.github.com/users/{username}/repos"
response = requests.get(url)
if response.status_code == 200:
repos = response.json()
return [repo['clone_url'] for repo in repos]
else: