202002

ADVA certified expert

  • 伝送のcert.
  • https://www.adva.com/en/resources/downloads/pdf/adva-certified-expert

React

create-react-appしたsrcをbuildしてdeployする

create-react-appしたdoucment rootのpackage.json

[
  "homepage": "."  #ここのpathはbuildされるpathの頭につくもの.http://<hoge>で指定してもよければ絶対パスでもよさそう.デフォルトが`/`なのでパスが通らない可能性が高い.
  ...(omit)
]

を追加して npm run build してbuildをデプロイ.

やりたくなってきたこと

  • stratum1なNTPサーバ with raspberry pi1 modelB
    • きのこ買うか
  • raspberry pi console hat
    • Kicadで基板つくるの久々にやりたい.USB hub ICとRS232なICでよさそう.
  • raspberry pi でKVMconsoleなんとかならないか...
    • bluetooth とかでいけると本当に嬉しいんだけれども.
    • 実際wifiでvncでとよさそう
    • hdmi inputできるhatはあるから,keyboard出力部(raspiにキーボード出力させる)だけうまいこと作れば行けそうな気はする.
    • マウスは正直プロトタイプ的にはなくていい気がする.HIDを1本のUSBでmouse/keyいれればいいだけなので難しくはなさそう.
    • webアクセスできたらうれしいかも.
  • 電力計そろそろ
  • 電子工作久々にやりたい.

イーサネットペイロードが1500bytesな件

イーサネットのペイロードサイズがなぜ最大1500バイトになったのかは、①当時の高速なバッファリングが可能なのがこれくらいだった説②当時のクロック精度限界説③自分が暴走して信号を送信しっぱなしになってないか監視する部品の設定がたまたま1500バイトだった説、の3つくらいを聞いたことある ---さんのツイート: "イーサネットのペイロードサイズがなぜ最大1500バイトになったのかは、①当時の高速なバッファリングが可能なのがこれくらいだった説②当時のクロック精度限界説③自分が暴走して信号を送信しっぱなしになってないか監視する部品の設定がたまたま1500バイトだった説、の3つくらいを聞いたことある"

アップロード向けのCDNみたいな.

こんな感じで怒られる

Mar 10 23:58:56 test01 kernel: [79337.475519] audit: type=1400 audit(1583852336.713:203): apparmor="DENIED" operation="open" profile="snap.chromium.chromedriver" name="/proc/17853/mem" pid=17853 comm="5eefc9322c78972" requested_mask="r" denied_mask="r" fsuid=1001 ouid=1001
% diff /var/lib/snapd/apparmor/profiles/snap.chromium.chromedriver_old /var/lib/snapd/apparmor/profiles/snap.chromium.chromedriver
--- /var/lib/snapd/apparmor/profiles/snap.chromium.chromedriver_old 2020-03-11 00:16:15.171080842 +0900
+++ /var/lib/snapd/apparmor/profiles/snap.chromium.chromedriver 2020-03-11 00:15:32.607853277 +0900
@@ -47,6 +47,9 @@
   owner @{HOME}/.Private/ r,
   owner @{HOMEDIRS}/.ecryptfs/*/.Private/ r,

+  # workaround
+  @{PROC}/@{pid}/mem r,
+
   # for python apps/services
   #include <abstractions/python>
   /usr/bin/python{,2,2.[0-9]*,3,3.[0-9]*} ixr,
[jp7fkf@test01 0:17:01] /etc/apparmor.d
% sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap.chromium.chromedriver

Wine Shop Soleic / TOPページ

  • 上野で出会ったe-wine shop.

UPSのプロトコル

  • Q1とかその辺り
  • https://www.upspowercom.com/Download/UPS-Protocol.pdf

Zabbixからslackへ通知する

  • https://www.zabbix.com/integrations/slack

メトリクスモニタリングと連携して設定したSLA/SLOにもとづきerr budget等がすぐ見えるポータル的なOSSないのかな

GNS3 installation battle on Ubuntu 18.04

Installation guideに沿ってやるだけ.ただし

sudo usermod -aG group ubridge,libvirt,kvm,wireshark,docker <username>

はできなかったので,ubridgewiresharkを除いて

sudo usermod -aG group libvirt,kvm,docker <username>

で実施.

  • systemdで管理.
# vi /etc/systemd/system/gns3server.service
[Unit]
Description=GNS3 server
After=syslog.target
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/gns3server

# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable gns3server
systemctl start gns3server

slack api でpost

  • curl -XPOST -d 'token=xoxb-0000000000000-00000000000-xxxxxxxxxxxxxxxxxxxxxxxx' -d 'channel=hoge' -d 'text=Hello World' -d 'icon_emoji=rotating_light' 'https://slack.com/api/chat.postMessage'

homebrew をdotfiles管理したい

  • brew bundleを使う
% brew bundle dump
==> Tapping homebrew/bundle
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle'...
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (55/55), done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 4377 (delta 12), reused 30 (delta 5), pack-reused 4322
Receiving objects: 100% (4377/4377), 961.74 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (2537/2537), done.
Tapped 1 command (101 files, 1.3MB).

% ls
Brewfile      setup.sh*     sublimetext3/

% head -n 10 Brewfile
tap "chef/chef"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/services"
brew "arping"
brew "bat"
brew "xz"
brew "python"
brew "colordiff"
  • Brewfileがあればbrew bundleを一括installできる.
  • brew bundle cleanupでBrewfileに記載のもの以外を削除する(Brewfileに記載されたものだけがinstallされた状態にする)
  • brew bundle dump でhomebrewでinstallされたものをBrewfileに書き出す.(そのままbrew bundleで読めるので楽)

nfc (RC-S380P)

  • sudo sh -c 'echo SUBSYSTEM==\"usb\", ACTION==\"add\", ATTRS{idVendor}==\"054c\", ATTRS{idProduct}==\"06c3\", GROUP=\"plugdev\" >> /etc/udev/rules.d/nfcdev.rules'
% lsusb                                                                                                     (git)-[master]
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 0590:0081 Omron Corp.
Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 010: ID 054c:06c3 Sony Corp. RC-S380
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
% sudo usermod -aG plugdev jp7fkf
% ./tagtool.py --device usb:054c:06c3                                                                       (git)-[master]
[nfc.clf] searching for reader on path usb:054c:06c3
[main] access denied for device with path usb:054c:06c3
[main] no contactless reader available
% sudo sh -c 'echo SUBSYSTEM==\"usb\", ACTION==\"add\", ATTRS{idVendor}==\"054c\", ATTRS{idProduct}==\"06c3\", GROUP=\"plugdev\" >> /etc/udev/rules.d/nfcdev.rules'
% sudo udevadm control --reload
% sudo rmmod port100
% ./tagtool.py --device usb:054c:06c3
[nfc.clf] searching for reader on path usb:054c:06c3
[nfc.clf] using SONY RC-S380/P NFC Port-100 v1.11 at usb:001:006
** waiting for a tag **
Type2Tag 'NXP NTAG213' ID=zzzzzzzzzzzzzz
NDEF Capabilities:
  readable  = yes
  writeable = yes
  capacity  = 137 byte
  message   = 0 byte

https://www.youtube.com/watch?v=_aYIsXFaKTs

https://www.monotaro.com/g/02412542/

raspberry pi でlogitechのusbカメラを使う(mjpg-streamer)

  • macもwindowsもドライバがなくなってしまったっぽいからlinuxで使ってやる.まぁwin/macでもまだこねればいけるとおもうけど.
% lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0590:0081 Omron Corp.
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 006: ID 054c:06c3 Sony Corp. RC-S380
Bus 001 Device 007: ID 046d:08c3 Logitech, Inc. Camera (Notebooks Pro)
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

% ls -la /dev/video*
crw-rw---- 1 root video 81, 0 Mar 22 19:36 /dev/video0
crw-rw---- 1 root video 81, 1 Mar 22 19:36 /dev/video1

% sudo apt-get install subversion imagemagick libjpeg-dev
% svn checkout svn://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer
% cd mjpg-streamer/mjpg-streamer/
% make
% sudo make install

% mjpg_streamer -i "/usr/local/lib/input_uvc.so -y -q 100 -r 1280x720 -f 30" -o "/usr/local/lib/output_http.so -w ./www -p 10080"
MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 1280 x 720
 i: Frames Per Second.: 30
 i: Format............: YUV
 i: JPEG Quality......: 100
ERROR opening V4L interface: Permission denied
 Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LC_CTYPE is UTF-8
svn: warning: please check that your locale name is correct

%sudo usermod -aG video jp7fkf

% mjpg_streamer -i "/usr/local/lib/input_uvc.so -y -q 100 -r 1280x720 -f 30" -o "/usr/local/lib/output_http.so -w ./www -p 10080"
MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 1280 x 720
 i: Frames Per Second.: 30
 i: Format............: YUV
 i: JPEG Quality......: 100
i: The format asked unavailable, so the width 1280 height 960
Adding control for Pan (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan/tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Focus (absolute)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
mapping control for Pan (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan/tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Focus (absolute)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Mode
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Frequency
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Disable video processing
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Raw bits per pixel
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
 o: www-folder-path...: ./www/
 o: HTTP TCP port.....: 10080
 o: username:password.: disabled
 o: commands..........: enabled
^Csetting signal to stop
 i: cleaning up ressources allocated by input thread
^[[A^[[Bforce cancellation of threads and cleanup resources
 o: cleaning up ressources allocated by server thread #00
done
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LC_CTYPE is UTF-8
svn: warning: please check that your locale name is correct

牛乳寒天じゃないけど牛乳ゼラチンなデザート

  • 750mlの牛乳に対してゼラチン25gは多すぎる.15-20gくらいでよさそう.