Skip to content

Instantly share code, notes, and snippets.

@tmknight
tmknight / Export-CMScriptResults.ps1
Last active December 20, 2022 22:34 — forked from alexverboon/Export-CMScriptResults.ps1
Export-CMScriptResults
<#
.Synopsis
Export-CMScriptResults
.DESCRIPTION
Export-CMScriptResults exports the return values from scripts that are executed
through the ConfigMgr Run Script feature.
.PARAMETER ScriptName
The name of the Script as it is displayed within the ConfigMgr Console.
.PARAMETER OperationId
The client operation ID as it is displayed within the ConfigMgr Console.
@catchdave
catchdave / pico_light_switch_std.py
Created July 7, 2019 00:29
Home Assistant Python Script to generalize pico remotes for any non-lutron light
#
# Script to manage a light using standard controls from a Lutron Pico Remote
# This will translate the standard button meanings on a Pico to any light controlled
# by Home Assistant.
# The "favourite" button is presumed to be 50% brightness (but can be overriden).
# Expected data packet is: { new_state: X, entity_id: entity_id, fav_brightness: [0-100] }
# new_state: REQUIRED. The pico value that triggered the event.
# entity_id: REQUIRED. The entity_id of the light to control
# fav_brightness: OPTIONAL. What brightness percentage to set when the favourite button is pressed (int 1 - 100).
#
@jackm
jackm / can-packages-and-tools.md
Last active October 9, 2025 06:51
Collection of CAN bus packages and tools

Collection of CAN bus packages and tools

This document assumes the use of Linux as the chosen development platform. Items in bold are highly recommended.

It is recommended to use SocketCAN when working with CAN bus on Linux. It is supported by the Linux kernel mainline and follows the Linux interface model, allowing you to use other network tools such as Wireshark. This also allows the creation of virtual CAN interfaces where no physical hardware is required to simulate or replay CAN messages.

@ajdruff
ajdruff / fix-git-line-endings
Last active October 13, 2025 19:09
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@joegasper
joegasper / ConvertFrom-DN
Last active April 24, 2025 08:40
Convert between DistinguishedName and CanonicalName
#Updated ConvertFrom-DN to support container objects
function ConvertFrom-DN {
[cmdletbinding()]
param(
[Parameter(Mandatory, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)]
[ValidateNotNullOrEmpty()]
[string[]]$DistinguishedName
)
process {
@MarMed
MarMed / README.md
Last active March 19, 2025 12:55
Routing plex traffic through an SSH tunnel

Routing plex traffic through an SSH tunnel

This guide creates a reverse SSH tunnel to route all Plex server traffic through it.

Step 2 is done on the tunnel, all other steps are done on the plex server.

1. Setup SSH keys (if you already have key based authenthication setup skip to step 2)

On plex server:

Function WSUSUpdate {
$Criteria = "IsInstalled=0 and Type='Software'"
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
try {
$SearchResult = $Searcher.Search($Criteria).Updates
if ($SearchResult.Count -eq 0) {
Write-Output "There are no applicable updates."
exit
}
else {
@adamhotep
adamhotep / gnome-keyring-query.c
Last active September 16, 2025 19:49
**OBSOLETE** Simple command-line interface to GNOME keyring (use secret-tool from libsecret instead)
/*
* gnome-keyring-query, for simple command-line interactions with gnome-keyring.
*
* To compile and install:
*
* sudo apt-get install libgnome-keyring-dev libglib2.0-dev
* gcc `pkg-config --cflags --libs gnome-keyring-1 glib-2.0` -o gnome-keyring-query gnome-keyring-query.c
* chmod +x gnome-keyring-query
* sudo cp -p gnome-keyring-query /usr/local/bin/
*
@chelming
chelming / nxlog.conf
Last active December 9, 2020 15:35
NXLOG config that will parse SCCM and IIS logs
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
define CERTDIR %ROOT%\cert
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
@mrlesmithjr
mrlesmithjr / nxlog.conf
Last active November 7, 2019 16:59
Windows nxlog.conf for Logstash
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
define ROOT_STRING C:\Program Files (x86)\\nxlog
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid