Email Alert for Host down using fping Rumi, October 26, 2020 A simplified bash script for host status alert: #!/bin/bash email=h.t.emdad@gmail.com NBR_DOWN=0 LOGFILE=/tmp/pinglog.txt echo “Server Down Status” > $LOGFILE for i in $(cat ping.txt); do fping $i >/dev/null if [ $? -ne 0 ]; then echo “$i is down” >> $LOGFILE NBR_DOWN=$((NBR_DOWN+1)) fi done if [ $NBR_DOWN -gt 0 ]; then… Continue Reading
WordPress Backup Script Rumi, August 23, 2020 #!/bin/bash # This script creates a compressed backup archive of the given directory and the given MySQL table. More details on implementation here: https://theme.fm # Feel free to use this script wherever you want, however you want. We produce open source, GPLv2 licensed stuff. # Author: Konstantin Kovshenin exclusively for… Continue Reading
Install Zoneminder on Ubuntu 18.04 with shell script Rumi, November 12, 2019November 12, 2019 This will install Zoneminder by using a shell script with one basic command (how easy is that!). You will need a Ubuntu 18.04 install with LAMP (Apache, MySQL and PHP) installed desktop or server. As an alternate you may use Mariadb in lieu of MySQL Shell script file contents: #!/bin/sh… Continue Reading
Archiving a large backup across multiple discs on Linux Rumi, September 6, 2019 We have two options (as we obviously don’t want to delete our data!) Use a different backup medium Split the backup across multiple volumes Sometimes the former just isn’t appropriate, as much because of the cost of harddrives vs Optical Media (i.e. CD’s/DVD’s). This short tutorial will explain how to… Continue Reading
PHP Session test Script Rumi, May 6, 2018May 6, 2018 I’ve just found a quality script to test php session- unless you’re in dark after some php.ini session tweaking done. To check if sessions really work you can use this code: <?php // Start Session session_start(); // Show banner echo ‘<b>Session Support Checker</b><hr />’; // Check if the page has… Continue Reading
How to keep a job running in Linux Rumi, November 13, 2017November 13, 2017 There are many ways to keep a process running on linux but I haven’t seen any that are as easy to implement as the script below. Basically the script does a ps ax and then a grep for your process. If it’s not running it will re-start the process. You install the script into… Continue Reading
How to quickly stress test a web server Rumi, November 13, 2017 The Curl syntax allows you to specify sequences and sets of URL’s. Say for example we’re going to run a load stress test against Google we can run… curl -s “http://google.com?[1-1000]” This will make 1000 calls to google i.e. Continue Reading
Very Generic Linux Service Watchdog script Rumi, 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… Continue Reading
IP Setting on CentOS6 using Shell Script Rumi, December 6, 2015 #!/bin/bash if [ $# -eq 5 ] then echo “” echo “Taking the backup and Changing the hostname from $(hostname) to $1 …” sed -i.bk “s/$(hostname)/$1/g” /etc/sysconfig/network echo “” echo “Backing up & Assigning the Static IP …” echo “” cp /etc/sysconfig/network-scripts/ifcfg-$2 /etc/sysconfig/network-scripts/$2.bk cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$2 DEVICE=$2 BOOTPROTO=static IPADDR=$3.$4… Continue Reading
Zimbra Domain Administration (Multi-tenant) Rumi, June 4, 2015 In order to create a multi tenancy in zimbra OSA, can be acheived through a bash script below. Thanks to Ahmad Imanuddin (http://www.imanudin.com) for sharing this very useful script. cd /srv/ vi admin-delegate.sh Fill with the following line : Continue Reading