Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Converts AD pwdlastset field to readable date
# Kudos: https://www.adminsys.ch/2013/07/31/convert-active-directory-pwdlastset-attribute-readable-time/
function convert {
unixepoc=$((($1/10000000)-11644473600))
adlastset=$(/bin/date -d "1970-01-01 ${unixepoc} sec GMT")
echo -e ${adlastset}
}
alias tmconf='vim ~/.tmux.conf'
alias tmls='tmux ls'
alias tmsess='tmux attach -t'
alias tmcolors='for i in {0..255}; do printf "\x1b[38;5;${i}mcolor%-5i\x1b[0m" $i ; if ! (( ($i + 1 ) % 8 )); then echo ; fi ; done'
alias tmnew='tmux new -s'
alias tmload='tmux source-file ~/.tmux.conf'
alias tmlayout='tmux list-windows | sed -n "s/.*layout \(.*\)] @.*/\1/p"'
alias mux='tmuxinator'
@curi0usJack
curi0usJack / Get-Origins.ps1
Created March 27, 2025 20:28
PowerShell code to map CDN (Classic or FrontDoor) to their Origin hostname.
Import-Module Az
Connect-AzAccount
$ipre = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
function Get-ClassicOrigins() {
$profs = Get-AzCDNProfile
$coll = @()
foreach ($prof in $profs) {