This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Filename containing the list of repositories | |
| FILE="repos.txt" | |
| # 1. Check if repos.txt exists | |
| if [ ! -f "$FILE" ]; then | |
| echo "Error: File $FILE not found in the current directory." | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/sh | |
| sudo apt update && sudo apt list --upgradable | |
| echo 'Do you want to run the update? (Y/n)' | |
| read INPUT | |
| case $INPUT in | |
| n) | |
| echo 'Update cancelled.' | |
| exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'init', function () { | |
| // Exceptions (do not redirect these URIs) | |
| $exceptions = array( | |
| '/exception1', | |
| '/exception2', | |
| ); | |
| // Redirects to special URIs | |
| $special_redirects = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/sh | |
| file=$1 | |
| if [ -z "$file" ]; then | |
| echo "USAGE: extract_mkv_track.sh <filename>" | |
| exit 1; | |
| fi | |
| extension="${file##*.}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if ! command -v svgo &> /dev/null; then | |
| echo "SVGO is not installed. Install it by running 'npm install -g svgo'" | |
| exit 1 | |
| fi | |
| for file in "$@"; do | |
| if [ -f "$file" ]; then | |
| extension="${file##*.}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/sh | |
| cd images_processed | |
| # Convert png to jpg | |
| mogrify -format jpg -quality 90 *.png | |
| rm -f *.png | |
| # Resize images | |
| for PHOTO in * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Check banned IP | |
| sudo zgrep '<IP>' /var/log/fail2ban.log* | |
| // Unban IP | |
| sudo fail2ban-client set <jail_name> unbanip <IP> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| ga('send', 'event', 'error_404', '<?php echo $_SERVER['REQUEST_URI']; ?>', '<?php echo ($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'direct'; ?>'); | |
| </script> |
NewerOlder