Skip to content

Instantly share code, notes, and snippets.

@lucas-mior
lucas-mior / btrfs_and_RAID.md
Last active June 8, 2024 16:54
Btrfs and RAID

BTRFS and RAID

Basics

There is a lot of confusion about btrfs and its RAID features. Let's start from the basics:

  • RAID stands for "redundant array of inexpensive/independent disks". It is a way of organizing disks.
  • There are hardware and software RAID implementations, for instance:
    • mdadm is a software implementation found in the linux kernel
  • some CPUs have hardware RAID

archlinux install with (almost) full disk encryption, btrfs and RAID

This tutorial is not ready yet.

This tutorial focuses on the disk setup and boot process. You should be familiar with a standard archlinux installation to follow along. However, I also added some general things that the archlinux installation guide fails to adress.

Setup

  • 2 disks of 2TB each
@lucas-mior
lucas-mior / quit.vim
Last active December 6, 2023 17:50
Vim - intuitively quit
" How to save and quit vim intuitively
" C-s -> save
" ZZ -> save then close buffer:
" - if last buffer, also quit vim.
" - if more then one window open, close the window
" :q -> close buffer:
" - if not saved will error.
" - if last buffer, also quit vim.
" - if more then one window open, close the window
" :qa! -> quit vim, no matter what
@lucas-mior
lucas-mior / C_no_replacement.md
Last active October 15, 2023 19:25
C - still no replacement

C - still no replacement

People who design languages can't resist the temptation of doing clever stuff. The result if that we still are having to deal with C problems that could have been solved years ago. Until this is done, we are stuck with this language.

Real issues with C

  • Lack of namespaces
  • Preprocessor is bad
  • Enums don't have explicit integer type
@lucas-mior
lucas-mior / pythonrc.py
Last active May 27, 2024 17:55
Python startup file, useful for using it as an interactive calculator.
import atexit
import sys
import os
import time
import readline
import inspect
import pyperclip
import math
import cmath