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<> /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

The new JACK server comes with a DBUS control interface:

$ jack_control help $ jack_control ds oss $ jack_control dp $ jack_control dps rate 48000 $ jack_control dps wordlength 16 $ jack_control dps capture /dev/dsp0 $ jack_control dps playback /dev/dsp0 $ jack_control eps realtime False $ jack_control start

To use real-time priority for JACK server and clients, load the mac_priority(4) module and add the JACK user to the realtime group.

Memory locking has to be allowed in /etc/login.conf or ~/.login_conf. Set the resource limit “:memorylocked=unlimited:” and don’t forget to run

cap_mkdb /etc/login.conf

It’s still possible to start JACK server as an RC service for a dedicated user. Note that only one JACK server can be run at a time. An /etc/rc.conf example:

jackd_enable=”YES” jackd_user=”joe” jackd_args=”–no-realtime -doss -r48000 -p1024 -w16 \ –capture /dev/dsp0 –playback /dev/dsp0”

1) add webcamd_enable=”YES”

to your /etc/rc.conf 2) Please restart devd to start webcamd

    # service devd restart

3) Optionally add a user to the “webcamd” group

    # pw groupmod webcamd -m <username>

cookie.factory@pink.systems

*once Robin validates runbox account yukon.systems

https://github.com/vbotka/ansible-examples

“cat audio-sets.parse.txt | grep -Evi “alignments|splits” | awk ‘{print $1}’ | tr ‘[:upper:]’ ‘[:lower:]’ | sort > lang.fullname.list.txt”

https://mlcommons.org/datasets/multilingual-spoken-words/ https://www.kaggle.com/datasets/mlcommons/the-dollar-street-dataset

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
April 28, 2024 05:45:39 May 25, 2024 17:33:11