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 | |
# 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 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/env/bash env | |
set -ex | |
# define our roles to be applied to our folders | |
declare -a folder_roles=( | |
"roles/resourcemanager.folderAdmin" | |
"roles/bigquery.admin" | |
"roles/cloudfunctions.admin" | |
"roles/cloudkms.admin" | |
"roles/cloudsql.admin" |
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
# PROD ORG | |
export TF_VAR_org_id=25xxxxxxxx | |
#-- BILLING INFO -- | |
export TF_VAR_billing_account=01xxxxxxxx65FBF-xxxxx | |
#-- PROJECT_NAME -- | |
export TF_ADMIN=us-gcp-xxxxxxxxxxxstg-1 | |
#-- SERVICE_ACC_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
#!/usr/bin/env bash | |
# -- debug | |
set -xe | |
if ! [ -x "$(command -v puppet)" ]; then | |
# -- write hostname correctly | |
hostname $(curl --silent "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hostname" -H "Metadata-Flavor: Google") | |
# -- delcare configs | |
str=$'[main]\ndns=none' |
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
# copy pub keys to the remote hosts | |
for host in ubuntu1 centos1 dnsmasq1; | |
do | |
ssh-copy-id -i $HOME/.ssh/id_rsa.pub ${host} | |
done |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
set exrc | |
set encoding=UTF-8 | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" ==== plugin manager |
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 | |
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" |
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 | |
# 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 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 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() |
NewerOlder