Test php mail function on your server Rumi, October 18, 2008 A handy code to test PHP mail functions on your server!############### Code <? // —————- SEND MAIL FORM —————- // send e-mail to … $to=”me@localhost“; // Your subject $subject=”Test”; // From $header=”from: your name <your email>”; // Your message $message=”Hello \r\n”; $message.=”This is test\r\n”; $message.=”Test again “; // send email $sentmail = mail($to,$subject,$message,$header); // if your email succesfully sent if($sentmail){ echo “Email Has Been Sent .”; } else { echo “Cannot Send Email “; } ?> Related Scripts
Very Generic Linux Service Watchdog script June 16, 2016 A strong watchdog script- indeed! #!/bin/bash # # watchdog # # Run as a cron job to keep an eye on what_to_monitor which should always # be running. Restart what_to_monitor and send notification as needed. # # This needs to be run as root or a user that can start… Read More
Monitor Service Port if Down execute a Bash Script November 14, 2022 #!/bin/bash HOST_NAME=”127.0.0.1″ HOST_PORT=”1656″ if ( (exec 3<>/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2> /dev/null); then echo -e “PORT: ${HOST_PORT} | ON” else cd /home/rumi/my-app/ && `node service.js` fi exit; Related Read More
Proxmox VM auto start VM after found in shutdown state July 30, 2021July 30, 2021 I was having this strange issue, where a running busy VM stopeed all of a sudden due to high CPU or Memory overload issue. So manually had to start everythime. In order to avoid this, created a small script to start the VM in case if it’s down. #!/bin/bash #… Read More