Skip to content

Instantly share code, notes, and snippets.

View martezr's full-sized avatar

Martez Reed martezr

View GitHub Profile
@martezr
martezr / 0_PE_Azure_Install
Last active April 9, 2020 17:39
Puppet Azure PE Installation
...
@martezr
martezr / join-ad.ps1
Created February 25, 2020 20:59
Join a Windows Workshop machine to the domain
# Find the domain controller IP address and replace the N with the environment number
ping winworkNdc.classroom.puppet.com
# Fetch the index number for the network interface
$adapterid = Get-NetAdapter | Select -expand InterfaceIndex
# Set the DC_IP_ADDRESS to the IP address found in from the first command
set-DnsClientServerAddress -InterfaceIndex $adapterid -ServerAddresses ('DC_IP_ADDRESS')
# Join Active Directory Domain
@martezr
martezr / audit_log_json
Last active January 31, 2020 14:21
Vault Root Login Notifications
{
"auth": {
"accessor": "hmac-sha256:67869871d870282745682c729d86cee81acb5346c3dbecb573b7d44ea5506d06",
"client_token": "hmac-sha256:8fe52f85c93aad7df87c7203f864a9900d25451a1cc88c486ae0c951bd3a8936",
"display_name": "root",
"policies": [
"root"
],
"token_policies": [
"root"
@martezr
martezr / winrm-config.ps1
Created November 13, 2019 22:36
WinRM Setup
Function New-LegacySelfSignedCert
{
Param (
[string]$SubjectName = $env:COMPUTERNAME,
[int]$ValidDays = 1095
)
$hostnonFQDN = $env:computerName
$hostFQDN = [System.Net.Dns]::GetHostByName(($env:computerName)).Hostname
$SignatureAlgorithm = "SHA256"
@martezr
martezr / bolt-linux-command.sh
Last active November 26, 2019 16:53
Puppet Bolt Vault Plugin
bolt plan run facts -i inventory.yaml --targets=linuxnode1
@martezr
martezr / bolt_plan.sh
Last active October 7, 2019 15:16
Puppet Bolt Terraform Inventory Plugin Basic
bolt plan run facts -i inventory.yaml nodes=boltservers
@martezr
martezr / bolt_plan.sh
Last active September 13, 2020 19:37
Puppet Bolt Terraform Inventory Advanced Blog Post
bolt plan run todoapp::todoapp -m /Users/martez.reed/.puppetlabs/bolt-code/modules:bolt/site-modules -i bolt/inventory
.yaml web=web database=database
@martezr
martezr / helm-install.sh
Last active October 18, 2019 21:25
Kubernetes Bootstrap
#!/bin/bash
kubectl -n kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
wget https://get.helm.sh/helm-v2.15.0-linux-amd64.tar.gz
tar -xzf helm-v2.15.0-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
helm init --service-account=tiller
@martezr
martezr / rhel8ks.cfg
Created June 13, 2019 01:44
RHEL 8 Kickstart
#version=RHEL8
ignoredisk --only-use=sda
autopart --type=lvm
# Partition clearing information
clearpart --none --initlabel
# Use text install
text
repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
# Use CDROM installation media
cdrom
@martezr
martezr / centos7golanginstaller.sh
Last active October 23, 2019 00:11
centos7golanginstaller.sh
#!/bin/bash
wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xvzf go1.13.3.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' > /etc/profile.d/gopath.sh
cat << EOF >> ~/.bash_profile
export GOBIN="$HOME/projects/bin"
export GOPATH="$HOME/projects/src"
EOF
mkdir -p ~/projects/{bin,pkg,src}
source /etc/profile && source ~/.bash_profile