2026年 02月 07日

Android Chrome で WebSerial うまくいかなかった。Bluetooth 経由のシリアルポートは見えるのに、USBで接続したデバイスがなぜか一切表示されない。そして WebUSB 経由で自力で USB-CDC すれば接続できる。USB-CDC デバイスをOSで自動的に握ってないのか?

このあたりプラットフォームごとの差異がまだ大きくて普通につらさが多い。Windows は COM ポートとして完全にOSが排他的に握るので WebUSB 経由で USB-CDC はできない。macOS は open するまでは排他ではないようで WebSerial でも WebUSB でも接続できる。

耳は、鼓膜と耳小骨がテコと面積比を用いて音圧を約22倍に増幅することで、空気の振動を「液体(リンパ液)に浸かった神経回路」へ反射させず効率よく流し込み(インピーダンス整合)、過大音には筋肉でブレーキ(意図的なインピーダンス不整合)をかける、生体用の信号変換インターフェースです。

Dendrite/SQLite + Element を試す

セルフホストで Slack 的なものがほしくなったらどういう選択肢があるのか調べていた。なにやらよくわからないが Matrix (protocol) + Element (client) という選択肢をためした

サーバサイドは Dendrite https://github.com/matrix-org/dendrite という golang 実装をつかってみた。適当に起動して_matrix/ をリバースプロキシすれば使えた。

Dendrite/SQLite

ただ適当に Dendrite を起動するのが割とだるい。postgresql を強く推してくるので、SQLite で起動させようとすると結構大変。すごく細かくコンポーネントが分かれているけど、これらすべて同一DBファイルにできないらしいので個別に設定する必要がある。

--- dendrite-sample.yaml	2026-02-07 18:34:03.311159499 +0900
+++ dendrite.yaml	2026-02-07 19:26:53.227362555 +0900
@@ -10,12 +10,12 @@
 # Global Matrix configuration. This configuration applies to all components.
 global:
   # The domain name of this homeserver.
-  server_name: localhost
+  server_name: _.lowreal.net
 
   # The path to the signing private key file, used to sign requests and events.
   # Note that this is NOT the same private key as used for TLS! To generate a
   # signing key, use "./bin/generate-keys --private-key matrix_key.pem".
-  private_key: matrix_key.pem
+  private_key: /data/matrix/dendrite/matrix_key.pem
 
   # The paths and expiry timestamps (as a UNIX timestamp in millisecond precision)
   # to old signing keys that were formerly in use on this domain name. These
@@ -40,11 +40,11 @@
   # this section is populated then you can omit the "database" blocks in all other
   # sections. For monolith deployments using SQLite databases,
   # you must configure the "database" block for each component instead.
-  database:
-    connection_string: postgresql://username:password@hostname/dendrite?sslmode=disable
-    max_open_conns: 90
-    max_idle_conns: 5
-    conn_max_lifetime: -1
+#  database:
+#    connection_string: postgresql://username:password@hostname/dendrite?sslmode=disable
+#    max_open_conns: 90
+#    max_idle_conns: 5
+#    conn_max_lifetime: -1
 
   # Configuration for in-memory caches. Caches can often improve performance by
   # keeping frequently accessed items (like events, identifiers etc.) in memory
@@ -84,7 +84,7 @@
 
   # Disables federation. Dendrite will not be able to communicate with other servers
   # in the Matrix federation and the federation API will not be exposed.
-  disable_federation: false
+  disable_federation: true
 
   # Configures the handling of presence events. Inbound controls whether we receive
   # presence events from other servers, outbound controls whether we send presence
@@ -127,7 +127,7 @@
 
     # Persistent directory to store JetStream streams in. This directory should be
     # preserved across Dendrite restarts.
-    storage_path: ./
+    storage_path: /data/matrix/dendrite
 
     # The prefix to use for stream names for this homeserver - really only useful
     # if you are running more than one Dendrite server on the same NATS deployment.
@@ -149,6 +149,9 @@
 
 # Configuration for the Appservice API.
 app_service_api:
+  database:
+    connection_string: "file:/data/matrix/dendrite/app_service_api.db?_cache=shared&_journal_mode=WAL"
+
   # Disable the validation of TLS certificates of appservices. This is
   # not recommended in production since it may allow appservice traffic
   # to be sent to an insecure endpoint.
@@ -167,9 +170,12 @@
 
 # Configuration for the Client API.
 client_api:
+  database:
+    connection_string: "file:/data/matrix/dendrite/client_api.db?_cache=shared&_journal_mode=WAL"
+
   # Prevents new users from being able to register on this homeserver, except when
   # using the registration shared secret below.
-  registration_disabled: true
+  registration_disabled: false
 
   # Prevents new guest accounts from being created. Guest registration is also
   # disabled implicitly by setting 'registration_disabled' above.
@@ -177,16 +183,16 @@
 
   # If set, allows registration by anyone who knows the shared secret, regardless
   # of whether registration is otherwise disabled.
-  registration_shared_secret: ""
+  registration_shared_secret: "foobar"
 
   # Whether to require reCAPTCHA for registration. If you have enabled registration
   # then this is HIGHLY RECOMMENDED to reduce the risk of your homeserver being used
   # for coordinated spam attacks.
-  enable_registration_captcha: false
+  enable_registration_captcha: true
 
   # To use hcaptcha.com instead of ReCAPTCHA, set the following parameters, otherwise just keep them empty.
@@ -221,6 +227,9 @@
 
 # Configuration for the Federation API.
 federation_api:
+  database:
+    connection_string: "file:/data/matrix/dendrite/federation_api.db?_cache=shared&_journal_mode=WAL"
+
   # How many times we will try to resend a failed transaction to a specific server. The
   # backoff is 2**x seconds, so 1 = 2 seconds, 2 = 4 seconds, 3 = 8 seconds etc. Once
   # the max retries are exceeded, Dendrite will no longer try to send transactions to
@@ -274,8 +283,11 @@
 
 # Configuration for the Media API.
 media_api:
+  database:
+    connection_string: "file:/data/matrix/dendrite/media_api.db?_cache=shared&_journal_mode=WAL"
+
   # Storage path for uploaded media. May be relative or absolute.
-  base_path: ./media_store
+  base_path: /data/matrix/dendrite/media
 
   # The maximum allowed file size (in bytes) for media uploads to this homeserver
   # (0 = unlimited). If using a reverse proxy, ensure it allows requests at least
@@ -302,11 +314,17 @@
 
 # Configuration for enabling experimental MSCs on this homeserver.
 mscs:
+  database:
+    connection_string: "file:/data/matrix/dendrite/mscs.db?_cache=shared&_journal_mode=WAL"
+
   mscs:
   #  - msc2836  # (Threading, see https://github.com/matrix-org/matrix-doc/pull/2836)
 
 # Configuration for the Sync API.
 sync_api:
+  database:
+    connection_string: "file:/data/matrix/dendrite/sync_api.db?_cache=shared&_journal_mode=WAL"
+
   # This option controls which HTTP header to inspect to find the real remote IP
   # address of the client. This is likely required if Dendrite is running behind
   # a reverse proxy server.
@@ -318,7 +336,7 @@
     enabled: false
 
     # The path where the search index will be created in.
-    index_path: "./searchindex"
+    index_path: /data/matrix/dendrite/searchindex
 
     # The language most likely to be used on the server - used when indexing, to
     # ensure the returned results match expectations. A full list of possible languages
@@ -327,6 +345,9 @@
 
 # Configuration for the User API.
 user_api:
+  account_database:
+    connection_string: "file:/data/matrix/dendrite/user_api.db?_cache=shared&_journal_mode=WAL"
+
   # The cost when hashing passwords on registration/login. Default: 10. Min: 4, Max: 31
   # See https://pkg.go.dev/golang.org/x/crypto/bcrypt for more information.
   # Setting this lower makes registration/login consume less CPU resources at the cost
@@ -378,4 +399,16 @@
   - type: file
     level: info
     params:
-      path: ./logs
+      path: /data/matrix/dendrite/logs
+
+room_server:
+  database:
+    connection_string: "file:/data/matrix/dendrite/room_server.db?_cache=shared&_journal_mode=WAL"
+
+key_server:
+  database:
+    connection_string: "file:/data/matrix/dendrite/key_server.db?_cache=shared&_journal_mode=WAL"
+
+relay_api:
+  database:
+    connection_string: "file:/data/matrix/dendrite/relay_api.db?_cache=shared&_journal_mode=WAL"

Element

「サインイン」すると matrix.org が表示されているが「編集」するとカスタムできる。

「他のホームサーバ」にはドメインじゃなくて https://xxx.lowreal.net/_matrix まで入れる必要があった。

2026年 02月 06日

Google Antigravity がシェル履歴を汚染する

Antigravity はなんか普通にインタラクティブなシェルを起動するのだが、シェルの履歴がめちゃくちゃ混ざってうざいので以下の設定をいれた

if [[ "$TERM_PROGRAM" == "vscode" ]]; then
    HISTFILE=~/.zsh_history_vscode
fi
2026年 02月 05日

だいぶ体調が悪い

AGENTS.md 書くより README.md ちゃんとしろよという話じゃないか? と思っている…… 別にエージェント特有の指示とかじゃなくね?

ScreenToGifで最新のffmpegを使う

ScreenToGifはffmpeg同梱してるが、v4.4.1 とだいぶ古い。

PS C:\Users\cho45> C:\ProgramData\ScreenToGif\ffmpeg.exe
ffmpeg version 4.4.1-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers

winget install ffmpeg

winget install ffmpeg

で簡単に入れられるので、フルパスしらべて

(base) PS C:\Users\cho45> Get-Command ffmpeg

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     ffmpeg.exe                                         0.0.0.0    C:\Users\cho45\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-8.0.1-full_build\bin\ffmpeg.exe

これを ScreenToGif の設定画面で指定してあげる。

animated avif

Animated AVIF の出力選択はあるのだけど、ffmpeg が古いせいか avif への出力に失敗したので新しくした。

animated avif と AV1 +webm って何がちがうのかという感じはするが (コンテナが違うというのはそうだけど)

Claude の契約が切れてました。しばらく z.ai バックエンドで Claude 使ったり Kilo Code 使ったりしてみる。ただ GLM 4.7 は 100kぐらいコンテキスト使った時点でかなりアホになる上に頑固なのがつらい

hackrf-sweep-webusbの更新

盆栽。地味に自分でも定期的に使っており、自分で作ったやつの中では使用頻度が高い。ということで盆栽がて、いろいろ古かったのでなおした。

ひさしぶりに見たらHackRF One だいぶ高いね…… とおもった。

やったこと

Rust 環境アップデート・コードをまともに

  • edition 更新
  • テスト (rust レベル + node )
  • 実装修正
    • ゼロアロケーションに

JS側

  • Vue2 やめて Vue3 に
  • Vue Material やめて Vanilla CSS に
  • バンドプリセット

Google Antigravity使いはじめてみたけど、Gemini CLI とはレートリミットが別みたい。意味わからんかった