__/\\\\\\\\\\\\\\\__/\\\\\\\\\\\\\\\__/\\\________/\\\___________________/\\\\\\\___________/\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\_
_\///////\\\/////__\///////\\\/////__\///\\\____/\\\/__________________/\\\/////\\\________\/\\\////////\\\__\/\\\///////////__
_______\/\\\_____________\/\\\_________\///\\\/\\\/___________________/\\\____\//\\\_______\/\\\______\//\\\_\/\\\_____________
_______\/\\\_____________\/\\\___________\///\\\/_______/\\\____/\\\_\/\\\_____\/\\\_______\/\\\_______\/\\\_\/\\\\\\\\\\\_____
_______\/\\\_____________\/\\\_____________\/\\\_______\//\\\__/\\\__\/\\\_____\/\\\_______\/\\\_______\/\\\_\/\\\///////______
_______\/\\\_____________\/\\\_____________\/\\\________\//\\\/\\\___\/\\\_____\/\\\_______\/\\\_______\/\\\_\/\\\_____________
_______\/\\\_____________\/\\\_____________\/\\\_________\//\\\\\____\//\\\____/\\\________\/\\\_______/\\\__\/\\\_____________
_______\/\\\_____________\/\\\_____________\/\\\__________\//\\\______\///\\\\\\\/____/\\\_\/\\\\\\\\\\\\/___\/\\\\\\\\\\\\\\\_
_______\///______________\///______________\///____________\///_________\///////_____\///__\////////////_____\///////////////__
On this homepage, you will find some configuration files I have written over the last couple of years, mostly for FreeBSD and OpenBSD, but they should be most cross-platform compatible as possible. Additions are always welcome. They can send to gbe@FreeBSD.org. My public key can be found on the contact page.
Besides FreeBSD, I have used macOS on a MacBook Pro as my main working environment for years. I have collected some useful tips to get the most out of macOS as a UNIX-like Operating System.
Besides the configuration files, there is also a collection of some ASCII(7) arts present. More can be found at the ASCII Art Archive. A nice source for inspiration is also the Phrack Magazine.
A TTY is historical a classic TeleTYp terminal, that is connected to a mainframe. In the early days of UNIX, these were implemented as /dev/tty[0-5] asynchronous communication interfaces. They first appeared in Version 1 AT&T UNIX around November 1971. A completed version history can be found at the BSD Family Tree.
The device /dev/ttyv0 itself is nowadays the first local terminal on a FreeBSD system. See /etc/ttys for the current configuration. The /etc/ttys configuration varies from BSD to BSD, but in general, the file type is described in the ttys(5) manual page.
If I have some free time, I spend some time working on documentation for the FreeBSD Project. The larger parts I have contributed are man pages for the TCP BBR Stack, the TCP RACK Stack, the WireGuard Driver wg(4), and unionfs(5).
A while ago, I received a Lenovo Z50-70 via the donations team of the FreeBSD project. On the Lenovo Z50-70 Setup page, you find detailed information on how to setup FreeBSD on this notebook. In general everything works just fine from Bluetooth to Wi-Fi.
unmy_hdr *
set hdrs
# default mail address
my_hdr from: Gordon Bergling <gbe@FreeBSD.org>
# some X-Headers which are optional
my_hdr X-Url: <https://www.ttyv0.de/>
my_hdr X-Operating-System: `uname -srm`
my_hdr X-Host-Uptime: `uptime`
# simple MTA as a sendmail replacement, see https://marlam.de/msmtp/
set sendmail="/usr/local/bin/msmtp"
set use_from=yes
set envelope_from=yes
# two aliases if you want multiple FROM accounts
alias FreeBSD Gordon Bergling <gbe@FreeBSD.org>
alias GMail Gordon Bergling <your gmail address>
macro compose v "<edit-from>^Uidentity\_<tab>" "Select from"
set imap_user = 'gbergling@gmail.com'
set imap_pass = 'separate gmail password for external apps'
set folder = imaps://imap.gmail.com/
set spoolfile = +FreeBSD
set record = "+[Gmail]/Sent Mail"
set postponed = "+[Gmail]/Drafts"
# Should be set for the INBOX or for a directory that should be opened as default
set mbox = "imaps://imap.gmail.com/[Gmail]/FreeBSD"
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
set sort = threads
auto_view text/html
alternative_order text/plain text/enriched text/html
# if OpenPGP (S/MIME) is configured, source a separate configuration file
source "~/.mutt/gpg.rc"
# Set the default python
alias python="python3.11"
alias vi="vim"
alias lsd="ls -ld"
alias ll="ls -la"
# extent the traceroute output by AS information
alias traceroute="traceroute -a"
# extent the top output with arguments of the current command
alias top="top -a"
# phabricator alias for differentials of the FreeBSD project
alias arc="/usr/local/lib/php/arcanist/bin/arc"
# always show file flags in long mode and use colors.
alias ls="ls -oG"
# when using security.bsd.see_other_uids=0 provide an alias
# for top to see all system processes
alias dtp="doas top -a"
# tmux aliases for three default sessions
alias ts0="tmux attach -t 0"
alias ts1="tmux attach -t 1"
alias ts2="tmux attach -t 2"
# use the -J flag for search highlighting. This option is not set
# as LESS option, since less is also default pager for the manpages.
alias less="less -J"
# extent the default history output with timestamps
export HISTTIMEFORMAT='%F %T '
export HISTCONTROL=ignoreboth
export DEVELOPER="yes"
export EDITOR="vim"
export PAGER=less
# When reading local mail from /var/mail/$USER, set an explicit mbox file
# in the users home directory.
export MBOX="~/mail/mbox"
# Linux LS colors. On FreeBSD these are working out of the box when you
# define an ls alias like 'ls -G'. On OpenBSD you have to use the port
# colorls with the following alias -> alias ls="colorls -G".
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
# Set a nice command prompt in the form of 'user@host : /path $' with some coloring. Also
# set the hostname as title if you connecting via SSH for some terminal clients that support it.
export PS1="\[\033]0;\h\007\015\[\033[01;32m\]\u@\h \[\033[00m\]: \[\033[01;34m\]\w\[\033[00m\] \$ "
# These exports are macOS specific, first set the locale to en_US, to avoid german
# translations on the command line, second extent the path for MacPorts.
#export LANG="en_US.UTF-8"
#export LC_ALL="en_US.UTF-8"
#export PATH=$PATH:/opt/local/bin:/opt/local/sbin
#export BASH_SILENCE_DEPRECATION_WARNING=1
# Change the default manual page with to 80 characters, this matches
# most other Unix-like operating systems.
OS=$( uname -s )
if [ "$OS" == 'Darwin' ]; then
export MANWIDTH=80
fi
# When working on a FreeBSD, I prefer the terminal output to be cleared after reading a man page
# or working in vim or reading a log via less, so set a special TERM entry.
# On OpenBSD this is the default.
OS=$( uname -s )
if [ "$OS" == 'FreeBSD' ]; then
case $TERM in
"xterm")
export TERM=xterm-clear
;;
"xterm-256color")
export TERM=xterm-clear
;;
esac
fi
# When connecting to an aarch64 system (Raspberry PI4 for example) print the CPU temperature.
# If the PI is passive cooled, it is good to monitor this.
ARCH=$( uname -m )
if [ "$ARCH" == 'arm64' ]; then
echo "CPU Temperature is `sysctl dev.cpu.0.temperature | awk '{ print $2 }'`."
echo ""
fi
# print historical events on login
if [ -x /usr/bin/calendar ] ; then /usr/bin/calendar -f calendar.history && echo "" ; fi
# print FreeBSD tips on login
if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips && echo "" ; fi
# update the pkg audit file and check the currently installed packages for security
# problems on login.
if [ -x /usr/sbin/pkg ] ; then /usr/sbin/pkg audit -F && echo "" ; fi
"" ViM Settings (with additions for MacVim)
""
"" Gordon Bergling <gbe@FreeBSD.org>
if has("gui_macvim")
set transparency=0
set guifont=Monaco:h14
set cursorline
set background=light
else
set background=dark
endif
set number
set visualbell t_vb= " turn off error beep/flash
set novisualbell
set backspace=indent,eol,start " more powerful backspacing
set ignorecase
set smartcase
set ruler
set guioptions-=T
set ttyfast " smoother changes
set nocompatible
set incsearch
set modelines=0
set autoindent
set smartindent
"set tabstop=4 " numbers of spaces of tab character
set mouse=a " enable mouse cursor positioning via SSH
" Enable True Color Support in ViM
if (has("termguicolors"))
set termguicolors
endif
" Try to load the colorscheme 'ayu'. This can be found at
" https://github.com/ayu-theme/ayu-vim and after a 'git clone'
" the ayu.vim file must be placed into ~/.vim/colors.
" Sadly, the theme doesn't work on macOS Terminal, but iTerm2 does the job just fine.
silent! colorscheme ayu
" Highlight the LineNr, the CursorLine and the CursorLineNr.
" Usually they get overwritten by the colorscheme, but in terms
" of an unavailable colorscheme file, these values provide a good
" fallback.
highlight LineNr cterm=NONE
highlight CursorLine cterm=NONE ctermbg=darkred ctermfg=white
highlight CursorLineNr cterm=NONE ctermbg=black ctermfg=yellow
" The StatusLine colors get usually overwritten by the colorscheme
" so use an 'autocmd' with nice inverted colors.
autocmd ColorScheme *
\ highlight StatusLine cterm=BOLD ctermbg=grey ctermfg=black guibg=grey guifg=black
" Set the cursor line.
set cursorline
" Provide two keymaps for disabling the CursorLine and the True Color Support.
" H -> Disable the CursorLine
" C -> Disable the True Color Support
nnoremap H :set cursorline!<CR>
nnoremap C :set termguicolors!<CR>
syntax enable
" use a centralized place for temporary files
" securely created via: $ mkdir ~/.tmp && chmod 700 ~/.tmp
set backupdir=~/.tmp
set directory=~/.tmp
set wildignore=*.o,*.obj,*.bak,*.exe,*.dll,*.jpg,*.png,*.pdf,*.tif,*.psd,*.pyc
" ruler and status lines
set laststatus=2 " Status Line will always be displayed
if has("statusline")
set statusline =%F%m%r%h%w\ [FMT=%{&ff}]\ [FTYPE=%Y]
set statusline+=\ [ENC=%{strlen(&fenc)?&fenc:&enc}]
set statusline+=\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [lpos=%03v]\ [line\ %l\/%L]
endif
" Show available Syntax Highlighting per default
let do_syntax_sel_menu = 1
inoremap [ []<ESC>i
inoremap ( ()<ESC>i
inoremap { {}<ESC>i
"inoremap [<CR> [<CR>]<ESC>ko <TAB>
"inoremap (<CR> (<CR>)<ESC>ko <TAB>
"inoremap {<CR> {<CR>}<ESC>ko <TAB>
if has("autocmd")
au BufNewFile,BufRead *.sgml,*.ent,*.xsl,*.xml call Set_SGML()
au BufNewFile,BufRead *.[1-9] call ShowSpecial()
endif " has(autocmd)
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter *.{c,h,pl,pm} match ExtraWhitespace /^\s* \|\s\+$/
autocmd InsertEnter *.{c,h,pl,pm} match ExtraWhitespace /^\s* \|\s\+\%#\@<!$/
autocmd InsertLeave *.{c,h,pl,pm} match ExtraWhitespace /^\s* \|\s\+$/
autocmd BufWinLeave *.{c,h,pl,pm} call clearmatches()
function Set_Highlights()
"match ExtraWhitespace /^\s* \s*\|\s\+$/
highlight default link OverLength ErrorMsg
match OverLength /\%71v.\+/
return 0
endfunction " Set_Highlights()
function ShowSpecial()
setlocal list listchars=tab:>>,trail:*,eol:$
hi def link nontext ErrorMsg
return 0
endfunction " ShowSpecial()
function Set_SGML()
setlocal number
syn match sgmlSpecial "&^;]*;"
setlocal syntax=sgml
setlocal filetype=xml
setlocal shiftwidth=2
setlocal textwidth=70
setlocal tabstop=8
setlocal softtabstop=2
setlocal formatprg="fmt -p"
setlocal autoindent
setlocal smartindent
" Rewrap paragraphs
noremap P gqj
" Replace spaces with tabs
noremap T :s/ /\t/<CR>
call ShowSpecial()
call Set_Highlights()
return 0
endfunction " Set_SGML()
# tmux.conf with better defaults
#
# 2023-08-15, Gordon Bergling <gbe@FreeBSD.org>
# Set scroll back buffer
set -g history-limit 10000
# Create a status bar in the form of
# hostname.domain.tld | 0:bash | 2.40 5.25 4.78 | 2023-08-15 08:15:01
set -g status-left-length 32
set -g status-left '#(hostname) | #[default]'
set -g status-right '| #(sysctl vm.loadavg | cut -d " " -f 3-5) | %Y-%m-%d %H:%M:%S#[default]'
# Better default for a horizontal split str + b followed by a |
unbind %
bind | split-window -h
# Better default for a vertical split str + b follow by a -
unbind '"'
bind - split-window -v
# Bind str + b followed by a 'r' to reload the dot.tmux.conf
unbind r
bind r source-file ~/.tmux.conf
bind -r m resize-pane -Z
# Enable mouse mouse support, useful for resizing panes
set -g mouse on
defaults
tls on
port 587
account GMail
host imap.gmail.com
from gbergling@googlemail.com
auth on
user gbergling@gmail.com
password 'separated gmail account password'
account FreeBSD
host smtp.FreeBSD.org
from gbe@FreeBSD.org
auth on
user gbe
password your_password
# Only show processes the user owns
security.bsd.see_other_uids=0
security.bsd.see_other_gids=0
security.bsd.see_jail_proc=0
# Only show the dmesg output for the root user
security.bsd.unprivileged_read_msgbuf=0
security.bsd.unprivileged_proc_debug=0
# Enable Stack Guard Pages
security.bsd.stack_guard_page=1
# Check the gid and uid for hardlinkes before
# accessing them
security.bsd.hardlink_check_gid=1
security.bsd.hardlink_check_uid=1
# Randomize the PIDs of spawned processes
kern.randompid=1
kern.ipc.shm_use_phys=1
vfs.zfs.min_auto_ashift=12
# Enable ASLR (address space randomazion)
kern.elf32.aslr.enable=1
kern.elf32.aslr.pie_enable=1
kern.elf64.aslr.enable=1
kern.elf64.aslr.pie_enable=1
# Randomize IP IDs
net.inet.ip.random_id=1
# Check the packets that are received on the interface
net.inet.ip.rfc1122_strong_es=1
# Some Security Enhancements for TCP/IP connections
net.inet.udp.blackhole=1
net.inet.tcp.blackhole=2
net.inet.tcp.drop_synfin=1
net.inet.icmp.drop_redirect=1
net.inet.icmp.bmcastecho=0
net.inet.ip.redirect=0
net.inet6.ip6.redirect=0
# Don't drop to the debugger on a kernel panic. When a dump device is configured
# in the rc.conf the kernel dump will created automatically.
debug.debugger_on_panic=0
# Local delivery that can be read by mail(1), could also be an external
# address if a MTA is configured.
daily_output="local_username"
daily_status_security_output="local_username"
weekly_output="local_username"
weekly_status_security_output="local_username"
monthly_output="local_username"
# Recommended ZFS settings, if ZFS is used and the zpools aren't that large,
# should be ideal if 'zfs set copies=2 example/data' is applied.
daily_status_zfs_enable="YES"
daily_scrub_zfs_enable="YES"
daily_scrub_zfs_default_threshold="3"
daily_backup_zfs_enable="YES"
daily_backup_zfs_props_enable="YES"
# Enable a daily rkhunter update
security_rkhunter_update_enable="YES"
security_rkhunter_update_flags="--update --nocolors"
___________________ _-_
\==============_=_/ ____.---'---`---.____
\_ \ \----._________.----/
\ \ / / `-_-'
__,--`.`-'..'-_
/____ ||
`--.____,-'
_____..---========+*+==========---.._____
______________________ __,-='=====____ =================== _____=====`=
(._____________________I__) - _-=_/ `---------=+=--------'
/ /__...---===='---+---_'
'------'---.___ - _ = _.-' * * * *
`--------'
,---------------------------------------------------------------------------, | .-. .-. .-. .-. .-. .-. .-. .-. .-. | | .' `._.' `._.' `._.' `._.' `._.' `._.' `._.' `._.' `. | | ( . .-. .-. .-. .-. .-. .-. .-. . ) | | `. `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' .' | | ) X X X X X X X X ( | | ,' ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. `. | | ( ( )-( )-( )-( )-( )-( )-( )-( ) ) | | `. `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. .' .' | | ) X X X X X X X X ( | | ,' ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. `. | | ( ( )-( )-( )-( )-( )-( )-( )-( ) ) | | `. `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. .' .' | | ) X X X X X X X X ( | | ,' ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. ,' `. `. | | ( ( )-( )-( )-( )-( )-( )-( )-( ) ) | | `. `. .' `. .' `. .' `. .' `. .' `. .' `. .' `. .' .' | | ) X X X X X X X X ( | | ,' .' `. .' `. .' `. .' `. .' `. .' `. .' `. .' `. `. | | ( ' _ `-' _ `-' _ `-' _ `-' _ `-' _ `-' _ `-' _ ` ) | | `. .' `. .' `. .' `. .' `. .' `. .' `. .' `. .' `. .' | | `-' `-' `-' `-' `-' `-' `-' `-' `-' | `---------------------------------------------------------------------------'
____ _x***, ____
j^ "wF h#" "q
w^""q#_ _0Np___g#L_ jLM"9*_
0 #NM*N0##" N#N@**0#L ]r
_*^*4p__gNN" 0h_ j#F 9Np__g0M^*s_
jF B@^"90p___g##@^^*N#h____0@""@NF 0
_h___gF jNP""9NF #@"""N# #___j@_
p"""N###Np__g0F j#p,,gN# Bp___d###@"""N_
t @" "NNNN#gggg#@" 5##ggggNNN#P "L I
9ggg0L _F 0@^^N#_ _j@@^NN" `L #p_gp"
p"""N##ggg#L_ _f j@""9N L j#NggN##@""^_
4 #" "0##*NN#___a& p___g##*NN#F "NF 0
^u_gdL JF 0#@"""-wgr"""N##" #_ j#p_ar"
p"""0NpgNNL_ _0#L j# ##_ j##pggN@""N,
t_ ##" "0NN@"""*gggN#Mggp^""9NNNF N#L I
9u__g##_ j##L TNF"""N# 0##_ j##p_a*"
qF 9ggN@"""*gggNE #Nggp^""9#gg@" "b
`L 0##_ 0N@^^#pgp@^@N#L d##L _0
"*wr4P"""qggg# ]# 0Npgg^"""#*w*"
0_ #NN@Ns__g0#N___w@NN#L jL
"*mm^B 0#"" "N#F ]F*mmM"
"w___y^L _Fh___a^
"" 9***" "" D.H., 1991
________________________________________________
/ \
| _________________________________________ |
| | | |
| | Welcome to FreeBSD! | |
| | | |
| | Last login: Wed Oct 29 13:00 2025 | |
| | FreeBSD 14.3-RELEASE-p5 releng/14.3 | |
| | FreeBSD (GENERIC#10) | |
| | | |
| | You have mail. <3 <3 | |
| | | |
| | gbe@bastion : ~ $ | |
| | | |
| | | |
| | | |
| |_________________________________________| |
| |
\_________________________________________________/
\___________________________________/
___________________________________________
_-' .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. --- `-_
_-'.-.-. .---.-.-.-.-.-.-.-.-.-.-.-.-.-.-.--. .-.-.`-_
_-'.-.-.-. .---.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-`__`. .-.-.-.`-_
_-'.-.-.-.-. .-----.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-----. .-.-.-.-.`-_
_-'.-.-.-.-.-. .---.-. .-------------------------. .-.---. .---.-.-.-.`-_
:-------------------------------------------------------------------------:
`---._.-------------------------------------------------------------._.---'
:
:
:
:
. :
'. : .'
'. : .'
'. .-""""""-. .' .'':
'." ".' .-""""-.' .---. .----. .-"""-.
: : _ _ ." .' ". ..." "... ." ". ." ".
......... ......... o (_) (_) () : .' : '..:.......:..' : : : : o
: : : .' : '.....' '. .' '. .'
: : .'.'. .' `''''` `'''''`
'........' '' ``````
.' : '.
.' : '.
.' : '.
.' : '.
Dana'97 :
:
:
:
_.--"""""--._
,-' `-.
_ ,' --- - ---- --- `.
,'|`. ,' ________________`.
O`.+,'O / /____(_______)___\ \
_......_ ,=. __________; _____ ____ _____ _____ :
,' ,--.-`,,;,:,;;;;;;;///////////| ----- ---- ----- ----- |
( SSt( ==)=========================| ,---. ,---. ,. |
`._ `--'-,``````"""""""\\\\\\\\\\\: /`. ,'\ /_ \ /\/\ ;
`````` \ : Y : :-'-. : : ): /
`. \ | / \=====/ \/\/'
`. `-'-' `---' ;'
`-._ _,-'
`--.....--' ,--.
().0()
`'-'
____
/\ \ Moebius Triangle
/ \ \
/ \ \
/ \ \
/ /\ \ \
/ / \ \ \
/ / \ \ \
/ / / \ \ \
/ / / \ \ \
/ / /---------' \
/ / /_______________\
\ / /
\/_____________________/ mn
____
/\ \
/ \___\
_\ / __/_
/\ \/_/\ \
/ \__/ \___\
_\ / \ / __/_
/\ \/___/\/_/\ \
/ \___\ / \___\
_\ / /_ _\__/ __/_
/\ \/___/ \/\ \/\ \
/ \___\ \___\ \___\ \___\
\ / / / / / / / /
\/___/\/___/\/___/\/___/ Veronica Karlsson
.o.
o8888o
d888888b
`Y8888P'
o .oood88booo. .o
Ybo .88888888888888888.
"8888888888888888888888888b,
.o88888888888888888888888888"
Y88888888888888888888888888888b.
.o8888888888888888888888888888888.
8888888888888888888888888888888888
o, ,db, ,o d8888888888888888888888888888888888[
.8888888888. 88888888888888888888888888888888888[
o888888888888b ]88888888888888888888888888888888888
d88888888888888o88888888888888888888888888888888888P
.o8o88888888888888888888888888888888888888888888888888"
<8888888888888888888888888888888888888888888888888888K
"Y"88888888888888888888888888888888888888888888888888o
Y88888888888888"88888888888888888888888888888888888b
"888888888888" ]88888888888888888888888888888888888
'8888888888` 88888888888888888888888888888888888[
"` "YP" `" "8888888888888888888888888888888888[
888888888888888888888888888888888
"8888888888888888888888888888888'
d88888888888888888888888888888P'
`"88888888888888888888888888o
,8888888888888888888888888P'
dP" "88888888888888888
" `"""Y88P"""' "'
.d8888b.
Y888888P -MJR
"8888"
`"'
Last modified on: Nov 21, 2025.
_ _ ,---------------------------.
... (_)-(_) ### ooo +++ ... | (c) Gordon Bergling 2024 | ((( +++ '*`
(. .) (o o) (o o) (o o) (o o) (o -) `--------------------------(_ (o o) (o o) (o o)
ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo----------------------------ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-