Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=====================================
- #
- # OpenBSD Install
- #
- #=====================================
- ### Installation ###
- ## pick shell:
- s
- ## wipe drive and clear the dead space:
- dd if=/dev/urandom of=/dev/rsd0c bs=1m
- ## encrypt the drive
- # create efi partition system:
- fdisk -iy -g -b 960 sd0
- # make one parition for the whole disk:
- disklabel -E sd0
- Label editor (enter '?' for help at any prompt)
- > a a
- offset: defaults
- size: defaults
- FS type: RAID
- > w
- > q
- No label changes.
- # encrypt drive:
- bioctl -c C -l sd0a softraid0
- # make device node and clear out first megabyte:
- cd /dev && sh MAKEDEV sd2
- dd if=/dev/zero of=/dev/rsd2c bs=1m count=1
- ## installer
- # start installer
- exit and choose installer:
- exit
- i
- # pick keyboard:
- US QWERTY
- # hostname:
- host
- # wireless:
- skip:
- done
- # DNS domain name:
- default
- # password for root:
- *type password*
- # start sshd:
- no
- # start the x window system by xenodm:
- yes
- # user setup:
- # setup a user: user
- # full name: User
- # password for user: *enter password*
- # which disk is the root disk:
- sd2
- # use whole disk with MBR or GPT:
- gtp
- # use auto layout
- a
- # location of sets:
- disk
- # Is the disk partition already mounted?:
- no
- # Which disk contains the install media? (or 'done'):
- sd1
- # Available sd1 partitions are:
- a
- # Which sd1 partition has the install sets? (or 'done')
- [a]
- # Pathname to the sets? (or 'done'):
- [6.4/amd64]
- # what timezone:
- UTC
- # reboot
- ### Post Installation ###
- ## login as root:
- username: root
- password: *enter root password*
- ## disable bell
- # ttys
- wsconsctl keyboard.bell.volume=0
- edit /etc/wsconsctl.conf:
- # disable bell
- keyboard.bell.volume=0
- # xorg
- echo 'xset b off' >> /etc/X11/xenodm/Xsetup_0
- ## network
- # setup with ethernet
- # find ethernet interface:
- ifconfig
- # setup ethernet:
- dhclient em0
- # get and install wifi firmware:
- fw_update
- # setup wifi card and find wifi:
- ifconfig iwn0 up
- ifconfig iwn0 scan
- # connect to wifi
- ifconfig iwn0 nwid YOUR_SSID wpakey "YOUR_PASSPHRASE"
- dhclient iwn0
- # create /etc/hostname.iwn0 with the following:
- vi /etc/hostname.iwn0:
- # add networks in order of priority, for example:
- # join "HOME_SSID" wpakey "HOME_PASSPHRASE"
- # join "WORK_SSID" wpakey "WORK_PASSPHRASE"
- # join "OPEN_COFFEE_SHOP"
- dhcp
- inet6 autoconf
- up powersave
- # test changes:
- ifconfig em0 down
- ifconfig iwn0 down
- pkill dhclient
- sh /etc/netstart
- # if that doesn't work reboot
- # set usb mount directory and test usb mounting
- mkdir /mnt/usb
- chown user:user /mnt/usb
- mount -t msdos /dev/sd2i /mnt/usb
- # disable xconsole window from autostarting at each login:
- sed -i 's/xconsole/#xconsole/' /etc/X11/xenodm/Xsetup_0
- # remap keys
- ## map caps lock to esacpe key in tty:
- # tty
- vi /etc/wsconsctl.conf:
- keyboard.map+="keysym Caps_Lock = Escape"
- # set UTF-8 for tty:
- export LANG=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
- # and add it to /etc/login.conf
- :charset=UTF-8:\
- :LANG=en_US.UTF-8:\
- :LC_ALL=en_US.UTF-8:
- # setup doas for user:
- echo 'permit persist keepenv user' > /etc/doas.conf
- # enable power managemnt options:
- rcctl enable apmd
- rcctl set apmd flags -A
- rcctl start apmd
- # add user to groups:
- usermod -G staff user
- usermod -G operator
- usermod -G games
- # change resource limits:
- vi /etc/login.conf:
- staff:\
- :datasize-cur=1024M:\
- :datasize-max=8192M:\
- :maxproc-cur=512:\
- :maxproc-max=1024:\
- :openfiles-cur=4096:\
- :openfiles-max=8192:\
- :stacksize-cur=32M:\
- :ignorenologin:\
- :requirehome@:\
- :tc=default:
- # bump up kernal sysctls:
- vi /etc/sysctl.conf:
- # shared memory limits
- kern.shminfo.shmall=3145728
- kern.shminfo.shmmax=2147483647
- kern.shminfo.shmmni=1024
- # semaphores
- kern.shminfo.shmseg=1024
- kern.seminfo.semmns=4096
- kern.seminfo.semmni=1024
- kern.maxproc=32768
- kern.maxfiles=65535
- kern.bufcachepercent=90
- kern.maxvnodes=262144
- kern.somaxconn=2048
- # lock screen automaticaly when you close the lid:
- # make the directory for apm:
- mkdir /etc/apm
- # Then, create the file /etc/apm/suspend with the following contents:
- #!/bin/sh
- pkill -USR1 xidle
- # And make it executable:
- chmod +x /etc/apm/suspend
- # turn off ntpd google check:
- sed -i '/google/d' /etc/ntpd.conf
- # restart ntpd:
- rcctl restart ntpd
- # change hostname:
- vi /etc/myname:
- host
- # exit and login as user
- # uninstall fvwm
- ## install ports tree
- # fetch the ports tree:
- cd /tmp
- ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/{ports.tar.gz,SHA256.sig}
- signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz
- # untar the ports tree in /usr/ports:
- cd /usr
- tar xzf /tmp/ports.tar.gz
- # configure ports:
- # vi /etc/mk.conf:
- WRKOBJDIR=/usr/obj/ports
- DISTDIR=/usr/distfiles
- PACKAGE_REPOSITORY=/usr/packages
- ## install programs
- # shell:
- ## zsh:
- doas pkg_add zsh
- # editor:
- ## neovim:
- doas pkg_add neovim
- # music and video:
- ## mpd:
- doas pkg_add mpd
- ## mpc:
- doas pkg_add mpc
- ## ncmpcpp:
- doas pkg_add ncmpcpp
- ## ncmpc:
- doas pkg_add ncmpc
- ## mpv:
- doas pkg_add mpv
- # network:
- ## tor:
- doas pkg_add tor
- # web browsing
- ## tor-browser:
- doas pkg_add tor-browser
- ## firefox:
- doas pkg_add firefox
- ## qutebrowser:
- doas pkg_add qutebrowser
- ## w3m:
- doas pkg_add w3m (
- # file management:
- ## thunar
- ## ranger
- # utilities:
- ## feh
- ## dunst
- ## tree
- ## scrot
- ## neofetch
- ## htop
- ## wget
- ## git
- ## gimp
- ## transmission
- ## unzip
- ## zathura
- ## qemu
- ## lxappearance *maybe uneeded*
- # social media:
- ## pidgin
- ## pidgin-otr
- ## pidgin-libnotify
- ## irssi
- ## irssi-otr
- ## neomutt
- # programming
- ## ipython
- # games
- ## wesnoth
- ## 0ad
- ## minetest
- ## nethack
- ## supertux
- ## supertuxkart
- # fonts (come back too)
- ## noto-lite
- ## liberation-fonts-ttf
- ## chinese/arphicttf
- ## chinese/font-std
- ## hebrew/culmus
- ## hebrew/elmar-fonts
- ## japanese/font-ipa
- ## japanese/font-ipa-uigothic
- ## japanese/font-ipaex
- ## japanese/font-kochi
- ## japanese/font-migmix
- ## japanese/font-migu
- ## japanese/font-mona-ipa
- ## japanese/font-motoya-al
- ## japanese/font-mplus-ipa
- ## japanese/font-sazanami
- ## japanese/font-shinonome
- ## japanese/font-takao
- ## japanese/font-ume
- ## japanese/font-vlgothic
- ## x11-fonts/hanazono-fonts-ttf
- ## japanese/font-mikachan
- ## korean/aleefonts-ttf
- ## korean/nanumfonts-ttf
- ## korean/unfonts-core
- ## x11-fonts/anonymous-pro
- ## x11-fonts/artwiz-aleczapka
- ## x11-fonts/dejavu
- ## x11-fonts/inconsolata-ttf
- ## x11-fonts/terminus-font
- ## x11-fonts/cantarell-fonts
- ## x11-fonts/droid-fonts-ttf
- ## x11-fonts/doulos
- ## x11-fonts/ubuntu-font
- ## x11-fonts/isabella
- ## x11-fonts/junicode
- ## x11-fonts/khmeros
- ## x11-fonts/padauk
- ## x11-fonts/stix-fonts
- ## x11-fonts/charis
- ## x11-fonts/urwfonts-ttf
- ## russian/koi8r-ps
- ## x11-fonts/geminifonts
- ## x11-fonts/cyr-rfx
- ## x11-fonts/paratype
- ## x11-fonts/gentium-plus
- # make a build directory:
- mkdir .builds
- # window manageer
- ## dwm
- cd .builds
- git clone git://git.suckless.org/dwm
- cd dwm
- # uncomment openbsd libs in config.mk:
- # build dwm:
- doas make clean install
- # application menu
- ## demenu
- cd .builds
- git clone git://git.suckless.org/dmenu
- cd dmenu
- # uncomment openbsd libs in config.mk
- # build dmenu:
- doas make clean install
- # make subdirecories and change shell:
- mkdir Documents Downloads Music Videos Pictures .builds
- mkdir Pictures/.screenshots
- # change shell for user:
- chsh -s /usr/local/bin/zsh
- # move files to the right places:
- doas mv Fonts /usr/local/share/fonts
- doas mkdir /usr/local/share/backgrounds
- doas mv wallpapers /usr/local/share/backgrounds
- ### Configurations ###
- ============================================================================================================================
- ## .xsession:
- #####################
- #
- # .xsession
- #
- #####################
- # use UTF-8 everywhere
- export LANG=en_US.UTF-8
- # specify location of .zshrc
- export ENV=$HOME/.zshrc
- # load .Xresources
- xrdb -merge $HOME/.Xresources
- # set background color
- xsetroot -solid back
- # enable scrolling with trackpoint and middle button
- xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
- xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
- xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
- # remap caps lock to esacpe
- setxkbmap -option caps:escape
- # start dwm
- exec dwm
- ============================================================================================================================
- ## .Xresources:
- !!!!!!!!!!!!!!!!!!!!!!!!!!
- !
- ! .Xresources
- !
- !!!!!!!!!!!!!!!!!!!!!!!!!!
- ! to load .Xresources run:
- ! xrdb ~/.Xresources
- ! ===== fonts
- !to find which font is used as the fall back font for a specific character run:
- ! FC_DEBUG=4 pango-view -q -t '{character}' 2>&1 |\grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1
- !to find the name of a font:
- ! fc-list -v | grep *name*
- Xft.autohint : 0
- Xft.lcdfilter : lcddefault
- Xft.hintstyle : hintslight
- Xft.hinting : 1
- Xft.antialias : 1
- Xft.rgba : rgb
- *font : Terminus (TTF):size=9
- ! ===== urxvt:
- ! scrollbar
- URxvt.scrollBar: false
- ! transparency
- URxvt.depth: 32
- URxvt.background: [95]#000000
- ! fading
- URxvt*fading: 30
- ! cursor
- URxvt*cursorUnderline: true
- URxvt*cursorBlink: true
- URxvt*cursorColor: #FF0099
- !! theme
- !background color
- URxvt*background: #000000
- ! font color
- URxvt*foreground: #67C8FF
- ! other colors
- URxvt*color0: #000000
- URxvt*color1: #FF0000
- URxvt*color2: #67C8FF
- URxvt*color3: #FF1493
- URxvt*color4: #099FFF
- URxvt*color5: #CC00FF
- URxvt*color6: #099FFF
- URxvt*color7: #820571
- URxvt*color8: #45013C
- URxvt*color9: #099FFF
- URxvt*color10: #FF0099
- URxvt*color11: #E6FB04
- URxvt*color12: #9400D3
- URxvt*color13: #DB329D
- URxvt*color14: #9400D3
- URxvt*color15: #FF0099
- URxvt*underlineColor: #FF34B3
- URxvt*highlightColor: #191970
- URxvt*highlightTextColor: #EE00EE
- !! extensions
- !fullscreen
- URxvt.perl-ext-common: fullscreen
- URxvt.keysym.F11: perl:fullscreen:switch
- ! ===== xterm
- !! theme
- XTerm*background : #000000
- XTerm*foreground : #67C8FF
- XTerm*cursorColor : #FF0099
- XTerm*colorUL : #366060
- XTerm*underlineColor : #FF34B3
- XTerm*color0 : #000000
- XTerm*color1 : #FF0000
- XTerm*color2 : #67C8FF
- XTerm*color3 : #FF1493
- XTerm*color4 : #099FFF
- XTerm*color5 : #CC00FF
- XTerm*color6 : #099FFF
- XTerm*color7 : #820571
- XTerm*color8 : #45013C
- XTerm*color9 : #099FFF
- XTerm*color10 : #FF0099
- XTerm*color11 : #E6FB04
- XTerm*color12 : #9400D3
- XTerm*color13 : #DB329D
- XTerm*color14 : #9400D3
- XTerm*color15 : #FF0099
- ! remove the additional black border
- XTerm*borderWidth : 0
- XTerm*internalBorder : 2
- ! set TERM env variable to use 256 colors
- XTerm*termName : xterm-256color
- ! make alt key work normally
- XTerm*vt100.metaSendsEscape : true
- ! save ~10,000 lines of scrollback
- XTerm*v100.saveLines : 10240
- ! hide scrollbar
- XTerm*vt100.scrollBar : false
- ! some black magic to change what characters XTerm considers "word delimiters"
- XTerm*charClass : 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48
- ============================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement