Monday, November 20, 2023

Final Tweaks

  •  In System Settings app:
    • Uncheck Suspend Session in Power Management, Energy Savings (I've had back luck with corrupted suspends that cause boot failure)
    •  Turn on numlock in Input Devices, Keyboard
    •  Turn on night color in Display and Monitor, Night Color

  • In right-click Display Settings, set up random slide show with preferred wallpapers

  • sudo su and then EDITOR=micro visudo  to get rid of update password timeout
    Defaults passwd_timeout=0 
  • sudo micro  /boot/loader/loader.conf  to set longer time for boot menu
  • Set up Printer.  HP is easy using HPlip.  
Set up Printer:
  • For Brother Laser printer: download linux deb package from Brother
  • yay -S dpkg
  • sudo dpkg -i --force-architecture hll2480dwpdrv-4.1.0-1.i386.deb
    Then set up in KDE add printer; manually point to ppd file at /usr/share/ppd/brother/XXXXX.ppd

    socket://192.168.4.174
  • and https://support.cc.gatech.edu/support-tools/howto/direct-ip-printing-unix 
    • yay -S brother-hll2370dw
    • Set up in KDE System Settings, Printer
      • Select AppSocket/HP JetDirect, input ip address of printer, and manually add ppd file from /opt/brother/Printers/HLL2370DW/cupswrapper/brother-HLL2370DW-cups-en.ppd
crontab:
yay -S cronie
sudo systemctl enable cronie.service && sudo systemctl start cronie.service

paccache cleaner:
yay -S pacman-contrib
sudo systemctl enable paccache.timer && sudo systemctl start paccache.timer

In cachyos-hello:  check Ananicy Cpp enabled, Bpftune enabled and Sysemd-oomd enabled

# For zen kernel 
sudo pacman -S linux-zen linux-zen-headers

copy linux.conf entry in /boot/loader/entries to linux-zen.conf and edit accordingly

sudo mkinitcpio -P

# For firewall (laptop)
yay -S firewalld ipset ebtables
sudo systemctl enable --now firewalld
sudo firewall-cmd --add-service libvirt --zone=libvirt --permanent
for config: firewall-config

Install Windows 11 on Virt-Manager

 Virt-Manager will have been installed in base install.  But to enable it (make sure SVM, or whatever virtualization is called in your BIOS is enabled).

From https://computingforgeeks.com/install-kvm-qemu-virt-manager-arch-manjar/

sudo pacman -S qemu-full virt-manager virt-viewer dnsmasq vde2 bridge-utils openbsd-netcat dmidecode iptables libguestfs edk2-ovmf swtpm

Then enable and start libritd.service

sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service

sudo micro /etc/libvirt/libvirtd.conf

Set the UNIX domain socket group ownership to libvirt, (around line 85)

unix_sock_group = "libvirt"

Set the UNIX socket permissions for the R/W socket (around line 102)

unix_sock_rw_perms = "0770"

Add your user account to libvirt group. 

sudo usermod -a -G libvirt $(whoami)

newgrp libvirt

Restart libvirt daemon.

sudo systemctl restart libvirtd.service

Section below is quoted directly from https://linustechtips.com/topic/1379063-windows-11-in-virt-manager/

Prerequisites:

Before starting, you need the following:

  • Windows 11 .iso from Microsoft [link]
  • OVMF - you need this for UEFI/secureboot. I used edk2-ovmf from the arch official repos.
  • SWTPM - you need this for TPM emulation. Again, i used swtpm from the arch repos.
  • qemu & virt-manager - if you don't already have these installed, they'll be in your distro's repo, more than likely.
  • virtio - once you have your VM set up, mount the latest image from here to install virtio drivers for things like networking [link]

Getting started:

In Virtual Machine Manager, create a new VM from the top-left corner.

For step 1, choose local install media.

For step 2, pick your Windows 11 iso. if it's not in the drop-down, choose it by clicking "Browse... > Browse local". It'll auto-detect the OS as Windows 10, this is fine.

For step 3, set your memory and CPU cores. the default (4gb & 2 cores) are the minimum for W11, so I set my RAM to 8gb, but you can always change these values later.

For step 4, make a virtual disk image. The minimum drive size for Windows 11 is 64gb, so it needs to be at least that big.

For step 5, choose your VM name, and then tick off Customize configuration before install.

Final setup:

RECENTLY I HAVEN'T DONE THIS (JUST LEAVE UEFI): In the overview section, set Firmware to UEFI x86_64: /....../OVMF_CODE.secboot.fd. It has to be secure boot, otherwise Windows 11 won't install. While I was looking into this, I saw some things saying OVMF_CODE.ms.fd instead, if your list has that, that should work as well.

image.png.b7594cea636a33080822ac120445ebfe.png

In boot options, tick off your virtual CD-ROM drive, and then set that as the highest boot priority:

image.png.bffb43d1cbd3d08b155e11186de4fe3d.png -> image.png.b170a4e96c4aba2b62d414defe07627d.png

 

Change video to Virtio

Finally, add a virtual TPM module. the defaults (CRB, Emulated, 2.0) should be fine. 

 

You shouldn't have to manually start the virtual network service, but if you do it's  sudo virsh net-autostart default


if no internet:

sudo systemctl start iptables.service
sudo systemctl enable iptables.service
sudo systemctl restart libvirtd.service

sudo nano /etc/libvirt/network.conf

write the following:
firewall_backend = "iptables"

https://bbs.archlinux.org/viewtopic.php?id=296590

Create update script

 Create u.sh in your ~/Downloads directory

#!/bin/bash
yay
cd ~/Downloads/Stockfish
echo "Stockfish"
git pull
cd ~/Downloads/scid-code
echo "scid"
git pull
cd ~/Downloads/lc0
echo "lc0-ergodice"
git pull
cd ~/Downloads/nibbler
echo "nibbler"
git pull
cd ..
view raw u.sh hosted with ❤ by GitHub

Price updates in Kmymoney

 To enable price updates in Kmymoney (Settings, Configure Kmymoney), create a Online Quote source called Yahoo.


 Text insertions are:

https://query1.finance.yahoo.com/v8/finance/chart/%1

%1

"regularMarketPrice":((\d+|\d{1,3}(?:[,]\d{3})).\d+)

"regularMarketTime":([\d]+)


Nothing in the Date Format field and Skip HTML stripping is checked

 

 

Setup OneDrive, Google Drive & Dropbox

OneDrive: Install via: pamac build onedrive-abraunegg from the Arch Linux User Repository (AUR)

Note: If asked regarding a provider for 'd-runtime' and 'd-compiler', select 'liblphobos' and 'ldc'

type onedrive and follow instructions to authenticate.   Then onedrive --force --skip-dot-files --skip-dir venv --synchronize

 

Google Drive

I use Insync  which is intalled via my base install blogpost.  Open and authenticate and sync.


Dropbox

Dropbox is installed via my base install.  Open and authenticate.

but need 

yay -S gnome-browser-connector

yay -S libappindicator-gtk3

Set up Konsole to use Fish and prettify

 In Konsole, go to Settings, Configure Konsole, Profiles and create new profile and make it the default:

Restart Konsole.  micro ~/.config/fish/config.fish and add fastfetch to the last row.

In Konsole: fisher install IlanCosman/tide@v6 and go through the set-up steps. 

 

 alias --save ld="eza --long  --all --sort modified --total-size"

 alias --save lt="eza --long --all --tree --level=2 --sort modified --total-size"


Edit profile and get new themes (I like Otto); set font to meslo nerd fonts


Set up Stockfish, lc0 (Ergodice), Nibbler, Scid

 Download and unzip makeFish.sh and makeScid.sh into ~/Downloads.  Make them executable with chmod +x ./makeFish.sh etc. Then run the following script.

#!/bin/bash
cd ~/Downloads
git clone --recurse-submodules https://github.com/official-stockfish/Stockfish.git
./makeSF.sh
git clone --recurse-submodules https://github.com/rooklift/nibbler.git
sudo npm install -g electron #you can run Nibbler from ~/Downloads/nibbler/file/src using electron .
git clone --recurse-submodules https://git.code.sf.net/p/scid/code scid-code
./makeScid.sh
git clone --recurse-submodules https://github.com/Ergodice/lc0.git
# see https://github.com/Ergodice/lc0 for config file and cutlass instructions
view raw sfLc0Nibbler.sh hosted with ❤ by GitHub

Copy your xxxxx.desktop launch files to ~/.local/share/applications/
and then run 'update-desktop-database'


If you want cron:
yay -S cronie

systemctl enable cronie.service
systemctl start cronie.service

Base Install

This blog is for my notes on setting up Arch from scratch to my liking. I use KDE Plasma as my desktop and my computers have a NVIDIA GPU (my Asus laptop also has an additional integrated GPU). I am not going to cover downloading the ISO, putting it on a USB, booting from the USB or running the Archinstall installer (selecting the Plasma desktop).

Get WIFI running
iwctl
station wlan0 connect xxxxxxx

May need: sudo mkfs -t ext4 /dev/nvme1n1 if you have btrfs on old installation

When running the arch installer:

1. Don't have a /home partition added! 
2. Don't forget desktop!
3. Install both linux and linux-zen kernels
4. Add additional packages:  wget git micro duf base-devel kde-applications

to log in the first time it may be helpful to create /usr/lib/modprobe.d/nvidia.conf with "options nvidia_drm modeset=1 fbdev=1"   (although cachyos-settings will overwrite later)

Apparmor 

  1. Add the following kernel parameters to your Boot Manager, see Boot Manager Configuration for reference

    lsm=landlock,lockdown,yama,integrity,apparmor,bpf
  2. Install apparmor and apparmord (Set of over +1500 profiles) packages

    Terminal window
    sudo pacman -S apparmor apparmor.d-git
  3. Enable/Start AppArmor service

    Terminal window
    systemctl enable --now apparmor.service
  4. Enable caching for AppArmor profiles

    /etc/apparmor/parser.conf
    ## Add the following lines:
    write-cache
    Optimize=compress-fast

    Save the file and reboot.

Example (/boot/limine.conf):

/boot/limine.conf
timeout: 5
default_entry: 2 # Points directly to the 'linux-cachyos' entry below
/+CachyOS # Entry 1: A directory (use /+ to expand by default)
//linux-cachyos # Entry 2: The actual bootable entry
protocol: linux
kernel_path: boot():/vmlinuz-linux-cachyos
cmdline: quiet splash root=UUID=... rw # Basic kernel parameters
module_path: boot():/initramfs-linux-cachyos.img

put apparmor kernel options after splash in cmdline:

Also:
Edit the configuration file: Modify the KERNEL_CMDLINE variables in /etc/default/limine. You can set default parameters for all kernels or specific parameters for certain kernel names (e.g., linux-cachyos).
/etc/default/limine
# Default parameters for most kernels
KERNEL_CMDLINE[default]="quiet splash rd.udev.log_priority=3"
# Specific parameters for the 'linux-cachyos' kernel
KERNEL_CMDLINE["linux-cachyos"]="quiet splash mitigations=off"
# Parameters for fallback entries (if generated)
# KERNEL_CMDLINE[fallback]="..."

Installing yay

sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Snapper support:

  1. Create the file /etc/default/limine if it doesn’t already exist.
  2. Make sure to manually set ESP_PATH=/boot in this file.
  3. Try sudo limine-snapper-sync in a terminal, does it work?
  4. If works, enable the service systemctl enable --now limine-snapper-sync.service

yay -Syu btrfs-assistant 

Probably reboot and then run Btrfs-assistant

Gnome fractional scaling  
set org.gnome.mutter experimental-features '["scale-monitor-framebuffer"]' https://wiki.archlinux.org/title/HiDPI#Wayland

Warp terminal

download zst from preview site and do a sudo pacman U ./xxxx.zst file

Install cachyos mirrors

wget https://mirror.cachyos.org/cachyos-repo.tar.xz
tar xvf cachyos-repo.tar.xz && cd cachyos-repo
sudo ./cachyos-repo.sh

You will want to run Cachy's
sudo chwd -a 
to auto detect hardware

Install All Packages (from prior installs)

Using a previously created package list from prior installs (pacman -Qqet > pkglist.txt), type yay -S --needed --noconfirm  - < YOURPKGLIST.txt with the downloaded package list below.  Current list: https://gist.github.com/whelanh/28f620a1f0890d73f2be251344658f9a

Check if Nvidia really installed

sudo cat /sys/module/nvidia_drm/parameters/modeset
 
systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service

Install Cachyos kernel

yay -S systemd-boot-manager
yay -S cachyos-sysctl-manager
sudo sdboot-manage
Usage: /usr/bin/sdboot-manage [OPTIONS]... [ACTION]

Actions:
  gen     Generates entries for systemd-boot based on installed kernels
  remove  Removes orphaned systemd-boot entries
  setup   Installs systemd-boot and generate initial entries
  update  Updates systemd-boot

sudo pacman -S linux-cachyos linux-cachyos-headers
reboot
if you use systemd-boot-manager (in the Cachyos Repos....not AUR), it will create the boot entries for you
 



RTL-SDR On Opensuse Tumbleweed

Notes on setting up RTL-SDR V4 in Opensuse Tumbleweed: opi sdrpp sudo zypper in rtl-sdr sudo usermod -a -G rtlsdr $(whoami)  #then logout an...