HLab

Julien Hautefeuille

Openbsd notes

nfsen with chrooted httpd

/etc/nfsen.conf

$COMMSOCKET = "/var/www/tmp/nfsen.comm";

/var/www/htdocs/nfsen/conf.php

$COMMSOCKET = "/tmp/nfsen.comm";

install path in /etc/pkg.conf

installpath=ftp.openbsd.org

Nano configuration

Edit /home/user/.nanorc

unset autoindent
unset backup
set mouse
set multibuffer
set noconvert
unset nofollow
set nohelp
set nowrap
set regexp
set smooth
set speller aspell
set tabsize 4
set tabstospaces
set tempfile
set fill 72

Window manager

Install xfce4

sudo pkg_add -vi xfce xfce-extras

Wifi configuration

In terminal

ifconfig urtw0 nwid xxxAP wpakey xxxpass

Or in hostname.urtw0

dhcp NONE NONE NONE nwid xxxAP wpakey "xxxpass"

Windows Shares

Install

sudo pkg_add -vi sharity-light

Edit /etc/hosts, sharity doesn’t like ip

192.168.0.3 syno.home.lan syno

Launch sharity

sudo shlight //windowsserver/backup /mnt/backup -U bob

Power saving

Add apmd flag into /etc/rc.conf.local

sudo echo 'apmd_flags="-A"' >> /etc/rc.conf.local
sudo /etc/rc.d/apmd start

Adjust system or edit /etc/sysctl.conf

sudo sysctl hw.setperf=0

Network tips

Edit /etc/sysctl.conf

net.inet.ip.forwarding=1 # traffic pass-through
kern.bufcachepercent=50 # use ram for cache
net.inet.ip.ifq.maxlen=1024 # 256 * nb network card
net.inet.tcp.mssdflt=1440 # set max-mss value
kern.securelevel=2 # define security access

Firmware for rsu0 network wireless card

sudo fw_update -a

Basic installation softwares

Install

pkg_add -vi evince firefox keepassx abiword pftop nmap pidgin pidgin-otr nano vlc youtube-dl
pkg_add -vi slim mc vim mutt feh sxiv zathura xombrero tor polipo xautolock mpd mpc ncmpc

Disks

Preserve CF and SSD in /etc/fstab add

softdep, noatime

Custom dotted files

.xinitrc

synclient TapButton1=1 # control pad click
syndaemon -i 1 -d
xset -dpms
xset s 3600 # black screen after one hour
exec startxfce4 # launch xfce with startx

.xsession

export LANG=fr_FR.UTF-8
export LANGUAGE=$LANG
export LC_ALL=$LANG

.profile

PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
export PATH HOME TERM
export PKG_PATH=http://ftp.fr.openbsd.org/pub/OpenBSD/5.5/packages/i386/
export ALT_PKG_PATH=http://ftp.spline.de/pub/OpenBSD/5.5/packages/i386/
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PS1="\u@\h:\w\$ "
export LC_CTYPE=fr_FR.UTF-8
export LC_MESSAGES=fr
ulimit -d 1500000

Trunk interfaces

Trunkate re0 (wired) and urtw0 (wireless)

Edit /etc/hostname.re0

up

Edit /etc/hostname.urtw0

up

Edit /etc/hostname.trunk0

trunkproto failover trunkport re0
trunkport urtw0
dhcp   

Using packages and ports

Edit /etc/mk.conf

FETCH_PACKAGES=yes

Checking ports out-of-date and updates

Run

/usr/ports/infrastructure/bin/out-of-date    

Go to

/usr/ports/<portname>
make update

Follow mtier : “Hassle-free and timely updates for your packages!”

Go to

https://stable.mtier.org/

About layout of filesystems

Run

man hier

http://openbsd-archive.7691.n7.nabble.com/Nfsen-and-php-problems-td63744.html