This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mqtt_topic="mi_temp" | |
mqtt_ip="localhost" | |
sensors_file="/usr/lib/mi_temp/sensors" | |
handler() | |
{ | |
logger -p 6 --tag=mitemp "Closing HCI device" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
####### Configuration ##### | |
# Azure Setup: https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows | |
AzureSubscriptionKey="" | |
AzureEndpoint="" | |
# IFTTT Setup: https://ifttt.com/maker_webhooks | |
IFTTTKey="" | |
IFTTTEventName="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! [[ "$1" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$ ]] | |
then | |
echo "Email address $1 is invalid." | |
exit 1 | |
fi | |
npm=`npm list -g --depth=0 | sed 's/$/<br \/>/'` | |
config=`cat /var/homebridge/config.json | sed 's/$/<br \/>/'` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Uses information from NZ Government to identify if a date is a New Zealand public holiday. | |
.DESCRIPTION | |
This script pulls the lastest iCal from employment.govt.nz to confirm if a date is a public holiday. | |
If a public holiday is found, it's name is returned. | |
There is an assumption that the holidays supplied are single day events. | |
.PARAMETER Date | |
The date to be checked. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param() | |
#Main Variables adjusted | |
$Dest = "F:\" | |
$LogFile = "C:\Admin\RobocopyBackup.log" | |
$ReportTo = @("[email protected]","[email protected]") | |
$LogSummary = "" | |
$Region = "Auckland" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Gathers the Security.evtx files from each DC in your Forest | |
.DESCRIPTION | |
This script will query your forest for a list of all Domain Controllers. It'll then connect to the C$ share on each server and | |
get a copy of Security.evtx from C:\Windows\System32\Winevt\Logs\. These will then be output to the folder supplied as OutputFolder | |
.PARAMETER OutputFolder | |
Required - The folder where the evtx files should be collected. | |
.EXAMPLE | |
./Get-DCSecurityLogs.ps1 E:\LogFiles\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Crawls evtx files and gathers events based on predefined searches. | |
.DESCRIPTION | |
This script uses LogParser 2.2 from Microsoft to to build a list of logon events. | |
Supply a path to EventPath which contains the evtx files you'd like to scan. You'll want to grab Security.evtx from | |
C:\Windows\System32\WinEvt\Logs on all servers to scan. | |
.PARAMETER LogParserLocation | |
The full path to logparser.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Powershell OneLiner to encrypt a password to file: | |
' ConvertTo-SecureString -String "ThisIsMySecurePassword" -AsPlainText -Force | ConvertFrom-SecureString > .\Password.txt | |
'Powershell OneLiner to decrypt that password | |
' (New-Object PSCredential "user",(ConvertTo-SecureString (Get-Content .\Password.txt))).GetNetworkCredential().Password | |
'You could then embed this into VBScript so the password is not stored in the script | |
'powershell.exe -NonInteractive -NoLogo -Command "(New-Object PSCredential 'user',(ConvertTo-SecureString (Get-Content .\Desktop\Password.txt))).GetNetworkCredential().Password" | |
Set oShell = WScript.CreateObject("WScript.Shell") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Scans for RAW drives attached to the computer and formats them. | |
.DESCRIPTION | |
Drive Letters are assigned sequentially from D:\ on, except on computers with SQL in the Computername where | |
Drive 2 will become L drive for Logs. Subsequent drives are lettered sequentially. | |
.PARAMETER UnitSize | |
An Int specifying the AllocationUnitSize used when formatting | |
.PARAMETER FileSystem | |
Specifies the file system with which to format the volume. The acceptable values for this parameter are:NTFS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Tests the connection to the supplied host or IP and reports back on changes to its status. | |
.DESCRIPTION | |
This script will check the connection to the supplied hostname or IP address every 5 second's to | |
monitor its status. If the status changes, a message is recorded, the Eventlog is update (optional), and an email is sent | |
to a supplied email address (optional). | |
If a TCPPort parameter is suppied the script will attempt to connect to this port. Otherwise a simple ICMP Ping is used. |
NewerOlder