Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -eu
# Ryzen CPUs:
# ((0, 1), (2, 3), (4, 5), (6, 7))
# ((8, 9), (10, 11), (12, 13), (14, 15))
# Dedicated for Windows: (0, 1, 2, 3, 4, 5, 6, 7)
CPUSET=/sys/fs/cgroup/cpuset
#CPUSET=/dev/cpuset
@arcnmx
arcnmx / kit.md
Last active November 6, 2021 01:28

https://www.twitch.tv/kitboga/videos?filter=highlights&sort=time

for (const link of document.querySelectorAll('a[href^="/videos/"][lines="1"]')) {
  console.log(`- [${link.text}](https://twitch.tv${link.getAttribute("href")})`);
}
@arcnmx
arcnmx / map_disk.sh
Last active August 17, 2021 17:44
add a temporary MBR header to an NTFS partition to be passed to a windows VM
map_disk() {
DISK=$1
DM_NAME=$(basename $DISK)
if [[ ! -e /dev/mapper/$DM_NAME ]]; then
DISK_ID=${2-$(printf %s "$DM_NAME" | sha256sum)}
DISK_TYPE=7 # NTFS
MBR_FILE=$(mktemp -t vm-$DM_NAME-XXXXXXXX.mbr)
BLOCK=$(basename $(readlink $DISK))
BLOCK_START=$(cat /sys/class/block/$BLOCK/start)
BLOCK_SIZE=$(cat /sys/class/block/$BLOCK/size)