Skip to content

Instantly share code, notes, and snippets.

@romanblanco
Last active February 8, 2022 20:31
Show Gist options
  • Save romanblanco/f0dfc1ff954a53cf87a5fc07a2fd406e to your computer and use it in GitHub Desktop.
Save romanblanco/f0dfc1ff954a53cf87a5fc07a2fd406e to your computer and use it in GitHub Desktop.
Archlinux install notes
# Get ISO and verify signature
# - https://wiki.archlinux.org/index.php/Installation_guide#Verify_signature
# ============================
# https://www.archlinux.org/download/
gpg --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig
# Preparing bootable USB
# - https://wiki.archlinux.org/index.php/USB_flash_installation_medium#Using_basic_command_line_utilities
# ======================
wipefs --all /dev/sdx
dd bs=4M if=path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync
# Verify boot mode is UEFI
# - https://wiki.archlinux.org/index.php/Installation_guide#Verify_the_boot_mode
# ========================
# should end with 0 if is booted as UEFI
ls /sys/firmware/efi/efivars && echo $?
# Connect to the internet
# - https://wiki.archlinux.org/index.php/Installation_guide#Connect_to_the_internet
# - https://wiki.archlinux.org/index.php/Iwd#Connect_to_a_network
# =======================
# > [iwd]# device list
# > [iwd]# station wlan0 scan
# > [iwd]# station wlan0 get-networks
# iwctl --passphrase <passphrase> station <device> connect <SSID>
iwctl --passphrase mywifipassword station wlan0 connect mywifiname
ping archlinux.org
# Update the system clock
# - https://wiki.archlinux.org/index.php/Installation_guide#Update_the_system_clock
# =======================
timedatectl set-ntp true
timedatectl status
# Partition the disks
# - ~https://wiki.archlinux.org/index.php/Installation_guide#Partition_the_disks~
# - https://wiki.archlinux.org/index.php/Partitioning#Partitioning_tools
# - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
# ===================
# - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Preparing_the_disk_2
# - Create a partition to be mounted at /boot with a size of 200 MiB or more.
# - Create a partition which will later contain the encrypted container.
cfdisk /dev/sda
# $ lsblk -f || fdisk -l
#Number Start (sector) End (sector) Size Code Name
# 1 2048 1050623 512.0 MiB EF00 EFI System
# 2 5244928 976773133 463.3 GiB 8E00 Linux LVM
#| in case of seeing "dev/sda2 is apparently in use by the system; will not make a filesystem here!"
#| https://superuser.com/questions/668347/installing-arch-linux-unable-to-format-filesystem#comment844950_668347
#| dmsetup ls
#| dmsetup remove VolumeGroup-swap
#| dmsetup remove VolumeGroup-root
#| dmsetup remove VolumeGroup-home
#| or also:
#| cgdisk /dev/nvme0n1
#| $ lsblk
#| NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
#| sda 8:0 0 1.8T 0 disk
#| └─sda1 252:0 0 1.8T 0 crypt
#| hardisk erasure
#| cryptsetup open --type plain -d /dev/urandom /dev/sda sda1
#| dd if=/dev/zero of=/dev/mapper/sda1 status=progress
#| cryptsetup close sda1
# - Create a partition which will later contain the encrypted container.
# - Create the LUKS encrypted container at the "system" partition. Enter the chosen password twice.
cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda2
# - Open the container
cryptsetup open /dev/sda2 cryptlvm
# - Preparing the locical volumes
# create physical volume
pvcreate /dev/mapper/cryptlvm
# - Create the volume group
vgcreate t460pVolGroup /dev/mapper/cryptlvm
# - Create logical volumes on the volume group
lvcreate -L 35G t460pVolGroup -n swap
lvcreate -L 60G t460pVolGropu -n root
lvcreate -l 100%FREE t460pVolGroup -n home
# - Format your filesystems on each logical volume
mkfs.ext4 /dev/t460pVolGroup/root #| mkfs.ext4 /dev/mapper/t460pVolGroup-root
mkfs.ext4 /dev/t460pVolGroup/home #| mkfs.ext4 /dev/mapper/t460pVolGroup-home
mkswap /dev/t460pVolGroup/swap #| mkswap /dev/mapper/t460pVolGroup-swap
# - Mount your filesystems
mount /dev/t460pVolGroup/root /mnt #| mount /dev/mapper/t460pVolGroup-root /mnt
mkdir /mnt/home
mount /dev/t460pVolGroup/home /mnt/home #| mount /dev/mapper/t460pVolGroup-home /mnt
# activate swap
swapon /dev/t460pVolGroup/swap #| swapon /dev/mapper/t460pVolGroup-swap
# - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Preparing_the_boot_partition_2
mkfs.fat -F32 /dev/sda1
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot/
# Install esential packages
# - https://wiki.archlinux.org/index.php/Installation_guide#Install_essential_packages
# =========================
pacstrap /mnt base base-devel linux linux-firmware lvm2 efibootmgr grub-efi-x86_64 mkinitcpio grub nvim networkmanager
# Generate an fstab file
# - https://wiki.archlinux.org/index.php/Installation_guide#Fstab
# ======================
genfstab -pU /mnt >> /mnt/etc/fstab
# Change root into the new system
# - https://wiki.archlinux.org/index.php/Installation_guide#Chroot
# ===============================
arch-chroot /mnt
# Time zone
# - https://wiki.archlinux.org/index.php/Installation_guide#Time_zone
# =========
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
hwclock --systohc
# Localization
# - https://wiki.archlinux.org/index.php/Installation_guide#Localization
# ============
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf
echo "KEYMAP=us" > /etc/vconsole.conf
# Network configuration
# - https://wiki.archlinux.org/index.php/Installation_guide#Network_configuration
# =====================
echo "t460p" > /etc/hostname
# update /etc/hosts:
# 127.0.0.1 localhost
# ::1 localhost
# 127.0.1.1 t460p.localdomain t460p
# # - https://github.com/StevenBlack/hosts
# Initramfs
# - https://wiki.archlinux.org/index.php/Installation_guide#Initramfs
# - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_mkinitcpio_2
# =========
vi /etc/mkinitcpio.conf
# update /etc/mkinitcpio.conf hooks:
# HOOKS=(base udev systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck shutdown)
mkinitcpio -p linux
# Root password
# - https://wiki.archlinux.org/index.php/Installation_guide#Root_password
# =============
passwd
# Boot loader
# - https://wiki.archlinux.org/index.php/Installation_guide#Boot_loader
# - https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_the_boot_loader_2
# ===========
# update /etc/default/grub kernel parameter for bootloader:
# lsblk -f | grep 'sda2' >> /etc/default/grub
# GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/t460pVolGroup/root resume=/dev/t460pVolGroup/swap" ... #| GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/mapper/t460pVolGroup-root resume=/dev/mapper/t460pVolGroup-swap" ...
# GRUB_ENABLE_CRYPTODISK=y
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
# Reboot
# - https://wiki.archlinux.org/index.php/Installation_guide#Reboot
# ======
exit
umount -R /mnt
swapoff -a
reboot
# Post-installation
# - https://wiki.archlinux.org/index.php/Installation_guide#Post-installation
# =================
useradd -m -g users -G wheel rblanco
passwd rblanco
# edit /etc/sudoers:
# rblanco ALL=(ALL) ALL
systemctl enable NetworkManager
systemctl start NetworkManager
#| nmtui
#| ip link set dev enp0s31f6 up
#| dhcpcd enp0s31f6
# https://github.com/romanblanco/dotfiles
@romanblanco
Copy link
Author

romanblanco commented Mar 1, 2020

QT_SCALE_FACTOR=1.1 keepassxc
QT_QPA_PLATFORM=wayland telegram-desktop

• ~/ telegram-desktop

(process:11903): Telegram-WARNING **: 07:26:28.673: Unfortunately, GTK integration conflicts with qgtk2 platformtheme and style. Therefore, QT_QPA_PLATFORMTHEME and QT_STYLE_OVERRIDE will be unset.
Telegram-Message: 07:26:28.675: This can be ignored by setting TDESKTOP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY environment variable to any value, however, if qgtk2 theme or style is used, this will lead to a crash.
Telegram-Message: 07:26:28.675: GTK integration can be disabled by setting TDESKTOP_DISABLE_GTK_INTEGRATION to any value. Keep in mind that this will lead to clipboard issues and tdesktop will be unable to get settings from GTK (such as decoration layout, dark mode & more).

(process:11903): Telegram-WARNING **: 07:26:28.675: Application was built without embedded fonts, this may lead to font issues.
Telegram-Message: 07:26:28.765: You can disable tray icon counter with TDESKTOP_DISABLE_TRAY_COUNTER and make it look better if it is monochrome.
error: : cannot open
error: : cannot open
error: : cannot open
The X11 connection broke (error 2). Did the X11 server die?
Segmentation fault (core dumped)
• ~/ QT_QPA_PLATFORM=wayland telegram-desktop

@romanblanco
Copy link
Author

romanblanco commented Mar 1, 2020

nmcli device wifi connect <uuid> password <password>

stored in /etc/NetworkManager/system-connections/

@romanblanco
Copy link
Author

xorg utils:

xev - print contents of X events
xprop - property displayer for X

@romanblanco
Copy link
Author

checksum of folder:

find ./fotky/ -type f | sort | xargs -d'\n' md5sum | awk '{ print $1; }' | md5sum

@romanblanco
Copy link
Author

In case I ever end up working in Gnome again: gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']"

@romanblanco
Copy link
Author

romanblanco commented Apr 1, 2020

adblock plus:
reddit.com#?#div.promotedlink
reddit.com#?#.size-compact.Post:-abp-has([class*=promoted])

@romanblanco
Copy link
Author

romanblanco commented Apr 4, 2020

https://austingwalters.com/increasing-battery-life-on-an-arch-linux-laptop-thinkpad-t14s/

Con Kolivas kernel

https://wiki.archlinux.org/index.php/Unofficial_user_repositories/Repo-ck

/etc/pacman.conf
------------------------
[repo-ck]
Server = http://repo-ck.com/$arch
pacman-key -r 5EE46C4C && pacman-key --lsign-key 5EE46C4C
pacman -Syu linux-ck linux-ck-headers
sudo systemctl enable cpupower.service
sudo cpupower frequency-set -g powersave
# sudo cpupower frequency-set -g performance
sudo cpupower frequency-info

--> https://www.archlinux.org/packages/extra/x86_64/wireguard-dkms/

@romanblanco
Copy link
Author

When recording GIF on Wayland, it does not deal with monitor being turned 270 degrees and the video is rotated:

ffmpeg -i input.mp4 -vf "transpose=clock" output.mp4

https://ostechnix.com/how-to-rotate-videos-using-ffmpeg-from-commandline/

@romanblanco
Copy link
Author

Copying block in tmux with no mouse:

CTRL-b [
CTRL-v  // navigate to start
Space
// select area
Enter

@romanblanco
Copy link
Author

[...]
:: File /var/cache/pacman/pkg/libpsl-0.16.1-1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

solve by

sudo pacman -S archlinux-keyring

https://ostechnix.com/fix-invalid-corrupted-package-pgp-signature-error-arch-linux/

@romanblanco
Copy link
Author

==> WARNING: Hook 'sd-lvm2' is deprecated. Replace it with 'lvm2' in your config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment