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}') |
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
| # install lsws | |
| bash <( curl https://get.litespeed.sh ) TRIAL | |
| # symlink docroot from filemanager to ls | |
| ln -s /home/stefan/josjedan.openpanel.org /usr/local/lsws/Example2/public_html | |
| # install lsphp | |
| wget -O - https://repo.litespeed.sh | bash | |
| apt-get install lsphp81 lsphp81-common lsphp81-mysql |
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
| from flask import Flask, render_template, request | |
| from flask_socketio import SocketIO, emit | |
| import docker | |
| app = Flask(__name__) | |
| socketio = SocketIO(app, cors_allowed_origins="*") | |
| client = docker.from_env() | |
| @app.route('/terminal/<container_id>') | |
| def terminal(container_id): |
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/sh | |
| # Variables | |
| PDIR=$(pwd) | |
| ZONEDIR="/var/cache/bind" | |
| ZONE=$1 | |
| ZONEFILE="/etc/bind/zones/${ZONE}.zone" | |
| CONFIG_FILE="/etc/bind/named.conf.local" | |
| DNSSERVICE="bind9" |
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 | |
| # Threshold for the number of xmlrpc processes indicating an attack | |
| THRESHOLD=50 | |
| # Path to the custom Nginx configuration include file | |
| NGINX_CONF="/etc/nginx/conf.d/custom_code_for_all_domains.conf" | |
| # Function to log the change | |
| log_change() { |
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
| # Gunicorn configuration file | |
| # https://docs.gunicorn.org/en/stable/configure.html#configuration-file | |
| # https://docs.gunicorn.org/en/stable/settings.html | |
| import multiprocessing | |
| from gunicorn.config import Config | |
| import configparser | |
| import os |
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 | |
| # https://unix.stackexchange.com/questions/537645/how-to-limit-docker-total-resources | |
| # https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/ | |
| CPU_PERCENTAGE="90" | |
| RAM_PERCENTAGE="90" | |
| # Get total RAM in bytes | |
| total_ram=$(grep MemTotal /proc/meminfo | awk '{print $2}') |