View openmsedgeprofilemacos.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Navigate to the profiles directory | |
cd ~/Library/Application\ Support/Microsoft\ Edge | |
# List out the profile directories. Note that the directory name is what is used in the launch command, *not* necessarily the friendly name of the profile you see in Microsoft Edge.app | |
find ./ -type f -name Preferences | |
# Let's say "Profile 1" is one of our directories | |
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" --profile-directory="Profile 1" |
View rsync_examples.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sync parent folder and subfolders recursively | |
rsync -avP Takeout/Google\ Photos/ /Volumes/Multimedia/Pictures/Google\ Photos | |
# Exclude json files and consolidate into a flat folder | |
rsync -avP --exclude='*.json' Takeout/Google\ Photos/*/ organize/datefix |
View exiftool_examples.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read time metadata | |
exiftool -a -G1 -s -time:all *.JPG | |
# Update time metadata | |
# ModifyDate | |
exiftool -overwrite_original -d "%Y:%m:%d %H:%M:%S" -v "-AllDates<ModifyDate" "-FileModifyDate<ModifyDate" *.JPG | |
# DateTimeOriginal | |
exiftool -overwrite_original -d "%Y:%m:%d %H:%M:%S" -v "-AllDates<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" *.JPG |
View gist:9ca037353256941e528f668beb40bfc1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bordertown (Finnish) | |
Trapped (icelandic) | |
The Bureau (French) | |
Deutschland 83 | |
Giri/Haji | |
Vera | |
Wallander | |
Young Wallenberg | |
Collateral | |
Detective Montalbano |
View youtube-download.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i=1; | |
for youtube_uri in "$@" | |
do | |
echo "Downloading video $i: $youtube_uri"; | |
i=$((i + 1)); | |
yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio/best[ext=mp4]/best' --merge-output-format mp4 "$youtube_uri" --add-metadata --embed-thumbnail | |
done |
View metrics.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Monitor Azure Storage | |
### https://aka.ms/azuremonitor/storage-metrics | |
## Azure Monitor Metrics Overview | |
### https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-platform-metrics | |
## Azure Storage monitoring data reference | |
### https://docs.microsoft.com/en-us/azure/storage/common/monitor-storage-reference | |
## Azure Monitoring REST API walkthrough |
View Get-AzResourcesSupportingPolicies.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$currentContext = Get-AzContext | |
$currentSub = $(Get-AzContext).Subscription.Name | |
$token = $currentContext.TokenCache.ReadItems() | Where-Object {$_.tenantid -eq $currentContext.Tenant.Id} | |
$GetScanDetails = @{ | |
Headers = @{ | |
Authorization = "Bearer $($token.AccessToken)" | |
'Content-Type' = 'application/json' | |
} | |
Method = 'Get' |
View GetGrantedOATHPerms.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzureADServicePrincipal ` | |
-Filter "serviceprincipaltype eq 'Application'" -All $true -PipelineVariable sp ` | |
| Get-AzureADServicePrincipalOAuth2PermissionGrant ` | |
-top 1 ` | |
| select @{N="SPDisplayname";E={$sp.displayname}}, @{N="SPObjectid";E={$sp.objectid}}, consenttype, scope | |
#https://twitter.com/rootsecdev/status/1282640558025060354 |
View azure_expiringsps.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az ad sp list \ | |
--all \ | |
--query "[?passwordCredentials[0].endDate<='$(date -d "+60 days" +%Y-%m-%d)'||keyCredentials[0].endDate<='$(date -d "+60 days" +%Y-%m-%d)'].{\"App ID Display Name\":appDisplayName,\"SP appId\":appId,\"Password Expiry Date\":passwordCredentials[0].endDate, \"Key Expiry Date\":keyCredentials[0].endDate}" \ | |
-o table |
NewerOlder