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
/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 |
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/bash | |
set -x | |
#enable ssh to the host | |
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config | |
#disable selinux | |
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config | |
# check hostname | |
hostname -f | |
# update and install Apache |
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/bash | |
# use this script to provision/configure haproxy when CM is not setup or applicable | |
set -x | |
#enable ssh | |
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config | |
#disable selinux | |
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config | |
if [ ! $(command -v haproxy) ]; then |
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/env bash | |
# check if ssh keys exist else create keys with no password automatically no prompting, ideal for shell scripts and automation | |
if [ -f $HOME/.ssh/id_rsa ]; then | |
echo rsa key installed | |
else | |
ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' | |
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/env bash | |
## use this to parse json and extract what you need and place in BASH as array with unique elements, if you need this to be a single "string" remove the \n in the print statement below. | |
echo ' | |
{ | |
"devDependencies": { | |
"babel-cli": "^6.26.0", | |
"babel-preset-env": "^1.7.0", | |
"babel-plugin-lodash": "^3.3.4", | |
"eslint": "^5.4.0", |
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/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 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
#--------------------------------------------------------------------- | |
# FrontEnd Configuration | |
#--------------------------------------------------------------------- | |
frontend http | |
bind *:80 | |
option http-server-close | |
option forwardfor | |
default_backend backend | |
frontend https |
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/env bash | |
DIR_TO_CHECK='./' | |
OLD_STAT_FILE='./old_stat.txt' | |
if [ -e $OLD_STAT_FILE ] | |
then | |
OLD_STAT=$(cat $OLD_STAT_FILE) | |
else |
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
# 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 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 |