Skip to content

Instantly share code, notes, and snippets.

@ilgaur
ilgaur / llm-concat.sh
Last active April 12, 2025 08:30
llm-concat
#!/bin/bash
# Check if the script received the correct number of arguments
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <repo_path> <output_file>"
exit 1
fi
REPO_PATH=$1
OUTPUT_FILE=$2
@ilgaur
ilgaur / docker-images-cleanup.sh
Created February 17, 2025 06:54
cleanup old tags
#!/bin/bash
set -euo pipefail
DRY_RUN=0
if [[ $# -gt 0 && "$1" == "--dry-run" ]]; then
DRY_RUN=1
echo "Dry run mode. No changes will be made."
fi
@ilgaur
ilgaur / cloudinit-docker-and-docker-compose-installation.yaml
Last active January 20, 2025 10:35
cloudinit-docker-and-docker-compose-installation
#cloud-config
groups:
- docker
users:
- default
# the docker service account
- name: docker-service
groups: docker
package_upgrade: true
packages:
@ilgaur
ilgaur / gitlab_project_repository_tag_info_with_size_and_age.py
Created December 30, 2024 10:20
Lists GitLab project repositories and tags, showing tag sizes and time since creation, with a summary of total images and sizes per project.
import gitlab
import urllib3
import humanfriendly
import timeago, datetime
# 2020-04-24T12:04:26.475+00:00
date_now = datetime.datetime.now()
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
@ilgaur
ilgaur / pullpush.sh
Last active December 30, 2024 10:22
#!/usr/bin/env bash
#a simple bash function for updating servers safely (to avoid branch conflicts and corruption)
pullpush() {
ifgit=$(git status &>/dev/null; echo $?)
if [[ "$ifgit" = 0 ]]; then
echo "A git repository"
else
echo "Not a git repository, exiting..."
return 1
fi