How to Automate/Gather Statistics for Multiple Websites in BASH

Introduction For one reason or another, Im sure you will find yourself in a position when you need to obtain statistics for a collection of websites. Today, we will show you steps required in building a BASH script that will do just that. Lets go…. Output Format Within our script we will use curl. Curl … Read more

Tool – SSLReport

SSLReport provides the ability to scan a network and determine which hosts are running SSL/TLS based services and then query each of these servers/ports to determine which ciphers are supported. The output of this is then outputted within a CSV based format. Usage [root@william images]# bash sslreport.txt 10.1.1.0/23 home Checking for Binaries …..  *Successful execution … Read more

Stream ripper bash script

This bash script allows you to download an audio stream via ASX (Advanced Stream Redirector) for a defined time period. The downloaded file (wma) is then converted to mp3. This provides the ability to schedule and download your favourite radio shows for later listening. Requirements There are 2 main binaries that this script requires. They … Read more

SoundCloud Downloader BASH Script

SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all tracks for a given artist. SCRIPT #!/bin/bash if [ -z “$1” ]; then echo “Usage: `basename $0` [URL]”; echo echo “Example:” echo ” `basename $0` http://soundcloud.com/disco-dave”; exit fi page=`wget $1 -q –user-agent=’Mozilla/5.0′ … Read more

RHEL5 Backup Shell Script

Below is a link to a RHEL5 shell backup script. Below is a summary of what the script does : Creates a tgz of all the major RHEL 5 operating system files to ${backup_name}. All the installed rpms are saved to a text file named /var/log/installed_rpms.txt. #!/bin/sh # # RHEL 5 Backup Script v1.1 # … Read more

Solaris Backup Script

This script will backup all the major operating system files and save them within /var/tmp. It was also log the MD5 of the backup after each successful backup and rotate the backups to ensure you dont run into disk space issues. #!/sbin/sh ## ## SunOS Backup Script v1.3 ## ## Backups up the the following … Read more

FTP Transfer script for SGS logs files

Below is a script will send the latest log file of the SGS (Symantec Gateway) across to an FTP server. You would need to add this to your crontab to run every hour, in the event of multiple log files being generated per day. #!/bin/sh # # This script will ftp gzip the latest sgs … Read more

R65 / R55 Script – Resource Usage Report

Below is a bash/sh script to log the resouces of a R55/R65 Check Point firewall. The following resources are recorded, Free Memory CPU Usage Concurrent Connections Peak Connections Time Date The script will build a .csv file which can then be opened using excel, and the required data (columns) can be selected and converted into … Read more

Recursive ZIP command

This is a small command which will take each file in the directory that it is run in and zip the file and then remove the original. for i in `ls` ; do zip=$(echo $i | sed s/iso/iso”.”zip/) ; zip -r $zip $i && rm -fv $i ;  done

Bourne – File name Converter

This script will convert any mp3/wav/wma files into neat and tidy naming format, #!/bin/sh ls | /bin/egrep -i “.wma|.mp3|.wav” > /dev/null if [ $? == 0 ] then ls | /bin/egrep -i “.wma|.mp3|.wav”  | while read source do dest=$(echo “$source” | /bin/sed ‘s/^[0-9]*[-,_]//;s/^-//;s/\_/ /g;s/^ *//g;;s/.*/\L&/g;s/-/ – /g;s/  / /g;s/\<./\u&/g;s/…$/\L&/’) /bin/mv -fv “$source” “$dest” done exit … Read more

BASH – F-Prot Scripts

Here are 2 scripts created for the AV software F-Prot, FProt_scan Runs a scan on your system, you will need to enter you own path under the variable $path #!/bin/bash #Variables path=/ #binaries fprot=/usr/local/f-prot/f-prot if [ ! -x “${fprot}” ]; then echo “Error: ${fprot} not found or not executable!” | /usr/bin/logger -t fprot_scan -p daemon.err … Read more