Skip to content

Instantly share code, notes, and snippets.

@kaubu
kaubu / dual-boot.md
Last active October 25, 2024 23:44 — forked from shimeoki/dual-boot.md
Windows 11 + Arch Linux dual-boot (systemd-boot) installation guide with encrypted partitions (BitLocker and LUKS respectively) and Secure Boot (UEFI)

My Windows 11 + Arch Linux dual-boot installation

Caution

All actions are at your own risk! This has been tested by me, but does not guarantee your success.

Read everything at least once before actually following the guide. If something goes wrong, stop immediately. Consider starting from the beginning.

About the guide

@kaubu
kaubu / assignable_ip.py
Created October 15, 2024 07:39
Given a prefix notation, calculate the possible number of IP addresses in a subnet
def calc_assignable(prefix):
import math
print(f"{int(math.pow(2, 32 - prefix) - 2):,}")

Poetry for dependencies

poetry add <package> to add the package

poetry build

Dependencies: poetry add pylint mypy black isort

@kaubu
kaubu / toggle_scroll_lock_linux.sh
Created June 24, 2024 03:44
Toggle keyboard leds on Arch and Arch derivatives that require pressing the scroll lock button
# Get list of devices
ls /sys/class/leds/
# Find all that have "inputX::scrolllock" where X is an integer, and try the following command with all of them
# The one that worked for me was 6
# Toggle keyboard scroll lock leds on
sudo sh -c 'echo 1 > /sys/class/leds/input6::scrolllock/brightness'
# Toggle keyboard scroll lock leds off
@kaubu
kaubu / foreign.txt
Last active December 25, 2023 13:30
Misc Foreign Highlight
obscure origin
unknown origin
uncertain origin
unclear origin
unknown etymology
unknown etymologies
borrowed
Old Norse
Norse
Icelandic
@kaubu
kaubu / english.txt
Created December 25, 2023 00:07
English Highlight List
Old English
Proto-Germanic
Proto-West Germanic
@kaubu
kaubu / romance.txt
Last active December 25, 2023 04:07
French and Latin Highlight list
Anglo-French
Anglo-Latin
Anglo-Norman
Norman
French
Old French
Middle French
Latin
Medieval Latin
Vulgar Latin
@kaubu
kaubu / env.nu
Created November 18, 2023 02:02
Nu environment
# Enforce Git timezone is UTC
$env.TZ = "UTC"
# Set default editor of Nushell
$env.EDITOR = "vim"
@kaubu
kaubu / config.nu
Created November 18, 2023 02:00
NuShell config
# Aliases
alias ll = ls -l
alias la = ls -a
alias lla = ls -la
alias gs = git status
alias ga = git add .
alias gc = git commit
alias gcu = git commit -m 'Update'
alias gac = git add .; git commit
# 9(1)+4(2)+3(3)+2(4)+1(5)+1(6)+1(7)+1(8)+1(9)=
import math
slots: int = int(input("Slots: "))
spells = 0
for i in range(1, slots + 1):
# print(i)
new_spells = math.floor(slots / i)