Skip to content

Instantly share code, notes, and snippets.

View markd69's full-sized avatar
:shipit:
Chillin!

Mark David markd69

:shipit:
Chillin!
View GitHub Profile
@markd69
markd69 / block_ports.sh
Last active June 22, 2021 17:03
Block Mail Ports on Virtualizor & SolusVM
# Set kernel module enable bridged iptables
# See: https://wiki.libvirt.org/page/Net.bridge.bridge-nf-call_and_sysctl.conf
modprobe br_netfilter
sysctl net.bridge.bridge-nf-call-iptables=1
# Set it on reboot
echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf
# Block TCP
iptables -A FORWARD -j DROP -p tcp --destination-port 25
iptables -A FORWARD -j DROP -p tcp --destination-port 25
@markd69
markd69 / OVH_SmartTest.sh
Created April 1, 2021 15:07
The script that OVH uses to check disk health.
#!/bin/bash
#Script pour l'execution automatique des tests smart
echo
mem=`(free -m | grep Mem | awk {'print $2'})`
cpu=`(cat /proc/cpuinfo | grep -m 1 name | cut -d : -f 2)`
echo -e "\033[32mProfil Serveur:$cpu; $mem Mo de ram detecte\033[00m"
# fonction permettant de verifier l'etat du raid soft
DOMAIN:443 {
root * /var/www/DOMAIN
file_server
php_fastcgi unix//var/run/php-fpm/site.sock
encode gzip zstd
log {
output file /var/log/caddy/whmcs.access.log {
roll_size 3MiB
roll_keep 5