Skip to content

Instantly share code, notes, and snippets.

Avatar
🧸

Laim

🧸
View GitHub Profile
@Laim
Laim / powershell_messaging_system.ps1
Created Mar 24, 2022
Script that allows sending a pre-defined message to Discord or Telegram. Useful for Handbrake when conversions are completed.
View powershell_messaging_system.ps1
<#
.SYNOPSIS
Sends a message to an external provider such as Discord or Telegram
.DESCRIPTION
Script that allows sending a pre-defined message to Discord or Telegram. Useful for Handbrake when conversions are completed.
.PARAMETER messageSystem
Which message system you want to use, Discord or Telegram.
@Laim
Laim / org_rules.sql
Created Mar 14, 2022
Get organisation and autoconnect rules in Snow License Manager
View org_rules.sql
/*
Author: Laim McKenzie
URL: https://gist.github.com/Laim/dee0e030cc6b452d1eafb4b7e48ca9c5
Date: 14-03-2022
*/
SELECT
@Laim
Laim / handbrakePresets.json
Last active Feb 11, 2022
Handbrake presets that I use for file size management and plex quality
View handbrakePresets.json
{
"PresetList": [
{
"ChildrenArray": [
{
"AlignAVStart": true,
"AudioCopyMask": [
"copy:aac"
],
"AudioEncoderFallback": "av_aac",
View SSLlabs-powershellscan.ps1
<#
.NOTES
Version : 1.0
Author : Laim McKenzie
Creation Date : 17.05.2021
Purpose : Automation of SSLLabs SSLtests.
Credits : Modified version of script by /u/tramperdk
#>
@Laim
Laim / lmu_del_sql_jobs.sql
Last active Nov 15, 2021
Delete all SQL Jobs that are assigned to LicenseManagerUser
View lmu_del_sql_jobs.sql
/*
Author: Laim McKenzie
Website: https://laim.scot
Version: 1.0
Modified version of https://sqlgeekspro.com/script-to-delete-sql-agent-jobs/
*/
DECLARE @SQLStatement VARCHAR(200)
DECLARE @jobName SYSNAME
@Laim
Laim / CopyLogFiles.ps1
Last active Jul 29, 2021
Copy Log files from Source Directory to Destination Directory via PowerShell
View CopyLogFiles.ps1
#<----------------------------------------->#
# > Author: Laim McKenzie
# > Date: 29-07-2021
# > Description: This script can be ran under a Scheduled Task and collect log files from the Source Directory and copy to the Destination Directory
# > Pre-requisites:
# > 1. You need to ensure the Source Directory exists
# > 2. You need to ensure the Desitnation Directory exists
# > 3. The account running the scheduled task (if ran under one) needs to have access to both directories
# > Copyright (c) 2021 Laim McKenzie
#<----------------------------------------->#
@Laim
Laim / hide_unassigned.sql
Last active Jun 4, 2021
Mass hide Unassigned Software in Snow License Manager to prevent SMACC lag
View hide_unassigned.sql
/*
Author: Laim McKenzie
Website: https://laim.scot
Version: 1.0
You can view the Hidden Software count using this script
SELECT COUNT(*) FROM SnowLicenseManager.dbo.tblSoftware WHERE IsHidden = 1
*/
View snow_stuff.sql
-- Custom Fields
SELECT C.Name, COUNT(CF.CID) AS [CustomFieldCount] FROM SnowLicenseManager.dbo.tblCustomField CF
INNER JOIN SnowLicenseManager.dbo.tblCID C ON CF.CID = C.CID
GROUP BY C.Name
-- Custom Compare Values
SELECT C.Name, COUNT(CCV.CID) AS [CCVCount] FROM SnowLicenseManager.dbo.tblCustomCompareValues CCV
INNER JOIN SnowLicenseManager.dbo.tblCID C ON CCV.CID = C.CID
GROUP BY C.Name
@Laim
Laim / versions.ps1
Last active May 7, 2021
PowerShell, .NET and SQL Instance Versions in PowerShell
View versions.ps1
# START : Get SQL Instance Version #
cls # prevents the script itself from echoing out into ISE
"---------------------------------------------------------------------"
$inst = (get-itemproperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances # Gets the installed SQL instances
$sqlInstanceCount = 0; # loop for the foreach
foreach ($i in $inst)
View backuprestoreprocess.sql
/*
Modified version of https://blog.sqlauthority.com/2017/03/12/get-status-running-backup-restore-sql-server-interview-question-week-113/
Author: Laim McKenzie
Available from https://gist.github.com/laim
Copyright (c) 2021 laim.scot
*/
SELECT r.session_id AS [Session_Id]
,r.command AS [command]