Skip to content

Instantly share code, notes, and snippets.

View rayterrill's full-sized avatar

Ray Terrill rayterrill

View GitHub Profile
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install 1password dropbox googlechrome nodejs powershell slack notepadplusplus git git-credential-manager-for-windows atom spotify 7zip Virtualbox vagrant conemu dropbox putty minikube -Confirm:$false -Force
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole
#setup git
git config --global user.email "rayjohnterrill@gmail.com"
git config --global user.name "rayterrill"
@rayterrill
rayterrill / GettingTheVMwarevSphereProviderWorkingInKubernetes.md
Created November 27, 2017 23:28
Getting the VMware vSphere Provider Working In Kubernetes

Configuring the vSphere Cloud Provider

[Global]
        user = "Kubernetes@vsphere.local"
        password = "MYSUPERSECRETPASSWORD"
 server = "MYVCENTERSERVER.MYDOMAIN.com"
Tool Website Description Really Like?
Vagrant https://www.vagrantup.com/ Vagrant is a tool for building and managing virtual machine environments in a single workflow
Kafka https://kafka.apache.org/ Kafka is used for building real-time data pipelines and streaming apps.
InfluxDB https://www.influxdata.com/time-series-platform/influxdb/ InfluxDB is used as a data store for any use case involving large amounts of timestamped data, including DevOps monitoring, application metrics, IoT sensor data, and real-time analytics.
Grafana https://grafana.com/grafana Visualization tool for InfluxDB, Graphite, Prometheus, ElasticSearch, AWS CloudWatch, etc
Etcd https://github.com/coreos/etcd Distributed reliable key-value store for the most critical data of a distributed system
Fluentd https://www.fluentd.org/ Fluentd is an open source data collector for unified logging layer.
RethinkDB https://www.reth
@rayterrill
rayterrill / UploadAzlogDataToGrayLog.ps1
Created November 17, 2017 15:53
Upload Azlog Data to GrayLog with GELF
$docs = Get-ChildItem C:\users\azlog\AzureActiveDirectoryJson -File
#declare a variable to hold how many messages we're uploading
$messagesUploaded = 0
foreach ($d in $docs) {
$content = Get-Content -Raw -Path "C:\users\azlog\AzureActiveDirectoryJson\$($d.Name)" | ConvertFrom-Json
$records = $content.Records
foreach ($r in $records) {
$obj = New-Object PSObject
@rayterrill
rayterrill / angular.js
Created October 25, 2017 04:44
More Complicated AngularJS Dropdown JSON Example
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<label for="name">Select a State:</label>
<select id="name" ng-model="selectedName" ng-options="state as state.Name for state in states"></select>
<br />
@rayterrill
rayterrill / anotherExample.js
Last active October 13, 2017 04:31
A simple async NodeJS example
var async = require("async");
function a(callback) {
setTimeout(function() {
console.log('a');
callback();
}, 5000);
}
function b(callback) {
@rayterrill
rayterrill / vlantester.tests.ps1
Created October 7, 2017 17:47
Tests VLANs in VMWare using PowerShell, Pester, and PowerCLI by swapping a VM into different networks, setting an IP, and verifying connectivity.
Connect-VIServer -Server YOUR_VCENTER_SERVER | Out-Null
#build a credential object to connect to the VM at the OS level to switch the network settings
$secpwd = ConvertTo-SecureString "PASSWORD_GOES_HERE" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ("ACCOUNT_GOES_HERE", $secpwd)
#set a hash tables of VMWare networks and an IP address in each network
$networks = @{
"VLAN1" = "192.168.1.5"
"VLAN2" = "192.168.2.5"
@rayterrill
rayterrill / office365AWSRoute54DNS.ps1
Created September 25, 2017 22:06
Create AWS Route53 DNS Records for Office365
Param(
[string]$domainName, #example: mydomain.com
[string]$verificationValue #example: ms23254363
)
$domain_withoutDot = $domainName -Replace '\.', '-'
#make sure you're authenticated to AWS and that you've pre-created the new hosted zone
#get the hosted zone
@rayterrill
rayterrill / office365AWSRoute54DNS.ps1
Created September 25, 2017 22:06
Create AWS Route53 DNS Records for Office365
Param(
[string]$domainName, #example: mydomain.com
[string]$verificationValue #example: ms23254363
)
$domain_withoutDot = $domainName -Replace '\.', '-'
#make sure you're authenticated to AWS and that you've pre-created the new hosted zone
#get the hosted zone
@rayterrill
rayterrill / dashboard.js
Created September 22, 2017 14:44
Bootstrap "Dashboard" Showing Change Control Ticket Status from a SharePoint List (using CSOM)
<script language="javascript" type="text/javascript" src="/sites/MySPSite/SiteAssets/jquery-2.2.0.min.js"></script>
<script language="javascript" type="text/javascript" src="/sites/MySPSite/SiteAssets/jquery.SPServices.min.js"></script>
<script type="text/javascript">
SP.SOD.executeFunc('sp.js','SP.ClientContext',runthiscode);
function getFormattedDate(date) {
var year = date.getFullYear();