Skip to content

Instantly share code, notes, and snippets.

View linuxwizard's full-sized avatar

LinuxWiz linuxwizard

View GitHub Profile
@linuxwizard
linuxwizard / dns_check.sh
Last active February 23, 2021 03:23
Bulk Bash DNS checker
#!/bin/bash
domain_list='shortlist.txt'
declare -a resol
resol=('8.8.8.8' '8.8.4.4' '1.1.1.1' '1.0.0.1' '9.9.9.9' '149.112.112.112') #multiple resolvers
for domain in `cat $domain_list`
do
ns_ip=${resol[`shuf -i0-5 -n1`]} #select resolver
registrar_detail=`whois $domain | grep -i "registrar:" | tail -n1 | awk '{print $2 $3}' | tr , " "` #fetch registrar. improvement needed
@linuxwizard
linuxwizard / diskcheck.sh
Last active September 5, 2022 15:43
Script for checking disk performance using smartctl, dd and hdparm. Requires CentOS installed :)
#!/bin/bash
#Date 20/10/2017 , Version 1.0.1
#Authors : Arun D, Nikhil Sasi
#Requirements : CentOS installed
#Note : Not coded for checking Hardware RAID arrays
#Things to do : Log file generation
echo -n "SMARTCTL test selection, Enter [short/long]: "
@linuxwizard
linuxwizard / MegaCli-Check.sh
Created May 26, 2017 02:47
Simple RAID status check script for LSI MegaRAID cards
# Simple RAID status check script for LSI MegaRAID cards
# Needs MegaCli installed. Install from https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip
# Requires sendmail installed
# Create a cron job for auto checks
# Output format
# Degraded 1
# Failed 1
#!/bin/bash
STATUS=`MegaCli -AdpAllInfo -aALL -NoLog|egrep '^ (Degraded|Failed)'|grep -v ' 0'`;
#To download a list of courses from LinuxAcademy through a simple script.
#go through
#Substitute /<download-directory>/<course-directory> with the path to download
#download Utility from https://github.com/vassim/linuxacademy-dl
#Substitute course IDs in the loop
#!/bin/bash
for i in 33 45 48 49
do
mkdir /<download-directory>/<course-directory>/$i
@linuxwizard
linuxwizard / zip.sh
Last active May 26, 2017 02:35
Bash script to create tar gzip archive
#Simple script to create a tar gzip archive of all directories inside the current directory excluding the shell file and removes the
#directory once archived
#!/bin/bash
#for i in `ls | awk '{print $0}'`
for i in `ls | grep -v zip.sh | awk -F. '{ print $1 }'`
do
tar -czvf $i.tar.gz $i/
echo $?
rm -rf $i/