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
add-type @" | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
public class TrustAllCertsPolicy : ICertificatePolicy { | |
public bool CheckValidationResult( | |
ServicePoint srvPoint, X509Certificate certificate, | |
WebRequest request, int certificateProblem) { | |
return true; | |
} | |
} |
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
# Get a list of all the available subscriptions | |
az account list | |
# Output | |
# | |
#[ | |
# { | |
# "cloudName": "AzureCloud", | |
# "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" <- Subscription ID | |
# "isDefault": true, |
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
#### Install Automate Server ### | |
# Set up pre-reqs | |
sysctl -w vm.max_map_count=262144 | |
sysctl -w vm.dirty_expire_centisecs=20000 | |
# Make them permenant | |
vi /etc/sysctl.conf | |
vm.max_map_count=262144 |
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
for node in $(knife search node "ohai_time:[* TO $(date +%s -d '30 days ago')]" -i); do | |
knife client delete $node | |
knife node delete $node | |
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
BU_NAME='The Awesome Group!' | |
NODE_COUNT="$(/path/to/chef-repo/knife exec -E "puts api.get('/nodes').size")" | |
MONTH="$(date +%B)" | |
YEAR="$(date +%Y)" | |
MAIL_URL="https://api.sendgrid.com/v3/mail/send" | |
HEADER="Authorization: Bearer My-Super-Secret-Token" | |
HEADER2="Content-Type: application/json" | |
EMAIL_TO='[email protected]' | |
EMAIL_FROM='[email protected]' | |
EMAIL_SUBJECT="Chef Server Node Count for ${BU_NAME}" |
NewerOlder