Skip to content

Instantly share code, notes, and snippets.

View jcoehoorn's full-sized avatar

jcoehoorn

  • York University
  • York NE
View GitHub Profile
@jcoehoorn
jcoehoorn / check_uosserver_version.sh
Created September 4, 2026 20:01
check_uosserver_version.sh
#!/bin/bash
echo "Querying Ubiquiti for the latest UniFi OS Server (Linux x64)..."
API_URL="https://fw-update.ubnt.com/api/firmware?filter=eq~~product~~unifi-os-server&filter=eq~~channel~~release&filter=eq~~platform~~linux-x64&sort=-version&limit=1"
if command -v curl &> /dev/null; then
PAYLOAD=$(curl -sL "$API_URL")
elif command -v wget &> /dev/null; then
PAYLOAD=$(wget -qO- "$API_URL")
else
@jcoehoorn
jcoehoorn / PPTtoPPTX.ps1
Last active August 11, 2026 20:47
PPTtoPPTX.ps1
<#
.SYNOPSIS
Converts legacy PowerPoint (.ppt) files to OpenXML presentation (.pptx) format.
.DESCRIPTION
Searches a specified directory for legacy .ppt files and converts them to .pptx using
Microsoft PowerPoint COM automation. Displays a progress dot indicator for large
batches (>150 files) unless -Verbose is enabled.
.PARAMETER Path
@jcoehoorn
jcoehoorn / PfxToApacheCertsAndKey.ps1
Last active October 3, 2025 14:08
Create Linux Apache certs/key from a password protected Windows pfx with only Powershell 5 (no openssl or .Net Core)
# This may need to run as administrator.
<#
The idea here is avoiding tools that cannot be assumed to be available,
especially tools that are not serviced/patched **as a matter of course.**
For example, this could be much simplier with OpenSSL. The two functions below, along with a couple dozen lines that use
them, would then reduce to a single openssl call, with maybe a handful of lines of extra work around making the call.
However, the point of this process is improving automation.
OpenSSL, particularly, needs regular service updates/patches to avoid publishing certificates that may continue
to have vulnerabilities over time. Adding openssl here in a way that is not serviced as a matter of course
#Copyright 2015 Joel Coehoorn.
# This script is provided under the CC BY 2.0 license. https://creativecommons.org/licenses/by/2.0/
#Acknowledgements:
# This script was original based on the work by Johan Dahlbom located here:
# http://365lab.net/2014/04/15/office-365-assign-licenses-based-on-groups-using-powershell/#comment-4353
# However, it has been almost completely re-written twice since then, and boasts significant added functionality.
#This script syncs Office 365 license assignments from group membership in the Azure Active Directory Tenant.
# Adjust the variable assignments in the first section to match your environment.