Skip to content

Instantly share code, notes, and snippets.

@bulatovv
bulatovv / treecat.sh
Last active September 5, 2025 05:33
Treecat is a shell utility that displays directory structures and file contents in a tree-like format with options for hidden files, gitignore filtering, and file size limits
#!/bin/sh
# treecat - A script to display directory structure or file contents for multiple paths.
# (Generated with Gemini Pro 2.5)
# --- Default Configuration ---
MAX_SIZE=102400 # 100 KB
SHOW_HIDDEN=false
USE_GITIGNORE=true
# TARGET_PATH is now handled by arguments
@bulatovv
bulatovv / nginx_log_parse.py
Created April 28, 2024 22:06
Parse nginx access log using polars
import polars as pl
nginx_log_pattern = (
r'(?<remote_addr>[^ ]+) - '
r'(?<remote_user>.+) '
r'\[(?<time_local>[^\]]+)] '
r'"(?<request>(?<request_method>\w+) '
r'(?<request_uri>[^?]+)(?<request_query_string>\?.*)? '
r'(?<request_protocol>[^"]+)|[^"]*)?" '
r'(?<status_code>[^ ]+) '
export EDITOR="nvim"
export TERMINAL="alacritty"
export BROWSER="firefox"
export PATH="$PATH:$HOME/.local/bin"
if [[ "$(tty)" = "/dev/tty1" ]]; then
startx ~/.xinitrc
fi