Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Nick Shores nshores

View GitHub Profile
@nshores
nshores / azure_gw_ipsec_setup.ps1
Created Apr 19, 2019
azure_gw_ipsec_setup.ps1
View azure_gw_ipsec_setup.ps1
#default to msdn sub
Set-AzContext -Subscription "716f03d6-acff-467c-bca4-3c8eb56f549d"
# https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-tutorial-create-gateway-powershell
##Notes
10.1.220.0/23 ## Address Space
10.1.220.0/24 ## Frontend
10.1.221.0/24 ## Backend
@nshores
nshores / powercli_upload_to_ds
Created Apr 9, 2019
upload iso to datastore
View powercli_upload_to_ds
#upload iso to datastore
$datastore = Get-Datastore "PK-VOL-01"
New-PSDrive -Location $datastore -Name ds -PSProvider VimDatastore -Root "\"
Copy-DatastoreItem -Item c:\users\dsatech\2016.iso -Destination ds:\
View wash_dry_sensor.yaml
sensor:
- platform: template
sensors:
wash_power:
friendly_name: "Current Wash Power"
unit_of_measurement: "W"
value_template: "{{ states.switch.zigbee_outlet.attributes.current_power_w }}"
washing_machine_status:
value_template: '{{ states.input_select.washing_machine_status.state}}'
friendly_name: 'Washing Machine Status'
View Untitled-13
Param (
[string]$Printservers = "oldPrintServer"
)
# Create new Excel workbook
cls
$Excel = New-Object -ComObject Excel.Application
$Excel.Visible = $True
$Excel = $Excel.Workbooks.Add()
$Sheet = $Excel.Worksheets.Item(1)
@nshores
nshores / Untitled-13
Created Jan 11, 2019
printer_info.ps1
View Untitled-13
Param (
[string]$Printservers = "oldPrintServer"
)
# Create new Excel workbook
cls
$Excel = New-Object -ComObject Excel.Application
$Excel.Visible = $True
$Excel = $Excel.Workbooks.Add()
$Sheet = $Excel.Worksheets.Item(1)
@nshores
nshores / ansible_junos_update_dhcp.yaml
Last active Jan 9, 2019
ansible_junos_update_dhcp
View ansible_junos_update_dhcp.yaml
#Update configuraton for DHCP on Junos 12.x devices
#Nick Shores 1-8-2018 - Created for WRA
---
- hosts: wra
gather_facts: no
connection: local
roles:
- Juniper.junos
View update_dns_ip.ps1
$Computerlist = get-content "\\vmware-host\Shared Folders\Documents\RGA\dns_server_updates.txt"
$dnsservers =@("192.168.0.9","192.168.0.12")
$cred = Get-Credential rga.local\it-services
foreach ($computername in $computerlist) {
$result = get-wmiobject win32_pingstatus -filter "address='$computername'"
if ($result.statuscode -eq 0) {
$remoteNic = get-wmiobject -class win32_networkadapter -computer $computername -Credential $cred | where-object {$_.Name -eq "vmxnet3 Ethernet Adapter"}
$index = $remotenic.index
$DNSlist = $(get-wmiobject win32_networkadapterconfiguration -computer $computername -Credential $cred -Filter ‘IPEnabled=true’ | where-object {$_.index -eq $index}).dnsserversearchorder
@nshores
nshores / vm-dns.ps1
Last active Dec 20, 2018
vm-dns.ps1
View vm-dns.ps1
$iplist = import-csv /Users/nshores/Documents/USA Properties/vms122018.csv
$guestcred = Get-Credential
$CompCollection=@()
$code = @'
$dns = Get-NetIPConfiguration | Select-Object -ExpandProperty DnsServer | select ServerAddresses
$dns.serveraddresses
'@
@nshores
nshores / pulse_secure_update.ps1
Last active Dec 13, 2018
pulse_secure_update
View pulse_secure_update.ps1
#Script for updating Pulse Secure network connection profiles on Windows clients.
#Any active profiles will be wiped during script execution and replaced with the target configuration.
#The script will also check for active VPN connections and copy the pulse configuration locally before proceeding.
#Make sure to update $connection_profile to match your environment location.
#Pulse 5.3 and above is required for connection delete support.
#Nick Shores - 12/11/18
$connection_profile = '\\wra-fileserver.wra.local\Fileserver\Support\wra.pulsepreconfig'
write-host "Configuration Location:" `n$connection_profile `n
View onkyo_grafana_dashboard.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
You can’t perform that action at this time.