Skip to content

Instantly share code, notes, and snippets.

@gdyr
gdyr / Three (Hints).md
Created March 7, 2023 20:10
Three (Hints)

Hints

Hint 1 You don't need any credentials or secrets to access a public bucket. However, the AWS CLI requires them to be set. You could get around this by using cURL, amongst other ways.
@gdyr
gdyr / cisco-igmp-monitor.ps1
Last active July 21, 2022 13:25
Monitor Cisco switch IGMP groups
function Get-CiscoIGMPGroups {
return plink -ssh cisco@10.10.10.17 -pw cisco -batch "sh ip igmp snooping groups | include 224.0.1.129" 2>$null | ? {$_.Length -gt 0};
}
Write-Output "Starting IGMP group monitoring."
Write-Output "Press any key to exit..."
Write-Output "";
$prevEntry = "";
do {
@gdyr
gdyr / Mono Remote.PNG
Last active March 9, 2022 08:16
JetBrains Rider setup for S# Pro Debugging
Mono Remote.PNG
@gdyr
gdyr / launcher.ps1
Created February 3, 2021 01:30
Automatically launch best Q-Sys Designer version for design file
# Parse design file header
$header = [System.Text.Encoding]::ASCII.GetString((Get-Content $args[0] -Encoding byte -TotalCount 64));
$version = ($header | Select-String -Pattern "Q-Sys Designer, Version=(\d+\.\d+)").Matches.Groups[1].Value;
# Enumerate installed Q-Sys Designer versions
$InstalledSoftware = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall";
$DesignerVersions = @();
foreach($obj in $InstalledSoftware){
$name = $obj.GetValue('DisplayName');
if($name -like "Q-Sys Designer *") {
S = TcpSocket.New();
S.EventHandler = print;
S:Connect(<HOST>, 80);
S.ReconnectTimeout = 0;
function randomWebSocketKey()
return Crypto.Base64Encode(('x'):rep(16):gsub('.', function() return string.char(math.random(0,255)) end));
end;
S.Connected = function()

Locimation Stability & Support Tags

Locimation provides a range of open-source software, available at github.com/locimation.

Some projects may make use of undocumented features, or require further testing or development.

As such, we provide two types of graphical label to indicate the current status of the software.

Stability

@gdyr
gdyr / redis.lua
Last active January 17, 2023 22:52
Q-Sys Redis Client
--[[
Q-Sys Redis Client
Author: Michael Goodyear
Email: michael@locimation.com
Version: 1.1
Copyright 2020 Locimation Pty Ltd
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software
and associated documentation files (the "Software"),
@gdyr
gdyr / qsys-b64-img.lua
Created December 30, 2019 19:06
Q-Sys Dynamic button images
--[[
Notes:
- Remove any data:image/type; prefix
- Legend = '' prevents the Style JSON from appearing as the button label
- DrawChrome hides the button itself and just displays the image.
]]
Controls['Artwork'].Style = json.encode({
DrawChrome = false,
@gdyr
gdyr / list-playlists.lua
Last active January 17, 2023 22:53
List playlists on Q-Sys using Lua
-- First we find all the files in the "playlist" directory
PlaylistFiles = dir.get('media/Playlists/')
-- Next we make a table that's going to contain all our playlist names
PlaylistNames = {}
-- Next we go through the list of playlist files we've found
for _,f in ipairs(PlaylistFiles) do
-- Open the file
@gdyr
gdyr / promise.lua
Created December 12, 2019 06:11
Quick Lua Promises (v0.1)
Promise = (function(asyncFunction)
local state = 'pending';
local result;
local rListen, eListen = {}, {};
asyncFunction(function(...)
for _,f in pairs(rListen) do
f(...);
end;