FreeBSD Day to Day Engineering Notes

Adjusting browser-chrome on Firefox + LibreWolf

navigate to: about:config
key: layout.css.devPixelsPerPx
value: 0.65

Removing a file by inode index value

╰─»» eza -ali
 362718 .rw-r--r--  23k user  7 Jun 11:13 -sv      <<---- illegal dash char
 925253 drwxr-xr-x    - user  26 Mar 11:53 .foo


 ╰─»» find . -inum 362718 -exec ls -al {} \;
-rw-r--r--  1 root eva 23208 Jun  7 11:13 ./-sv


╰─»» find . -inum 362718 -exec rm -v {} \;
./-sv


╰─»» find . -inum 362718 -exec ls -al {} \;
 (no results)

Virtualization Minimal Setup

Install Packages

Minimally, we need the Bhyve packages. Optionally, qemu and libvirt related packages.

sudo pkg inst qemu-tools qemu edk2-qemu-x64 aqemu
sudo pkg inst bhyve+ bhyve-firmware bhyve-rc-4 edk2-bhyve grub2-bhyve sysutils/vm-bhyve
sudo pkg inst libvirt libvirt-dbus

Encrypting a usb-key with GELI+UFS2

Remove all partitions on the USB device

gpart destroy -F da2

Create 4K block size GELI device with Passphrase

geli init -s 4096 /dev/da2
<enter passphrase on prompt>

geli attach /dev/da2
<enter passphrase on prompt>

Create mount dir and wipe the GELI device

mkdir /mnt/usb64
dd if=/dev/random of=/dev/da2.eli bs=1M conv=sync status=progress

Load gJournal and create + label the GELI device

gjournal load
sysrc -f /boot/loader.conf geom_journal_load="YES"
gjournal label /dev/da2.eli

Create GPT part-map and UFS2 partition on gJournal device

gpart create -s gpt da2.eli.journal
gpart add -t freebsd-ufs -l usb64 da2.eli.journal

Create GPT based UFS2 filesystem with gJournal and volume label

newfs -J -t -L usb64-ufs-gjournal /dev/gpt/usb64

Mount device for use

mount /dev/gpt/usb64 /mnt/usb64

Commands to unmount + detach GELI when finished

umount /mnt/usb64
geli detach da2.eli

Bootstrap stuff

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
service sshd restart

pkg inst -y security/sudo devel/git sysutils/tmux editors/vim editors/micro net/chrony lang/python lang/python3 devel/py-jmespath

echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /usr/local/etc/sudoers.d/sudo-wheel

pw groupadd eva -g 1024
pw useradd eva -u 1024 -g eva -m
pw groupmod -n wheel,video -m eva
sudo -H -u eva ssh-keygen -t ed25519 -C "eva@${HOSTNAME}" -N "" -f /home/eva/.ssh/id_ed25519
sudo -H -u eva echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICGaGcRcmW6vcZqb3lqUHxoHdc5kLf3PKV3RdtBeZdYn eva@null.ed25519" > /home/eva/.ssh/authorized_keys
chown -R eva: /home/verwalterin/.ssh

pw groupadd verwalterin -g 4096
pw useradd verwalterin -u 4096 -g verwalterin -m
pw groupmod -n wheel -m verwalterin
sudo -H -u verwalterin ssh-keygen -t ed25519 -C "verwalterin@${HOSTNAME}" -N "" -f /home/verwalterin/.ssh/id_ed25519
sudo -H -u verwalterin echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFlf1YB1YPxRwtPKDGx+XyktPG+VQGh+cZPLD0nGZ/ei verwalterin@rfc1918.cloud" > /home/verwalterin/.ssh/authorized_keys
chown -R verwalterin: /home/verwalterin/.ssh

Root stuff

ssh-keygen -t ed25519 -C "root@${HOSTNAME}" -N "" -f /root/.ssh/id_ed25519

echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFlf1YB1YPxRwtPKDGx+XyktPG+VQGh+cZPLD0nGZ/ei verwalterin@rfc1918.cloud" >  /root/.ssh/authorized_keys

Adhoc packages needed

nvme
usb stuff
lsblk
pkg inst -y shells/ksh93 textproc/groff x11/xdm x11-drivers/xf86-video-mga x11-drivers/xf86-video-vesa

x11-fonts/liberation-fonts-ttf
x11-fonts/fira x11-fonts/droid-fonts-ttf
x11-fonts/webfonts
x11/xorg

sysrc rpcbind_enable=yes
sysrc dtcms_enable=yes
sysrc inetd_enable=yes
service rpcbind start
service dtcms start

cat<<EOF>> /etc/inetd.conf
dtspc   stream  tcp     nowait  root     /usr/local/dt/bin/dtspcd       /usr/local/dt/bin/dtspcd
EOF

echo "dtspc           6112/tcp # CDE Subprocess Control Service" >> /etc/services
echo "allowed_users=anybody" > /usr/local/etc/X11/Xwrapper.config

Thunar File Manager in KDE or XFCE

pkg inst thunar
chmod 444 /dev/devstat
mkdir .config/tumbler
mkdir ~/.local/share/thumbnailers
cp /usr/local/etc/xdg/tumbler/tumbler.rc ~/.config/tumbler/
cp /usr/local/share/thumbnailers/* ~/.local/share/thumbnailers/

Firefox UI/UX Chrome-Scale-Corrections

about:config
  browser.compactmode.show [set true]
  layout.css.devPixelsPerPx [set float]
posted revised
October 7, 2024 11:22:15 October 7, 2024 11:34:31