unix/openbsd.md
... ...
@@ -10,7 +10,7 @@ dd if=/dev/urandom of=/dev/rsd0c bs=1m
10 10
fdisk -iy sd0 #mbr
11 11
disklabel -E sd0
12 12
Label editor (enter '?' for help at any prompt)
13
- sd0> a a
13
+ sd0> a a
14 14
offset: [64]
15 15
size: [976773104] *
16 16
FS type: [4.2BSD] RAID
... ...
@@ -18,14 +18,25 @@ disklabel -E sd0
18 18
sd0> q
19 19
No label changes.
20 20
sh MAKEDEV sd2 #keydisk
21
+dd if=/dev/urandom of=/dev/rsd0c bs=1m
21 22
fdisk -iy sd2 #mbr
22 23
disklabel -E sd2
23 24
Label editor (enter '?' for help at any prompt)
24
- sd2> a a
25
- offset: [64]
26
- size: [7831488] 1024
25
+ sd2> a a
26
+ offset: [64] 31205376 #total - 2048
27
+ size: [2048] 1024
27 28
FS type: [4.2BSD] RAID
28 29
sd2*> w
30
+ sd2> a b
31
+ offset: [64] 31206400 #total - 1024
32
+ size: [1024] *
33
+ fs type: [swap] RAID
34
+ sd2*> w
35
+ sd2> a i
36
+ offset: [64]
37
+ size: [31205312] *
38
+ fs type: [swap] msdos
39
+ sd2*> w
29 40
sd2> q
30 41
No label changes.
31 42
bioctl -c C -k sd2a -l sd0a softraid0
... ...
@@ -38,8 +49,69 @@ exit
38 49
### post install
39 50
```
40 51
echo "permit nopass <username> > /etc/doas.conf
41
-pkg_add -u
42 52
```
53
+
54
+```
55
+doas pkg_add -u
56
+doas pkg_add \
57
+ git \
58
+ vim \
59
+ herbstluftwm \
60
+ rxvt-unicode \
61
+ stow \
62
+ zsh \
63
+ unclutter \
64
+ xbindkeys \
65
+ keychain \
66
+ dmenu \
67
+ gnupg \
68
+ irssi \
69
+ qutebrowser \
70
+ sacc \
71
+ xcape \
72
+ mpv \
73
+ wget
74
+doas ln -s /usr/local/bin/zsh /usr/bin/zsh
75
+git clone git://git.pyratebeard.net/dotfiles.git dot
76
+cd dot
77
+stow *
78
+mkdir ~/.fonts
79
+cd ~/.fonts
80
+wget https://pyratebeard.net/trigon-font/trigon8x15r.bdf
81
+# cp .xinitrc to .xsession
82
+doas chsh pyratebeard
83
+# urxvt LANG
84
+```
85
+
86
+#### wifi
87
+* on arch
88
+```
89
+lftp "http://firmware.openbsd.org/firmware/7.2/"
90
+cd ok, cwd=/firmware/7.2
91
+lftp firmware.openbsd.org:/firmware/7.2> mget *
92
+69709649 bytes transferred in 124 seconds (549.2 KiB/s)
93
+Total 26 files transferred
94
+lftp firmware.openbsd.org:/firmware/7.2> quit
95
+quit
96
+cd ../
97
+tar czf ./firmware.tgz openbsd_firmware
98
+scp firmware.tgz laptop:
99
+```
100
+
101
+* in openbsd
102
+```
103
+tar xzf firmware.tgz
104
+doas fw_update -p openbsd_firmware/
105
+doas vi /etc/hostname.iwm0
106
+ join "<ssid>" wpakey "<password>"
107
+ #join "<ssid>" wpakey "<password>"
108
+ #join "<ssid>" wpakey "<password>"
109
+ inet autoconf
110
+doas sh /etc/netstart iwm0
111
+```
112
+
113
+#### gui
114
+
43 115
## firewall
44 116
```
45 117
vi /etc/pf.conf
... ...
@@ -47,6 +119,14 @@ vi /etc/pf.conf
47 119
48 120
## packages
49 121
* `pkg_info` show all packages installed by `pkg_add`
122
+* use `pkg_info -Q <package_name>` or `pkglocate <package_name>` (requires installing `pkglocatedb`) for searching
123
+* mirror in `/etc/installurl`
124
+
125
+## daemons
126
+```
127
+rcctl ls all
128
+rcctl start sshd
129
+```
50 130
51 131
## devices
52 132
* list attached devices
... ...
@@ -74,5 +154,14 @@ newfs_msdos /dev/rsd2b
74 154
75 155
## misc
76 156
* hostname - /etc/myname
77
-
157
+* changing terminal font
158
+ * on arch
159
+ ```
160
+ pacman -S cabel-install ghc
161
+ git clone "https://github.com/polachok/bdf2wscons"
162
+ cd bdf2wscons
163
+ cabel install
164
+ bdf2wscons trigon8x15.bdf >
165
+ ```
166
+
78 167
[softraid encryption]: https://www.openbsd.org/faq/faq14.html#softraidFDE