Skip to content

Instantly share code, notes, and snippets.

View Aldo-f's full-sized avatar
🐛
Search and destroy.

Aldo Aldo-f

🐛
Search and destroy.
  • Creamy Coding
  • Merelbeke Ghent
View GitHub Profile
@Aldo-f
Aldo-f / restart_apaches.sh
Created March 6, 2024 14:12
restart_apaches.sh
#!/bin/bash
# Switch Xdebug state for different PHP configurations
PHP_VERSIONS=($(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$'))
PHP_SAPI=("cli" "fpm") # Add more SAPIs if needed
APACHE_RESTART_COMMAND="sudo /etc/init.d/apache2 restart"
for version in "${PHP_VERSIONS[@]}"; do
for sapi in "${PHP_SAPI[@]}"; do
# Restart PHP-FPM service for the current version
@Aldo-f
Aldo-f / batch_convert.sh
Created July 29, 2024 07:27
batch_convert.sh - convert JPG to a reduced size
#!/bin/bash
# Default prefixes for parameters
QUALITY_PREFIX="-q"
SUFFIX_PREFIX="-s"
MAX_DEPTH_PREFIX="-d"
MAX_FILES_PREFIX="-m"
# Check if the quality parameter is provided
if [ -z "$2" ] || [ "$1" != "$QUALITY_PREFIX" ]; then
@Aldo-f
Aldo-f / fix_extensions.sh
Created October 19, 2024 19:11
Add extension to files where extension is missing
#!/bin/bash
# Function to display help
display_help() {
echo "Usage: $0 <source_directory> [destination_directory] [-overwrite] [-start <start_index>] [-limit <max_files>]"
echo
echo "Parameters:"
echo " source_directory Directory containing files without extensions (use '.' for current directory)"
echo " destination_directory Optional: Directory to save files with added extensions (defaults to source_directory)"
echo " -overwrite Optional flag to overwrite original files"
@Aldo-f
Aldo-f / docker-compose.yml
Created June 19, 2025 14:08
Beer money and Chill
services:
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
environment:
- PUID=1000
- PGID=1000
- VERSION=docker
- TZ=Europe/Brussels
volumes: