Protect your server with a strong iptables rules and ipset lists.
apt install ipset
#!/bin/bash | |
# Copy this file into your project root | |
# Configure LOG path, DOMAIN and WEB folder (from project root) | |
# Set execution permissions with: chmod 755 404-download.sh | |
# View some page on your local environment | |
# Launch the script with ./404-download.sh | |
LOG="/var/log/apache2/access.log" | |
HOST="https://domain.com" |
function dateLocal(timezone) { | |
var date = new Date().toLocaleString('en-US', { | |
timeZone: timezone, | |
hour12: false | |
}).match(/^([0-9]+)\/([0-9]+)\/([0-9]+), ([0-9]+):([0-9]+):([0-9]+)$/); | |
return new Date(Date.UTC(date[3], date[1] - 1, date[2], date[4], date[5], date[6])); | |
} |
#!/bin/bash | |
echo -ne "\nSTART: $(date "+%Y-%m-%d %H:%M:%S")" | |
logs="/root/logs/ipset-locate" | |
if [ ! -d "$logs" ]; then | |
install -d "$logs" | |
fi |
# | |
# Delete previous function definition (if exists) | |
# | |
DROP FUNCTION IF EXISTS before_update_updated_at() CASCADE; | |
# | |
# Create function to update updated_at timestamp if changed values on update | |
# | |
CREATE OR REPLACE FUNCTION before_update_updated_at() RETURNS trigger AS | |
$BODY$ |
# Save on /usr/local/bin/apt-dist-upgrade with 700 permissions to root | |
# Execute: sudo apt-dist-upgrade | |
export DEBIAN_FRONTEND=noninteractive | |
export NEEDRESTART_MODE=a | |
export DEBIAN_PRIORITY=critical | |
apt clean | |
apt autoclean |
#!/bin/bash | |
# Require adb-sync https://github.com/google/adb-sync | |
MOUNT="/mnt/backup" | |
NAME="Xiaomi-Mi-A2" | |
e () { | |
echo -e "\n$(date '+%Y-%m-%d %H:%M:%S'): $1\n" | |
} |
<?php declare(strict_types=1); | |
if (!function_exists('uniqidReal')) { | |
/** | |
* @param int $length | |
* | |
* @return string | |
*/ | |
function uniqidReal(int $length): string | |
{ |
<IfModule mod_negotiation.c> | |
Options -MultiViews -Indexes | |
</IfModule> | |
# Allow Access Control Headers | |
Header set Access-Control-Allow-Origin "*" | |
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE,PATCH,OPTIONS" | |
Header set Access-Control-Allow-Headers "Accept, Accept-Datetime, Accept-Language, App-Version, Authorization, Cache-Control, Content-Type, Date, Device-Token, Location, Origin, Time-Zone, User-Agent, X-Requested-With" | |
Header set Access-Control-Allow-Credentials "true" |
#!/bin/bash | |
# Install as /usr/local/bin/json-pretty with +xr permissions | |
# | |
# Usage: | |
# | |
# * `json-pretty file.json` generate a prettified file-pretty.json file | |
# * `json-pretty file.json new-file.json` generate a prettified new-file.json file | |
if [ "$1" == "" ] || [ ! -f "$1" ]; then |