# Arch Linux Cheat Sheet ## AUR / Aura / Makepkg Alternative Build Directory: ```zsh export BUILDDIR=/var/cache/makepkg-local sudo --preserve-env=BUILDDIR aura -Axac proton --build $BUILDDIR ``` GPG Keys für AUR müssen im User-GPG eingefügt werden, nicht im Root GPG: ```sh gpg --recv-key B94556F81C85D0D5 ``` ## SSD Trim + DMCrypt https://wiki.archlinux.org/title/Dm-crypt/Specialties#Discard/TRIM_support_for_solid_state_drives\_(SSD) ## Online resize Crypt+LVM Disk ```zsh # Expand the disc in ESXi # Rescan SCSI to see expanded disk echo "1" > /sys/class/block/sdb/device/rescan # Check if everything went well fdisk -l /dev/xyz # if it didn't, you might have to reboot cryptsetup status crypted # Expand the LUKS partition and verify size cryptsetup status crypted cryptsetup resize crypted cryptsetup status crypted # Resize the LVM PV, check pvresize /dev/mapper/crypted pvsdisplay # Now allocate space to the volume lvresize -L+750g /dev/isp/owncloud lvs # And resize the fs resize2fs /dev/mapper/isp-owncloud df -h ``` ### References - https://www.versedaily.net/how-can-i-rescan-hardware-on-linux/ - https://unix.stackexchange.com/questions/320957/extend-a-luks-encrypted-partition-to-fill-disk ## User Management [UNIX / Linux : How to lock or disable an user account](https://www.thegeekdiary.com/unix-linux-how-to-lock-or-disable-an-user-account/) To lock a users account use the command **usermod -L** or **passwd -l**. Both the commands adds an exclamation mark **(“!”)** in the second field of the file **/etc/passwd**. For example : ``` # usermod -L testuser ``` or ``` # passwd -l testuser ``` **Check if the user account is locked.** Check for the flag ***LK*** in the below command output which indicates that the account is locked. ``` # passwd --status root root ***LK*** 2017-07-19 0 45 7 -1 (Password set, SHA512 crypt.) ``` ## Alle AUR Python Pakete reinstallieren (Python Version Update) ```bash aura -A $(pacman -Qqm | xargs -I {} pacman -Ql {} | grep "/usr/lib/python3.12/site-packages" | cut -d'/' -f1) ```