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
$ cat Vagrantfile | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "bento/ubuntu-16.04" | |
config.vm.define "LogsParsing" | |
config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct: true | |
config.vm.provision :file, source: './provision.sh', destination: '~/provision.sh' | |
config.vm.provision "shell", run: 'always', path: "./provision.sh", privileged: false |
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
console.log('Loading function'); | |
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/...'; | |
const slack_req_opts = url.parse(slack_url); | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; | |
slack_notify = '<!channel>' // notification control: !channel = @channel, !here = @here, etc... |
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
# Simple for loop leveraging both filters and query params off the default "Name" tag: | |
for i in $(aws ec2 describe-instances --region us-west-2 --filters "Name=tag:Name,Values={replace-with-name-tag-value}" --query "Reservations[].Instances[].PrivateIpAddress[]" --output text); do echo -e "ip: $i"; 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
<powershell> | |
################################################# | |
# Detect the Ephemeral drives and stripe them | |
################################################# | |
$DriveLetterToAssign = "Z:" # Be sure to choose a drive letter that will not already be assigned | |
################################################# | |
# Given a device (e.g. xvda), strip off "xvd" and convert the remainder to the appripriate SCSI ID | |
################################################# |