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 | |
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 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
#--------------------------------------------------------------------- | |
# FrontEnd Configuration | |
#--------------------------------------------------------------------- | |
frontend http | |
bind *:80 | |
option http-server-close | |
option forwardfor | |
default_backend backend | |
frontend https |
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/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 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/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 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 | |
# different ways to use the linux find command preferred choice typically. | |
find . -exec grep chrome {} + | |
#find will execute grep and will substitute {} with the filename(s) found. The difference between ; and + #is that with ; a single grep command for each file is executed whereas with + as many files as possible #are given as parameters to grep at once. | |
#If you use the \; ending construct grep is passed one file at a time, so it doesn't display the file name by default, only the matched lines. To get a file list instead add use grep -ls inside of the find construct. |
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 | |
# 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 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 | |
## 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 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 | |
# turn off swap | |
swapoff -a | |
sed -i '/ swap / s/^/#/' /etc/fstab | |
# reboot |
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 | |
# enable debug mode | |
set -x | |
# 1. deploy new install of Centos 7 minimal | |
# 2. ensure that "secure boot" is disabled otherwise you get the following error: (see below) | |
####### | |
# vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why. | |
# update & upgrade system | |
yum -y update && yum -y upgrade |
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 | |
set -e | |
source config | |
sleep 10 | |
export PIVNET_TOKEN="$token" | |
export LOCAL_FILE_NAME=pcfdev-v0.30.0+PCF1.11.0-linux.zip | |
export DOWNLOAD_URL=https://network.pivotal.io/api/v2/products/pcfdev/releases/88478/product_files/125612/download | |
#export OPSMGR_HOST=localhost | |
export OPSMGR_USER="$useraccount" | |
export OPSMGR_PASSWORD="$password" |