Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.12 KB | None | 0 0
  1. #=====================================
  2. #
  3. # OpenBSD Install
  4. #
  5. #=====================================
  6.  
  7. ### Installation ###
  8.  
  9. ## pick shell:
  10.  
  11. s
  12.  
  13. ## wipe drive and clear the dead space:
  14.  
  15. dd if=/dev/urandom of=/dev/rsd0c bs=1m
  16.  
  17. ## encrypt the drive
  18.  
  19. # create efi partition system:
  20.  
  21. fdisk -iy -g -b 960 sd0
  22.  
  23. # make one parition for the whole disk:
  24.  
  25. disklabel -E sd0
  26.  
  27. Label editor (enter '?' for help at any prompt)
  28.  
  29. > a a
  30.  
  31. offset: defaults
  32.  
  33. size: defaults
  34.  
  35. FS type: RAID
  36.  
  37. > w
  38.  
  39. > q
  40.  
  41. No label changes.
  42.  
  43. # encrypt drive:
  44.  
  45. bioctl -c C -l sd0a softraid0
  46.  
  47. # make device node and clear out first megabyte:
  48.  
  49. cd /dev && sh MAKEDEV sd2
  50. dd if=/dev/zero of=/dev/rsd2c bs=1m count=1
  51.  
  52. ## installer
  53.  
  54. # start installer
  55.  
  56. exit and choose installer:
  57.  
  58. exit
  59.  
  60. i
  61.  
  62. # pick keyboard:
  63.  
  64. US QWERTY
  65.  
  66. # hostname:
  67.  
  68. host
  69.  
  70. # wireless:
  71.  
  72. skip:
  73. done
  74.  
  75. # DNS domain name:
  76.  
  77. default
  78.  
  79. # password for root:
  80.  
  81. *type password*
  82.  
  83. # start sshd:
  84.  
  85. no
  86.  
  87. # start the x window system by xenodm:
  88.  
  89. yes
  90.  
  91. # user setup:
  92.  
  93. # setup a user: user
  94.  
  95. # full name: User
  96.  
  97. # password for user: *enter password*
  98.  
  99. # which disk is the root disk:
  100.  
  101. sd2
  102.  
  103. # use whole disk with MBR or GPT:
  104.  
  105. gtp
  106.  
  107. # use auto layout
  108.  
  109. a
  110.  
  111. # location of sets:
  112.  
  113. disk
  114.  
  115. # Is the disk partition already mounted?:
  116.  
  117. no
  118.  
  119. # Which disk contains the install media? (or 'done'):
  120.  
  121. sd1
  122.  
  123. # Available sd1 partitions are:
  124.  
  125. a
  126.  
  127. # Which sd1 partition has the install sets? (or 'done')
  128.  
  129. [a]
  130.  
  131. # Pathname to the sets? (or 'done'):
  132.  
  133. [6.4/amd64]
  134.  
  135. # what timezone:
  136.  
  137. UTC
  138.  
  139. # reboot
  140.  
  141. ### Post Installation ###
  142.  
  143. ## login as root:
  144.  
  145. username: root
  146.  
  147. password: *enter root password*
  148.  
  149. ## disable bell
  150.  
  151. # ttys
  152. wsconsctl keyboard.bell.volume=0
  153.  
  154. edit /etc/wsconsctl.conf:
  155. # disable bell
  156. keyboard.bell.volume=0
  157.  
  158. # xorg
  159.  
  160. echo 'xset b off' >> /etc/X11/xenodm/Xsetup_0
  161.  
  162. ## network
  163.  
  164. # setup with ethernet
  165.  
  166. # find ethernet interface:
  167.  
  168. ifconfig
  169.  
  170. # setup ethernet:
  171.  
  172. dhclient em0
  173.  
  174. # get and install wifi firmware:
  175.  
  176. fw_update
  177.  
  178. # setup wifi card and find wifi:
  179.  
  180. ifconfig iwn0 up
  181.  
  182. ifconfig iwn0 scan
  183.  
  184. # connect to wifi
  185.  
  186. ifconfig iwn0 nwid YOUR_SSID wpakey "YOUR_PASSPHRASE"
  187.  
  188. dhclient iwn0
  189.  
  190. # create /etc/hostname.iwn0 with the following:
  191.  
  192. vi /etc/hostname.iwn0:
  193.  
  194. # add networks in order of priority, for example:
  195.  
  196. # join "HOME_SSID" wpakey "HOME_PASSPHRASE"
  197.  
  198. # join "WORK_SSID" wpakey "WORK_PASSPHRASE"
  199.  
  200. # join "OPEN_COFFEE_SHOP"
  201.  
  202. # home:
  203.  
  204. join "SSID" wpakey "PASSPHRASE"
  205.  
  206. dhcp
  207.  
  208. inet6 autoconf
  209.  
  210. up powersave
  211.  
  212. # test changes:
  213.  
  214. ifconfig em0 down
  215.  
  216. ifconfig iwn0 down
  217.  
  218. pkill dhclient
  219.  
  220. sh /etc/netstart
  221.  
  222. # if that doesn't work reboot
  223.  
  224. # set usb mount directory and test usb mounting
  225. mkdir /mnt/usb
  226.  
  227. chown user:user /mnt/usb
  228.  
  229. mount -t msdos /dev/sd2i /mnt/usb
  230.  
  231. # disable xconsole window from autostarting at each login:
  232.  
  233. sed -i 's/xconsole/#xconsole/' /etc/X11/xenodm/Xsetup_0
  234.  
  235. # remap keys
  236.  
  237. ## map caps lock to esacpe key in tty:
  238.  
  239. # tty
  240. vi /etc/wsconsctl.conf:
  241.  
  242. keyboard.map+="keysym Caps_Lock = Escape"
  243.  
  244. # set UTF-8 for tty:
  245.  
  246. export LANG=en_US.UTF-8
  247.  
  248. export LC_ALL=en_US.UTF-8
  249.  
  250. # and add it to /etc/login.conf
  251.  
  252. :charset=UTF-8:\
  253. :LANG=en_US.UTF-8:\
  254. :LC_ALL=en_US.UTF-8:
  255.  
  256. # setup doas for user:
  257.  
  258. echo 'permit persist keepenv user' > /etc/doas.conf
  259.  
  260. # enable power managemnt options:
  261.  
  262. rcctl enable apmd
  263.  
  264. rcctl set apmd flags -A
  265.  
  266. rcctl start apmd
  267.  
  268. # add user to groups:
  269.  
  270. usermod -G staff user
  271.  
  272. usermod -G operator
  273.  
  274. usermod -G games
  275.  
  276. # change resource limits:
  277.  
  278. vi /etc/login.conf:
  279.  
  280. staff:\
  281. :datasize-cur=1024M:\
  282. :datasize-max=8192M:\
  283. :maxproc-cur=512:\
  284. :maxproc-max=1024:\
  285. :openfiles-cur=4096:\
  286. :openfiles-max=8192:\
  287. :stacksize-cur=32M:\
  288. :ignorenologin:\
  289. :requirehome@:\
  290. :tc=default:
  291.  
  292. # bump up kernal sysctls:
  293.  
  294. vi /etc/sysctl.conf:
  295.  
  296. # shared memory limits
  297. kern.shminfo.shmall=3145728
  298. kern.shminfo.shmmax=2147483647
  299. kern.shminfo.shmmni=1024
  300.  
  301. # semaphores
  302. kern.shminfo.shmseg=1024
  303. kern.seminfo.semmns=4096
  304. kern.seminfo.semmni=1024
  305.  
  306. kern.maxproc=32768
  307. kern.maxfiles=65535
  308. kern.bufcachepercent=90
  309. kern.maxvnodes=262144
  310. kern.somaxconn=2048
  311.  
  312. # lock screen automaticaly when you close the lid:
  313.  
  314. # make the directory for apm:
  315.  
  316. mkdir /etc/apm
  317.  
  318. # Then, create the file /etc/apm/suspend with the following contents:
  319.  
  320. #!/bin/sh
  321. pkill -USR1 xidle
  322.  
  323. # And make it executable:
  324.  
  325. chmod +x /etc/apm/suspend
  326.  
  327. # turn off ntpd google check:
  328.  
  329. sed -i '/google/d' /etc/ntpd.conf
  330.  
  331. # restart ntpd:
  332.  
  333. rcctl restart ntpd
  334.  
  335. # change hostname:
  336.  
  337. vi /etc/myname:
  338.  
  339. host
  340.  
  341. # exit and login as user
  342.  
  343. # uninstall fvwm
  344.  
  345. ## install ports tree
  346.  
  347. # fetch the ports tree:
  348.  
  349. cd /tmp
  350.  
  351. ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/{ports.tar.gz,SHA256.sig}
  352.  
  353. signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz
  354.  
  355. # untar the ports tree in /usr/ports:
  356.  
  357. cd /usr
  358.  
  359. tar xzf /tmp/ports.tar.gz
  360.  
  361. # configure ports:
  362.  
  363. # vi /etc/mk.conf:
  364.  
  365. WRKOBJDIR=/usr/obj/ports
  366.  
  367. DISTDIR=/usr/distfiles
  368.  
  369. PACKAGE_REPOSITORY=/usr/packages
  370.  
  371. ## install programs
  372.  
  373. # shell:
  374.  
  375. ## zsh:
  376.  
  377. doas pkg_add zsh
  378.  
  379. # editor:
  380.  
  381. ## neovim:
  382.  
  383. doas pkg_add neovim
  384.  
  385. # music and video:
  386.  
  387. ## mpd:
  388.  
  389. doas pkg_add mpd
  390.  
  391. ## mpc:
  392.  
  393. doas pkg_add mpc
  394.  
  395. ## ncmpcpp:
  396.  
  397. doas pkg_add ncmpcpp
  398.  
  399. ## ncmpc:
  400.  
  401. doas pkg_add ncmpc
  402.  
  403. ## mpv:
  404.  
  405. doas pkg_add mpv
  406.  
  407. # network:
  408.  
  409. ## tor:
  410.  
  411. doas pkg_add tor
  412.  
  413. # web browsing
  414.  
  415. ## tor-browser:
  416.  
  417. doas pkg_add tor-browser
  418.  
  419. ## firefox:
  420.  
  421. doas pkg_add firefox
  422.  
  423. ## qutebrowser:
  424.  
  425. doas pkg_add qutebrowser
  426.  
  427. ## w3m:
  428.  
  429. doas pkg_add w3m
  430.  
  431. choice: (2)
  432.  
  433. # file management:
  434.  
  435. ## thunar:
  436.  
  437. doas pkg_add thunar
  438.  
  439. ## ranger:
  440.  
  441. doas pkg_add ranger
  442.  
  443. # utilities:
  444.  
  445. ## feh:
  446.  
  447. doas pkg_add feh
  448.  
  449. ## dunst:
  450.  
  451. doas pkg_add dunst
  452.  
  453. ## tree:
  454.  
  455. doas pkg_add tree
  456.  
  457. ## scrot:
  458.  
  459. doas pkg_add scrot
  460.  
  461. ## neofetch:
  462.  
  463. doas pkg_add neofetch
  464.  
  465. ## htop:
  466.  
  467. doas pkg_add htop
  468.  
  469. ## wget:
  470.  
  471. doas pkg_add wget
  472.  
  473. ## git:
  474.  
  475. doas pkg_add git
  476.  
  477. ## gimp:
  478.  
  479. doas pkg_add gimp
  480.  
  481. ## transmission:
  482.  
  483. doas pkg_add transmission
  484.  
  485. ## unzip:
  486.  
  487. doas pkg_add unzip
  488.  
  489. choice (1)
  490.  
  491. ## zathura:
  492.  
  493. doas pkg_add zathura
  494.  
  495. ## qemu:
  496.  
  497. doas pkg_add qemu
  498.  
  499. # social media:
  500.  
  501. ## pidgin:
  502.  
  503. doas pkg_add pidgin
  504.  
  505. choice (1)
  506.  
  507. ## pidgin-otr:
  508.  
  509. doas pkg_add pidgin-otr
  510.  
  511. ## pidgin-libnotify:
  512.  
  513. doas pkg_add pidgin-libnotify
  514.  
  515. ## irssi:
  516.  
  517. doas pkg_add irssi
  518.  
  519. choice (2)
  520.  
  521. ## irssi-otr:
  522.  
  523. doas pkg_add irssi-otr
  524.  
  525. ## neomutt:
  526.  
  527. doas pkg_add neomutt
  528.  
  529. choice (1)
  530.  
  531. # programming
  532.  
  533. ## ipython:
  534.  
  535. doas pkg_add ipython
  536.  
  537. ## py-virtualenv:
  538.  
  539. doas pkg_add py-virtualenv
  540.  
  541. ## py3-virtualenv:
  542.  
  543. doas pkg_add py3-virtualenv
  544.  
  545. ## py-pip:
  546.  
  547. doas pkg_add py-pip
  548.  
  549. ## py3-pip:
  550.  
  551. doas pkg_add py3-pip
  552.  
  553. # games
  554.  
  555. ## wesnoth:
  556.  
  557. doas pkg_add wesnoth
  558.  
  559. ## 0ad:
  560.  
  561. doas pkg_add 0ad
  562.  
  563. ## minetest:
  564.  
  565. doas pkg_add mintest
  566.  
  567. ## nethack:
  568.  
  569. doas pkg_add nethack
  570.  
  571. choice (2)
  572.  
  573. ## supertux:
  574.  
  575. doas pkg_add supertux
  576.  
  577. ## supertuxkart:
  578.  
  579. doas pkg_add supertuxkart
  580.  
  581. # fonts
  582.  
  583. ## noto-fonts:
  584.  
  585. doas pkg_add noto-fonts
  586.  
  587. ## liberation-fonts:
  588.  
  589. doas pkg_add liberation-fonts
  590.  
  591. ## zh-fonts-arphicttf:
  592.  
  593. doas pkg_add zh-fonts-arphicttf
  594.  
  595. ## terminus-font:
  596.  
  597. doas pkg_add terminus-font
  598.  
  599. choice (1: terminus-font)
  600.  
  601. ## p5-Locale-Hebrew:
  602.  
  603. doas pkg_add p5-Locale-Hebrew
  604.  
  605. ## migmix:
  606.  
  607. doas pkg_add migmix
  608.  
  609. ## migu:
  610.  
  611. doas pkg_add migu
  612.  
  613. ## ja-sazanami-ttf:
  614.  
  615. doas pkg_add ja-sazanami-ttf
  616.  
  617. ## vlgothic:
  618.  
  619. doas pkg_add vlgothic
  620.  
  621. ## hanazono:
  622.  
  623. doas pkg_add hanazono
  624.  
  625. ## korean/nanumfonts-ttf
  626.  
  627. ## korean/unfonts-core
  628.  
  629. ## x11-fonts/anonymous-pro
  630.  
  631. ## x11-fonts/artwiz-aleczapka
  632.  
  633. ## x11-fonts/dejavu
  634.  
  635. ## x11-fonts/inconsolata-ttf
  636.  
  637. ## x11-fonts/cantarell-fonts
  638.  
  639. ## x11-fonts/droid-fonts-ttf
  640.  
  641. ## x11-fonts/doulos
  642.  
  643. ## x11-fonts/ubuntu-font
  644.  
  645. ## x11-fonts/isabella
  646.  
  647. ## x11-fonts/junicode
  648.  
  649. ## x11-fonts/khmeros
  650.  
  651. ## x11-fonts/padauk
  652.  
  653. ## x11-fonts/stix-fonts
  654.  
  655. ## x11-fonts/charis
  656.  
  657. ## x11-fonts/urwfonts-ttf
  658.  
  659. ## russian/koi8r-ps
  660.  
  661. ## x11-fonts/geminifonts
  662.  
  663. ## x11-fonts/cyr-rfx
  664.  
  665. ## x11-fonts/paratype
  666.  
  667. ## x11-fonts/gentium-plus
  668.  
  669. ## powerline fonts
  670.  
  671. # make a build directory:
  672.  
  673. mkdir .builds
  674.  
  675. # window manageer
  676.  
  677. ## dwm
  678.  
  679. cd .builds
  680.  
  681. git clone git://git.suckless.org/dwm
  682.  
  683. cd dwm
  684.  
  685. # uncomment openbsd libs in config.mk:
  686.  
  687.  
  688.  
  689. # build dwm:
  690.  
  691. doas make clean install
  692.  
  693. # application menu
  694.  
  695. ## demenu
  696.  
  697. cd .builds
  698.  
  699. git clone git://git.suckless.org/dmenu
  700.  
  701. cd dmenu
  702.  
  703. # uncomment openbsd libs in config.mk
  704.  
  705. # build dmenu:
  706.  
  707. doas make clean install
  708.  
  709. # make subdirecories and change shell:
  710.  
  711. mkdir Documents Downloads Music Videos Pictures
  712.  
  713. mkdir Pictures/.screenshots
  714.  
  715. # change shell for user:
  716.  
  717. chsh -s /usr/local/bin/zsh
  718.  
  719. # move files to the right places:
  720.  
  721. doas mv Fonts /usr/local/share/fonts
  722.  
  723. doas mkdir /usr/local/share/backgrounds
  724.  
  725. doas mv wallpapers /usr/local/share/backgrounds
  726.  
  727. ### Configurations ###
  728.  
  729. ============================================================================================================================
  730.  
  731. ## .xsession:
  732.  
  733. vi ~/.xsessions
  734.  
  735. #####################
  736. #
  737. # .xsession
  738. #
  739. #####################
  740.  
  741.  
  742. # use UTF-8 everywhere
  743. export LANG=en_US.UTF-8
  744.  
  745. # specify location of .zshrc
  746. export ENV=$HOME/.zshrc
  747.  
  748. # load .Xresources
  749. xrdb -merge $HOME/.Xresources
  750.  
  751. # set background color
  752. xsetroot -solid back
  753.  
  754. # enable scrolling with trackpoint and middle button
  755. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
  756. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
  757. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
  758.  
  759. # remap caps lock to esacpe
  760. setxkbmap -option caps:escape
  761.  
  762. # start dwm
  763. exec dwm
  764.  
  765. ============================================================================================================================
  766.  
  767. ## .Xresources:
  768.  
  769. vi ~/.Xresources
  770.  
  771. !!!!!!!!!!!!!!!!!!!!!!!!!!
  772. !
  773. ! .Xresources
  774. !
  775. !!!!!!!!!!!!!!!!!!!!!!!!!!
  776.  
  777. ! to load .Xresources run:
  778.  
  779. ! xrdb ~/.Xresources
  780.  
  781. ! ===== fonts
  782.  
  783. !to find which font is used as the fall back font for a specific character run:
  784.  
  785. ! FC_DEBUG=4 pango-view -q -t '{character}' 2>&1 |\grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1
  786.  
  787. !to find the name of a font:
  788.  
  789. ! fc-list -v | grep *name*
  790.  
  791. Xft.autohint : 0
  792. Xft.lcdfilter : lcddefault
  793. Xft.hintstyle : hintslight
  794. Xft.hinting : 1
  795. Xft.antialias : 1
  796. Xft.rgba : rgb
  797. *font : Terminus (TTF):size=9
  798.  
  799. ! ===== urxvt:
  800.  
  801. ! scrollbar
  802. URxvt.scrollBar: false
  803.  
  804. ! transparency
  805. URxvt.depth: 32
  806. URxvt.background: [95]#000000
  807.  
  808. ! fading
  809. URxvt*fading: 30
  810.  
  811. ! cursor
  812. URxvt*cursorUnderline: true
  813. URxvt*cursorBlink: true
  814. URxvt*cursorColor: #FF0099
  815.  
  816. !! theme
  817. !background color
  818. URxvt*background: #000000
  819.  
  820. ! font color
  821. URxvt*foreground: #67C8FF
  822.  
  823. ! other colors
  824. URxvt*color0: #000000
  825. URxvt*color1: #FF0000
  826. URxvt*color2: #67C8FF
  827. URxvt*color3: #FF1493
  828. URxvt*color4: #099FFF
  829. URxvt*color5: #CC00FF
  830. URxvt*color6: #099FFF
  831. URxvt*color7: #820571
  832. URxvt*color8: #45013C
  833. URxvt*color9: #099FFF
  834. URxvt*color10: #FF0099
  835. URxvt*color11: #E6FB04
  836. URxvt*color12: #9400D3
  837. URxvt*color13: #DB329D
  838. URxvt*color14: #9400D3
  839. URxvt*color15: #FF0099
  840. URxvt*underlineColor: #FF34B3
  841. URxvt*highlightColor: #191970
  842. URxvt*highlightTextColor: #EE00EE
  843.  
  844. !! extensions
  845.  
  846. !fullscreen
  847. URxvt.perl-ext-common: fullscreen
  848. URxvt.keysym.F11: perl:fullscreen:switch
  849.  
  850. ! ===== xterm
  851.  
  852. !! theme
  853.  
  854. XTerm*background : #000000
  855. XTerm*foreground : #67C8FF
  856. XTerm*cursorColor : #FF0099
  857. XTerm*colorUL : #366060
  858. XTerm*underlineColor : #FF34B3
  859. XTerm*color0 : #000000
  860. XTerm*color1 : #FF0000
  861. XTerm*color2 : #67C8FF
  862. XTerm*color3 : #FF1493
  863. XTerm*color4 : #099FFF
  864. XTerm*color5 : #CC00FF
  865. XTerm*color6 : #099FFF
  866. XTerm*color7 : #820571
  867. XTerm*color8 : #45013C
  868. XTerm*color9 : #099FFF
  869. XTerm*color10 : #FF0099
  870. XTerm*color11 : #E6FB04
  871. XTerm*color12 : #9400D3
  872. XTerm*color13 : #DB329D
  873. XTerm*color14 : #9400D3
  874. XTerm*color15 : #FF0099
  875.  
  876. ! remove the additional black border
  877. XTerm*borderWidth : 0
  878. XTerm*internalBorder : 2
  879.  
  880. ! set TERM env variable to use 256 colors
  881. XTerm*termName : xterm-256color
  882.  
  883. ! make alt key work normally
  884. XTerm*vt100.metaSendsEscape : true
  885.  
  886. ! save ~10,000 lines of scrollback
  887. XTerm*v100.saveLines : 10240
  888.  
  889. ! hide scrollbar
  890. XTerm*vt100.scrollBar : false
  891.  
  892. ! some black magic to change what characters XTerm considers "word delimiters"
  893. XTerm*charClass : 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48
  894.  
  895. ============================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement