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
#Generate a random password from a list of words and a special character | |
# Get the list of words from a URL | |
$url = 'https://gist.githubusercontent.com/Sp5rky/8d3b36dad42a2a71dd142ca80f481484/raw/5356681469364a377b506c57c03ac6dedc17be7c/gistfile1.txt' | |
$content = Invoke-WebRequest -Uri $url | Select-Object -ExpandProperty Content | |
$lines = $content -split "`n" | |
# Pick two random words from the list | |
$randomLine1 = $lines | Get-Random | |
$randomLine2 = $lines | Get-Random | |
# Define a string of special characters | |
$specialChars = '!', '@', '#', '$', '*', '%' |
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
Connect-AzAccount | |
#74658136-14ec-4630-ad9b-26e160ff0fc6 is the AppId to https://main.iam.ad.ext.azure.com/api/AccountSkus?backfillTenants=false | |
$Token = (Get-AzAccessToken -ResourceUrl "74658136-14ec-4630-ad9b-26e160ff0fc6").Token | ConvertTo-SecureString -AsPlainText -Force | |
$webData = Invoke-WebRequest -UseBasicParsing -Uri "https://main.iam.ad.ext.azure.com/api/AccountSkus?backfillTenants=false" ` | |
-Headers @{ | |
"Authorization"="Bearer $([PSCredential]::new("token", $($script:Token)).GetNetworkCredential().Password)" | |
} |
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
# Fetch the URI of the latest version of the winget-cli from GitHub releases | |
$latestWingetMsixBundleUri = $(Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object { $_.EndsWith('.msixbundle') } | |
# Extract the name of the .msixbundle file from the URI | |
$latestWingetMsixBundle = $latestWingetMsixBundleUri.Split('/')[-1] | |
# Show a progress message for the first download step | |
Write-Progress -Activity 'Installing Winget CLI' -Status 'Downloading Step 1 of 2' | |
# Temporarily set the ProgressPreference variable to SilentlyContinue to suppress progress bars |
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
from PIL import Image, ImageDraw, ImageFont, ImageSequence | |
import math | |
import moviepy.editor as mp | |
import os | |
# this code is really ugly, just learning Python and ImageDraw | |
# Set the path to your font file (adjust if necessary) | |
font_path = "C:\\Windows\\Fonts\\CascadiaCode.ttf" | |
chars = ''.join(chr(i) for i in range(32, 127) if not 48 <= i <= 57 and not 65 <= i <= 90 and not 97 <= i <= 122) |