Skip to content

Instantly share code, notes, and snippets.

@cert01
cert01 / macosExchangePowerShell.zsh
Last active April 12, 2022 07:21
How to get MACOS Monterey PowerShell Exchange Online Connection
brew install powershell
brew install openssl
newpath='export PATH=/opt/homebrew/opt/openssl@3/bin:$PATH'
if grep -q $newpath ~/.zshrc; then printf '%s\n' "$newpath" | tee -a ~/.zshrc; fi
source ~/.zshrc
pwsh -Command 'Install-Module -Name PowerShellGet'
pwsh -Command 'Install-Module -Name ExchangeOnlineManagement'
pwsh -Command 'Install-Module -Name PSWSMAN'
sudo pwsh -Command 'Install-WSMan'
# RunPowerShell
@cert01
cert01 / Repair_CloudKey.sh
Created January 27, 2022 23:41
Commands to repair Ubiquiti Cloudkey journal when it exceeds 32 bit memory space
# https://help.ui.com/hc/en-us/articles/360006634094-UniFi-SDN-Repairing-Database-Issues-on-the-UniFi-Controller#2
# https://help.ui.com/hc/en-us/articles/204911424-UniFi-How-to-Remove-Prune-Older-Data-and-Adjust-Mongo-Database-Size#4
cd ~
curl -kO https://help.ui.com/hc/article_attachments/115024095828/mongo_prune_js.js
curl -kO https://help.ui.com/hc/en-us/article_attachments/360008640574/CK_repair.js
service unifi stop
mongod --dbpath /usr/lib/unifi/data/db --smallfiles --logpath /usr/lib/unifi/logs/server.log --repair
@cert01
cert01 / Find-GitRepository.ps1
Last active January 5, 2022 06:53 — forked from jdhitsolutions/Find-GitRepository.ps1
Use this PowerShell function to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed.
Function Find-GitRepository {
<#
.SYNOPSIS
Find Git repositories
.DESCRIPTION
Use this command to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed.
.PARAMETER Path
The top level path to search.
@cert01
cert01 / check_trim.sh
Created December 15, 2021 23:58
Check and enable trim on Rasbian Buster
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
fstrim -v /
lsblk -D
# looking for Disk-Max 0B, which is not enabled
@cert01
cert01 / excel-australia-phone-numbers.md
Created December 1, 2021 21:38
Excel Phone Number Formatting - Australia

Excel Phone Number Formatting

Excel will by default strip the leading zero from a phone number cell, and accept any content as valid. The below number formats will modify phone number inputs as specified.

Input Human Readable International Human Readable International Azure Active Directory Azure AD Azure AD Graph Active Directory
0411223344 0411 223 344 (+61) 411 223 344 +614 1122 3344 +61 411223344 Mobile Phone mobilePhone telephoneNumber
0291223344 02 9122 3344 (+61) 2 9122 3344 +612 9122 3344 +61 291223344 Office Phone businessPhones mobile