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
[Unit] | |
Description=Monitor AWS Spot Termination Event | |
After=network.target | |
[Service] | |
ExecStart=/opt/monitor_termination.sh | |
Restart=always | |
User=root | |
[Install] |
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 | |
# Define the cPanel username | |
cpanel_user="your_cpanel_username" | |
# Define the file containing the list of subdomains | |
file="domains.txt" | |
# Define the log file | |
log_file="deletion_log.txt" |
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
location /pma { | |
alias /usr/share/phpmyadmin; | |
location ~ \.php$ { | |
try_files $uri /index.php =404; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $request_filename; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/run/php/php8.0-fpm-dev.sock; | |
fastcgi_index index.php; | |
} |
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
[Unit] | |
Description=Send Telegram Notif | |
Requires=network-online.target | |
After=network.target | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStop=/usr/bin/bash /opt/script/down.sh |
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 | |
TMPFILE="$(mktemp -p /tmp wp-auto-install-XXXXXXXX)" | |
cat "${1:-/dev/stdin}" > $TMPFILE | |
DOMAIN=$(python2.7 -c "import sys, json; print json.load(open('$TMPFILE'))['data']['domain']") | |
CUSTOMEREMAIL=$(python2.7 -c "import sys, json; print json.load(open('$TMPFILE'))['data']['contactemail']") | |
## The following variable contains the name of the Package that was assigned to the account. | |
## It would be possible to add additional logic to this script so that WordPress is only installed for certain packages | |
PACKAGE=$(python2.7 -c "import sys, json; print json.load(open('$TMPFILE'))['data']['plan']") |
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 | |
# Collect some information about this instance | |
MY_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
MY_REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/.$//') | |
MY_ASG=$(aws autoscaling describe-auto-scaling-instances --region $MY_REGION --instance-ids $MY_ID --query "AutoScalingInstances[].AutoScalingGroupName" --output text) | |
# Query the ASG | |
FIRST_ID=$(aws autoscaling describe-auto-scaling-groups --region $MY_REGION --auto-scaling-group-name $MY_ASG --query "AutoScalingGroups[].Instances[0].InstanceId" --output text) |