This file contains 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 | |
color_off='\033[0m' # Text Reset | |
color_green='\033[1;32m' # Green text | |
versions=(/usr/bin/php*) | |
mapfile -t versions < <(printf '%s\n' "${versions[@]}" | egrep '[0-9]+\.[0-9]+' | cut -c 13-) | |
counter=0 | |
if [ $# -eq 0 ]; then |
This file contains 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
/** | |
* These two functions takes an integer (with some optional salt) and converts it to an alphanumeric string | |
* It's super easy to use, and it's useful if you want to "hide" the original ID - or at least make it not obvious | |
* | |
* WARNING: It's not a security tool! Actually, it's far from being secure. It's just an obfuscator | |
* | |
* | |
* Usage: | |
* | |
* $id = 53; // The data you want to encode |
This file contains 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 | |
// Pt. 1) This is the server side part. We read the error (see pt. 2) and write it down using error_log | |
if (!empty($_POST)) { | |
$errorData = $_POST; | |
$error = " Error: " . $errorData['url']; | |
if ($errorData['error'] !== '') { | |
$error .= "<br><br>" . $errorData['error']; | |
} | |
if ($errorData['msg'] !== '') { |
This file contains 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 [ -z "$1" ] | |
then | |
echo "You need to specify the database file. Eg.: ./access_dump.sh my-database.mdb" | |
echo "" | |
echo "Please make sure that you have mdbtools installed on your system: 'sudo apt install mdbtools'" | |
exit 1 | |
fi | |
DB="$1" |
This file contains 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 | |
# Please note that this script downloads the italian localization of wordpress. | |
# Please check on line 21 if this doesn't suit you. | |
if [ $# -eq 0 ]; then | |
echo "You didn't specify in which directory you want wordpress to be installed!" | |
exit 1 | |
fi | |
cd $1 |
This file contains 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 | |
echo "Updating wp-cli to its latest version..." | |
sudo wp cli update | |
echo "" | |
for d in */ ; do | |
user=$(stat -c '%U' $d) | |
echo "" | |
echo "Entering $d with user $user..." |
This file contains 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/sh | |
############## | |
## CONFIGURATION | |
############## | |
# remote access | |
sshUser="" | |
sshPass="" | |