====== FreeBSD Tweaks ======
Maybe useful to some...
===== ZeroConf =====
* avahi & multicast dns pkg install -y avahi-app nss_mdns
* enable avahi daemon in ''rc.conf'':
avahi_daemon_enable="YES"
* modify the ''hosts:'' line in ''nsswitch.conf'':
hosts: files dns mdns
===== User Account =====
* by default root shell is csh and user is sh - edit .shrc to get prettier prompt
PS1="`whoami`@\H:\w\$ "
* (IF using slim) to enable x environment after slim login, create ''~/.xinitrc'' for each user:
exec /usr/local/bin/mate-session
===== Git =====
- 'git log' output does not show colorized output
* can see the escape sequence
* so, as user, type git config --global core.pager "ls -r"
===== Network Configuration =====
//**Note** DHCP client is dhclient - simply run ''dhclient '' when booting to console and using something like USB tethering.//
Configure (wireless) network interface (in case was not done during installation)
* FreeBSD has network interface name - based on the driver name (e.g. sis, re)
* to find this, use ''pciconf -lv''
* for normal wired connection (e.g. re0), add to 'rc.conf' ifconfig_re0="DHCP"
* for a wireless connection (e.g. ath0), add in wlan_ath0="wlan0"
ifconfig_wlan0="DHCP"
* for a secured wireless connection (e.g. WPA protected), add in wlan_ath0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP" also, append '/ etc/wpa_supplicant.conf'
network={
ssid="the_ssid"
psk="the_psk"
}
* not sure why but ''wlan0'' was not auto-created?
* from official handbook, do ''ifconfig wlan0 create wlandev ath0''
* to start up and scan, do ''ifconfig wlan0 up scan''
* or just scan, do ''ifconfig wlan0 list scan''
===== Graphics =====
Driver for ASUS E5450 Graphics Card (based on Radeon 5450?)
* install driver pkg install -y xf86-video-ati
* to load on startup, edit ''rc.conf'':kld_list="radeonkms"
For Intel Graphics (Asus H81M-K Motherboard)
* install driver pkg install -y xf86-video-intel
* to load on startup, edit ''rc.conf'':kld_list="i915kms"
* install something? (for kernel?) pkg install -y drm-kmod
* some older ones require ''drm-fake-kmod'' instead
===== Web Server =====
Web Server (Apache)
* find apache package(s) pkg search apache2 | grep -e "^apache2"
* install apache package(s) pkg install -y php56 mod_php56 php56-mbstring php56-mcrypt php56-zlib php56-curl php56-gd php56-json
* to load on startup, edit ''rc.conf'':apache24_enable="YES"
* default document path is ''/usr/local/www/apache24/data/''
Server Script (PHP)
* find php package(s) pkg search php5 | grep -e "^php5"
* install php package(s) pkg install -y apache24
* configure ''/usr/local/ etc/apache24/Includes/php.conf'':
DirectoryIndex index.php index.html
SetHandler application/x-httpd-php
SetHandler application/x-httpd-php-source
* copy template configuration file ''//# cp /usr/local/ etc/php .ini-production /usr/local/ etc/php .ini//''
Data-base (mysql/mariadb)
* install package(s) pkg install mariadb103-server mariadb103-client php56-mysqli
* to load on startup, edit ''rc.conf'':mysql_enable="YES"
* by default, it listens to remote request at port 3306. to check:
# lsof -i4 -i6
# sockstat -4 -6
* to allow local access only, edit ''rc.conf'':mysql_args="--bind-address=127.0.0.1"
* now, to make sure all is okay:
# lsof -i4 -i6 | grep mysql
# netstat -an | grep 3306
# sockstat -4 -6 | grep 3306
===== Label for Partitions/Slices =====
This is nice to have in / etc/ fstab when device assignment may change (e.g. usb drive on different machine may be assigned differently)
For ufs,# tunefs -L
To check if assigned,# ls /dev/ufs
For swap,# glabel label
To check if assigned,# ls /dev/label
Then, / etc/ fstab entry can be like,
/dev/label/
===== Disk Utility ''gpart'' =====
Show partition
# gpart show
Resize partition
# gpart resize -i 3 da0
Not really gpart stuff, but don't forget to grow FS to fit new size
# growfs /dev/da0p3
===== Access to Linux ExtFS =====
At the moment, full R/W access for Ext2, Journal-less for Ext3 and R/O for Ext4.
# kldload ext2fs
# mount -t ext2fs /dev/
===== Creating Disk Layout for Bootable USB =====
{{page>freebsd:freebsd_prep_bootusb&noheader}}