2017年9月23日土曜日

openbsd 6.2 と lumina と dual boot



luminaです。
クリックして add to quick lunch すると左下のようにメニューがバーに加わります
ctrl + F2 で あたらし workspace がでます。
chroniumもOKで、xfce4 と別れの時です。


まず寄り道
苫米地さんのお言葉に私見を加えました


お釈迦様が禁じたことが2つあります
もっとあるかもしれません


1)文語を使わないこと
サンスクリット語は文語です
従って民衆は 樋口一葉のたけくらべ をよむようなもので理解することができません.
したがってサンスクリット語の文献は本当はだめです。
釈迦の布教ははマガダ国なのでその言葉でしゃべったのですがこれは残ってないです
従って残されたのは パーリ語(口語)です。


日本ではお経を漢字の音読みでますがこれでは全く意味が分かりません。
釈迦の教えに背いてます。
(なおキリスト教も最初は民衆にわからないラテン語でした。 グーテンベルクの印刷機がでてはじめてキリスト教が口語で知られるようになり宗教改革が起こったそうです)

http://ir.nul.nagoya-u.ac.jp/jspui/bitstream/2237/17970/1/k10039_2.pdf
によると 東南アジアでは上座部仏教でパーリ語仏典がよまれてるらしい。



2)マントラつまり呪文を唱えないこと
バラモン教は呪文が大好きです
これを釈迦は禁止してます
しかし日本仏経ではこのマントラが大好きです


知識を2つ
インドで起こった仏教は2つのルートで伝わりました
1つは南方系でこれは東南アジアの方にきました


もう一つはチベットから中国に行った方です
チベットのはサンスクリット語です。
これも文語で問題なのですが、さらに悪いのは中国にいくと道教の影響を受けてしまいました。
その典型が 道教の無に影響された禅宗です。
中国仏教は 釈迦の説いた教えと離れてしまいました。


そして日本仏教は中国仏教をそのまま取り入れました。
その証拠はお経をみればわかります。
漢文です。
サンスクリットの経典が日本に入ってきたのは昭和になってからで、
それまでは日本の仏教は中国仏教で 釈迦の教えではありませんでした。


女禁制ではない
釈迦の教団に入るには自分の全財産を自分の家に残して入ってきました
従って教団に寄進しませんでした
よって釈迦の教団は金銭的には貧乏でした。
釈迦を含めて持っているものは 托鉢のお椀1つと 三枚の衣と 爪楊枝でした。

しかもその衣は亡くなった人の着ていたものからで
それを川で洗って 継ぎはぎして 身につけていたものでした・
高層の着る黄色の袈裟は糞尿衣ですし、赤いのは血の色なのでしょう。

食事は朝1日に1回だけで それは托鉢でもらったものです。
寝る時には衣を地面にしきその上に素裸でねてました。


従って初期の釈迦教団は女性を受け入れらいれなかったのです。
後になってお金持ちから建物を寄進されて初めて女性を受け入れることができました。

つまり女人禁制ではなかったのです。

釈迦のさとったものは すべてを重要と考えることでした。
また 瞑想とは頭を無にすることではなく 脳を120%働かせ(例えば悟りについて考える)、雑念ははらうことでした。
キリスト教、浄土宗は すくいを主眼としますが、 
釈迦の目指したものは 生老病死の四苦を解く悟りでした。

釈迦の生涯
http://gihyo.jp/admin/serial/01/bsd-yomoyama/0069



1)  LUMINAについて


「KDEやGNOMEはどんどんLinuxに依存した機能を使うようになってきていて,移植し続けるのが多大な努力を要するようになっている。
作業は膨大だが,Linuxと完全に同じ機能を有効にすることは難しく,労力の割に合っていない。
しかも,必要としていないソフトウェアの移植も行わないといけないし,もっと軽量で自分の使いたい機能が使える環境が欲しいが存在していない」

そこで開発者らは最近のデスクトッププロトコルに対応しつつ,軽量で,さまざまな機能をプラグイン的に組み合わせて利用できるフレームワークの開発に着手します。



LuminaはTrueOSに限らず,ほかのディストリビューションでも有力な候補になる可能性があります。
Linux特有の機能に依存しないので,そのあたりもさまざまなシーンで扱いやすくなっています。


まだluminaは問題はあるが 将来性に期待しよう、


逆に
Lumina は FreeBSD で使うことをメインとしており、Linux については
考慮されていません
との由  https://wiki.archlinux.jp/index.php/Lumina
鰹節は   日本料理に使うことをメインとしており フランス料理での使用については考慮されてません



cat xterm.bat                                                                
xterm -fn 10x20


cat .xsession                                                                
#startxfce4
exec start-lumina-desktop



と起動。

cat .profile                                                                 
# $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $
#
# sh/ksPATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
export PATH HOME TERM
#####################
export PKG_PATG=http://ftp.openbsd.org/pub/OpenBSD/6.2/packages/amd64
export XMODIFIERS=@im=ibus
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"




luminaを pkg_add でいれた



2) dualboot ; openbsd or archlinux

archlinux's grub cannot do this task .


archlinux を インストール後 
openbsdを install62.fs にてインストールしました.
( http://openbsd-akita.blogspot.jp/2015/10/openbsd-uefi_15.html )

すると

# disklabel -E sd0
Label editor (enter '?' for help at any prompt)
> p
OpenBSD area: 108067216-312581775; size: 204514559; free: 38
#                size           offset  fstype [fsize bsize   cpg]
  a:        202424032        110157728  4.2BSD   2048 16384 12958 # /
  b:          2090489        108067216    swap                    # none
  c:        312581808                0  unused                 
  i:          1048576             2048   MSDOS                 
  j:        104857600          1050624  ext2fs                 
  k:          2097119        105970096 unknown    実はLINUXのSWAP

となっていて

mount_msdos /dev/sd0i /m0i
するとわかるように


# ls -lSr /m0i/EFI/boot/                                                     
total 960
-rw-r--r--  1 root  wheel       113664   Sep 27 14:31 BOOTIA32.EFI
-rw-r--r--  1 root  wheel       122368   Sep 27 15:20 bootx64-AL.efi
-rw-r--r--  1 root  wheel  126976 Sep 28 00:19 bootx64.efi
-rw-r--r--  1 root  wheel  126976 Sep 27 14:45 bootx64-OB.efi

です。
Archlinuxも OpenBSDも 同じbootx64.efiという同じ名前bootx64.efiなのです。
したがって
cp bootx64-AL.efi bootx64.efi
とすれば つぎは ARCHlinuxが立ち上がります。

そこでシェルスクリプトです。

# cat switch-2-ArchLinux.bat                                                 
mount_msdos /dev/sd0i /m0i
cp /m0i/EFI/boot/bootx64-AL.efi  /m0i/EFI/boot/bootx64.efi


archlinuxでも 次からはOpenBSDも同じ考え方でいけます



なお
 fdisk -l /dev/sda
Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7BFA3233-9471-4A5C-B9A9-AB5C40366755

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M EFI System       <----------openbsdのsd0i
/dev/sda2    1050624 105908223 104857600   50G Linux filesystem<----archlinux
/dev/sda3  105970096 108067214   2097119 1024M Solaris swap<-------linux swap
/dev/sda4  108067216 312581774 204514559 97.5G OpenBSD data<----openbsd





3)印刷
まず愚痴です
仕事場のprinterは USBプリンターなので 苦しい
自宅のprinterは  wifiなのでつながるのだが ドライバーがCUPSではサポートされてない。
で 以下抜け道を書きます。


状況は
openbsd---wired LAN---HUB---archlinux---> USB printer(EPSON_PX-401A)

です
また-archlinuxは cupsで陰圧できるようにしてます。
openbsdには cupsはいれてません。
 

まず  openbsd で。

1) たとえば seamonkeyで print to file します。
file is mozilla.pdf

2)./print.bat  mozilla.pdf

-------------------
なお print.bat は
scp $1 taro@192.168.10.185:/home/taro
ssh taro@192.168.10.185
-------------------



2) on the same terminal (もっとも sshでarchlinuxに入ってるのだが)
./print-at-arch.bat  mozilla.pdf
でおしまい

----------------
なお print-at-arch.bat は
lp -dEPSON_PX-401A $1
----------------

簡単ですね。

ただ この方法の欠点は archkinuxがないと印刷できないですねー

https://192.168.10.185:631/printers/


4)cloning 
usbではなく  PCのなかのドライブ につける。
archlinuxを起動して
dd if=/dev/sdcクローン元  of=/dev/sddクローン先  bs=32k
つまり 
USBなハードディスクと PCの中につけたハードディスクは 性質がまるで違う!
クローン先が USB な dupicatorにつけたHD ではだめ。

つまりarchlinux の iso を焼きつけた USBメモリで 起動し 


dd if=/dev/sda of=/dev/sdc bs=32k


なお

sda はノートのHD
sdc はduplicatorのHD
sdb はUSBメモリ
は あかんたれ



5)日本語入力
ja-mplus-ttf と  ibus-anthyをいれて

.profile   を
                                                  
# $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $
#
# sh/ksh initialization

PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
export PATH HOME TERM

export PKG_PATH=http://ftp.openbsd.org/pub/OpenBSD/6.2/packages/amd64

export XMODIFIERS=@im=ibus
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"







6) wifi 復活 ほっとする
 これで スマホに負担かけなくてもいい(USB テザリング)
cat /etc/hostname.iwm0
nwid Buffalo-A-6A50
wpakey n6fxuitf
dhcp

にて
iwm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr a0:d3:7a:2c:f0:d8
        index 1 priority 4 llprio 3
        groups: wlan egress
        media: IEEE802.11 autoselect (HT-MCS6 mode 11n)
        status: active
        ieee80211: nwid Buffalo-A-6A50 chan 36 bssid cc:e1:d5:80:6a:54 86% wpakey 0xfd05e70fc52c1b0f5da18d343b4bb098f50f4bfad391dca51e7c4503d4b33fc7 wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp
        inet 192.168.11.4 netmask 0xffffff00 broadcast 192.168.11.255




*) 
i think that 
there is the OpenBSD version of Temple Expiatori de la Sagrada Família in Theo's brain .

the  church of OpenBSD is under constructing for ever alike Gaudí's one  . 
i love openbsd for its beautiful symmetry & simplicity.






2017年5月18日木曜日

server by Raspberry pi 3

i use snapshots on 16th May .


8GB micro SDは セルモーターのようなもので
rootは 32G USB にあります。
WWWのファイルは sata ハードディスク にあります。




# ./comment-out.bat /etc/rc.local                                              
/start.bat

そして

./comment-out.bat /start.bat                                                                       
umount /WWW
mount /dev/sd1a /WWW
rm /etc/resolv.conf
echo 'nameserver 8.8.8.8' > /etc/resolv.conf
cat /etc/resolv.conf
swapon     /dev/sd1b
swapctl -d /dev/sd0b
/etc/rc.d/nginx restart



一応
# ./comment-out.bat /etc/fstab                                                                       
c87666335bcb7b91.b none swap sw
c87666335bcb7b91.a / ffs rw,wxallowed 1 1



WWWサーバー with basic auth
cat /etc/rc.conf.local                                         
httpd_flags=""


cat /var/www/htdocs/index.html
123


/etc/httpd.conf                                            
ext_addr="*"
server "default" {
        listen on $ext_addr port 80


}
i was greatly  helped by william at openbsd arm mailing list .
# htpasswd  /var/www/htpasswd.conf user-X        
Password: 
Retype Password: 

# chown www /var/www/htpasswd.conf

# chmod 600 /var/www/htpasswd.conf

# /etc/httpd.conf                                            
ext_addr="*"
server "default" {
        listen on * port 80
        authenticate "secure area" with "/htpasswd.conf"
    }




以下の NGINX は 今はうまく行かない
# ./comment-out.bat /etc/nginx/nginx.conf   
worker_processes  1;
worker_rlimit_nofile 1024;
events {
    worker_connections  800;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    index         index.html index.htm;
    keepalive_timeout  65;
    server_tokens off;
    server {
        listen       80;
        server_name  straw-berry.mydns.jp;
        root         /WWW/d1;
auth_basic "Restricted";
auth_basic_user_file /var/www/.htpasswd;
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /WWW/d1;
        }
    }
}



後述のwifiルーター狙いで

# ./comment-out.bat /etc/pf.conf    
ext=smsc0
icmp_types = "{echoreq, unreach}"
set block-policy return
set loginterface $ext
set skip on lo0
match in all scrub (no-df max-mss 1440)
match out on $ext inet from !($ext:network) to any nat-to ($ext:0)
block log all
pass out quick
pass in on $ext inet proto tcp from any to ($ext:network) port 22 flags S/SA keep state
pass in on $ext inet proto tcp from any to ($ext:network) port 80 flags S/SA keep state
pass in quick inet proto { tcp udp gre } from any to any
pass in quick inet proto icmp all icmp-type $icmp_types keep state


どうなってるかというと
# pfctl -sr                                                                                          
match in all scrub (no-df max-mss 1440)
match out on smsc0 inet from ! (smsc0:network) to any nat-to (smsc0:0)
block return log all
pass out quick all flags S/SA
pass in on smsc0 inet proto tcp from any to (smsc0:network) port = 22 flags S/SA
pass in on smsc0 inet proto tcp from any to (smsc0:network) port = 80 flags S/SA
pass in quick inet proto icmp all icmp-type echoreq
pass in quick inet proto icmp all icmp-type unreach
pass in quick inet proto tcp all flags S/SA
pass in quick inet proto udp all
pass in quick inet proto gre all


# ./comment-out.bat /etc/rc.conf.local                                                            
#dhcpd_flags=
pf=YES                  # Packet filter / NAT
sshd_flags=






wifi ルーター
wifi-AP.bat  で wifi ルーターを作ります 
PCs--(wifi)-->rum0:OpenBSD:smsc0--(wired)-->router-->internet
ですね。

# ./comment-out.bat /etc/dhcpd.interfaces
rum0


# ./comment-out.bat /etc/dhcpd.conf
option  domain-name-servers 8.8.8.8;
subnet 192.168.120.0 netmask 255.255.255.0 {
        option routers 192.168.120.1;
        range 192.168.120.11 192.168.120.15;
}


# ./comment-out.bat ./wifi-AP.bat
sh /etc/netstart
pfctl -f /etc/pf.conf                                                                             
pfctl -sr         
ifconfig rum0 inet 192.168.120.1 netmask 255.255.255.0 \
media autoselect mediaopt hostap nwid openbsdAP  wpakey 1234567890 \
chan 1 up
/etc/rc.d/dhcpd  restart




finally


Rpi3 serves as sshd server , www server and wifi router .

この変更を うっかり忘れてはまった



# ./comment-out.bat /start.bat                                                                               sysctl  net.inet.ip.forwarding=1
rm /etc/resolv.conf
echo 'nameserver 8.8.8.8' > /etc/resolv.conf
cat /etc/resolv.conf
/etc/rc.d/httpd -f restart
sh /etc/netstart
pfctl -f /etc/pf.conf                                                                             
pfctl -sr         
ifconfig rum0 inet 192.168.120.1 netmask 255.255.255.0 \
media autoselect mediaopt hostap nwid openbsdAP  wpakey 100100100 \
chan 1 up
/etc/rc.d/dhcpd  -f restart



# head /etc/pf.conf  
ext_if=smsc0
int_if=rum0
table <martians> { 0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16      \
                   172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 224.0.0.0/3  \
                   192.168.1.0/24                                       \              
                   198.18.0.0/15 198.51.100.0/24                        \
                   203.0.113.0/24                                       \ 
1.0.1.0/24 \



# tail -30 /etc/pf.conf

block in quick on ext_if from <martians> to any
icmp_types = "{echoreq, unreach}"
set block-policy return
set loginterface $ext_if
set skip on lo0
match in all scrub (no-df max-mss 1440)
match out on $ext_if inet from !($ext_if:network) to any nat-to ($ext_if:0)
block log all
pass out quick
pass in on $ext_if inet proto tcp from any to ($ext_if:network) port 22 flags S/SA keep state
pass in on $ext_if inet proto tcp from any to ($ext_if:network) port 80 flags S/SA keep state
pass in quick inet proto { tcp udp gre } from any to any
pass in quick inet proto icmp all icmp-type $icmp_types keep state





# ./comment-out.bat /etc/rc.local                                                                                         
/start.bat



# ./comment-out.bat /etc/dhcpd.interfaces                                                                                   
rum0




# ./comment-out.bat /etc/dhcpd.conf                                                                                         
option  domain-name-servers 8.8.8.8;
subnet 192.168.120.0 netmask 255.255.255.0 {
        option routers 192.168.120.1;
        range 192.168.120.11 192.168.120.15;
}




# ./comment-out.bat /etc/httpd.conf                                                                                         
ext_addr="*"
server "default" {
        listen on * port 80
        authenticate "secure area" with "/htpasswd.conf"
    }

/var/www/htdocs/index.html をみてる




# ./comment-out.bat /etc/rc.conf.local                                                                                      
pf=YES                  # Packet filter / NAT
sshd_flags=
httpd_flags=



# df
Filesystem  512-blocks      Used     Avail Capacity  Mounted on

/dev/sd0a     57683640   1541704  53257756     3%    /
と 32GUSBメモリだけでも スカスカ!






監視
 1)簡易./comment-out.bat atack.bat                                                                                    
pfctl -f /etc/pf.conf
tail -20 /var/log/authlog
read X
echo $X
awk '/.*\..*\..*\..*$/ {print $10 $11    }' /var/log/authlog | sed "s/from//g" |sed "s/port//g"  \
|sed "s/root//g" | sed "s/exceededfor//g" | sed "s/.*:11://g"


 2)snort

  ls -l /etc/snort/                                                                                              
total 181268
-rw-r--r--  1 _snort  wheel         3757 May 21 10:06 classification.config
drwxr-xr-x  2 _snort  wheel          512 May 18 11:27 etc
-rw-r--r--  1 _snort  wheel        31971 May 21 10:06 gen-msg.map
-rw-r--r--  1 _snort  wheel         2060 May 21 10:06 generators
-rw-r--r--  1 _snort  wheel          687 May 21 10:06 reference.config
drwxr-xr-x  4 _snort  wheel         3584 May 21 17:51 rules
-rw-r--r--  1 _snort  wheel        27941 May 21 10:06 snort.conf
-rw-r--r--  1 _snort  wheel        27941 May 21 10:17 snort.conf-ori
-rw-r--r--  1 _snort  foge  46027008 May 21 17:32 snortrules-snapshot-2983.tar.gz
-rw-r--r--  1 _snort  foge  46448896 May 21 17:22 snortrules-snapshot-2990.tar.gz

-rw-r--r--  1 _snort  wheel         2335 May 21 10:06 threshold.conf
-rw-r--r--  1 _snort  wheel       160606 May 21 10:06 unicode.map

 /etc/rc.d/snort -f restart

./comment-out.bat /etc/snort/snort.conf |  grep RULE
var RULE_PATH /etc/snort/rules
var SO_RULE_PATH /etc/snort/so_rules
var PREPROC_RULE_PATH /etc/snort/preproc_rules
以下略

........

2017年4月18日火曜日

openbsd 6.1 特に xenodm


fake history made by politicians

Politicians cannot do olympic level figure skating .Politicians do not have the technology to explore history .
Therefore history should be left to historians.
Conversely, historians should not do politics at present .

Regarding the historical problems 
lying between the two countries, 
I think that it should be decided openly 
by discussions with two national academics .



某国に行ってそこの屋台を食べた
確かに美味しい
しかし衛生と言う概念がまるでない
生野菜はそこのあたりの水で洗っているので食べたら細菌性の下痢の心配がある・

油はドブに捨てた油から作られてるかもしれない。

windows にはこの衛生概念違ったセキュリティへの配慮がかけている。
あなたは美味しいけど危険な windows を食べ続けますか。
あるいは
コードの正確さから生まれるセキュリティなopenbsdにのりかえますか
旅客機にとって一番大事なことは安全に飛ぶことです

といいながら
白河の 清きに魚も 住みかねて もとの濁りの 田沼恋しき
ということで中庸なLINUXを常用してる日和見な自分がいる


これが現実だね(ちょっと言われてその気になって、女房にしたのがおおまちがい。
USB wifi ,bluetooth まるでダメ。 RUM0はOKだったけどねー )


と いうふうに日本語入力 OKです。
今回の壁は xenodm でした。


ビデオは ここ

     寄り道への誘惑 openbsdとUEFIは ここ


1) .profile
export PKG_PATH=ftp://ftp.jaist.ac.jp/pub/OpenBSD/6.1/packages/i386



2)pkg_add nano lftp xfce




3)cat .xsession                                                                                     
startxfce4



4)cat /etc/rc.conf.local   
xenodm_flags=
にて xfce4が始まる


for autologin
by https://marc.info/?l=openbsd-misc&m=149261350115837&w=2
Just add to /etc/X11/xenodm/xenodm-config
                  DisplayManager.*.autoLogin: your_user_name



5)pkg_add chromium   seamonkey seamonkey-i18n-ja
chromeは パッケージからでも ポートからやっても立ち上がらないね


6)pkg_add ibus-anthy   ja-mplus-ttf


cat .profile                                                                                      

# $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $

#

# sh/ksh initialization



PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.

export PATH HOME TERM

              

export PKG_PATH=ftp://ftp.jaist.ac.jp/pub/OpenBSD/6.1/packages/i386

                 

export XMODIFIERS=@im=ibus

export GTK_IM_MODULE="ibus"

export QT_IM_MODULE="ibus"





7)pkg_add xfce4-screenshooter
      pkg_add sakura
      pkg_add  xfce4-mixer
      
      
# ./comment-out.bat /etc/rc.local                                             
if [ -x /usr/local/bin/slim ]; then
        echo -n ' slim'; ( sleep 5; /usr/local/bin/slim -nodaemon ) &
fi

8)boot openbsd by grub
fdisk -l /dev/sda
Device     Boot    Start       End  Sectors  Size Id Type
/dev/sda1        4196352  61499391 57303040 27.3G 83 Linux
/dev/sda2           2048   4196351  4194304    2G 82 Linux swap / Solaris

/dev/sda4       61499392 156301487 94802096 45.2G a6 OpenBSD




/boot/grub/grub.cfg
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi
function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}
if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod btrfs
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos1' --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  9d7e1366-bafa-4822-86da-4f36ff6893cc
else
  search --no-floppy --fs-uuid --set=root 9d7e1366-bafa-4822-86da-4f36ff6893cc
fi
    font="/ROOT/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=15
else
  set timeout=15
fi
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9d7e1366-bafa-4822-86da-4f36ff6893cc' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod btrfs
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos1' --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  9d7e1366-bafa-4822-86da-4f36ff6893cc
else
  search --no-floppy --fs-uuid --set=root 9d7e1366-bafa-4822-86da-4f36ff6893cc
fi
echo 'Loading Linux linux ...'
linux /ROOT/boot/vmlinuz-linux root=UUID=9d7e1366-bafa-4822-86da-4f36ff6893cc rw rootflags=subvol=ROOT  quiet
echo 'Loading initial ramdisk ...'
initrd  /ROOT/boot/initramfs-linux.img
}

menuentry 'openbsd' {
set root='hd0,msdos4'
chainloader +1
}

if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;

fi






my now state

.profile
PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
export PATH HOME TERM
export PKG_PATH=ftp://ftp.jaist.ac.jp/pub/OpenBSD/6.1/packages/i386
export XMODIFIERS=@im=scim
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
 
zzz.bat          より軽いscimをこれで開始                                         
scim -d &
sleep 1
echo '-------'
kill `  ps ax | grep xfce4-terminal                                  |  cut -d ' ' -f 1 `
kill `  ps ax | grep xfce4-terminal  | sed "s/^ //g"                 |  cut -d ' ' -f 1 `
kill `  ps ax | grep xfce4-terminal  | sed "s/^ //g" | sed "s/^ //g" |  cut -d ' ' -f 1 `





i use SSD of 32 GB .

# df
Filesystem  512-blocks      Used     Avail Capacity  Mounted on
/dev/sd0a     58447576   4436968  51088232     8%    /

only 8%


# top ( 1GB memory)
and in using seamonkey
 load averages:  1.34,  1.04,  0.50                                       i3.lan 05:44:57
61 processes: 3 running, 57 idle, 1 on processor                                up  0:04
CPU states: 33.3% user,  0.0% nice, 66.7% system,  0.0% interrupt,  0.0% idle
Memory: Real: 297M/634M act/tot Free: 349M Cache: 196M Swap: 0K/1028M
  PID USERNAME PRI NICE  SIZE   RES STATE     WAIT      TIME    CPU COMMAND
99439 fuji      32    0  187M  200M run       -         0:49  2.83% seamonkey
64681 _x11      29    0   14M   28M run       -         0:07  0.68% Xorg
89616 fuji       2    0 3416K   14M sleep     poll      0:01  0.34% xfwm4
63670 fuji      29    0 6188K   21M run       -         0:01  0.05% xfce4-terminal
81230 fuji       2    0 3620K   16M sleep     poll      0:01  0.05% xfce4-panel
 5154 fuji       2    0 6864K   18M sleep     poll      0:01  0.00% xfdesktop
    1 root      10    0  384K  368K idle      wait      0:01  0.00% init
57588 root      10    0 1712K 6488K idle      wait      0:00  0.00% slim
70594 fuji       2    0 1376K 8920K sleep     poll      0:00  0.00% xfce4-session





温度 CPU temperature
 ./comment-out.bat /etc/rc.conf.local  | grep sensor
sensorsd_flags=



./comment-out.bat temp.bat                                                   
n=0
while true
do
n=`expr $n + 1`
echo $n '---------------'
sysctl -a | grep "hw.sensors" | grep cpu
echo
echo
sleep 5
done


9)HDD 80GB -> SSD 32GB
a) install minimum openbsd to SSD 32 GB
b) boot openbsd by [usb openbsd ] or perhaps [cd openbsd]
c) attach HDD to usb-sata converter
d) attach SSD to usb-sata converter
e)mount /dev/sd1a /s1   <------HDD
f) mount /dev/sd2a /s2   <------SSD
g) (cd /s1 ; tar cvpf - .)|(cd /s2 ; tar xpf -)
h) umount /s1 ; umount /s2
i) atach SSD to PC
j) boot by cd and upgrade




i386 , celeron, 1G memory , 80GB harddisk-> https://youtu.be/e4s6-iMEzY4
the end of real openbsd
----------------------------------------------<





the following is virtual openbsd on archlinux.

#1) qemu-img create -f qcow2 OpenBSD30-61.img 30G

#2) qemu-system-x86_64 -hda OpenBSD30-61.img -enable-kvm  -m 4096 -cdrom ./install61.iso  -boot d -monitor stdio

#3)

modprobe tun
sysctl net.ipv4.ip_forward=1
systemctl start libvirtd
netctl start bridge


modprobe -r kvm_intel 
modprobe kvm_intel nested = 1

netctl restart bridge

qemu-system-x86_64 -enable-kvm -m 4096 -hda OpenBSD30-61.img -net nic,macaddr=52:54:00:12:11:11 -net tap,ifname=tap0,script=/etc/qemu-ifup


#qemu-system-x86_64 -enable-kvm  -soundhw sb16,adlib   -m 4096 -hda OpenBSD30-61.img -net nic,macaddr=52:54:00:12:11:11 -net tap,ifname=tap0,script=/etc/qemu-ifup





if you can not conect internet on arch , plese do  netctl restart bridge







my cheap printer(DCP-J325N) is not supported by cups .
cat print.bat                                                                
scp mozilla.pdf ya@192.168.80.116:/home/ya
ssh ya@192.168.80.116

and
lp mozilla.pdf 

then i get print ! 
cups is not needed .

ps is also OK .









3) www server 


/etc/rc.conf.local                                         
httpd_flags=""


/var/www/htdocs/index.html
123


/etc/httpd.conf                                            
ext_addr="*"
server "default" {
        listen on $ext_addr port 804)boot openbsd by grub
}






again real openbsd , but now amd64
  first i install USB stick then dd to HDD .

1) in i386       chromium can not boot , but 
    in arm64   chromium can        boot

2) when boot
i do the next script
zzzzz.bat                                                  
sleep 1
export PKG_PATH=ftp://ftp.jaist.ac.jp/pub/OpenBSD/6.1/packages/amd64
sleep 1
export XMODIFIERS=@im=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
echo $PKG_PATH
echo
echo $XMODIFIERS
echo $GTK_IM_MODULE
echo $QT_IM_MODULE
ibus-daemon &
sleep 1
echo '-------'
kill `  ps ax | grep xfce4-terminal                                  |  cut -d ' ' -f 1 `
kill `  ps ax | grep xfce4-terminal  | sed "s/^ //g"                 |  cut -d ' ' -f 1 `

kill `  ps ax | grep xfce4-terminal  | sed "s/^ //g" | sed "s/^ //g" |  cut -d ' ' -f 1 `


3) print.bat      need not install cups                                            
scp -r $1  taro@192.168.80.105:/home/taro
ssh taro@192.168.80.105

4) i use ibus-anthy

5)sound
xfce4-mixer

6)/etc/rc.conf.local                                         
xenodm_flags=


# ./comment-out.bat .xsession                                                  
startxfce4


 /etc/X11/xenodm/xenodm-config                                        <
! $OpenBSD: xenodm-config.cpp,v 1.1 2016/10/23 08:30:37 matthieu Exp $
!
!
!
!
!
DisplayManager.*.autoLogin:      User_A
DisplayManager.authDir: /etc/X11/xenodm
DisplayManager.errorLogFile:    /var/log/xenodm.log
DisplayManager.keyFile:         /etc/X11/xenodm/xenodm-keys
DisplayManager.servers:         /etc/X11/xenodm/Xservers
DisplayManager*resources:       /etc/X11/xenodm/Xresources
! All displays should use authorization, but we cannot be sure
! X terminals may not be configured that way, so they will require
! individual resource settings.
DisplayManager*authorize:       true
!
DisplayManager*startup:         /etc/X11/xenodm/Xstartup
DisplayManager*session:         /etc/X11/xenodm/Xsession
DisplayManager*reset:           /etc/X11/xenodm/Xreset
DisplayManager*authComplain:    true
! The following three resources set up display :0 as the console.
DisplayManager._0.setup:        /etc/X11/xenodm/Xsetup_0
DisplayManager._0.startup:      /etc/X11/xenodm/GiveConsole
DisplayManager._0.reset:        /etc/X11/xenodm/TakeConsole
DisplayManager.*.authName:      MIT-MAGIC-COOKIE-1



7) dd over scp

dd if=/dev/rsd1c  | gzip -1 - | ssh f@s.mydns.jp  dd of=p.gz




8) wifi router

many PC ---(wifi)--->rumo:OpenBSD:bge0---(wired LAN)--->internet


./comment-out.bat /etc/hostname.bge0                                         

dhcp

./comment-out.bat /etc/hostname.rum0                                         
awk: can't open file /etc/hostname.rum0

 source line number 1
つまりない

./comment-out.bat /etc/sysctl.conf                                           

net.inet.ip.forwarding=1 


./comment-out.bat /etc/pf.conf                                               
ext=bge0
icmp_types = "{echoreq, unreach}"
set block-policy return
set loginterface $ext
set skip on lo0
match in all scrub (no-df max-mss 1440)
match out on $ext inet from !($ext:network) to any nat-to ($ext:0)
block log all
pass out quick
pass in quick inet proto { tcp udp gre } from any to any

pass in quick inet proto icmp all icmp-type $icmp_types keep state


/comment-out.bat /etc/dhcpd.interfaces                                        <
rum0



 ./comment-out.bat /etc/dhcpd.conf                                            
option  domain-name-servers 8.8.8.8;
subnet 192.168.120.0 netmask 255.255.255.0 {
        option routers 192.168.120.1;
        range 192.168.120.11 192.168.120.15;

}




./comment-out.bat wifi-AP.bat                                                
sh /etc/netstart
ifconfig rum0 inet 192.168.120.1 netmask 255.255.255.0 \
media autoselect mediaopt hostap nwid openbsdAP  wpakey 123  \
chan 1 up
/etc/rc.d/dhcpd restart




9) print

openbsd--wired LAN-->192.168.1.64:archlinux--USB cable-->epson PX-404A

という印刷です。
なぜなら openbdは USBプリンターが苦手だから

9-A) archlinux



/etc/cups/cupsd.conf
MaxLogSize 0
LogLevel warn
port 631
Browsing On
BrowseLocalProtocols dnssd
DefaultAuthType Basic
WebInterface Yes
<Location />
  Order allow,deny
  Allow localhost
  Allow 192.168.1.0/24
</Location>
<Location /admin>
  Order allow,deny
  Allow localhost
  Allow 192.168.1.0/24
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>
<Policy default>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy authenticated>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy kerberos>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Negotiate
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Negotiate
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Negotiate
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>


cat /etc/cups/mime.types
application/octet-stream


cat /etc/cups/mime.convs
application/octet-stream       application/vnd.cups-raw        0






9-B)openbsd



at httpa://192.178.1.64:631
i can print out testpage


use seamonkey , and print page to file (mozilla.pdf)
lp -h192.168.1.64:631/printers/EPSON_PX-404A/version=1.1  mozilla.pdf
then print it to USB printer which is attached to archlinux 


mv /usr/bin/lpr   /usr/bin/lpr-ori/home/fuji/LPR                                                         
cat  /home/f-user/LPR                     
lp -h192.168.1.64:631/printers/EPSON_PX-404A/version=1.1
ln -s  /home/f-user/LPR  /usr/bin/lpr
then i can print www page on seamonkey