Skip to content

Instantly share code, notes, and snippets.

@zvchei
zvchei / arrange_images.py
Created September 2, 2025 16:52
Script to arrange images two by two on A4 landscape pages. Each page will contain up to 2 images side by side with spacing between them.
#!/usr/bin/env python3
"""
MIT-0 License
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@zvchei
zvchei / dclean.sh
Created July 16, 2025 15:11
An interactive bash script for cleaning up Docker images and volumes by given search pattern
#!/bin/bash
# Docker Image and Volume Cleanup Script
#
# Description:
# This script helps clean up Docker images and volumes by searching for items
# that match a specified pattern. It provides a safe way to remove Docker
# resources by showing what will be deleted and requiring explicit confirmation.
#
# Usage: ./dclean.sh <search_pattern>
@zvchei
zvchei / get-route.sh
Last active May 16, 2025 15:18
Retrieves the route for a given domain using the `ip` and `dig` tools.
#!/bin/bash
HOST="$1"
if [[ -z "$HOST" ]]; then
echo "Usage: $0 <HOSTNAME>"
exit 1
fi
IP_ADDRESS=$(dig +short A "$HOST" 2>/dev/null)
#!/bin/bash
# Configuration
SERVICE_NAME="gemini"
KEY_ATTRIBUTE="api-key"
PREDEFINED_PROMPT="Answer the following question directly and provide the single best answer."
# Functions