Skip to content

Instantly share code, notes, and snippets.

@afshawnlotfi
Last active April 19, 2023 03:17
Show Gist options
  • Save afshawnlotfi/049180f719825d4c71e209b2a959be38 to your computer and use it in GitHub Desktop.
Save afshawnlotfi/049180f719825d4c71e209b2a959be38 to your computer and use it in GitHub Desktop.
USBFlasher
import os
shellPath = input("What is the path of the ISO\n").replace(" ", "")
if os.path.isfile(shellPath):
deviceNum = input("What is the device number. Refer to README for what this is.\n").replace(" ", "")
os.system("hdiutil convert -format UDRW -o write.img " + shellPath)
os.system("diskutil unmountDisk /dev/rdisk" + deviceNum)
os.system("sudo dd if=write.img.dmg of=/dev/rdisk" + deviceNum + " bs=1m")
else:
print("This is not a real file")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment