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
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name example.com; | |
# SSL | |
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; | |
ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem; |
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/python3 | |
import smtplib, ssl, socket | |
from email.mime.text import MIMEText | |
port = 465 # For SSL | |
msg = MIMEText('Sensu is Down!. Please do the needful') | |
msg['Subject'] = 'Sensu is down!' | |
msg['From'] = '[email protected]' | |
msg['To'] = '[email protected]' |
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
<?php | |
require_once('wp-load.php'); | |
is_user_logged_in() || auth_redirect(); | |
list($basedir) = array_values(array_intersect_key(wp_upload_dir(), array('basedir' => 1)))+array(NULL); | |
$file = rtrim($basedir,'/').'/'.str_replace('..', '', isset($_GET[ 'file' ])?$_GET[ 'file' ]:''); |
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
//add this file to your site's configuration. It usually located inside the sites-enabled folder. | |
location ~ ^/wp-content/uploads/(?<file>restricted/.*) | |
{ | |
rewrite ^ /dl.php?file=$file last; | |
// get the dl.php from https://www.youtube.com/shorts/GLiDRC9dbPg | |
} |
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
deploy_development: | |
stage: deploy | |
only: | |
- development # Limit this job to the staging branch | |
script: | |
- echo "Deploy to staging server" | |
- cd /var/www/stagingadmin.example.com | |
- sudo git stash | |
- sudo git fetch | |
- sudo git pull |
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 | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |