Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| howtos [2022-12-05 19:40] – asdf | howtos [2024-03-10 00:10] (current) – [Add Linux swap space] asdf | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Instructions for performing tasks that I do often enough to need to know but infrequently enough to never remember the details. | Instructions for performing tasks that I do often enough to need to know but infrequently enough to never remember the details. | ||
| - | ===== Fake a document scan ===== | ||
| ===== Add Linux swap space ===== | ===== Add Linux swap space ===== | ||
| - | ===== Create | + | These commands should all be performed with root permissions. The instructions below assume |
| - | ===== Log keys in Python ===== | + | |
| - | <code python> | + | |
| - | from pynput.keyboard import Key, Listener | + | |
| - | import logging | + | |
| - | logging.basicConfig(filename=(" | + | First, allocate space: |
| - | def on_press(key): | + | <code bash> |
| - | | + | fallocate -l 1G /swapfile |
| - | + | # alternatively | |
| - | with Listener(on_press=on_press) as listener: | + | dd if=/dev/zero of=/ |
| - | listener.join() | + | |
| </ | </ | ||
| + | |||
| + | Ensure only root can read the swap file's contents: | ||
| + | |||
| + | <code bash> | ||
| + | chmod 600 /swapfile | ||
| + | </ | ||
| + | |||
| + | Finally, activate and enable the swap file: | ||
| + | |||
| + | <code bash> | ||
| + | mkswap /swapfile | ||
| + | swapon /swapfile | ||
| + | </ | ||
| + | |||
| + | To have the swap automount on boot, add the following to ''/ | ||
| + | |||
| + | < | ||
| + | /swapfile swap swap defaults 0 0 | ||
| + | </ | ||
| + | |||
| + | ===== Boot an ISO from GRUB ===== | ||
| + | Adapted from [[https:// | ||
| + | |||
| + | < | ||
| + | set isofile="/ | ||
| + | set dri=" | ||
| + | set lang=" | ||
| + | set keytable=" | ||
| + | set timezone=" | ||
| + | search --no-floppy -f --set=root $isofile | ||
| + | probe -u $root --set=abc | ||
| + | set pqr="/ | ||
| + | loopback loop $isofile | ||
| + | linux (loop)/ | ||
| + | initrd (loop)/ | ||
| + | </ | ||
| + | |||
| + | Adjust '' | ||
| + | |||
| + | Note that the [[GreatFET]] has Facedancer capabilities, | ||
| + | |||
| + | ===== Make an ethernet loopback connector ===== | ||
| + | This trick works with either a socket or a plug. Connect the following pins: | ||
| + | |||
| + | * 1 <-> 3 | ||
| + | * 2 <-> 6 | ||
| + | * 4 <-> 7 | ||
| + | * 5 <-> 8 | ||
| + | |||
| + | ===== Mount an ext4 drive in WSL2 ===== | ||
| + | Open a PowerShell window as an administrator, | ||
| + | |||
| + | <code powershell> | ||
| + | GET-CimInstance -query " | ||
| + | </ | ||
| + | |||
| + | Locate the desired entry, then attach it to the WSL instance: | ||
| + | |||
| + | <code powershell> | ||
| + | wsl --mount \\.\PHYSICALDRIVE2 | ||
| + | </ | ||
| + | |||
| + | Finally, locate and mount the disk within the WSL instance. | ||
| + | |||
| + | https:// | ||
| + | |||
| + | ===== Fake a document scan ===== | ||
| + | ===== Create a reverse SSH connection ===== | ||