Generate an SSH public keypair with OpenSSH:
ssh-keygen -t rsa -C "email"You can also specify arguments and provide info about the source machine:
| <# | |
| .SYNOPSIS | |
| Custom preset file for "Sophia Script for Windows 11" | |
| Version: 6.8.0 | |
| Date: 29.12.2024 | |
| Modified: 2025-01-10 19:40 | |
| #> | |
| #Requires -RunAsAdministrator |
| function Main | |
| { | |
| # File containing a MAC device list | |
| $filename = './c4_lan/c4_lan_list.txt' | |
| # The variables above may vary according to your input | |
| $ip = Get-IPAddress | |
| $broadcast = Get-BroadcastAddress $ip | |
| Send-WOL-FromFile $filename $broadcast -Verbose |
| """ | |
| Given a dictionary, transform it to a string. Then byte encode that string. Then base64 encode it and since this will go | |
| on a url, use the urlsafe version. Then decode the byte string so that it can be else where. | |
| """ | |
| data = base64.urlsafe_b64encode(json.dumps({'a': 123}).encode()).decode() | |
| # And the decode is just as simple... | |
| data = json.loads(base64.urlsafe_b64decode(query_param.encode()).decode()) | |
| # Byte encode the string, base64 decode that, then byte decode, finally transform it to a dictionary |