Tips and Tricks for FreeBSD.
-
Set
- timezone:
cp /usr/share/zoneinfo/EST5EDT /etc/localtime
- Shell:
bash
:chsh -s /usr/local/bin/bash
- timezone:
-
Errors
GDBus.Error:org.freedesktop.Consolekit.Manager.GeneralError: Unable to lookup session information for process
ck-launch-session dbus-launch --exit-with-session startlxde
-
pkg install bash-completion
. /usr/local/share/bash-completion/bash_completion.sh
-
- Ensure
lock.d
enabled:/etc/rc.conf
:rpc_lockd_enable="YES"
- Ensure
-
- Client
/etc/rc.conf
nisdomainname="[domain name]"
nis_client_enable="YES"
nis_client_flags="-S [nis server]"
/etc/master.passwd
:+:::::::::
/etc/group
:+:*::
- Client
-
Single User Mode:
mount -o rw /
- ZFS:
mount -u / ; mount -a -t zfs
-
top -oswap -w
-
/etc/ttys
:ttyv8 "/usr/local/bin/xdm -nodaemon" xterm on secure
-
Packages
- List contents:
pkg info -l [package]
. Example:pkg info -l tigervnc-server
- List contents:
-
Print ip address:
ifconfig
-
Enable a service:
sysrc [enable var]=YES
. Example:sysrc grafana_enable=YES
. -
- Examples:
- gpt/freebsd-ufs:
gpart destroy -F /dev/da0
gpart create -s gpt /dev/da0
gpart add -t freebsd-ufs /dev/da0
newfs /dev/da0p1
- mbr/fat32
gpart destroy -F /dev/da0
gpart create -s mbr /dev/da0
gpart add -t fat32 /dev/da0
newfs_msdos -L FILES -F 32 /dev/da0s1
- gpt/freebsd-ufs:
- Examples:
-
Run Linux Browsers (for example Vivaldi).
git clone https://github.com/mrclksr/linux-browser-installer.git
cd linux-browser-installer
./linux-browser-installer install vivaldi
freebsd-update fetch
freebsd-update install
pkg update
pkg upgrade
Some base apps:
pkg install -y openjdk8 openjdk11 openjdk17 htop vim rsync terminator bash bash-completion libreoffice postfix git firefox chromium virt-manager
Some desktops:
pkg install -y xorg sddm fvwm lxde-meta lxqt kde5
/boot/loader.conf
:vfs.root.mountfrom="cd9660:/dev/cd0"
/etc/installerconfig
:
PARTITIONS="vtbd0"
DISTRIBUTIONS="kernel.txz base.txz"
#!/bin/sh
# Set up Networking
#hostname vanilla-vm
env > /var/log/sfloess.env
#echo 'hostname="vanilla-vm"' >> /etc/rc.conf
echo 'ifconfig_vtnet0="DHCP"' >> /etc/rc.conf
echo 'sshd_enable=YES' >> /etc/rc.conf
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
# Set Time Zone
/bin/cp /usr/share/zoneinfo/EST5EDT /etc/localtime
/usr/bin/touch /etc/wall_cmos_clock
/sbin/adjkerntz -a
/usr/sbin/ntpdate -u ntp.flossware.com
#Set Default Root Password
# 1. echo into -h 0
# 2. echo into -H 0
# Use one or the other. Ex:
echo cobbler | pw usermod root -h 0
poweroff
/usr/local/etc/rc.d/activemq
:
#!/bin/sh
#
# PROVIDE: activemq
# REQUIRE: DAEMON
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable activemq:
# activemq_enable="YES"
# activemq_flags="<set as needed>"
. /etc/rc.subr
name="activemq"
rcvar=activemq_enable
export JAVACMD=/usr/local/openjdk14/bin/java
export JAVA_HOME=/usr/local/openjdk14
client="/usr/local/opt/apache-activemq/bin/activemq"
load_rc_config ${name}
activemq_enable=${activemq_enable-"NO"}
pidfile=${activemq_pidfile-"/usr/local/opt/apache-activemq/data/activemq.pid"}
start_cmd="${client} start"
stop_cmd="${client} stop"
reload_cmd="${client} reload"
status_cmd="${client} status"
run_rc_command "$1"
/usr/local/etc/rc.d/nexus
:
#!/bin/sh
#
# PROVIDE: nexus
# REQUIRE: DAEMON
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable activemq:
# nexus_enable="YES"
# nexus_flags="<set as needed>"
. /etc/rc.subr
name="nexus"
rcvar=nexus_enable
export JAVACMD=/usr/local/openjdk8/bin/java
export JAVA_HOME=/usr/local/openjdk8
client="/usr/local/nexus/bin/nexus"
load_rc_config ${name}
nexus_enable=${nexus_enable-"NO"}
#pidfile=${nexus_pidfile-"/usr/local/opt/apache-activemq/data/activemq.pid"}
start_cmd="${client} start"
stop_cmd="${client} stop"
reload_cmd="${client} reload"
status_cmd="${client} status"
run_rc_command "$1"
Creds upon install: freebsd/freebsd
or root/root