Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nick Shores nshores

🏠
Working from home
View GitHub Profile
@nshores
nshores / check_snmp_rev.yml
Last active Nov 30, 2020
check_snmp_rev.yml
View check_snmp_rev.yml
---
- hosts: test
become: yes
#Is sudo actually needed? Only use it when needed.
become_method: sudo
#Use variables whenever possible. You can place them in the task, or in a outside file at the inventory level.
vars:
snmp_path: "/etc/snmp/snmpd_conf/snmpd.conf"
backup_path: "/etc/snmp/snmpd_conf/snmpd.conf.bak"
tasks:
@nshores
nshores / check_patio_monitor.sh
Created Jul 27, 2020
check_patio_monitor.sh
View check_patio_monitor.sh
#!/bin/sh
if pgrep -f "python3 patio_light_notify.py"; then
pid=$(pidof python3 patio_light_notify.py)
echo "pid of patio_light_notify:" $pid
echo "it is already running"
exit
else
echo "starting patio notify script"
cd /home/zoneminder/
@nshores
nshores / check_zm_alarm.py
Last active Jul 27, 2020
check_zm_alarm.py
View check_zm_alarm.py
import pyzm.ZMMemory as zmmemory
import requests
import time
#set monitor id
mid = 6
#HA Url
ha_webhook = 'http://slim-dev.local:8123/api/webhook/patio'
View rgb_patio_lights.yaml
- alias: Turn on patio lights when motion detected by camera
trigger:
platform: state
entity_id: camera.backyard
to: 'recording'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
View ios_changes.yaml
#Playbook to backup configurations from IOS Devices, then apply a set of changes.
#Nick Shores 1-9-2017 - Created for Roebbelen Network
---
- hosts: roebbelen
gather_facts: no
connection: local
vars:
@nshores
nshores / upgrade_esxi_vib.yaml
Last active Nov 11, 2020
upgrade_esxi_vib.yaml
View upgrade_esxi_vib.yaml
---
- hosts: dunn-esxi:!*dc-esxihost-01*
vars:
#Set the source VIB file to copy, Source Location, and Destination Location
src_vib: NVIDIA-VMware-450.55-1OEM.670.0.0.8169922.x86_64.vib
src_location: ~/Downloads/NVIDIA-GRID-vSphere-6.7-450.55-450.51.05-451.48/
dest_location: /tmp/
tasks:
@nshores
nshores / reboot_az_server.ps1
Last active Jul 7, 2020
reboot_az_server_runbook
View reboot_az_server.ps1
$connectionname = "AzureRunAsConnection"
try
{
$servicePrincipalConnection=Get-Automationconnection -Name $connectionname
Login-AzAccount -servicePrincipal -TenantId $servicePrincipalConnection.TenantId -applicationId $servicePrincipalConnection.applicationId -certificateThumbprint $servicePrincipalConnection.certificatethumbprint
}
catch{
if (!$serviceprincipalconnection)
{
$ErrorMessage = "Connection $connectionName not found."
View failover_dns.ps1
#run on med7 dc (local)
$zonename = "healthcare.local"
$ip_table = @{
M7FS = "10.1.100.30";
M7KDM = "10.1.100.7";
M7DTS = "10.1.100.6";
M7KESM = "10.1.100.8";
TS2 = "10.1.100.37";
M7APP = "10.1.100.5";
View azure_upload_throtle.ps1
$mon = [System.DayOfWeek]::Monday
$tue = [System.DayOfWeek]::Tuesday
$wed = [System.DayOfWeek]::Wednesday
$thu = [System.DayOfWeek]::Thursday
$fri = [System.DayOfWeek]::Friday
Set-OBMachineSetting -WorkDay $mon, $tue, $wed, $thu, $fri -StartWorkHour "7:00:00" -EndWorkHour "22:00:00" -WorkHourBandwidth (10000*1024) -NonWorkHourBandwidth (90000*1024)
View fpx_profile_migration.ps1
#### EDIT ME
$newprofilepath = "\\adcfs01\profiledisks\"
$skip = "admin","administrator","ontimetech","adc","old","temp","automate","public","NerdioAdministrator@ADC.local","nerdioadmin","ontimetech.ADC"
#### Don't edit me
$ENV:PATH=$ENV:PATH;\\Pool-A000005.adc.local\c$\Program Files\FSLogix\Apps”
$oldprofiles = gci c:\users | Sort-Object LastWriteTime -Descending | select -expand fullname -First 2
You can’t perform that action at this time.