Skip to content

Instantly share code, notes, and snippets.

View merura's full-sized avatar
🎯
Focusing

Yernar Tursynali merura

🎯
Focusing
View GitHub Profile
@merura
merura / colors.sh
Created June 14, 2026 08:35
colors.sh
#!/usr/bin/env bash
echo "=== Normal colors ==="
echo -e "\e[30m black \e[0m \e[31m red \e[0m \e[32m green \e[0m \e[33m yellow \e[0m"
echo -e "\e[34m blue \e[0m \e[35m magenta \e[0m \e[36m cyan \e[0m \e[37m white \e[0m"
echo ""
echo "=== Bright colors ==="
echo -e "\e[90m black \e[0m \e[91m red \e[0m \e[92m green \e[0m \e[93m yellow \e[0m"
echo -e "\e[94m blue \e[0m \e[95m magenta \e[0m \e[96m cyan \e[0m \e[97m white \e[0m"
echo ""
echo "=== Bold (should stay same shade, not go bright) ==="
@merura
merura / README.md
Last active April 15, 2026 06:12
xlsx2pdf.py

xlsx2pdf.py

Convert Excel workbooks to PDF on Linux — one sheet per page, landscape, with a labeled watermark.

What it does

  • Sets every sheet to landscape orientation, fit to one page (width × height)
  • Exports to PDF via LibreOffice headless
  • Overlays each page with a semi-transparent watermark showing the sheet name
@merura
merura / .envrc
Created August 28, 2025 07:40
direnv rootful docker
# rootful docker
export PATH="$PWD/.direnv/bin:$PATH"
if [ ! -x .direnv/bin/docker ]; then
mkdir -p .direnv/bin
cat > .direnv/bin/docker <<'EOF'
#!/usr/bin/env bash
exec sudo /run/current-system/sw/bin/docker "$@"
EOF
chmod +x .direnv/bin/docker
fi
@merura
merura / sync.sh
Created August 25, 2025 06:45
sync.sh
#!/usr/bin/env bash
# Based on https://unix.stackexchange.com/a/693178
repr () {
if [[ $# -gt 0 ]]; then
local result="$(printf -- '%q ' "$@")"
printf -- '%s' "${result::-1}"
fi
return $?
}
#!/usr/bin/env bash
sudo true
setup_routes() {
sleep 1
if ip route show 10.10.10.0/24 | grep -v ppp0 >/dev/null 2>&1; then
sudo ip route del 10.10.10.0/24 dev ppp0
echo "Setup routes"
fi
@merura
merura / speed.py
Created November 24, 2024 22:38
DPDK telemetry interface RX/TX byte and packet rate per second
#!/usr/bin/env python3
import socket
import os
import sys
import glob
import json
import time
import argparse
from datetime import datetime
@merura
merura / index.md
Last active June 8, 2025 07:40
Windows WebDav Basic Auth (Apache + LDAP)
@merura
merura / compose.yaml
Created April 2, 2024 14:16
mtproto server using v2ray-core (ARM supported)
version: "3"
services:
v2ray:
image: v2fly/v2fly-core:v4.45.2
restart: always
command: v2ray -config /config.json
volumes:
- ./config.json:/config.json
ports:
@merura
merura / agent.sh
Created April 1, 2024 10:09
ssh-agent shell
#!/usr/bin/env bash
trap 'echo "Killing ssh-agent" && eval "$(ssh-agent -k)"' EXIT
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
echo "Shell activated"
bash
@merura
merura / Caddyfile
Created January 1, 2024 12:03
LFH caddy
*.8197cb8c.nip.io {
tls internal
@portNum header_regexp "Host" ([0-9]+)\.8197cb8c\.nip\.io
handle @portNum {
reverse_proxy localhost:{http.regexp.1}
}
handle {
respond "bad port"
}