Skip to content

Instantly share code, notes, and snippets.

View Ranger-NF's full-sized avatar
πŸ”
Trying to do something useful

Fahad Ranger-NF

πŸ”
Trying to do something useful
View GitHub Profile

Path-Walker

Ever felt like you have to provide your file structure to ChatGPT or Claude so that they can better understand and help you in your project? Well, I used this script to do it for one of my recent projects and helped me to not overexplain every detail to the AI and help it understand where all I need to apply changes.

import os
import fnmatch

def print_file_structure(root_dir, exclude_dirs=None, exclude_files=None, save_to_file=False, output_filename="file_structure.txt", prefix="", file=None):
    """
@JamesCullum
JamesCullum / immich-docker-config.md
Last active January 20, 2025 13:01
docker-compose.yml for immich with WAF, DDoS protection, image resizing and without port forwarding

Setup Immich via Docker Compose with WAF, CDN, DDoS protection, no port forwarding and automated image resizing

In this guide, we are using the docker compose setup that is recommended by the Immich team. Once everything is configured and running in your local network, we can expand on it.

The first recommended step is to use Cloudflare Tunnel to make your local instance globally available. This is free and you benefit from the native DDoS protection, WAF and CDN from Cloudflare. The cloudflared daemon basically makes an outgoing connection to Cloudflare and makes the designed interfaces available on the internet, without granting access to undesired parts of the network.

Start off by creating a Cloudflare account, going into the "Zero Trust" portion of the account and add a new tunnel.