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
$setup = <<-SCRIPT | |
sudo setenforce 0 | |
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config | |
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo | |
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
sudo dnf clean all | |
sudo dnf -y install nomad docker-ce | |
sudo systemctl start docker.service |
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 | |
sanitize_nomad () { | |
nomad system gc | |
nomad system reconcile summaries | |
} | |
deregister_instance () { |
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
locals { | |
minions = [ | |
{ "name" = "greg", | |
"type" = "m5.large" }, | |
{ "name" = "ragha", | |
"type" = "t3.micro" | |
} | |
] |
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
# start nested array if i==100 | |
# end nested array if i==200 | |
flat_tokens = [1, 2, 100, 3, 4, 200, 5, 100, 6, 7, 200, 8] | |
alias MYARR = Array(Array(Array(Int32) | Int32) | Array(Int32) | Int32) | |
def parse(tokens, list : MYARR) | |
return {tokens, list} if tokens.empty? | |
token = tokens.shift |
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
ruby_block 'shell out fun' do | |
block do | |
# this is me running my command and assigning the output to a var | |
ls = shell_out('ls /var/') | |
# this is me assigning the STDOUT to a var | |
raw_output = ls.stdout | |
# i used the Ruby p method to print out the raw chars | |
# then i knew how to manipulate the string |
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
--- | |
# this is how you encrypt a file using openssl and aes-256 | |
# openssl aes-256-cbc -salt -a -e -in <src file> -out <out file> -k <enc salt> | |
# expects you pass in vars: | |
# enc_src_file -- local location of encrypted src file that will copied to target node | |
# enc_src_dest -- where the decrypted file should be put | |
# enc_salt -- salt used to decrypt | |
# enc_file_user -- user ownership |
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
# cookbook code | |
... | |
reboot 'soon' do | |
delay_mins 2 | |
action :request_reboot | |
end | |
Chef.event_handler do | |
on :run_failed do |exception, run_status| |
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
version: 0.2 | |
phases: | |
build: | |
commands: | |
- ansible-playbook -i $INVENTORY $PLAYBOOK \ | |
--limit $LIMIT --extra-vars $EXTRA --tags $TAGS |
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 | |
# hubot | |
# chkconfig: 345 20 80 | |
# description: hubot | |
# processname: hubot | |
# REFERENCE: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/ | |
# This script assumes you have a user called "hubot" on your system and that hubot is installed in /home/hubot |
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 | |
# our AEM app runs as the 'day' user in the /home/day DIR | |
## for you yungins, 'day' is the company that created cq5/aem6 | |
# MUST RUN THIS as the day user | |
# {{ aem_type }} is the AEM instance type we store in Ansible .. author or publish | |
PID=$(ps aux | egrep "day.*java" | egrep -v "egrep" | awk '{print $2}') | |
LOG="/home/day/{{ aem_type }}/crx-quickstart/logs/threaddump.log" | |
# clear out old log file |
NewerOlder