Synchronize date and time

ntpdate -v -b in.pool.ntp.org

Install patches

freebsd-update fetch
freebsd-update install

Update portsnap

portsnap fetch
portsnap extract

Install X11 and configure it

pkg_add -r xorg
Xorg -configure
mv xorg.conf.new /etc/X11/xorg.conf

Start hald and dbus at boot time

echo 'hald_enable="YES"' >> /etc/rc.conf
echo 'dbug_enable="YES"' >> /etc/rc.conf

Reboot and then test X11

startx

Install Slim to replace xdm

pkg_add -r slim

Start Slim at boot time

echo 'slim_enable="YES"' >> /etc/rc.conf

Enable auto login by change the following

default_user    simone
auto_login      no

to

default_user    {username}
auto_login      yes

Install Xfce4

pkg_add -r xfce4

allow user to reboot or shutdown in xfce4

add the following lines into /usr/local/etc/PolicyKit/PolicyKit.conf IN BETWEEN <config> and </config>

<match action="org.freedesktop.hal.power-management.shutdown">
    <return result="yes"/>
</match>
<match action="org.freedesktop.hal.power-management.reboot">
    <return result="yes"/>
</match>

Start xfce4 at boot time

echo "/usr/local/bin/startxfce4" > ~/.xinitrc

Install portmaster

cd /usr/ports/ports-mgmt/portmaster/
make install clean

Install sudo and uncomment wheel group

pkg_add -r sudo
visudo

Install zsh

portmaster shells/zsh
chsh -s /usr/loca/bin/zsh

Add Chinese support

pkg_add -r wqy-fonts

Add the following lines into /etc/X11/xorg.conf

Section "Files"
...
    FontPath    "/usr/local/lib/X11/fonts/wqy"
...
EndSection
...
Section "Module"
...
    Load    "freetype"
...
EndSection

Install Linuxulator

# load the module
kldload linux
# enable the module at boot time
echo 'linux_enable="YES"' >> /etc/rc.conf
# install linuxulator
pkg_add -r linux_base-f10

Linuxulator requires procfs. Add the following line into /etc/fstab

linprocfs    /compat/linux/proc    linprocfs    rw    0    0

Enable sound

echo 'snd_driver_load="YES"' >> /boot/loader.conf

Enable SMART

cp /usr/local/etc/smartd.conf.sample /usr/local/etc/smartd.conf
echo 'smartd_enable="YES"' >> /etc/rc.conf
service smartd start

Install chinese IMP

sudo pkg_add -r zh-ibus-pinyin

Set the env var for IBUS

XIM=ibus
GTK_IM_MODULE=ibus
QT_IM_MODULE=xim
XMODIFIERS=@im=ibus
XIM_PROGRAM="ibus-deamon"
XIM_ARGS="--daemonize --xim"

Browser

pkg_add -r chromium

Java applets in browser

portmaster java/icedtea-web

Adobe flash plugin

pkg_add -r nspluginwrapper
portmaster www/linux-f10-flashplugin11
ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so /usr/local/lib/browser_plugins/
nspluginwrapper -v -a -i

PDF viewer

sudo pkg_add -r epdfview

Image viewer

sudo pkg_add -r ristretto