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 / 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);
}
});
@Aldo-f
Aldo-f / Block ads on Stremio
Created August 17, 2019 09:35
Block ads on Stremio using windows hosts file
#C:\Windows\System32\drivers\etc\hosts
0.0.0.0 market.moonicorn.network
@Aldo-f
Aldo-f / fix for contextual-links-region
Created January 5, 2019 17:35
Minor fix for contextual-links-region
@Aldo-f
Aldo-f / center-well-with-push-footer.markdown
Created May 3, 2018 10:51
Center well with push footer