This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vg=vg_backup-lv_backup | |
numlines=50 | |
geta() { | |
a=() | |
while read -d $'\n'; do | |
a+=("$REPLY") | |
done < <(echo "$@" | tail -n 6| grep -A2 iowait | awk '{ print $4 }' | sed 's,\,,,g' | grep -o '[0-9]*' | sed 's/.$//') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sda=sda | |
numlines=60 | |
outputr=$1 | |
outputw=$2 | |
getread() { | |
a=() | |
while read -d $'\n'; do | |
a+=("$REPLY") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
getlog() { | |
log=() | |
while read -d $'\n'; do | |
log+=("$REPLY") | |
done < <(find /var/log/apache2/* -type f | grep log."$1".gz | grep "$2" error ) | |
} | |
manupilatelogs() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
search_str="$1" | |
pipe=/tmp/alert | |
trap "rm -f $pipe" EXIT | |
rm -f $pipe | |
if [[ ! -p $pipe ]]; then | |
mkfifo $pipe | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from sh import tail | |
import string | |
for line in tail("-fn0", "/tmp/alert", _iter=True): | |
if ("PASSIVE" and "OK") in line: | |
nagios_alerts = line.split(" ") | |
print repr(nagios_alerts[4:]) | |
print(len(nagios_alerts[4:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sidekiq Init script for Sidekiq | |
# chkconfig: 345 100 75 | |
# | |
# Description: Starts and Stops Sidekiq message processor for Stratus application. | |
# | |
# User-specified exit parameters used in this script: | |
# | |
# Exit Code 5 - Incorrect User ID | |
# Exit Code 6 - Directory not found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
numbertokeep=15 | |
for zone in $(cat tmp_zones) | |
do | |
for x in $(find /home/ubuntu/KEYS/* -type f | grep ".key"); | |
do | |
key="--region "$zone" -C ${x%.*}.pem -K ${x%.*}.key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################### | |
# How to use | |
# Naviage to the aws/securityCredentials page and generate a x.509 certificate | |
# take both the public and the private certificate file and place them in $KEYDIR | |
# rename the public and private certificate foo.pub and foo.key respectivly | |
# you may provide this script with any number of certificate pairs | |
# | |
# What it does | |
# This script takes a SNAPSHOT of all ATTACHED volumes across all AVALIABILITY zones. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gondrol | |
2321 | |
56 | |
58 | |
45 | |
RinRao | |
2122 | |
38 | |
37 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for x in $(find /home/ubuntu/KEYS/* -type f | grep ".key"); | |
do | |
#Get a list of avaliable avaliablility zones | |
if [[ ! -e tmp_zones ]]; then | |
ec2-describe-regions -C ${x%.*}.pem -K ${x%.*}.key | awk '{ print $2 }' > tmp_zones | |
fi | |
for zone in $(cat tmp_zones) |