This file contains hidden or 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 | |
#GLOBAL VARS | |
set -x | |
DATE=`date +%Y-%m-%d.%H:%M:%S` | |
RECIPIENTS="[email protected]" | |
STAGING=/nas/tbdata/.encrypted_file | |
EXTRACT=/nas/tbdata2 | |
ARCHIVE=/nas/tbdata/.encrypted_file/md5 | |
MD5="[email protected]:/erp.tar.gpg.md5" | |
DATA="[email protected]:/erp.tar.gpg" |
This file contains hidden or 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 | |
#set -x | |
shopt -s nullglob | |
data=(/nas/csi/*) | |
key="$HOME"/.ssh/csi | |
[email protected]:/Drop | |
archive=/nas/data/.data_archive | |
now=$(date +"%Y%m%d-%T") | |
sftp_copy () { |
This file contains hidden or 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/env bash | |
repo_name=$1 | |
test -z $repo_name && echo "Repo name required." 1>&2 && exit 1 | |
curl -u 'username_github' https://api.github.com/user/repos -d "{\"name\":\"$repo_name\"}" |
This file contains hidden or 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/env bash | |
(echo "Content-Type: text/html"; curl localhost/cgi-bin/report.cgi) | /usr/sbin/sendmail [email protected] |
This file contains hidden or 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/env bash | |
IFS=$'\n' | |
arr=($(dig @dns.server domain_to_search axfr)) | |
unset IFS | |
for i in "${arr[@]:6:92}" | |
do | |
echo "$i" | awk '{print $5,$1}' | |
done |
This file contains hidden or 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 | |
## non ssl | |
exec >> "/var/www/vhosts/application/log/archive/test_ops/devel.domain.com_$(date +%Y-%m-%d).log"; | |
while IFS= read -r line; do | |
if (( SECONDS > 10 )); then | |
exec >> "/var/www/vhosts/application/log/archive/test_ops/devel.domain.com_$(date +%Y-%m-%d).log" | |
SECONDS=0 | |
fi | |
printf '%s\n' "$line"; |
This file contains hidden or 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
#place this file in /etc/logrotate.d/ | |
/var/log/vhosts/*.log { | |
su root root | |
copytruncate | |
rotate 30 | |
missingok | |
notifempty | |
sharedscripts | |
compress |
This file contains hidden or 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
# Enable Debug | |
set -x | |
# Install requirements | |
yum -y install nrpe nagios-plugins-ping nagios-plugins-load nagios-plugins-check-updates nagios-plugins-ssh nagios-plugins-disk nagios-plugins-mysql nagios-plugins-http | |
# Create new firewall XML rules save as Monitoring2 so as not to chagne existing xml configs | |
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> | |
<zone> | |
<short>Monitoring</short> |
This file contains hidden or 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 | |
import subprocess | |
from shutil import copyfile | |
copyfile("/etc/nagios/nrpe.cfg","/etc/nagios/nrpe.cfg.bak") | |
f = open("/etc/nagios/nrpe.cfg",'r') | |
filedata = f.read() | |
f.close() |
This file contains hidden or 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
/etc/ssl/private/apache-selfsigned.key > /etc/ssl/private/haproxy.pem; /etc/ssl/certs/apache-selfsigned.crt >> /etc/ssl/private/haproxy.pem; cat /etc/ssl/certs/dhparam.pem >> /etc/ssl/private/haproxy.pem |