Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.21 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. dhcp
  203.  
  204. inet6 autoconf
  205.  
  206. up powersave
  207.  
  208. # test changes:
  209.  
  210. ifconfig em0 down
  211.  
  212. ifconfig iwn0 down
  213.  
  214. pkill dhclient
  215.  
  216. sh /etc/netstart
  217.  
  218. # if that doesn't work reboot
  219.  
  220. # set usb mount directory and test usb mounting
  221. mkdir /mnt/usb
  222.  
  223. chown user:user /mnt/usb
  224.  
  225. mount -t msdos /dev/sd2i /mnt/usb
  226.  
  227. # disable xconsole window from autostarting at each login:
  228.  
  229. sed -i 's/xconsole/#xconsole/' /etc/X11/xenodm/Xsetup_0
  230.  
  231. # remap keys
  232.  
  233. ## map caps lock to esacpe key in tty:
  234.  
  235. # tty
  236. vi /etc/wsconsctl.conf:
  237.  
  238. keyboard.map+="keysym Caps_Lock = Escape"
  239.  
  240. # set UTF-8 for tty:
  241.  
  242. export LANG=en_US.UTF-8
  243.  
  244. export LC_ALL=en_US.UTF-8
  245.  
  246. # and add it to /etc/login.conf
  247.  
  248. :charset=UTF-8:\
  249. :LANG=en_US.UTF-8:\
  250. :LC_ALL=en_US.UTF-8:
  251.  
  252. # setup doas for user:
  253.  
  254. echo 'permit persist keepenv user' > /etc/doas.conf
  255.  
  256. # enable power managemnt options:
  257.  
  258. rcctl enable apmd
  259.  
  260. rcctl set apmd flags -A
  261.  
  262. rcctl start apmd
  263.  
  264. # add user to groups:
  265.  
  266. usermod -G staff user
  267.  
  268. usermod -G operator
  269.  
  270. usermod -G games
  271.  
  272. # change resource limits:
  273.  
  274. vi /etc/login.conf:
  275.  
  276. staff:\
  277. :datasize-cur=1024M:\
  278. :datasize-max=8192M:\
  279. :maxproc-cur=512:\
  280. :maxproc-max=1024:\
  281. :openfiles-cur=4096:\
  282. :openfiles-max=8192:\
  283. :stacksize-cur=32M:\
  284. :ignorenologin:\
  285. :requirehome@:\
  286. :tc=default:
  287.  
  288. # bump up kernal sysctls:
  289.  
  290. vi /etc/sysctl.conf:
  291.  
  292. # shared memory limits
  293. kern.shminfo.shmall=3145728
  294. kern.shminfo.shmmax=2147483647
  295. kern.shminfo.shmmni=1024
  296.  
  297. # semaphores
  298. kern.shminfo.shmseg=1024
  299. kern.seminfo.semmns=4096
  300. kern.seminfo.semmni=1024
  301.  
  302. kern.maxproc=32768
  303. kern.maxfiles=65535
  304. kern.bufcachepercent=90
  305. kern.maxvnodes=262144
  306. kern.somaxconn=2048
  307.  
  308. # lock screen automaticaly when you close the lid:
  309.  
  310. # make the directory for apm:
  311.  
  312. mkdir /etc/apm
  313.  
  314. # Then, create the file /etc/apm/suspend with the following contents:
  315.  
  316. #!/bin/sh
  317. pkill -USR1 xidle
  318.  
  319. # And make it executable:
  320.  
  321. chmod +x /etc/apm/suspend
  322.  
  323. # turn off ntpd google check:
  324.  
  325. sed -i '/google/d' /etc/ntpd.conf
  326.  
  327. # restart ntpd:
  328.  
  329. rcctl restart ntpd
  330.  
  331. # change hostname:
  332.  
  333. vi /etc/myname:
  334.  
  335. host
  336.  
  337. # exit and login as user
  338.  
  339. # uninstall fvwm
  340.  
  341. ## install ports tree
  342.  
  343. # fetch the ports tree:
  344.  
  345. cd /tmp
  346.  
  347. ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/{ports.tar.gz,SHA256.sig}
  348.  
  349. signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz
  350.  
  351. # untar the ports tree in /usr/ports:
  352.  
  353. cd /usr
  354.  
  355. tar xzf /tmp/ports.tar.gz
  356.  
  357. # configure ports:
  358.  
  359. # vi /etc/mk.conf:
  360.  
  361. WRKOBJDIR=/usr/obj/ports
  362.  
  363. DISTDIR=/usr/distfiles
  364.  
  365. PACKAGE_REPOSITORY=/usr/packages
  366.  
  367. ## install programs
  368.  
  369. # shell:
  370.  
  371. ## zsh:
  372.  
  373. doas pkg_add zsh
  374.  
  375. # editor:
  376.  
  377. ## neovim:
  378.  
  379. doas pkg_add neovim
  380.  
  381. # music and video:
  382.  
  383. ## mpd:
  384.  
  385. doas pkg_add mpd
  386.  
  387. ## mpc:
  388.  
  389. doas pkg_add mpc
  390.  
  391. ## ncmpcpp:
  392.  
  393. doas pkg_add ncmpcpp
  394.  
  395. ## ncmpc:
  396.  
  397. doas pkg_add ncmpc
  398.  
  399. ## mpv:
  400.  
  401. doas pkg_add mpv
  402.  
  403. # network:
  404.  
  405. ## tor:
  406.  
  407. doas pkg_add tor
  408.  
  409. # web browsing
  410.  
  411. ## tor-browser:
  412.  
  413. doas pkg_add tor-browser
  414.  
  415. ## firefox:
  416.  
  417. doas pkg_add firefox
  418.  
  419. ## qutebrowser:
  420.  
  421. doas pkg_add qutebrowser
  422.  
  423. ## w3m:
  424.  
  425. doas pkg_add w3m (
  426.  
  427. # file management:
  428.  
  429. ## thunar
  430.  
  431. ## ranger
  432.  
  433. # utilities:
  434.  
  435. ## feh
  436.  
  437. ## dunst
  438.  
  439. ## tree
  440.  
  441. ## scrot
  442.  
  443. ## neofetch
  444.  
  445. ## htop
  446.  
  447. ## wget
  448.  
  449. ## git
  450.  
  451. ## gimp
  452.  
  453. ## transmission
  454.  
  455. ## unzip
  456.  
  457. ## zathura
  458.  
  459. ## qemu
  460.  
  461. ## lxappearance *maybe uneeded*
  462.  
  463. # social media:
  464.  
  465. ## pidgin
  466.  
  467. ## pidgin-otr
  468.  
  469. ## pidgin-libnotify
  470.  
  471. ## irssi
  472.  
  473. ## irssi-otr
  474.  
  475. ## neomutt
  476.  
  477. # programming
  478.  
  479. ## ipython
  480.  
  481. # games
  482.  
  483. ## wesnoth
  484.  
  485. ## 0ad
  486.  
  487. ## minetest
  488.  
  489. ## nethack
  490.  
  491. ## supertux
  492.  
  493. ## supertuxkart
  494.  
  495. # fonts (come back too)
  496. ## noto-lite
  497.  
  498. ## liberation-fonts-ttf
  499.  
  500. ## chinese/arphicttf
  501.  
  502. ## chinese/font-std
  503.  
  504. ## hebrew/culmus
  505.  
  506. ## hebrew/elmar-fonts
  507.  
  508. ## japanese/font-ipa
  509.  
  510. ## japanese/font-ipa-uigothic
  511.  
  512. ## japanese/font-ipaex
  513.  
  514. ## japanese/font-kochi
  515.  
  516. ## japanese/font-migmix
  517.  
  518. ## japanese/font-migu
  519.  
  520. ## japanese/font-mona-ipa
  521.  
  522. ## japanese/font-motoya-al
  523.  
  524. ## japanese/font-mplus-ipa
  525.  
  526. ## japanese/font-sazanami
  527.  
  528. ## japanese/font-shinonome
  529.  
  530. ## japanese/font-takao
  531.  
  532. ## japanese/font-ume
  533.  
  534. ## japanese/font-vlgothic
  535.  
  536. ## x11-fonts/hanazono-fonts-ttf
  537.  
  538. ## japanese/font-mikachan
  539.  
  540. ## korean/aleefonts-ttf
  541.  
  542. ## korean/nanumfonts-ttf
  543.  
  544. ## korean/unfonts-core
  545.  
  546. ## x11-fonts/anonymous-pro
  547.  
  548. ## x11-fonts/artwiz-aleczapka
  549.  
  550. ## x11-fonts/dejavu
  551.  
  552. ## x11-fonts/inconsolata-ttf
  553.  
  554. ## x11-fonts/terminus-font
  555.  
  556. ## x11-fonts/cantarell-fonts
  557.  
  558. ## x11-fonts/droid-fonts-ttf
  559.  
  560. ## x11-fonts/doulos
  561.  
  562. ## x11-fonts/ubuntu-font
  563.  
  564. ## x11-fonts/isabella
  565.  
  566. ## x11-fonts/junicode
  567.  
  568. ## x11-fonts/khmeros
  569.  
  570. ## x11-fonts/padauk
  571.  
  572. ## x11-fonts/stix-fonts
  573.  
  574. ## x11-fonts/charis
  575.  
  576. ## x11-fonts/urwfonts-ttf
  577.  
  578. ## russian/koi8r-ps
  579.  
  580. ## x11-fonts/geminifonts
  581.  
  582. ## x11-fonts/cyr-rfx
  583.  
  584. ## x11-fonts/paratype
  585.  
  586. ## x11-fonts/gentium-plus
  587.  
  588. # make a build directory:
  589.  
  590. mkdir .builds
  591.  
  592. # window manageer
  593.  
  594. ## dwm
  595.  
  596. cd .builds
  597.  
  598. git clone git://git.suckless.org/dwm
  599.  
  600. cd dwm
  601.  
  602. # uncomment openbsd libs in config.mk:
  603.  
  604.  
  605.  
  606. # build dwm:
  607.  
  608. doas make clean install
  609.  
  610. # application menu
  611.  
  612. ## demenu
  613.  
  614. cd .builds
  615.  
  616. git clone git://git.suckless.org/dmenu
  617.  
  618. cd dmenu
  619.  
  620. # uncomment openbsd libs in config.mk
  621.  
  622. # build dmenu:
  623.  
  624. doas make clean install
  625.  
  626. # make subdirecories and change shell:
  627.  
  628. mkdir Documents Downloads Music Videos Pictures .builds
  629.  
  630. mkdir Pictures/.screenshots
  631.  
  632. # change shell for user:
  633.  
  634. chsh -s /usr/local/bin/zsh
  635.  
  636. # move files to the right places:
  637.  
  638. doas mv Fonts /usr/local/share/fonts
  639.  
  640. doas mkdir /usr/local/share/backgrounds
  641.  
  642. doas mv wallpapers /usr/local/share/backgrounds
  643.  
  644. ### Configurations ###
  645.  
  646. ============================================================================================================================
  647.  
  648. ## .xsession:
  649.  
  650. #####################
  651. #
  652. # .xsession
  653. #
  654. #####################
  655.  
  656.  
  657. # use UTF-8 everywhere
  658. export LANG=en_US.UTF-8
  659.  
  660. # specify location of .zshrc
  661. export ENV=$HOME/.zshrc
  662.  
  663. # load .Xresources
  664. xrdb -merge $HOME/.Xresources
  665.  
  666. # set background color
  667. xsetroot -solid back
  668.  
  669. # enable scrolling with trackpoint and middle button
  670. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
  671. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
  672. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
  673.  
  674. # remap caps lock to esacpe
  675. setxkbmap -option caps:escape
  676.  
  677. # start dwm
  678. exec dwm
  679.  
  680. ============================================================================================================================
  681.  
  682. ## .Xresources:
  683.  
  684.  
  685. !!!!!!!!!!!!!!!!!!!!!!!!!!
  686. !
  687. ! .Xresources
  688. !
  689. !!!!!!!!!!!!!!!!!!!!!!!!!!
  690.  
  691. ! to load .Xresources run:
  692.  
  693. ! xrdb ~/.Xresources
  694.  
  695. ! ===== fonts
  696.  
  697. !to find which font is used as the fall back font for a specific character run:
  698.  
  699. ! FC_DEBUG=4 pango-view -q -t '{character}' 2>&1 |\grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1
  700.  
  701. !to find the name of a font:
  702.  
  703. ! fc-list -v | grep *name*
  704.  
  705. Xft.autohint : 0
  706. Xft.lcdfilter : lcddefault
  707. Xft.hintstyle : hintslight
  708. Xft.hinting : 1
  709. Xft.antialias : 1
  710. Xft.rgba : rgb
  711. *font : Terminus (TTF):size=9
  712.  
  713. ! ===== urxvt:
  714.  
  715. ! scrollbar
  716. URxvt.scrollBar: false
  717.  
  718. ! transparency
  719. URxvt.depth: 32
  720. URxvt.background: [95]#000000
  721.  
  722. ! fading
  723. URxvt*fading: 30
  724.  
  725. ! cursor
  726. URxvt*cursorUnderline: true
  727. URxvt*cursorBlink: true
  728. URxvt*cursorColor: #FF0099
  729.  
  730. !! theme
  731. !background color
  732. URxvt*background: #000000
  733.  
  734. ! font color
  735. URxvt*foreground: #67C8FF
  736.  
  737. ! other colors
  738. URxvt*color0: #000000
  739. URxvt*color1: #FF0000
  740. URxvt*color2: #67C8FF
  741. URxvt*color3: #FF1493
  742. URxvt*color4: #099FFF
  743. URxvt*color5: #CC00FF
  744. URxvt*color6: #099FFF
  745. URxvt*color7: #820571
  746. URxvt*color8: #45013C
  747. URxvt*color9: #099FFF
  748. URxvt*color10: #FF0099
  749. URxvt*color11: #E6FB04
  750. URxvt*color12: #9400D3
  751. URxvt*color13: #DB329D
  752. URxvt*color14: #9400D3
  753. URxvt*color15: #FF0099
  754. URxvt*underlineColor: #FF34B3
  755. URxvt*highlightColor: #191970
  756. URxvt*highlightTextColor: #EE00EE
  757.  
  758. !! extensions
  759.  
  760. !fullscreen
  761. URxvt.perl-ext-common: fullscreen
  762. URxvt.keysym.F11: perl:fullscreen:switch
  763.  
  764. ! ===== xterm
  765.  
  766. !! theme
  767.  
  768. XTerm*background : #000000
  769. XTerm*foreground : #67C8FF
  770. XTerm*cursorColor : #FF0099
  771. XTerm*colorUL : #366060
  772. XTerm*underlineColor : #FF34B3
  773. XTerm*color0 : #000000
  774. XTerm*color1 : #FF0000
  775. XTerm*color2 : #67C8FF
  776. XTerm*color3 : #FF1493
  777. XTerm*color4 : #099FFF
  778. XTerm*color5 : #CC00FF
  779. XTerm*color6 : #099FFF
  780. XTerm*color7 : #820571
  781. XTerm*color8 : #45013C
  782. XTerm*color9 : #099FFF
  783. XTerm*color10 : #FF0099
  784. XTerm*color11 : #E6FB04
  785. XTerm*color12 : #9400D3
  786. XTerm*color13 : #DB329D
  787. XTerm*color14 : #9400D3
  788. XTerm*color15 : #FF0099
  789.  
  790. ! remove the additional black border
  791. XTerm*borderWidth : 0
  792. XTerm*internalBorder : 2
  793.  
  794. ! set TERM env variable to use 256 colors
  795. XTerm*termName : xterm-256color
  796.  
  797. ! make alt key work normally
  798. XTerm*vt100.metaSendsEscape : true
  799.  
  800. ! save ~10,000 lines of scrollback
  801. XTerm*v100.saveLines : 10240
  802.  
  803. ! hide scrollbar
  804. XTerm*vt100.scrollBar : false
  805.  
  806. ! some black magic to change what characters XTerm considers "word delimiters"
  807. XTerm*charClass : 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48
  808.  
  809. ============================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement