commit 884c735fd00a960ac7a1b6d7ee859e74cabdb5a9 from: Isabella date: Wed Dec 3 09:41:33 2025 UTC Initial Commit commit - /dev/null commit + 884c735fd00a960ac7a1b6d7ee859e74cabdb5a9 blob - /dev/null blob + 5a4efc039df2dfa375adb1a7c73b19f5f5767d52 (mode 755) --- /dev/null +++ Alpine Linux/ap @@ -0,0 +1,104 @@ +#!/bin/bash +# Alpine aports auto-update and selective rebuild script + +### LICENSE ### +# Copyright (c) 2025 Isabella + +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. + +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +############### +### AUTHORS ### +# Original Authors +# ---------------- +# Isabella +############### + +# Current deps: bash, rsync, git, alpine-sdk, abuild-rootbld + +args=("$@") + +APORTS_DIR="$HOME/aports" +CUSTOM_DIR="$HOME/aports-custom" +LOGFILE="$HOME/aports-update.log" + + +## Functions. +function helpmsg() { + printf "AP: Alpine Ports Package Manager\n" + printf "Commands:\n" + printf " (h)elp, --help, -h: Show help\n" + printf " (s)ync, --sync, -s: Sync the ~/aports tree\n" + printf " (u)pdate, --update, -u: Upgrade packages from the ~/aports tree\n" + printf "\n" + printf "Example usage:\n" + printf " Update local-ports tree (~/aports): ap sync\n" + printf " Upgrade packages from local-ports tree: ap update\n" + + exit 1 +} + +function minihelp() { + printf "AP: Alpine Ports Package Manager\n" + printf "Basic usage: ap COMMAND \n" + printf "To show help:\n" + printf " ap help\n" + + exit 1 +} + +function synctree() { + # Ensure directories exist + mkdir -p "$APORTS_DIR" "$CUSTOM_DIR" + + echo "=== Updating aports tree ===" | tee -a "$LOGFILE" + cd "$APORTS_DIR" || exit 1 + + # Fetch latest changes without overwriting local mods + git fetch origin + git merge --strategy=recursive -X ours origin/master + + echo "=== Syncing custom APKBUILD files ===" | tee -a "$LOGFILE" + # Copy your custom APKBUILD files back after merge + rsync -av --ignore-existing "$CUSTOM_DIR/" "$APORTS_DIR/" + + echo "=== Done ===" | tee -a "$LOGFILE" +} + + +function update() { + echo "=== Rebuilding selected packages ===" | tee -a "$LOGFILE" + # List packages you want to rebuild + PACKAGES="$(cat /etc/apk/world)" + + for pkg in $PACKAGES; do + PKG_PATH=$(find "$APORTS_DIR" -type d -name "$pkg" | head -n 1) + if [ -n "$PKG_PATH" ]; then + echo "Building $pkg..." | tee -a "$LOGFILE" + cd "$PKG_PATH" || continue + abuild rootbld || echo "Failed to build $pkg" | tee -a "$LOGFILE" + fi + done + echo "=== Done ===" | tee -a "$LOGFILE" +} + +## Main. +if [[ "$args" = "-h" || "$args" = "--help" || "$args" = "h" || "$args" = "help" ]]; then + helpmsg +elif [[ "$args" = "" || "$args" = " " ]]; then + minihelp +elif [[ "$args" = "-s" || "$args" = "--sync" || "$args" = "sync" || "$args" = "s" ]]; then + synctree +elif [[ "$args" = "-u" || "$args" = "--update" || "$args" = "update" || "$args" = "up" ]]; then + update +else + minihelp +fi blob - /dev/null blob + 90c5cd763f55d57e2be642e7e94ef7ca84669418 (mode 755) --- /dev/null +++ install/install_tmp.md @@ -0,0 +1,126 @@ +TODO: Convert to either HTML or Markdown and update. + +## Partitioning. + +Wipe hard drive. + +`wipefs -a /dev/sda` + +Add GPT partition table to hard drive. + +`fdisk /dev/sda` + 1. g + 2. w + +Partition disk. + +`cgdisk /dev/sda` + 1. 512 MiB - sda1 + 2. 512 MiB - sda2 + 3. Rest - sda3 + +Format partitions. + +`mkfs.fat -F32 /dev/sda1 -n 'efi'` +`mkfs.ext4 -jv /dev/sda2 -L 'boot'` + +Create and open LUKS encryption partition. + +`cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 -i 4000 --use-urandom -y luksFormat /dev/sda3` +`cryptsetup luksOpen /dev/sda3 crypt` + +Create LVM2 logical volumes and do a volume change sync. + +`pvcreate /dev/mapper/crypt` +`vgcreate vgroot /dev/mapper/crypt` +`lvcreate -L 8GiB -n swap vgroot` +`lvcreate -l100%FREE -n root vgroot` +`vgscan --mknodes` +`vgchange -ay` + +Format partitions of LVM2 logical partitions. + +`mkswap /dev/vgroot/swap -L 'swap'` +`mkfs.ext4 -jv /dev/vgroot/root -L 'root'` + +Mount partitions. + +`swapon /dev/vgroot/swap` +`mount /dev/vgroot/root /mnt` +`mkdir /mnt/boot` +`mount /dev/sda2 /mnt/boot` +`mkdir /mnt/boot/efi` +`mount /dev/sda1 /mnt/boot/efi` + +Install base packages to drive. + +`pacstrap /mnt base base-devel linux linux-firmware grub lvm2 emacs dhcpcd wpa_supplicant` + +Generate fstab to help bootloader and kernel auto-mount stuff. + +`genfstab -U /mnt >> /mnt/etc/fstab` + +Chroot into nearly created install. + +`arch-chroot /mnt` + +Configure timezone. + +`ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime` + +Generate `/etc/adjtime`. + +`hwclock --systohc` + +Comment out `en_GB.UTF-8 UTF-8` in `/etc/locale.gen`. + +Run `locale-gen`. + +Change `/etc/locale.conf`. + +Add `LANG=en_GB.UTF-8` to `/etc/locale.conf`. + +Change `/etc/vconsole.conf`. + +Add `KEYMAP=uk` to `/etc/vconsole.conf`. + +Set hostname. + +Add a hostname to `/etc/hostname`. + +Add these lines into `/etc/hosts` (replacing `myhostname` with your hostname and `localdomain` with your local domain name). + +``` +127.0.0.1 localhost +::1 localhost +127.0.1.1 myhostname.localdomain myhostname +``` + +Edit `/etc/mkinitcpio.conf`. + +``` +Add 'ext4' to MODULES. +Add 'encrypt' and 'lvm2' to HOOKS before 'filesystems' +``` + +Generate initramfs. + +`mkinitcpio -P` + +Install GRUB. + +`grub-install --target=i386-pc --recheck /dev/sda` + +Edit `GRUB_CMDLINE_LINUX=""` to `GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:luks:allow-discards"` in `/etc/defualt/grub`. + +Generate GRUB config. + +`grub-mkconfig -o /boot/grub/grub.cfg` + +Set a root password. + +`passwd` + +Enable dhcpcd. + +`systemctl enable dhcpcd` blob - /dev/null blob + baee2efac835aea1309f48dc2021f092d56c265d (mode 755) --- /dev/null +++ kdenlive/1-profile.md @@ -0,0 +1,38 @@ +## WebM. + +#### Summary: Added 'frame_rate_num=60 frame_rate_den=1' to Parameters to change video from 25fps to 60fps. + +Group `Custom` + +Profile name `WebM - the widespread free format (VP8/Vorbis)` + +Extention `webm` + +Parameters (see [MLT documentation](https://www.mltframework.org/plugins/ConsumerAvformat/)) + + ``` + f=webm vcodec=libvpx acodec=libvorbis crf=%quality vb=0 quality=good aq=%audioquality max-intra-rate=1000 frame_rate_num=60 frame_rate_den=1 + ``` + +Video + + * Qualities `15,45` + + * Default quality `0` + +Audio + + * Qualities `7,3` + + * Default quality `0` + +Speed options + + ``` + cpu-used=2 + cpu-used=3 + cpu-used=4 + cpu-used=5 + ``` + +#### More [MLT documentation](https://www.mltframework.org/docs/profiles/) blob - /dev/null blob + 8e6a26ff7eefa3e3f569ab4f7d4d3af0888904a9 (mode 755) --- /dev/null +++ kdenlive/2-stop.md @@ -0,0 +1,19 @@ +# Stop Kdenlive on Windows + +## How to stop all Kdenlive processes on Windows, thanks to Matthew Moore. + +### [Kill Script for Kdenlive - YouTube](https://www.youtube.com/watch?v=7nRe_48vgRs) + +Save as 'kdenlive_stop.bat': + +``` +@echo off +color f0 + +taskkill /IM "kioslave.exe" /T /F +taskkill /IM "kdenlive.exe" /T /F +taskkill /IM "dbus-daemon.exe" /T /F +wmic process where name='kdenlive.exe' delete +wmic process where name='kioslave.exe' delete +wmic process where name='dbus-daemon.exe' delete +``` blob - /dev/null blob + 9372df3ea6c7a1f8ca4ddd48b37f517279f80134 (mode 755) --- /dev/null +++ partitioning/1-partitioning.md @@ -0,0 +1,55 @@ +# Partitioning. + +## EFI and boot filesystems. +EFI partition. + +`mkfs.vfat -F 32 /dev/sda1 -n 'efi'` + +Boot partition. + +`mkfs.ext4 -jv /dev/sda2 -L 'boot'` + +## cryptsetup. + +`cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 -i 4000 --use-urandom -y luksFormat /dev/sda3` + +(cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 4000 --use-urandom --verify-passphrase luksFormat /dev/sda3) + +then + +`cryptsetup luksOpen /dev/sda3 crypt` + +to view cryptsetup header: `cryptsetup luksDump /dev/sda3` + +## LVM2. + +Create physical volume. + +`pvcreate /dev/mapper/crypt` + +Create volume group. + +`vgcreate vgroot /dev/mapper/crypt` + +Create logical volume partitions. + +``` +lvcreate -L 8GiB -n swap vgroot +lvcreate -L 40GiB -n root vgroot +lvcreate -l100%FREE -n home vgroot +``` + +Rescan LVM. + +``` +vgscan --mknodes +vgchange -ay +``` + +## Create filesystems. + +Swap: `mkswap /dev/vgroot/swap -L 'swap' && swapon /dev/vgroot/swap` + +Root: `mkfs.xfs -f /dev/vgroot/root -L 'root'` + +Home: `mkfs.xfs -f /dev/vgroot/home -L 'home'` blob - /dev/null blob + 226814c6b943535f09d131e4bd7eabfc45117c9a (mode 755) --- /dev/null +++ partitioning/2-fstab.md @@ -0,0 +1,59 @@ +# Filesystems table. +## Location: /etc/fstab + +# EXT4 or XFS. +``` + + +UUID= /boot/efi vfat defaults,noatime 0 2 +UUID= /boot ext4 defaults,noatime 0 2 +UUID= / ext4 defaults,noatime 0 1 +UUID= none swap sw 0 0 + +/dev/cdrom /mnt/cdrom auto noauto,ro 0 0 +``` + +# BTRFS. +``` + + +UUID= /boot/efi vfat defaults,noatime 0 2 +UUID= /boot btrfs defaults,noatime,subvol=boot 0 2 +UUID= / btrfs defaults,compress=lzo,noatime,autodefrag,subvol=root 0 1 +UUID= none swap sw 0 0 + +/dev/cdrom /mnt/cdrom auto noauto,ro 0 0 +``` + +## Notes: +### Options. +`autodefrag` Specific to btrfs. Enable automatic file defragmentation. When enabled, small random writes into files (in a range of tens of kilobytes, currently it’s 64K) are detected and queued up for the defragmentation process. Not well suited for large database workloads. + +[Why autodefrag should still be enabled on SSDs.](https://www.spinics.net/lists/linux-btrfs/msg31028.html) + +`defaults` Use default options: rw, suid, dev, exec, auto, nouser, and async. + +`discard` Enables TRIM (for SSDs). + +`noauto` Does not automatically mount at boot. Can still be mounted via the `mount -a` command. + +`compress=lzo` Specific to btrfs. (See 'compression' below.) + +`sw` Specific to swap. + +## Pass (fsck). +The 6th column (in bold) is the fsck option. + + 0 = Do not check. + 1 = First file system (partition) to check; / (root partition) should be set to 1. + 2 = All other filesystems to be checked. + +## Compression. +### What are the differences between compression methods? +There's a speed/ratio trade-off: + + ZLIB -- slower, higher compression ratio (uses zlib level 3 setting, you can see the zlib level difference between 1 and 6 in zlib sources). + LZO -- faster compression and decompression than zlib, worse compression ratio, designed to be fast + ZSTD -- (since v4.14) compression comparable to zlib with higher compression/decompression speeds and different ratio levels (details) + +The differences depend on the actual data set and cannot be expressed by a single number or recommendation. Do your own benchmarks. LZO seems to give satisfying results for general use. blob - /dev/null blob + 4479b8394efb4b2e5201e8ef5ba40586ac77e2f3 (mode 755) --- /dev/null +++ partitioning/3-mkinitcpio.md @@ -0,0 +1,79 @@ +# mkinitcpio.conf + +## Location: `/etc/mkinitcpio.conf`. + +## Example mkinitcpio config (for LVM2 + LUKS encryption). +``` +# vim:set ft=sh +# MODULES +# The following modules are loaded before any boot hooks are +# run. Advanced users may wish to specify all system modules +# in this array. For instance: +# MODULES=(piix ide_disk reiserfs) +MODULES=(ext4 ext2) + +# BINARIES +# This setting includes any additional binaries a given user may +# wish into the CPIO image. This is run last, so it may be used to +# override the actual binaries included by a given hook +# BINARIES are dependency parsed, so you may safely ignore libraries +BINARIES=() + +# FILES +# This setting is similar to BINARIES above, however, files are added +# as-is and are not parsed in any way. This is useful for config files. +FILES=() + +# HOOKS +# This is the most important setting in this file. The HOOKS control the +# modules and scripts added to the image, and what happens at boot time. +# Order is important, and it is recommended that you do not change the +# order in which HOOKS are added. Run 'mkinitcpio -H ' for +# help on a given hook. +# 'base' is _required_ unless you know precisely what you are doing. +# 'udev' is _required_ in order to automatically load modules +# 'filesystems' is _required_ unless you specify your fs modules in MODULES +# Examples: +## This setup specifies all modules in the MODULES setting above. +## No raid, lvm2, or encrypted root is needed. +# HOOKS=(base) +# +## This setup will autodetect all modules for your system and should +## work as a sane default +# HOOKS=(base udev autodetect block filesystems) +# +## This setup will generate a 'full' image which supports most systems. +## No autodetection is done. +# HOOKS=(base udev block filesystems) +# +## This setup assembles a pata mdadm array with an encrypted root FS. +## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. +# HOOKS=(base udev block mdadm encrypt filesystems) +# +## This setup loads an lvm2 volume group on a usb device. +# HOOKS=(base udev block lvm2 filesystems) +# +## NOTE: If you have /usr on a separate partition, you MUST include the +# usr, fsck and shutdown hooks. +HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck) + +# COMPRESSION +# Use this to compress the initramfs image. By default, gzip compression +# is used. Use 'cat' to create an uncompressed image. +#COMPRESSION="gzip" +#COMPRESSION="bzip2" +#COMPRESSION="lzma" +#COMPRESSION="xz" +#COMPRESSION="lzop" +#COMPRESSION="lz4" + +# COMPRESSION_OPTIONS +# Additional options for the compressor +#COMPRESSION_OPTIONS=() +``` + +### NOTE: + +`ext4` and `ext2` are added onto `MODULES()`. + +`encrypt` and `lvm2` are addded onto `HOOKS=()`. blob - /dev/null blob + 320eb6707aba01ac3e40d9f761a03c7f36fc019f (mode 755) --- /dev/null +++ partitioning/4-grub.md @@ -0,0 +1,68 @@ +# GNU GRand Unified Bootloader. +### (GRUB.) + +## Location: `/etc/default/grub`. + +## Example default grub config (for LVM2 + LUKS encryption). +``` +# GRUB boot loader configuration + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Gentoo" +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="root=/dev/mapper/vg01-root cryptdevice=/dev/sda3:crypt" + +# Preload both GPT and MBR modules so that they are not missed +GRUB_PRELOAD_MODULES="part_gpt part_msdos" + +# Uncomment to enable booting from LUKS encrypted devices +GRUB_ENABLE_CRYPTODISK=y + +# Uncomment to enable Hidden Menu, and optionally hide the timeout count +#GRUB_HIDDEN_TIMEOUT=5 +#GRUB_HIDDEN_TIMEOUT_QUIET=true + +# Uncomment to use basic console +GRUB_TERMINAL_INPUT=console + +# Uncomment to disable graphical terminal +#GRUB_TERMINAL_OUTPUT=console + +# The resolution used on graphical terminal +# note that you can use only modes which your graphic card supports via VBE +# you can see them in real GRUB with the command `vbeinfo' +GRUB_GFXMODE=auto + +# Uncomment to allow the kernel use the same resolution used by grub +GRUB_GFXPAYLOAD_LINUX=keep + +# Uncomment if you want GRUB to pass to the Linux kernel the old parameter +# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +GRUB_DISABLE_RECOVERY=true + +# Uncomment and set to the desired menu colors. Used by normal and wallpaper +# modes only. Entries specified as foreground/background. +#GRUB_COLOR_NORMAL="light-blue/black" +#GRUB_COLOR_HIGHLIGHT="light-cyan/blue" + +# Uncomment one of them for the gfx desired, a image background or a gfxtheme +#GRUB_BACKGROUND="/path/to/wallpaper" +#GRUB_THEME="/path/to/gfxtheme" + +# Uncomment to get a beep at GRUB start +#GRUB_INIT_TUNE="480 440 1" + +# Uncomment to make GRUB remember the last selection. This requires to +# set 'GRUB_DEFAULT=saved' above. +#GRUB_SAVEDEFAULT="true" +``` + +### NOTE: + +`root=/dev/mapper/vg01-root cryptdevice=/dev/sda3:crypt` is added to `GRUB_CMDLINE_LINUX=""`. + +`#GRUB_ENABLE_CRYPTODISK=y` has been uncommented to `GRUB_ENABLE_CRYPTODISK=y`. blob - /dev/null blob + 6da7e0d1d0e754d8da3d487182d8aca42816fa1e (mode 755) --- /dev/null +++ partitioning/readme.md @@ -0,0 +1,7 @@ +## This subdirectory will teach you some advanced techniques when it comes to partitioning during manual Linux installation. + +### Links to online guides: + +[Gentoo guide](https://wiki.gentoo.org/wiki/Dm-crypt_full_disk_encryption) + +[Gentoo guide (simplified)](https://wiki.gentoo.org/wiki/Full_Disk_Encryption_From_Scratch_Simplified) blob - /dev/null blob + bb380532f9b24a71b8a111a47128250ede993f01 (mode 755) --- /dev/null +++ readme.md @@ -0,0 +1,19 @@ +# This directory contains documentation written in Markdown. + +## Contents: + +### partitioning/1-partitioning.md + +How to setup partitions for LVM2 + LUKS properly (imo). + +### partitioning/2-fstab.md + +Example fstab. + +### partitioning/3-mkinitcpio.md + +Example mkinitcpio config. + +### partitioning/4-grub.md + +Example default grub config.