Q: How to add/setup X windows
A: 1. # pkg install xorg
2. Then vim .xinitrc
and add a window manager to start, i.e. exec wmaker
Q: How to change the keyboard map
A: kbdmap
Q: What's the un/pw for root and the default account in FreeBSD on arm (Raspberry Pi)?
A: root/root, freebsd/freebsd
Q: How to set the date + time
A: # date 2208062151.30
will set the date + time to 2022, 06 August, 21:51:30
Q: How to remove a user
A: # rmuser
Q: How to copy an entire dir into another dir?
A: cp -iprv /path/of/source_dir /path/of/destination_dir
(no / at the end!)
Note: -i = interactive, -p = preserve file attributes, -r = recursive: will copy subdirs
Q: How to change the hostname
A: # vim /etc/rc.conf
Q: When runnning startx
: "Cannot run in framebuffer mode. Please specify BUS IDs" (this is for Intel graphics)
1. # pkg install drm-kmod
2. sysrc -f /etc/rc.conf kld_list+=i915kms
3. Make sure user is part of video group! (see above)
4. Reboot
Q: How to setup a cron job
A:
1. crontab -e
2. Make sure sh
or bash
's path is correct
3. Put this in the file:
# order of crontab fields
# minute hour mday month wday command (Use tabs between words)
30 03 * * * /home/user/Scripts/script.sh /home/user/log/log.txt
This will run script.sh in /home/user/Scripts, everyday at 03:30, and then write what it did to log.txt in /home/user/log
Note: Make sure you have the necessary permissions for all folders!
Q: How to add Japanese support (display fonts)
A: # pkg install japanese/font-ipa japanese/font-ipa-uigothic japanese/font-ipaex japanese/font-kochi japanese/font-migmix japanese/font-migu japanese/font-mona-ipa japanese/font-motoya-al japanese/font-mplus-ipa japanese/font-sazanami japanese/font-shinonome japanese/font-takao japanese/font-ume japanese/font-vlgothic x11-fonts/hanazono-fonts-ttf japanese/font-mikachan x11-fonts/anonymous-pro x11-fonts/artwiz-aleczapka x11-fonts/dejavu x11-fonts/inconsolata-ttf x11-fonts/terminus-font x11-fonts/cantarell-fonts x11-fonts/droid-fonts-ttf x11-fonts/doulos x11-fonts/ubuntu-font x11-fonts/isabella x11-fonts/junicode x11-fonts/khmeros x11-fonts/padauk x11-fonts/stix-fonts x11-fonts/charis x11-fonts/urwfonts-ttf x11-fonts/geminifonts x11-fonts/cyr-rfx x11-fonts/paratype x11-fonts/gentium-plus
(Got that from here: From https://cooltrainer.org/a-freebsd-desktop-howto/#install-fonts, with some modifications for packages now missing)
Q: How do I get rid of the error hdac0: Command 0x20270600 timeout on address 2 when exiting X?
A: add
compat.linuxkpi.i915_disable_power_well="0"
to
/boot/loader.conf
Q: How to sync time:
A:
1. # bsdconfig
2. Make sure enable ntpd_enable is set to Yes
3. Make sure enable ntpdate_enable is set to Yes
(Not sure which one it is)
4. Edit /etc/ntp.conf
Comment out:
pool 0.freebsd.pool.ntp.org
pool 1.freebsd.pool.ntp.org
And add ones local to your timezone. Go to https://www.ntppool.org/en/ and find some near you.
Q: How to check the battery level on a laptop
A: apm
or
acpiconf -i 0
Q: How to setup doas:
A:
1. # pkg install doas
2. Create doas.conf in /usr/local/etc
3. Add permit nopass keepenv :wheel
! Make sure your user is in the wheel group !