Skip to content

Instantly share code, notes, and snippets.

View ashutoshsmaurya's full-sized avatar

Ashutosh ashutoshsmaurya

View GitHub Profile
@ashutoshsmaurya
ashutoshsmaurya / Monitor_dhcp.sh
Created November 5, 2017 05:23
Monitoring DHCP usage
#!/bin/bash
rm /tmp/showdhcp.log &
rm /tmp/tmp* &
tempFile=$(mktemp)
cat /var/lib/dhcpd/dhcpd.leases \
| grep \
-e '^lease ' \
-e '^ binding state' \
@ashutoshsmaurya
ashutoshsmaurya / Basckup_Web_Database_Server.sh
Last active December 21, 2020 04:34
Backup Web Server and Database to Google Drive - Bash Script
#!/bin/bash
#Please note - This script tested on Centos-6,7/Redhat-6,7.
#Check Internet Connection
IS=`/bin/ping -c 5 4.2.2.2 | grep -c "64 bytes"`
if (test "$IS" -gt "2") then
internet_conn="1"
#Check Gdrive Software Install Or Not
file="/usr/bin/gdrive"
if [ -f "$file" ]
then
@ashutoshsmaurya
ashutoshsmaurya / Reset_MySQL_User_Password.sh
Last active November 16, 2017 07:15
Reset MySLQ User Password
#!/bin/bash
#Confirm that you want to reset the MySQL passwords
CONFIRM="n"
echo -n "Please confirm MySQL password reset for continue? (y/N): "
read -n 1 CONFIRM_INPUT
if [ -n "$CONFIRM_INPUT" ]; then
CONFIRM=$CONFIRM_INPUT
fi