Skip to content

Instantly share code, notes, and snippets.

@RonnyAL
RonnyAL / profileHandler.ahk
Last active January 22, 2022 15:01
A demonstration of time-based functions in AutoHotkey.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance Force
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
profiles := []
InsertionSort(array)
{
@RonnyAL
RonnyAL / RemoveTeamsChat.ps1
Created April 27, 2023 11:39
Disable Teams chat autoinstall.
<# Based on https://raw.githubusercontent.com/groovemaster17/IntunePowershell/main/removeChat.ps1, with a slight modification
to get localized admin group name #>
$Action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-executionpolicy bypass -command "reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications /v ConfigureChatAutoInstall /t REG_DWORD /d 0 /f | Out-Host"'
$SID = (New-Object System.Security.Principal.SecurityIdentifier([System.Security.Principal.WellKnownSidType]::BuiltinAdministratorsSid, $Null)).Value
$Principal = New-ScheduledTaskPrincipal -GroupId $SID
Register-ScheduledTask -TaskName 'uninstallChat' -Action $action -Principal $Principal
@RonnyAL
RonnyAL / CurrencyConverter.ps1
Last active May 2, 2023 21:25
PowerShell currency converter
function Convert-Currency {
<#
.SYNOPSIS
Utilizes free APIs to convert between currencies.
.DESCRIPTION
The converter API updates its exchange rates once per 24 hours. To prevent rate limiting, this script will
cache data (in %TEMP%\PSConvertCurrency) and check its contents for its expiry date. Only after the data has
expired will it query the API again. A known, potential future issue is that the script will, in its current
state, never consider the currency metadata expired.
.PARAMETER List
@RonnyAL
RonnyAL / UpdateModules.ps1
Created October 18, 2023 06:42
Update all PowerShell modules
# Original author: Harm Veenstra
# Source: https://powershellisfun.com/2022/07/11/updating-your-powershell-modules-to-the-latest-version-plus-cleaning-up-older-versions/
function Update-Modules {
param (
[switch]$AllowPrerelease,
[string]$Name = '*',
[switch]$WhatIf
)
@RonnyAL
RonnyAL / update-public-ip-acl.sh
Last active November 20, 2023 13:21
Use with cron to maintain a dynamic IP in an NPM access list.
#!/bin/bash
helpFunction()
{
echo ""
echo "Usage: $0 -i <ACL IP ID> -p <PATH TO NPM /data folder>"
echo -e "\t-i This ID can be found by querying the database"
echo -e "\t-p The path to the NPM /data folder."
echo -e "\t-d The name of the docker container running NPM."
exit 1
@RonnyAL
RonnyAL / DisableStreamBIMNotifications.ps1
Created June 6, 2024 08:06
Disables all type sof notifications for all projects in StreamBIM, given your access token (can be found by inspecting various HTTP requests while using the site)
function Disable-Notifications {
param (
[string]$ProjectId,
[string]$SettingId,
[string]$BearerToken
)
$val = 'never'
if ($SettingId -eq 'push-notifications') {
$val = 'false'
}