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
# prepration | |
git clone https://github.com/cathugger/mkp224o.git | |
apt install gcc libc6-dev libsodium-dev make autoconf | |
cd mkp224o | |
./autogen.sh | |
./configure | |
make | |
# generation |
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 | |
log_dir="/var/lib/docker/containers" | |
echo "Container Name | Log Size" | |
echo "--------------------------" | |
for log_file in "$log_dir"/*/*-json.log; do | |
container_id=$(basename "$(dirname "$log_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
# enable demo | |
opencli config update demo_mode on | |
# disaable dev | |
opencli config update dev_mode off | |
# purge all redis cache so dev_mode value is instantly active and any sensitive data removed | |
docker exec -it openpanel_redis redis-cli FLUSHALL |
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
account openpanel | |
host 1IP_HERE | |
port 465 | |
from [email protected] | |
user [email protected] | |
password XXXXXXXXXXXXXXXXXXXX | |
auth login | |
tls off | |
tls_starttls off | |
tls_trust_file /etc/ssl/certs/ca-certificates.crt |
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
# /etc/msmtprc | |
defaults | |
auth off | |
tls off | |
logfile /var/log/msmtp.log | |
account default | |
host IP_HERE | |
port 25 | |
from USERNAME@HOSTNAME |
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 | |
function _setup_mailname() { | |
_log 'debug' "Setting up mailname and creating '/etc/mailname'" | |
echo "${DOMAINNAME}" >/etc/mailname | |
} | |
function _setup_docker_permit() { | |
_log 'debug' 'Setting up PERMIT_DOCKER option' |
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 | |
if (!defined('WHMCS')) { | |
die('You cannot access this file directly.'); | |
} | |
add_hook('TicketOpen', 1, function ($vars) { | |
// Your Discord webhook URL | |
$discordWebhookUrl = "PUT_HERE"; |
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 | |
BLUEPRINTS_DIR="/var/www/blueprints" | |
# Function to count valid lines (ignores empty lines and comments) | |
count_valid_lines() { | |
[[ -f "$1" ]] && grep -Evc '^\s*$|^\s*#' "$1" || echo "0" | |
} | |
# Function to validate each line (must be a slug, path, or URL) |
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
# backup database only for WP site | |
0 0 1,15 * * backup_dir="/var/www/backups/demo.openpanel.org/2025-02-12_19-01-00" && mkdir -p "$backup_dir" && wp db export "$backup_dir/database.sql" --path="/var/www/html/demo.openpanel.org/" --allow-root | |
# backup files only for WP site | |
0 0 1,15 * * backup_dir="/var/www/backups/stefan.openpanel.org/$(date +"%Y-%m-%d_%H-%M-%S")" && mkdir -p "$backup_dir" && cd "/var/www/html/stefan.openpanel.org/" && zip -r files.zip . && mv files.zip $backup_dir/ | |
# backup both files and database for WP site | |
0 0 1,15 * * backup_dir="/var/www/backups/stefan.openpanel.org/$(date +"%Y-%m-%d_%H-%M-%S")" && mkdir -p "$backup_dir" && wp db export "$backup_dir/database.sql" --path="/var/www/html/stefan.openpanel.org/" --allow-root && cd "/var/www/html/stefan.openpanel.org/" && zip -r "$backup_dir/files.zip" . && mv files.zip $backup_dir/ |
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 | |
# Print JB encryption key | |
token=$(whmapi1 api_token_create token_name=temp 2>/dev/null | grep -oP '(?<=token: ).*' 2>/dev/null) | |
hostname=$(hostname) | |
encryption_key=$(curl --insecure -H "Authorization: whm root:$token" "https://$hostname:2087/cgi/addons/jetbackup5/api.cgi?function=getMasterEncryptionKey" 2>/dev/null | grep -o '"encryption_key":"[^"]*' | awk -F '"' '{print $4}') |
NewerOlder