-
Ensure that you have a working backup of all VMs.
-
Find the UUID of the LUKS device hosting the dom0 ext4 root filesystem:
grep -Eo '^/dev/mapper/luks-[0-9a-f-]{36} / ext4 ' /proc/mounts | cut -b 18-54
Write down the output on a piece of paper.
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/bin/python3 -S | |
import fcntl | |
import os | |
import struct | |
import sys | |
LOOP_CONFIGURE = 0x4C0A | |
LO_FLAGS_READ_ONLY = 1 | |
LO_FLAGS_DIRECT_IO = 16 |
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
--- /etc/xen/scripts/block.orig 2022-10-21 11:44:46.259102430 +0000 | |
+++ /etc/xen/scripts/block 2022-10-21 11:44:46.259102430 +0000 | |
@@ -341,7 +341,7 @@ | |
else | |
roflag='' | |
fi | |
- do_or_die losetup $roflag "$loopdev" "$file" | |
+ do_or_die piccolosetup --sector-size=512 --direct-io=on $roflag "$loopdev" "$file" | |
xenstore_write "$XENBUS_PATH/node" "$loopdev" | |
echo $loopdev > "$HOTPLUG_STORE-node" |
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
#!/bin/bash | |
# | |
# "Manage Bookmarks" (Ctrl-Shift-o) - "Import and Backup" - "Backup..." | |
# split-browser-bookmark-json2tsv <bookmarks-2022-03-04.json >>bookmarks.tsv | |
# (Conversion happens in a diposable qube, which must have jq installed.) | |
set -e -u -o pipefail | |
jq_filter='recurse(.children[]?) | | |
select(.typeCode==1) | |
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/bin/sudo bash | |
set -e -o pipefail | |
shopt -s expand_aliases | |
usage() { | |
cat <<END | |
Usage: $0 -a # reset AEM ("reinstalled Qubes") | |
$0 -t # reset TPM ("new computer") | |
$0 -t -a # reset both ("new user") |
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/bin/python2 | |
# How to test: | |
# | |
# 1. Minimize all windows belonging to the VM, except for one terminal. | |
# 2. Run "sleep 10; ./window.py" in the terminal. | |
# 3. Focus a window from another VM before the popup appears. | |
# 4. Move the pointer to the popup without travelling through the terminal. | |
# 5. Click on the popup. | |
# |
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
#!/bin/bash | |
while :; do | |
date >&2 | |
curl --proxy socks5h://127.0.0.1:9150 \ | |
--proxy-user some:thing \ | |
https://check.torproject.org/api/ip | |
echo |
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
# moved to https://github.com/rustybird/qubes-stuff/blob/master/dom0/bin/qvm-copy-from-vm |
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/bin/sudo bash | |
set -xeuo pipefail | |
# Make a Btrfs layout Qubes R4.1 installation use ephemeral swap. | |
dev=/dev/sda2 | |
grub_cfg=/boot/grub2/grub.cfg # BIOS boot | |
#grub_cfg=/boot/efi/EFI/qubes/grub.cfg # EFI boot | |
test -e "$grub_cfg" # sanity check 1 |