Skip to content

Instantly share code, notes, and snippets.

@sitecode
sitecode / README.md
Last active March 17, 2024 02:14
Fix auto command

Boot from attached USB drive in guest virtual machine using VirtualBox on host machine running linux

The one step out of the ordinary of creating a new virtual machine, is creating the virtual hard disk (.vmdk) that points to the usb drive. It requires running a command in your favorite CLI/terminal. After being created it can then be added to a new VirtualBox virtual machine.

Command

Command to create a virtual hard disk pointing to your usb drive of choice. Adjust the command to your needs like specifying a different path. Plugin the usb drive. Verify the assigned device name and update the cammand. Then run it.

$ VBoxManage internalcommands createrawvmdk -filename sdb.vmdk -rawdisk /dev/sdb
RAW host disk access VMDK file sdb.vmdk created successfully.
@sitecode
sitecode / README.md
Created December 21, 2023 15:32
Convert Ubuntu 22.04 FDE hard drive from MBR to GPT (and UEFI optionally)

Convert Ubuntu 22.04 FDE hard drive from MBR to GPT (and UEFI optionally)

With zero data loss a Ubuntu 22.04 FDE (LUKS) drive can be converted to boot in a UEFI (non Legacy Boot) system. The LVM partition is left complete untouched. The boot partition is resized to give room for the EFI partition.

Make backup

Make a full backup of the drive. The partition table is getting totally rewritten which means data could be lost.

At a minimum backup the partition table of the drive:

sudo sh -c "sfdisk -d /dev/sda > sda.mbr.backup.sfdisk" #backup partition table
sudo sh -c "sfdisk /dev/sda < sda.mbr.backup.sfdisk" #restore partition table
@sitecode
sitecode / juno email my folders pop3 export.js
Last active September 2, 2022 07:13
Puppeteer node.js script to export juno.com my folders and emails via POP3 to Thunderbird
//file: package.json dependencies
"dependencies": {
"fs": "0.0.1-security",
"puppeteer": "^1.20.0"
//used Thunderbird 78.7.1
}
//STEP 1 login to juno.com with this new window
//$ node start.js
//file: start.js: