2019年10月22日火曜日

★openbsd arm64 raspberry pi 3B ハードデスクだけから起動できます


アメリカ国歌
http://www.world-anthem.com/lyrics/usa.htm
おお、見えるだろうか、
夜明けの薄明かりの中
我々は誇り高く声高に叫ぶ
危難の中、城壁の上に
雄々しく翻(ひるがえ)る
太き縞に輝く星々を我々は目にした
砲弾が赤く光を放ち宙で炸裂する中
我等の旗は夜通し翻っていた
ああ、星条旗はまだたなびいているか?
自由の地 勇者の故郷の上に!


中国国歌https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1090653005
立ちあがれ! 奴隷になるのを望まぬ人々よ!
我々の血肉をもって、我々の新しき長城を築こう!
中華民族は最も危険な時に到ったのだ、
皆が最後の雄たけびを発することを迫られているのだ。
立ちあがれ! 立ちあがれ! 立ちあがれ!
我々民衆は心を一にして
敵の砲火に立ち向かって前進せよ!
敵の砲火に立ち向かって前進せよ!
前進せよ! 前進せよ! 進め!

フランス国歌https://tsvocalschool.com/classic/marseillaise/
行こう 祖国の子供たちよ
栄光の日が来た!
私たちに対して 暴政の
血まみれの旗が上がった
血まみれの旗が上がった
聞こえるか 戦場の
残酷な軍人のうなりが?
彼らは私たちの腕の中まで来て
私たちの息子や妻の 喉を掻き切って殺す!


アドネラリン分泌を大量放出させ 競技場で歌ってる間に戦闘モードになるね
それに比べ日本の国歌のなんと平和なこと

https://celestia358.luxe/319
恋歌として歌ってもいいほどロマンティック

君が = 親愛なる君、古代日本語ではき」は男性「み」は女性
代 = 人が生活を営む期間、一生涯
千代に八千代に = 千年も、八千年も
さざれ石の巌となりて = 小さなことが大きくなるまで、協力する
苔のむすまで = 絆がむすびついていく

【ロマンチックな恋歌の解釈】
「愛しい君と永遠に生まれ変わっても、生涯は協力して絆を結んでいこう」

簡単なメモ

冗長なのは以下
https://openbsd-akita.blogspot.com/2017/03/openbsd-61-on-raspberry-pi-3.html


raspberry pi は arm64




黒 Ground
白 TX
緑 RX




#minicom -D /dev/ttyUSB0



Welcome to the OpenBSD/arm64 6.6 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?





Available disks are: sd0 sd0はUSB接続SSD
Which disk is the root disk? ('?' for details) [sd0] !
Type 'exit' to return to install.
rpi3# dmesg | grep sd                                                       
    deraadt@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/RAMDISK
wsdisplay0 at simplefb0
wsdisplay0: screen 0 added (std, vt100 emulation)
sd0 at scsibus0 targ 1 lun 0: <Mass, Storage Device, 0 0> serial.14cd6116116AC2101219
sd0: 15272MB, 512 bytes/sector, 31277230 sectors
wskbd0: connecting to wsdisplay0
bootfile: sd0a:/bsd
boot device: sd0
rpi3# exit
Available disks are: sd0.
Which disk is the root disk? ('?' for details) [sd0]
Disk: sd0       geometry: 1946/255/63 [31277230 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused   
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused   
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused   
 3: A6      0   0   1 -   1945 254  63 [           0:    31262490 ] OpenBSD   
Use (W)hole disk or (E)dit the MBR? [whole]
Creating a msdos partition and an OpenBSD partition for rest of sd0...done.
/dev/rsd0i: 32668 sectors in 8167 FAT16 clusters (2048 bytes/cluster)
bps=512 spc=4 res=1 nft=2 rde=512 mid=0xf8 spf=32 spt=63 hds=255 hid=32768 bsec=32768
The auto-allocated layout for sd0 is:
#                size           offset  fstype [fsize bsize   cpg]
  a:           372.9M            65536  4.2BSD   2048 16384     1 # /
  b:           525.8M           829216    swap                 
  c:         15272.1M                0  unused                 
  d:           476.6M          1906080  4.2BSD   2048 16384     1 # /tmp
  e:           659.5M          2882208  4.2BSD   2048 16384     1 # /var
  f:          1722.9M          4232960  4.2BSD   2048 16384     1 # /usr
  g:           517.7M          7761440  4.2BSD   2048 16384     1 # /usr/X11R6
  h:          1692.7M          8821760  4.2BSD   2048 16384     1 # /usr/local
  i:            16.0M            32768   MSDOS                 
  j:          1389.2M         12288416  4.2BSD   2048 16384     1 # /usr/src
  k:          5298.3M         15133408  4.2BSD   2048 16384     1 # /usr/obj
  l:          2584.4M         25984352  4.2BSD   2048 16384     1 # /home
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] c
Label editor (enter '?' for help at any prompt)
sd0> a b
offset: [65536]
size: [31211694] 1g
FS type: [swap]
sd0*> a a
offset: [2168775]
size: [29108455]
FS type: [4.2BSD]
mount point: [none] /
sd0*> p
OpenBSD area: 65536-31277230; size: 31211694; free: 39
#                size           offset  fstype [fsize bsize   cpg]
  a:         29108416          2168800  4.2BSD   2048 16384     1 # /
  b:          2103239            65536    swap                 
  c:         31277230                0  unused                 
  i:            32768            32768   MSDOS                 
sd0*> w
sd0> q






Let's install the sets!
Location of sets? (disk http nfs or 'done') [http]
HTTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none]
HTTP Server? (hostname, list#, 'done' or '?') [ftp.jaist.ac.jp]
Server directory? [pub/OpenBSD/snapshots/arm64]

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-', e.g.: '-game*'. Selected sets are labelled '[X]'.
    [X] bsd           [X] base66.tgz    [X] game66.tgz    [X] xfont66.tgz
    [X] bsd.mp        [X] comp66.tgz    [X] xbase66.tgz   [X] xserv66.tgz
    [X] bsd.rd        [X] man66.tgz     [X] xshare66.tgz






When you login to your new system the first time, please read your mail
using the 'mail' command.
Exit to (S)hell, (H)alt or (R)eboot? [reboot] h



マイクロSDカードを外して再起動(USB接続SSDのみ)



# minicom -D /dev/ttyUSB0
すると


minicom上で

sd0 at scsibus0 targ 1 lun 0: <Mass, Storage Device, 0 0> serial.14cd6116116AC2101219
sd0: 15272MB, 512 bytes/sector, 31277230 sectors
uhidev0 at uhub1 port 5 configuration 1 interface 0 "CHICONY HP Basic USB Keyboard" rev 2.00/1.30 a5
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0 mux 1
wskbd0: connecting to wsdisplay0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root on sd0a (cbf0a94f633ba6c0.a) swap on sd0b dump on sd0b
WARNING: CHECK AND RESET THE DATE!
Automatic boot in progress: starting file system checks.
/dev/sd0a (cbf0a94f633ba6c0.a): file system is clean; not checking
pf enabled
starting network
smsc0: 192.168.17.16 lease accepted from 192.168.17.1 (00:0d:0b:6a:34:16)
reordering libraries: done.
openssl: generating isakmpd/iked RSA keys... done.
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 
starting early daemons: syslogd pflogd ntpd.
starting RPC daemons:.
savecore: no core dump
checking quotas: done.
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
starting network daemons: sshd smtpd sndiod.
running rc.firsttime
Path to firmware: http://firmware.openbsd.org/firmware/snapshots/
No devices found which need firmware files to be downloaded.
starting local daemons: cron.
Tue Oct 22 04:46:15 JST 2019
OenBSD/arm64 (rpi3.my.domain) (console)
login: 





rpi3# ifconfig                                                                 
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
        index 2 priority 0 llprio 3
        groups: lo
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
enc0: flags=0<>
        index 1 priority 0 llprio 3
        groups: enc
        status: active
smsc0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
        lladdr b8:27:eb:ce:cf:d8
        index 3 priority 0 llprio 3
        groups: egress
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 192.168.17.16 netmask 0xffffff00 broadcast 192.168.17.255
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
        index 4 priority 0 llprio 3
        groups: pflog
rpi3# ping -c 3 www.google.com
PING www.google.com (172.217.31.164): 56 data bytes
64 bytes from 172.217.31.164: icmp_seq=0 ttl=49 time=34.531 ms
64 bytes from 172.217.31.164: icmp_seq=1 ttl=49 time=30.245 ms
64 bytes from 172.217.31.164: icmp_seq=2 ttl=49 time=29.891 ms

--- www.google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 29.891/31.556/34.531/2.109 ms

2019年10月20日日曜日

★★★ 6.7 snapshots



バッテリー残量もでてます



6.7 snapshots の起動風景は以下

説明を追加
今日アジア諸国が欧米と対等に話ができるのは誰のおかげか。
それは自らを殺してまで我々を産んでくれた日本というお母さんがあったからだ。
我々はお母さんが
  お産を決意した12月8日(開戦の日)を、
その後全ての力を出して私たちを産み、
  力尽きた   8月15日(敗戦の日)を
忘れてはならない。


力尽き焦土と化した日本



もしも ナチス 対 「英独米、ソ連」 の白人の内だけの戦争であったなら、 今なお殆どの有色人種国は植民地のままであるかもしれない。

http://truthyouth.jp/2018/522/
ローマ教皇ニコラウス五世にいたっては、ポルトガル人に「異教徒を永遠に奴隷にする許可」を与え、白人キリスト教徒による奴隷狩りに拍車をかけました。

1582年に、日本からヨーロッパに渡った天正少年使節団は次のように報告しています。
「行く先々日本女性がこまでいっても沢山目につく。
ヨーロッパ各地で50万という。
肌白くみめよき日本の娘たちが秘所丸出しにつながれ、もてあそばれ、奴隷として転売されていくのを正視できない。
---
ポルトガル人の教会や師父が
硝石と交換し、インドやアフリカまで売っている」


 神は言われた。
 「我々にかたどり、我々に似せて、人を造ろう。そして海の魚、空の鳥、家畜、地の獣、地を這うものすべてを支配させよう。」
 神は御自分にかたどって人を創造された
穿つとかっては 
白人は「神の造った人=白人」と思っていた風がある




snapshots をするのには lumina はちょっと苦しい。
一番 枯れたxfce がいい。



1).xsession
export LANG=ja_JP.UTF-8
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
scim -d
exec ck-launch-session startxfce4


2)autologin
/etc/X11/xenodm/xenodm-config
       DisplayManager.*.autoLogin:   your_user_name


3) pkg_add nano lftp mixfont-mplus-ipa ibus-anthy   cups gutenprint  nautilus  chromium  xfce consolekit2 scim-anthy xfce4-extras



あ) 
fdisk -i -b 1024 sd0



い) 
newfs_msdos sd0i
mount /dev/sd0i /mnt2
mkdir -p /mnt2/efi/boot
cp /mnt/user/mdec/BOOT* /mnt2/efi/boot


ここ以下は以前に書いたもので 今も行けるかは未確認


A)もしopenbsd でwifi router をつくりたいなら

cat id-accesspoint.bat

これは SSIDが aaでパスワードが 123456789で保護されてます。
ifconfig rum0 \
net    192.168.12.1   netmask 255.255.255.0 \
media autoselect mediaopt hostap nwid aa \
wpakey 123456789 chan 1 up


ですね




B)rsync-over-ssh.bat 
rsync -avHx --delete \
--exclude=".cache" \
--exclude=".config" \
--exclude=".local/share/Trash"  \
-e ssh /home/linux/ snap@192.168.0.88:/home/bsd/From-Linux/





C)/etc/rc.local                                       
/etc/rc.d/cupsd start



D) wifiです
/etc/hostname.rum0                                   
nwid elecom2g-b4c2d9
wpakey 123abc
dhcp




E) dhcpd サーバーです
ただし 今の所 イントラネット内で運用中
Linux PC--->bge0:openbsd:run0--->wifi router->router->internet
です。



# ./comment-out.bat /etc/sysctl.conf
net.inet.ip.forwarding=1        # 1=Permit forwarding (routing) of IPv4 packets



# ./comment-out.bat /etc/hostname.bge0                                             
inet 192.168.12.1 255.255.255.0 NONE



# ./comment-out.bat /etc/hostname.run0                                             
nwid elecom2g-b4c2d9
wpakey 12345678
dhcp


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



# ./comment-out.bat /etc/dhcpd.conf                                                 
option  domain-name "my.domain";
option  domain-name-servers 8.8.8.8;
subnet 192.168.12.0 netmask 255.255.255.0 {
        option routers 192.168.12.1;
        range 192.168.12.10 192.168.12.19;
}




# ./comment-out.bat /etc/pf.conf                                                   
ext = "run0"
int = "bge0"
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 \
                                 198.18.0.0/15 198.51.100.0/24        \
                   203.0.113.0/24 }
table <spammers> persist file "/etc/spammers"
set block-policy drop
set loginterface egress
set skip on lo0
match in all scrub (no-df random-id max-mss 1440)
match out on egress inet from !(egress:network) to any nat-to (egress:0)
antispoof quick for { egress $ext $int }
block in quick on egress from <martians> to any
block return out quick on egress from any to <martians>
block in quick on egress from <spammers> to any
block return out quick on egress from any to <spammers>
block all
pass out quick inet
block in quick  on { $ext $int }  inet proto tcp from any to any port 5900
pass  in quick  on {      $int }  inet proto tcp from any to any port 22
pass  in  on { $ext $int }  inet

どうも最後の行は
pass  in  on {  $int }  inet
がいいのではと思う昨今



#本来は下の4行、まイントラネット内のDHCPサーバーなので こないしてまんねん
#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.0.0/16 198.18.0.0/15 198.51.100.0/24        \
#    203.0.113.0/24 }



なお spammerについては、下の 14) をご参照ください。

あるいは 
curl -O http://nami.jp/ipv4bycc/cidr.txt.gz && gunzip -f cidr.txt.gz


```

cp cidr.txt c1

grep CN c1 > s1                               
grep KP c1 > s2

sed 's/CN//' s1 > S1
などで加工して
CN , KP をのけ

awk '{sub(/^[ \t]+/, ""); print}' s1 > spammers.txt-NoSpace

head spammers.txt-NoSpace
1.0.8.0/21
1.1.0.0/24
1.1.16.0/20
1.1.2.0/23
後略

cp spammers.txt-NoSpace /etc/spammers
です



ともかくとして
pfctl -sr 
は                                                                     
match in all scrub (no-df random-id max-mss 1440)
match out on egress inet from ! (egress:network) to any nat-to (egress:0) round-robin
block drop in quick on ! egress inet from 192.168.2.0/24 to any
block drop in quick inet from 192.168.2.113 to any
block drop in quick on ! run0 inet from 192.168.2.0/24 to any
block drop in quick on ! bge0 inet from 192.168.12.0/24 to any
block drop in quick inet from 192.168.12.1 to any
block drop in quick on egress from <martians> to any
block return out quick on egress from any to <martians>
block drop in quick on egress from <spammers> to any
block return out quick on egress from any to <spammers>
block drop all
pass out quick inet all flags S/SA
block drop in quick on run0 inet proto tcp from any to any port = 5900
block drop in quick on bge0 inet proto tcp from any to any port = 5900
pass in quick on bge0 inet proto tcp from any to any port = 22 flags S/SA
pass in on run0 inet all flags S/SA
pass in on bge0 inet all flags S/SA




```


なお pf についてですが
Each time a packet processed by the packet filter comes in on or goes out through an interface, the filter rules are evaluated in sequential order, from first to last.
For block and pass, the last matching rule decides what action is taken;
if no rule matches the packet, the default action is to pass the packet without creating a state.
For match, rules are evaluated every time they match; the pass/block state of a packet remains unchanged.




F) minidlna


./comment-out.bat /etc/minidlna.conf                                   
port=8200
media_dir=/home/userX/share
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
enable_tivo=no
tivo_discovery=bonjour
strict_dlna=no
notify_interval=900
serial=12345678
model_number=1



G)  openbsdをWWW serverとしてつかう(まだ イントラネット内だけですが)
basic認証です


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




# ls /var/www/htdocs/                                                                             
bgplg      index.html



htpasswd  /var/www/htpasswd.conf auth-user 
Password:
Retype Password:



#  chown www /var/www/htpasswd.conf
# chmod 600 /var/www/htpasswd.conf



/etc/rc.d/httpd -f restart





H) nginxをWWW serverとしてつかう

/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;
        listen       [::]:80;
        server_name  localhost;    #<-for test
        root         /var/www/m1;
auth_basic "Restricted";
auth_basic_user_file /var/www/1/.htpasswd;
          }

server {
        listen       80;
        listen       [::]:80;
        server_name  h.m.jp;
        root         /var/www/m1;
auth_basic "Restricted";
auth_basic_user_file /var/www/1/.htpasswd;
          }

server {
        listen       80;
        listen       [::]:80;
        server_name  s.s.ddns.vc;
        root         /var/www/y2;
auth_basic "Restricted";
auth_basic_user_file /var/www/2/.htpasswd;
          }

server {
        listen       80;
        listen       [::]:80;
        server_name  k.s.ddns.vc;
        root         /var/www/k3;
auth_basic "Restricted";
auth_basic_user_file /var/www/3/.htpasswd;
          }

server {
        listen       80;
        listen       [::]:80;
        server_name  m.p.ddns.vc;
        root         /var/www/d11;
auth_basic "Restricted";
auth_basic_user_file /var/www/11/.htpasswd;
          }

    }


htpasswd thinPC /var/www/1/.htpasswd

chown  www  /var/www/1/.htpasswd


 /etc/pf.conf
ext_if="bge0"
tcp_services="{ 22, 80 }"  # submisson port
icmp_types="echoreq"
set block-policy return
set loginterface $ext_if
set skip on lo
set reassemble yes no-df
block in log
pass out quick
 antispoof quick for { lo  }
pass in  on  $ext_if   inet proto tcp from any to  ( $ext_if:0 ) port  $tcp_services
pass in inet proto icmp all icmp-type $icmp_types
```


I) DVD

dvd+rw-format -force=full  /dev/rcd0c
growisofs -Z /dev/rcd0c -R -J X.iso



J)spammer 
https://www.wizcrafts.net/chinese-blocklist.html
が元です。
spammers.txtが 以下として

```
114.134.184.0/21 1.24.0.0/13 1.48.0.0/15 1.50.0.0/16 1.56.0.0/13 1.68.0.0/14 1.80.0.0/13
以下 略
```

これを 以下にしたら /etc/spammers が得られます。

cat spammers.txt | perl -pe 's/ /\n/g' > /etc/spammers





K) NFS

/etc/exports
/nfs -maproot=bin: -network=192.168.188 -mask=255.255.255.0


/etc/rc.conf.local             
xenodm_flags=
portmap_flags=""
mountd_flags=""
nfsd_flags="-tun 4"








L)DVDを視聴

1) mount /dev/cd0c /mnt
とDVDドライブをマウントします

2)$ mplayer -v /mnt/VIDEO_TS/VTS_11_1.VOB | grep 'audio stream'
==> Found audio stream: 128
==> Found audio stream: 129
にて 音声トラックが2つあることがわかります

3)mplayer /mnt/




L)DVDを視聴VIDEO_TS/VTS_11_1.VOB -aid 129 -nosub
129が日本語で 字幕なしに再生させます




https://ja.wikipedia.org/wiki/%E6%AD%A3%E5%8F%B2 より
正史とは一つの王朝が滅びた後、次代の王朝に仕える人々が著す。
中略
正史とはあくまで「(現)王朝が正当と認めた歴史書」という程の意味であり、
(真の)歴史事実を引き出すには歴史学の手法にのっとり厳密な史料批判を経て行う必要がある.
M) サンバの舞


M) サンバの舞

```
microsoft の windows は、
openbsd , linux などのfree UNIXからの補足されないように
常に そのネットワークシステムを変化させている。
したがって sambaは それにあわせて 猫の目のようにかわらないといけない。
苦労が多いねえ


今やっと
# date ;  /etc/rc.d/samba start ; date
Tue May 14 02:36:22 JST 2019
smbd(ok)
nmbd(ok)
Tue May 14 02:36:48 JST 2019
と 26秒もかかるけど sambaが起動した。


# testparm は                                                                                                                           
rlimit_max: increasing rlimit_max (128) to minimum Windows limit (16384)
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (128) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        dns proxy = No
        log file = /var/log/samba/smbd.%m
        max log size = 50
        server role = standalone server
        server string = Samba Server
        idmap config * : backend = tdb


[homes]
        browseable = No
        comment = Home Directories
        read only = No


[printers]
        browseable = No
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
だ。


------------
なお
The following new rcscripts were installed: /etc/rc.d/nmbd /etc/rc.d/samba /etc/rc.d/samba_ad_dc /etc/rc.d/saslauthd /etc/rc.d/smbd /etc/rc.d/winbindd
See rcctl(8) for details.
New and changed readme(s):
        /usr/local/share/doc/pkg-readmes/gamin
        /usr/local/share/doc/pkg-readmes/samba
```



N)タブレットでタッチスクリーン

タブレットでタッチスクリーン
vncをつかえば android タブレットが タッチパネルになる。 おー便利


IMG_20190422_102157.jpg
x11vnc -storepasswd

(the last one will use ~/.vnc/passwd)

x11vnc -usepw

( automatically use your ~/.vnc/passwd files)


2019年4月21日日曜日

sed awk

#1 sed 's/CN//' s1 > S1



sed -i 's|/usr/libexec/|/usr/lib/ibus-mozc/|g'









awk '{sub(/^[ \t]+/, ""); print}' s1 > spammers.txt-NoSpace

https://qiita.com/yamazon/items/563af1b485ff413d381f より

#2 echo 1:2/3:4 |awk -F'[:/]' '{print $1,$2}'

dell# ifconfig | grep 192 | awk  '{print $2}'          
192.168.17.17


dell# ifconfig |grep 192 | awk -F'[ ]' '{print $1,$2}'

inet 192.168.17.17




 
 ./comment-out.bat /etc/samba/smb.conf-ori | ./comment-out.bat- 


comment-out.bat
awk '$1 !~ "#"{print}' $1 | awk 'NF >0 {print}' -

comment-out.bat-

awk '$1 !~ ";"{print}' $1 | awk 'NF >0 {print}' -





  1. sed -> https://qiita.com/mattintosh4/items/4e4d44016be15333af11