====== Information ======
* FreeBSD ((https://www.freebsd.org/))
* 14.2-RELEASE (([[https://www.freebsd.org/releases/14.2R/relnotes/|relnotes]], [[https://www.freebsd.org/releases/14.2R/announce/|announce]]))
* Xfce ((https://www.xfce.org/))
====== TODOs ======
* [[bsd;notes;freebsd]]
* Joystick [[bsd;notes;joystick#devdconf|devd.conf]]
* PC speaker beep at log-in ([[https://forums.freebsd.org/threads/how-to-have-pc-speaker-beep-when-log-in-is-ready.94934/|thread]])
* Solo U2F key and Firefox ([[https://forums.freebsd.org/threads/solo-key-u2f-fido2-in-firefox.95203/|thread]])
* ZFS repair notes/commands
* Wargus with GOG files (works; wine gog install, :?: no xpac 2nd extract), and UT99 with ChaosUT
* 720p 1080p desktop res change desktop launchers
* Wine ''wine.bin'' kill desktop launcher
* Xfce Sticky Keys notification ([[https://forums.freebsd.org/threads/disable-random-notification-about-sticky-keys.94929/|thread]])
* Android ''adb'' ([[https://forums.freebsd.org/threads/adb-android-tools.93731/#post-670844|post]])
* Spinesnap = Dell Latitude 5591 laptop ((Intel UHD 630, no TB, no dGPU))
* Android file transfers with MTP
* Keybase GUI (''keybase'' pkg)
====== Download ======
* https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.2/
FreeBSD-14.2-RELEASE-amd64-memstick.img
====== Installation Notes ======
===== Partitioning =====
* https://docs.freebsd.org/en/books/handbook/bsdinstall/#bsdinstall-partitioning
* ZFS
* ''stripe'' (1 NVMe)
* :!: Not forced 4K Sectors ((''PM9A1'' only supports 512e))
* GPT (BIOS+UEFI)
===== System Configuration =====
* [x] ''local_unbound''
* Everything else unchecked
===== System Hardening =====
* [x] ''clear_tmp''
* [x] ''disable_syslogd''
===== User =====
* Invite to other groups: ''wheel''
* Shell: ''sh''
===== Network =====
* DHCP or Static on Ethernet (''em0'')
* DHCP on USB Tether (''ue0'')
====== Network ======
===== USB Tethering =====
* https://forums.freebsd.org/threads/usb-tethering-detected-and-up-but-no-internet.88441/
* :?: Might apply to any type of USB network device that shows up under ''ue#''
su -
sysrc ifconfig_ue0=SYNCDHCP
/etc/netstart
====== Time Sync ======
su -
ntpd -g -q
====== Update ======
===== FreeBSD =====
* https://docs.freebsd.org/en/books/handbook/cutting-edge/#freebsdupdate-security-patches
su -
freebsd-update fetch install
sync && reboot
===== pkg =====
su -
pkg update --force
pkg upgrade
====== Xorg ======
* https://docs.freebsd.org/en/books/handbook/x11/#x-install
* :!: 2024/11/29: ''drm-61-kmod'' failed to boot ([[https://forums.freebsd.org/threads/boot-hangs-after-loading-i915kms.95904/#post-681452|post]])
* TODO: ''gpu-firmware'' seems auto-covered at install; check if it depends on ''drm-kmod''
su -
pkg install xorg 'drm-515-kmod' 'gpu-firmware-intel-kmod-kabylake'
pw groupmod video -m espionage724
sysrc kld_list+=i915kms
====== Xfce ======
* https://docs.freebsd.org/en/books/handbook/desktop/#xfce-environment
su -
pkg install xfce
ee /etc/fstab
# Xfce
proc /proc procfs rw 0 0
sysrc dbus_enable="YES"
echo '. /usr/local/etc/xdg/xfce4/xinitrc' > /home/espionage724/.xinitrc
chown espionage724:espionage724 /home/espionage724/.xinitrc
sync && reboot
===== Login =====
* Username -> Password -> ''startx''
startx
====== Software ======
===== Initial =====
su -
pkg install xdg-user-dirs filezilla firefox
==== XDG Dirs ====
* :!: Done from regular user and not ''su''
exit
xdg-user-dirs-update --force
===== General =====
su -
pkg install evince-lite evolution foliate gbrainy gimp keepassxc libreoffice mate-calc mpv ristretto thunar-archive-plugin transmission-gtk xfce4-screensaver xfce4-screenshooter-plugin xfce4-whiskermenu-plugin android-tools aria2 cups en-freebsd-doc en-hunspell gnome-keyring gstreamer1-plugins-good gstreamer1-plugins-ugly gstreamer1-libav gtk-sharp30 htop icoutils libressl mesa-demos noto unar wget xarchiver xrandr yt-dlp
===== Chicago95 =====
* https://github.com/grassmunk/Chicago95
chicago95
===== Wine =====
* https://docs.freebsd.org/en/books/handbook/wine/#installing-wine-on-freebsd
wine wine-gecko wine-mono winetricks
===== Intel =====
****
libva-intel-driver
===== Games =====
* TODO: Joystick fix for ''neverball''
neverball xonotic
==== DevilutionX ====
* [[games;bsd;devilutionx|DevilutionX]]
devilutionx
==== Doomsday Engine ====
* [[games;bsd;doomsday_engine|Doomsday Engine]]
doomsday fluid-soundfont
==== FlightGear ====
* :!: [[games:bsd:flightgear|FlightGear]]
* [[games;controller_bindings;flightgear_sidewinder_joystick|Sidewinder Precision Pro Joystick Bindings]]
flightgear flightgear-data
===== Tor Browser =====
****
tor-browser
====== Settings ======
===== Groups =====
* ''operator'' to allow general reboot/power-off
su -
pw groupmod 'operator' -m 'espionage724'
===== 32-bit Wine =====
* :!: Done from regular user and not ''su''
exit
'/usr/local/share/wine/pkg32.sh' update --force && '/usr/local/share/wine/pkg32.sh' upgrade
'/usr/local/share/wine/pkg32.sh' install wine mesa-dri gstreamer1-plugins-good gstreamer1-plugins-ugly gstreamer1-libav libressl
===== Xfce =====
==== Appearance ====
* [[https://github.com/grassmunk/Chicago95/blob/master/INSTALL.md#enabling-chicago95|Chicago95]]
* TODO: Replace Greybird config with Chicago95's
* Style -> Greybird
* Icons -> elementary Xfce
* Fonts -> **Enable** anti-aliasing -> Uncheck and re-check for full check-mark
* Fonts -> Rendering -> Hinting: Slight
* Fonts -> Rendering -> Sub-pixel order: None
* Fonts -> DPI -> Uncheck ''Custom DPI setting''
008080
==== Panel 1 ====
* Items -> Add -> Whisker Menu (move to beginning of Items and remove Applications Menu)
* Items -> Status Tray Plugin -> Fixed icon size (pixels): ''16''
=== Whisker Menu ===
* General -> [x] ''Show generic application names''
* General -> Uncheck ''Show application descriptions''
* General -> Menu width: ''425''
* General -> Menu height: ''525''
* General -> Background opacity: ''100''
* Appearance -> [x] Position search entry on bottom
* Appearance -> [x] Position commands next to search entry
* Appearance -> Profile: Hidden
* Appearance -> Display: Icon and title
* Appearance -> Display: ''Start''
* Commands -> [x] Settings Manager, Lock Screen, Log Out, Restart, Shut Down (uncheck rest)
=== Window Buttons ===
* Appearance -> Uncheck ''Show flat buttons''
* Appearance -> Uncheck ''Show handle''
* Appearance -> Sort order: ''None, allow drag-and-drop''
* Behaviour -> Uncheck ''Group windows by application''
* Behaviour -> Uncheck ''Switch windows using the mouse wheel''
=== Clock ===
* Custom Formats for Date, and Time
%a, %b %d
%l:%M %P
==== Power Manager ====
* Display -> ''Blank after'' and ''Put to sleep after'': Never
* Display -> Switch off after: 5 minutes
==== Terminal ====
* General -> Scrollback: ''10000''
* Appearance -> [x] Use system font
* Appearance -> Background -> Transparent Background ''0.80''
==== Window Manager ====
* Style -> Theme -> Greybird-dark ((Greybird themes makes window borders tiny for mouse grab; Alt + Right-click hold-and-drag works nicely, [[https://forum.xfce.org/viewtopic.php?id=10432|thread]]))
==== Window Manager Tweaks ====
* :!: Compositor -> Uncheck ''Enable display compositing'' with [[bsd:notes:xorg.conf_snippets#intel|Intel DDX driver]] ((window dragging is notably laggy with compositor enabled))
* Compositor -> Uncheck ''Show shadows under popup windows''
* Compositor -> Uncheck ''Show shadows under dock windows''
* Compositor -> Uncheck ''Zoom desktop with mouse wheel''
* Compositor -> Opacity of window during move: 10 notches from right/Opaque
==== Xfce Screensaver ====
* Screensaver -> Floating Xfce
* Screensaver -> Regard the computer as idle after: ''1'' minutes
* Lock Screen -> Lock the screen after the screensaver is active for: ''4'' minutes
* Lock Screen -> Disable Session Status Messages
* Lock Screen -> Disable User Switching
===== Keyboard =====
==== Behavior ====
* Repeat delay: ''400''
* Repeat speed: ''30''
==== Shortcuts ====
bash -c "secret-tool lookup 'keepass' 'default' | keepassxc --pw-stdin ~/'Documents/keepass.kdbx'"
xfce4-terminal --title='FreeBSD Updater' --command "su - 'root' -c 'freebsd-update fetch install && pkg update --force && pkg upgrade && sync && echo 'Done' && sleep '3''"
xfce4-popup-whiskermenu
* Vol Up
mixer 'vol'='+5%' >> /dev/null 2>&1
* Vol Down
mixer 'vol'='-5%' >> /dev/null 2>&1
* Vol Mute
mixer 'vol'='mute=toggle' >> /dev/null 2>&1
=== Keys ===
* Listed respectively to above
* Ctrl + Alt + Z
* F6
* Super/Windows Key
* ''mixer'' commands bound to ''AudioRaiseVolume'', ''AudioLowerVolume'', and ''Audio Mute'' ((when set from a USB keyboard, requires ''hw.usb.usbhid.enable=1''))
===== loader.conf =====
==== Spinesnap ====
su -
ee '/boot/loader.conf'
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
zfs_load="YES"
autoboot_delay="2"
hw.usb.no_boot_wait="1"
hw.usb.usbhid.enable="1"
hw.i915kms.modeset="1"
hw.i915kms.fastboot="0"
hw.i915kms.disable_power_well="0"
hw.i915kms.enable_dc="0"
hw.i915kms.enable_fbc="0"
hw.i915kms.enable_psr="0"
hw.i915kms.enable_psr2_sel_fetch="0"
hw.i915kms.panel_use_ssc="0"
hw.i915kms.nuclear_pageflip="1"
hw.i915kms.enable_hangcheck="0"
hw.i915kms.reset="0"
==== Unused ====
hw.acpi.osname="Windows 2017"
exec="gop set 0"
==== Boot Commands ====
* TODO: Under misc
boot
gop list
===== rc.conf =====
==== Spinesnap ====
su -
ee '/etc/rc.conf'
clear_tmp_enable="YES"
syslogd_flags="-ss"
hostname="Spinesnap"
ifconfig_em0="inet 192.168.1.150 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
ifconfig_em0_ipv6="inet6 accept_rtadv"
local_unbound_enable="YES"
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
zfs_enable="YES"
kld_list="i915kms"
dbus_enable="YES"
cupsd_enable="YES"
===== sysctl.conf =====
==== Spinesnap ====
* https://docs.freebsd.org/en/books/handbook/config/#hwpstate_intel
* TODO: Device hint or devd.conf to change the epp state on AC/BAT states?
su -
ee '/etc/sysctl.conf'
dev.hwpstate_intel.0.epp=0
===== device.hints =====
==== Spinesnap ====
* https://docs.freebsd.org/en/books/handbook/multimedia/#sound-mixer
* https://forums.freebsd.org/threads/thinkpad-x270-audio-device-hints-for-headphones.74193/
* For built-in speaker and 3.5mm headphone jack auto-switch
* Last tested: 2024/11/29
su -
ee '/boot/device.hints'
hint.hdac.0.cad0.nid20.config="as=1 seq=0"
hint.hdac.0.cad0.nid33.config="as=1 seq=15 device=Headphones"
===== Network =====
==== local-unbound DNS ====
* https://docs.freebsd.org/en/books/handbook/network/#configuring-nameserver
* Already done during install by ''local_unbound''
cat '/etc/rc.conf' | grep 'local_unbound_enable'
cat '/etc/resolv.conf'
su -
ee '/etc/resolv.conf'
nameserver 127.0.0.1
options edns0
===== Printer =====
* https://docs.freebsd.org/en/books/handbook/printing/
==== CUPS ====
* https://docs.freebsd.org/en/articles/cups/
su -
sysrc cupsd_enable="YES"
service 'cupsd' start
==== Printer ====
* http://localhost:631/admin
* Log-in as regular user (not ''root'')
* Internet Printing Protocol (ipp)
* HP
* IPP Everywhere ™
* Output Mode: DeviceGray
* Duplex: DuplexNoTumble ((presumably double-sided printing, flip-on-long-edge))
ipp://192.168.1.164/ipp/print
Kole
===== Game Controllers =====
* :!: See [[bsd;notes;joystick|Joystick]]
===== mpv =====
mkdir -p ~/'.config/mpv' && ee ~/'.config/mpv/mpv.conf'
save-position-on-quit
sub-auto=fuzzy
force-window=yes
profile=gpu-hq
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
video-sync=display-resample
interpolation
tscale=oversample
hwdec=vaapi
hwdec-codecs=all
===== OpenJDK =====
* 2024/11/25: ''openjdk17'' is a dependency for ''libreoffice''
su -
ee '/etc/fstab'
# OpenJDK
fdesc /dev/fd fdescfs rw 0 0
mount | grep 'fdescfs on /dev/fd'
mount | grep 'procfs on /proc'
===== KeePassXC =====
==== Settings ====
* General -> [ ] Load previous databases on startup
* Security -> [x] Use DuckDuckGo service to download website icons
==== Database Password on Keyring ====
* For [[#keyboard_shortcuts|Keyboard Shortcut]]
secret-tool store --label='KeePass' 'keepass' 'default'
===== Secure Shell =====
* TODO
===== Drive Maintenance =====
==== ZFS ====
* TODO [[bsd:notes:zfs_nas_format]]
===== Wine =====
* See [[bsd;notes;wine|Wine]]
===== Xorg =====
* [[bsd;notes;xorg.conf_snippets|xorg.conf Snippets]] (75Hz, ''evdev'')
==== Full RGB HDMI ====
ee ~/'.xinitrc'
xrandr --output 'HDMI-1' --set 'Broadcast RGB' 'Full'
xrandr --output 'HDMI-1' --set 'content type' 'Game'
'.' '/usr/local/etc/xdg/xfce4/xinitrc'
====== Firefox ======
* See [[programs;firefox|Firefox]]
====== Notable Folders and Commands ======
===== Font Cache =====
****
fc-cache -r -v
===== Drive Wipe =====
su -
gpart show
gpart destroy -F 'da1'
dd if='/dev/zero' of='/dev/da1' count='8096'
===== USB Flash Drive =====
su -
camcontrol devlist
dmesg | grep 'ugen'
usbconfig -d '/dev/ugen0.6' power_off
===== User/Group =====
awk -F":" '{print $1}' /etc/passwd
awk -F":" '{print $1}' /etc/group
su -
pw userdel 'x' -r
pw groupdel 'x'
===== pkg =====
* ''x'' is a package name
pkg info -l x
pkg autoremove
===== Erase Command History =====
* Log-out of Xfce (pre-''startx''/tty)
rm -f ~/'.sh_history' & exit
===== Handbook =====
pkg info -l 'en-freebsd-doc'
gio open '/usr/local/share/doc/freebsd/en/books/handbook'
===== CPU Frequency =====
****
su - root -c "sysctl 'dev.cpu.0.freq' 'dev.cpu.1.freq' 'dev.cpu.2.freq' 'dev.cpu.3.freq' 'dev.cpu.4.freq' 'dev.cpu.5.freq' 'dev.cpu.6.freq' 'dev.cpu.7.freq'"
===== Time Sync =====
****
su - root -c 'ntpd -g -q'
===== Network Restart =====
su -
'/etc/netstart'
service 'netif' restart
===== hw-probe =====
* https://bsd-hardware.info/
* https://bsd-hardware.info/?view=howto
* 2024/09/13: [[https://bsd-hardware.info/?probe=99f8e55057|Spinesnap]]
su -
pkg install 'hw-probe'
hw-probe -all -upload
===== Crashdump Clean-up =====
****
rm -fv ~/*'.core'
===== Xfce Settings Reset =====
rm -fv ~/'.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml'
gio open ~/'.config/xfce4/xfconf/xfce-perchannel-xml'
gio open ~/'.config/xfce4/xfconf'
===== Audio Output Switch =====
* https://docs.freebsd.org/en/books/handbook/multimedia/#sound-mixer
* https://man.freebsd.org/cgi/man.cgi?query=mixer
mixer -a
echo ' Headphones ' && mixer -d 'pcm1' -f '/dev/mixer1'
echo ' Onboard ' && mixer -d 'pcm0' -f '/dev/mixer0'
===== GeoClue Test =====
* https://forums.FreeBSD.org/threads/does-geoclue-pose-a-security-issue.95914/
'/usr/local/libexec/geoclue-2.0/demos/where-am-i'
===== Single-user ZFS RW =====
* https://forums.freebsd.org/threads/how-to-rw-in-single-user-mode.86186/#post-578493
zfs readonly=off zroot/ROOT/default
===== Logs =====
newsyslog -v -CC -N
cat '/dev/null' > '/var/log/all.log'
cat '/dev/null' > '/var/log/Xorg.0.log'
gio open '/var/log'
ls -la '/var/log'
==== syslog.conf ====
=== all.log ===
== Enable ==
* Uncomment
su -
ee '/etc/syslog.conf'
#*.* /var/log/all.log
== Permissions ==
su -
touch '/var/log/all.log' && chmod '600' '/var/log/all.log'
== View ==
su -
ee '/var/log/all.log'
===== Other Files/Paths =====
* TODO