Skip to content

Instantly share code, notes, and snippets.

View tom-henderson's full-sized avatar
🇳🇿

Tom Henderson tom-henderson

🇳🇿
View GitHub Profile
@tom-henderson
tom-henderson / dsc-results.ps1
Created February 27, 2017 03:31
Check the output from the last DSC run
Get-ChildItem 'C:\Windows\System32\Configuration\ConfigurationStatus' | Sort LastWriteTime -Descending | ? Name -like '*.json' | Select -First 1 | Get-Content -Encoding Unicode
@tom-henderson
tom-henderson / bpa.ps1
Created January 27, 2017 02:31
Microsoft Best Practice Analyser
Get-BpaModel | Select Name, Id, LastScanTime
Invoke-BpaModel -ModelId Microsoft/Windows/DNSServer
Get-BpaResult -ModelId Microsoft/Windows/DNSServer | ? Severity -ne "Information" | Sort Severity | Select Severity, Title, Category

Keybase proof

I hereby claim:

  • I am tom-henderson on github.
  • I am tomhenderson (https://keybase.io/tomhenderson) on keybase.
  • I have a public key whose fingerprint is 76CF 88A4 617D 7A75 1E75 2AED 2CD6 62B9 52D4 65FB

To claim this, I am signing this object:

function Send-IftttNotification {
param (
[Parameter(Mandatory=$true)]
[String] $message
[Parameter(Mandatory=$true)]
[String] $key
[Parameter(Mandatory=$true)]
[String] $event_name
# DC should use their own IP as their primary DNS
$ip = Get-NetIPAddress -AddressFamily IPv4 | Where InterfaceAlias -notlike "Loopback*" | Select -First 1
Set-DnsClientServerAddress -InterfaceIndex $ip.InterfaceIndex -ServerAddresses $ip.IPAddress
# Install Features
Add-WindowsFeature RSAT-AD-Tools, RSAT-DNS-Server, AD-Domain-Services, DNS, GPMC
# Create New Forest, add Domain Controller
$restoreModePassword = ConvertTo-SecureString "P@ssw0rd123" -AsPlaintext -Force
Install-ADDSForest -CreateDnsDelegation:$false `
# -*- coding: utf-8 -*-
import sys
from yoctopuce.yocto_api import *
from yoctopuce.yocto_temperature import *
from yoctopuce.yocto_humidity import *
from yoctopuce.yocto_pressure import *
errmsg = YRefParam()
if YAPI.RegisterHub("usb", errmsg)!= YAPI.SUCCESS:
sys.exit("init error"+str(errmsg))
export PYTHONDONTWRITEBYTECODE=1
@tom-henderson
tom-henderson / config.sh
Last active March 24, 2017 22:16
Homebridge
sudo apt-get -y update && sudo apt-get -y upgrade
sudo apt-get install nodejs npm ibavahi-compat-libdnssd-dev
# http://stackoverflow.com/a/18130296:
sudo ln -s `which nodejs` /usr/bin/node
sudo npm install -g --unsafe-perm homebridge
sudo npm install -g homebridge-philipshue
sudo npm install -g homebridge-ifttt
sudo npm install -g homebridge-openweathermap-temperature
@tom-henderson
tom-henderson / Edgerouter Bonjour Forwarding
Created November 27, 2016 04:38
Repeat Bonjour packets across both interfaces.
configure
set service mdns repeater interface eth1
set service mdns repeater interface eth2
commit
save