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 / kvm_toggle.sh
Last active August 21, 2025 15:30
Toggle kvm - linux
#!/bin/bash
KVM_BLACKLIST_FILE="/etc/modprobe.d/blacklist-kvm.conf"
KVM_MODULES=("kvm_intel" "kvm_amd" "kvm")
# Check if the script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Please use 'sudo ./kvm_toggle.sh'."
exit 1
fi
@Aldo-f
Aldo-f / gemini-chat.ps1
Last active July 27, 2025 10:35
Chat with gemini
$API_KEY = "" # Haal hier api key op: https://aistudio.google.com/apikey
# Vraag taalkeuze
function Choose-Language {
while ($true) {
$lang = Read-Host "Choose language / Kies taal (EN/NL)"
switch ($lang.ToLower()) {
"en" { return "en" }
"nl" { return "nl" }
default { Write-Host "Please enter EN or NL / Geef EN of NL in." -ForegroundColor Yellow }
@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:
@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 / 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 / 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 / install_php_modules.sh
Last active March 6, 2024 14:11
install_php_modules.sh
#!/bin/bash
# Update package lists
sudo apt-get update
# Upgrade installed packages
sudo apt-get upgrade -y
# Fetch all installed PHP versions
php_versions=$(ls /etc/php)
@Aldo-f
Aldo-f / toggle_xdebug.sh
Last active February 3, 2024 07:37
Toggle Xdebug - Apache
#!/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"
# Determine the initial Xdebug state based on the first loop
for version in "${PHP_VERSIONS[@]}"; do
@Aldo-f
Aldo-f / .lando.yml
Last active December 4, 2021 11:51 — forked from MatthieuScarset/.lando.yml
Correct settings for XDebug + VSCode + Lando (+3.0)
# Lando version is at least +3.0
name: drupal-nine
recipe: drupal9
services:
appserver:
webroot: web
xdebug: debug
config:
php: .vscode/php.ini
@Aldo-f
Aldo-f / components.my-child.js
Last active October 15, 2019 14:31
Get data from child
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs() {
//debugger;
this._super(...arguments);
}
});