Created
March 9, 2023 20:37
-
-
Save rjhornsby/790ce86c8bfd32241028a10f80f4c0e3 to your computer and use it in GitHub Desktop.
kitchen windows 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
#!/usr/local/bin/python3 | |
import clipboard as c | |
import os | |
import sys | |
import yaml | |
base_path = f"{os.getcwd()}/.kitchen" | |
files = [os.path.join(base_path, file) for file in os.listdir(base_path) if (file.lower().endswith('.yml'))] | |
files.sort(key=os.path.getmtime) | |
with open(files[-1], 'r') as kitchen_yaml: | |
box_setup = yaml.safe_load(kitchen_yaml) | |
c.copy(box_setup['password']) | |
print(f"Password copied to clipboard: '{box_setup['password']}'") | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment