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
yum -h | |
yum update | |
yum update --disableexcludes=* | |
grubby --default-kernel |
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 | |
### | |
# | |
# install and enable tr locale for openpanel | |
# | |
### | |
cd /usr/local/panel && pybabel init -i messages.pot -d translations -l tr | |
wget -O /usr/local/panel/translations/tr/LC_MESSAGES/messages.po https://raw.githubusercontent.com/stefanpejcic/openpanel-translations/main/tr-tr/messages.pot |
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 | |
WORKDIR="/var/tmp" | |
TIMESTAMP_FILE="$WORKDIR/last_email_timestamp" | |
LIMIT="100" | |
LOAD="20" | |
starttime=$(date +%s -d '1 hour ago') # 1 hour ago | |
currenttime=$(date +%s) | |
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 | |
# adds a custom blacklist to ufw | |
# Check if ipset is installed | |
if ! command -v ipset &> /dev/null | |
then | |
echo "ipset could not be found, installing..." | |
sudo apt-get update && sudo apt-get install -y ipset | |
else |
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 | |
### | |
# | |
# install and enable de locale for openpanel | |
# | |
### | |
cd /usr/local/panel && pybabel init -i messages.pot -d translations -l de | |
wget -O /usr/local/panel/translations/de/LC_MESSAGES/messages.po https://raw.githubusercontent.com/stefanpejcic/openpanel-translations/main/de-de/messages.pot |
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
import sys | |
from werkzeug.security import generate_password_hash | |
def hash_password(unhashed_password): | |
hashed_password = generate_password_hash(unhashed_password) | |
return hashed_password | |
if __name__ == "__main__": | |
# Check if the correct number of command-line arguments is provided | |
if len(sys.argv) != 2: |
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
import os | |
import sys | |
from htmlmin import minify | |
from css_html_js_minify import process_single_html_file | |
def minify_files(input_dir, output_dir): | |
if not os.path.exists(output_dir): | |
os.makedirs(output_dir) | |
for root, dirs, files in os.walk(input_dir): |
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 | |
CLOUDFLARE_IPS_V4=$(/usr/bin/curl -s --max-time 10 https://www.cloudflare.com/ips-v4) | |
CLOUDFLARE_IPS_V6=$(/usr/bin/curl -s --max-time 10 https://www.cloudflare.com/ips-v6) | |
if [ -n "$CLOUDFLARE_IPS_V4" ] && [ -n "$CLOUDFLARE_IPS_V6" ]; then | |
/usr/sbin/ufw --force reset | |
/usr/sbin/ufw default allow incoming | |
/usr/sbin/ufw default allow outgoing | |
for IP in $CLOUDFLARE_IPS_V4; do |
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
docker run \ | |
--name {{printf "%q" .Name}} \ | |
{{- with .HostConfig}} | |
{{- if .Privileged}} | |
--privileged \ | |
{{- end}} | |
{{- if .AutoRemove}} | |
--rm \ | |
{{- end}} | |
{{- if .Runtime}} |
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 | |
# Stop the Docker service | |
systemctl stop docker.service | |
# Set the target file | |
target_file="/var/lib/docker.fs" | |
# Get available space in the home directory in kilobytes | |
available_space=$(df -k /home | awk 'NR==2 {print $4}') |