View gist:e2f3a63ff92800a16c6251de0a0a1f85
$ 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 |
View sns_to_slack.js
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... |
View gist:51e7719d76979c4bdd22
# 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 |
View windows_2k8_2k12r2_ephemeral_stripe.ps1
<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 | |
################################################# |