matoken's blog https://matoken.org/blog Is there no plan B? Wed, 18 Mar 2026 22:08:59 +0000 ja hourly 1 https://wordpress.org/?v=6.9.4 https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9-32x32.jpeg matoken's blog https://matoken.org/blog 32 32 モバイルルーターでインターネット接続ができなくなり困る https://matoken.org/blog/2026/03/19/router-settings-lost/ https://matoken.org/blog/2026/03/19/router-settings-lost/#respond Wed, 18 Mar 2026 22:07:49 +0000 https://matoken.org/blog/?p=5357

fs0303w no carrier

電源の整理のためにモバイルルーターの電源を抜きました.そしてまた電源に繋いでPCを触ると外に出られません.

モバイルルーターはFUJISOFT +F FS030W でバッテリーは抜いてクレードルで有線接続,更にPoE インジェクター – PoE スプリッター(USB 5V 出力) でPoE 運用をしています.
ルーターの管理画面を確認すると電波が拾えていません.携帯のpovo 2.0 のSIM で確認すると同じ基地局だろうau のBAND 18 は電波を出しています.
ルーターを再起動しても駄目です.

SIM を挿し直したら直らないかなとルーター設置場所の裏山へ.
小雨が降っているので傘を差して濡れないよう気をつけながらSIM を差し直します.

fs0303w cover01
fs0303w cover02

「APN設定を確認」のメッセージのまま進みません.もしかしてAPN設定がおかしい?と蓋をしてPC で管理画面を確認すると「モバイルネットワーク設定」→「プロファイル設定」が初期状態になっています.

fs0303w apn check
fs0303w setting lost

ということで設定し直すことでまた繋がるようになりました.

Note
FUJISOFT +F FS030W での楽天モバイル設定例
  • 「モバイルネットワーク設定」→「プロファイル設定」→「新規」

    プロファイル名

    任意

    ユーザ名
    パスワード
    APN

    rakuten.jp

    認証方式

    None

    接続方法

    IPv4/IPv6

これまでも何度も電源を入れ直していましたが,設定が飛んだのは今回が初めてです.ちなみに他の設定や通信量カウントは消えずに残っていてモバイルネットワーク設定だけが消えていそうです.
ちなみにこれは2台目で,1台目はブートループするようになってしまいました.これも壊れるのが近いのかもしれません.

]]>
https://matoken.org/blog/2026/03/19/router-settings-lost/feed/ 0
Web上のActivityPub投稿をsnacで使いやすくするFirefox拡張機能のSnacWer https://matoken.org/blog/2026/03/13/firefox-extension-snapwer/ https://matoken.org/blog/2026/03/13/firefox-extension-snapwer/#respond Thu, 12 Mar 2026 21:45:02 +0000 https://matoken.org/blog/?p=5332

snac susie

軽量ActivityPub server のsnac用Firefox addon を知ったので試してみました.

このAddOn作者の方のtootをsnacの作者がboostしていたので知りました.

Hello #snac users. If you enjoy exploring the Fediverse via the web, you might find this #FirefoxExtension I created helpful. It lets you interact with almost any post more easily. It also works, of course, on Firefox derivates.

Feel free to take a look.

Webでsnacを利用しているときに便利になる拡張機能のようです.
早速導入してみます.

以下からFirefoxに拡張機能を登録します.

拡張機能の設定から自分のsnacアドレスを登録します.これで準備完了です.

snacwer00

試しに使ってみましょう.MastodonなどのActivityPubの公開投稿を開きます.すると,アドレスバーの右側にsnacのアイコンが表示されます.

snacwer01

snacのアイコンをクリックすると設定した自分のsnacでその投稿が開かれます.ここでLikeやBoostなどの操作ができます.URLをコピーしてsnacに持っていったりするより便利です :)

snacwer02

環境

SnacWer バージョン 1.0.1

$ dpkg-query -W firefox
firefox 148.0.2-1
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/03/13/firefox-extension-snapwer/feed/ 0
久々にGNOME環境を起動したら操作できなくなっていたので設定をリセット https://matoken.org/blog/2026/03/07/gnome-setting-reset/ https://matoken.org/blog/2026/03/07/gnome-setting-reset/#respond Fri, 06 Mar 2026 20:46:07 +0000 https://matoken.org/blog/?p=5314

いつもXfce4 で使っているDebian statble(trixie) 環境で久々にGNOME 環境を起動したら操作を受け付けません.
設定をリセットして復旧しました.

GNOME の状況は上部の時計や拡張機能のRunCat なんかは動いているけどキーの入力を受け付けず操作できません.マウスもカーソルが偶に見えるけどクリックしても何も起きません.
という感じで使い物になりません.
元々ほとんど使っていなかったので設定を初期化してみることに.

まずはGNOME からどうにかして抜けます.今回はキー入力を受け付けずCtrl+Alt+F1 なんかでコンソールにも降りれないので困りましたが,sshd を有効にしていたのでそれで入ってディスプレイマネージャ(今回はLightDM) を再起動して抜けました.

$ sudo service lightdm restart
Tip

もしリモート操作もできない場合Magic SysRq key は反応したのでこれで再起動できると思います.

GNOME から抜けた後,GNOME 以外のデスクトップ環境か,コンソール,ssh などでdconf コマンドで設定をリセットします.

$ dconf dump / > dconf.backup (1)
$ dconf reset -f /org/gnome (2)
  1. 念の為dconf をbackup

  2. dconf のgnome 以下をリセット

この後GNOME に入り直すことで復旧できました.

GNOME48 reset

駄目だった場合 dconf reset -f / までやってみてもいいかもしれません.
それでも駄目なら$HOME 以下のGNOME 関連のファイルを消す感じでしょうか.

この環境はDebian bookworm からdist-upgrade した環境なのでdist-uograde のタイミングでお壊れたのかもしれません.
拡張機能も怪しいかなと思ったのですが今回のリセットでは拡張機能は設定されたままで動作しているので恐らく関係なかったです.(拡張機能の問題の場合今回の方法ではリセットできないですね)

環境
$ dpkg-query -W gnome lightdm dconf-cli
dconf-cli       0.40.0-5
gnome   1:48+2
lightdm 1.32.0-6+b2
$ lsb_release -dr
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
$ arch
x86_64
]]>
https://matoken.org/blog/2026/03/07/gnome-setting-reset/feed/ 0
dGPUがなくても動作する国立国会図書館のNDLOCR-Liteが公開されていたので試す https://matoken.org/blog/2026/03/02/ndlocr-lite/ https://matoken.org/blog/2026/03/02/ndlocr-lite/#respond Mon, 02 Mar 2026 14:15:44 +0000 https://matoken.org/blog/?p=5297

国立国会図書館がNDLラボでNDLOCR-Lite を公開しました.
元々NDLOCR が公開されていましたがCUDA 対応のNVIDIA GPU が必須でした.今回のNDLOCR-Lite はdGPU の無いPC でも動作するようなので試してみました.

NDLOCR-Liteは、NDLOCRの軽量版を目指して開発したOCRであり、ノートパソコン等の一般的な家庭用コンピュータやOS環境で、図書や雑誌といった資料のデジタル化画像からテキストデータが作成できるOCRです。

GPU(Graphics Processing Unit。画像描画等の高度な並列計算を処理する装置。)を必要とせず、軽量なOCR処理が可能です。

また、NDLOCRが不得意としていた英文や手書き文字等についても実験的に対応しています。

実際のリポジトリはこちら.

類似のものにNDL古典籍OCR-Lite というものもあります.これもdGPU の必要ないOCR で自分では読めない古典をOCR で読めるようになったりして面白いです.
以下は以前 #kagokug で発表した関連資料です.

  • NDLOCR 要NVIDIA GPU

    • NDL古典籍OCR-LiteのようにNDLOCR-Liteが出ないかな?

このときこんなことを書いていましたが実現しました :)

GUI版を試す

Windows版は以下に使い方があります.自分はLinux版を試しましたが起動後の操作は同じだと思います.

GitHub のReleases から最新のバイナリを入手します.v1.1.0 時点ではLinux amd64 / macOS arm64, amd64 / Windows(amd64?) が用意されているようです.ここではLinux版.

$ wget -c https://github.com/ndl-lab/ndlocr-lite/releases/download/1.1.0/ndlocr_lite_v1.1.0_linux.tar.gz (1)
$ sha512sum ndlocr_lite_v1.1.0_linux.tar.gz (2)
61faed1fc843266095852697bbf29a721db4fb5a054f6d66ae8850301d22a4b1e29535eed150e439f7fd35760a17790a39cf0d45afd7c0ed72e7a3928e47ed93  ndlocr_lite_v1.1.0_linux.tar.gz
$ fuse-archive ndlocr_lite_v1.1.0_linux.tar.gz (3)
$ file ndlocr_lite_v1.1.0_linux/linux/ndlocr_lite_gui (4)
ndlocr_lite_v1.1.0_linux/linux/ndlocr_lite_gui: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=55e769c1bfe893353a55cdddbe7066033dc540bf, for GNU/Linux 3.2.0, not stripped
$ ndlocr_lite_v1.1.0_linux/linux/ndlocr_lite_gui (5)
  1. バイナリアーカイブを入手

  2. hash

  3. fuse-archive でアドホックに展開

  4. ファイル形式を確認

  5. NDLOCR-Lite 実行

NDL古典籍OCR-Lite と同じように扱える感じです.画像ファイル,画像ファイルの格納されたディレクトリから一括処理などが可能です.
その他,画面の指定した範囲をキャプチャしてOCR するキャプチャモードも便利です.ただ,このモードのキャプチャはi3 wm では別のworkspace はキャプチャできなさそうで少し使い勝手が悪いです.

NDLOCR Lite gui01

Note
画像の出典:納谷友一 訳註『黒猫』,健文社,1952. 国立国会図書館デジタルコレクション https://dl.ndl.go.jp/pid/2436688

CLI版を使う

CLI版はPython 3.10+ が必要です.今回はDebian sid amd64 のパッケージで導入したPython 3.13.12 を利用しました.
README.md にはpip での導入と,uv での導入が紹介されています.頻繁に使う場合はuv の方がいいかもしれませんがお好みの方で.

pip でvenv 以下に導入した例
$ git clone https://github.com/ndl-lab/ndlocr-lite
$ cd ndlocr-lite
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python3 src/ocr.py -h
usage: ocr.py [-h] [--sourcedir SOURCEDIR] [--sourceimg SOURCEIMG] --output OUTPUT [--viz VIZ] [--det-weights DET_WEIGHTS] [--det-classes DET_CLASSES] [--det-score-threshold DET_SCORE_THRESHOLD] [--det-conf-threshold DET_CONF_THRESHOLD]
              [--det-iou-threshold DET_IOU_THRESHOLD] [--simple-mode SIMPLE_MODE] [--rec-weights30 REC_WEIGHTS30] [--rec-weights50 REC_WEIGHTS50] [--rec-weights REC_WEIGHTS] [--rec-classes REC_CLASSES] [--device {cpu,cuda}]

Arguments for NDLkotenOCR-Lite

options:
  -h, --help            show this help message and exit
  --sourcedir SOURCEDIR
                        Path to image directory
  --sourceimg SOURCEIMG
                        Path to image directory
  --output OUTPUT       Path to output directory
  --viz VIZ             Save visualized image
  --det-weights DET_WEIGHTS
                        Path to deim onnx file
  --det-classes DET_CLASSES
                        Path to list of class in yaml file
  --det-score-threshold DET_SCORE_THRESHOLD
  --det-conf-threshold DET_CONF_THRESHOLD
  --det-iou-threshold DET_IOU_THRESHOLD
  --simple-mode SIMPLE_MODE
                        Read line with one model(Setting this option to True will slow down processing, but it simplifies the architecture and may slightly improve accuracy.)
  --rec-weights30 REC_WEIGHTS30
                        Path to parseq-tiny onnx file
  --rec-weights50 REC_WEIGHTS50
                        Path to parseq-tiny onnx file
  --rec-weights REC_WEIGHTS
                        Path to parseq-tiny onnx file
  --rec-classes REC_CLASSES
                        Path to list of class in yaml file
  --device {cpu,cuda}   Device use (cpu or cuda)
uv で導入した例
$ git clone https://github.com/ndl-lab/ndlocr-lite
$ cd ndlocr-lite
$ uv tool install .
$ which ndlocr-lite
/home/matoken/.local/bin/ndlocr-lite
$ ndlocr-lite --help
usage: ndlocr-lite [-h] [--sourcedir SOURCEDIR] [--sourceimg SOURCEIMG] --output OUTPUT [--viz VIZ] [--det-weights DET_WEIGHTS] [--det-classes DET_CLASSES] [--det-score-threshold DET_SCORE_THRESHOLD]
                   [--det-conf-threshold DET_CONF_THRESHOLD] [--det-iou-threshold DET_IOU_THRESHOLD] [--simple-mode SIMPLE_MODE] [--rec-weights30 REC_WEIGHTS30] [--rec-weights50 REC_WEIGHTS50] [--rec-weights REC_WEIGHTS]
                   [--rec-classes REC_CLASSES] [--device {cpu,cuda}]

Arguments for NDLkotenOCR-Lite

options:
  -h, --help            show this help message and exit
  --sourcedir SOURCEDIR
                        Path to image directory
  --sourceimg SOURCEIMG
                        Path to image directory
  --output OUTPUT       Path to output directory
  --viz VIZ             Save visualized image
  --det-weights DET_WEIGHTS
                        Path to deim onnx file
  --det-classes DET_CLASSES
                        Path to list of class in yaml file
  --det-score-threshold DET_SCORE_THRESHOLD
  --det-conf-threshold DET_CONF_THRESHOLD
  --det-iou-threshold DET_IOU_THRESHOLD
  --simple-mode SIMPLE_MODE
                        Read line with one model(Setting this option to True will slow down processing, but it simplifies the architecture and may slightly improve accuracy.)
  --rec-weights30 REC_WEIGHTS30
                        Path to parseq-tiny onnx file
  --rec-weights50 REC_WEIGHTS50
                        Path to parseq-tiny onnx file
  --rec-weights REC_WEIGHTS
                        Path to parseq-tiny onnx file
  --rec-classes REC_CLASSES
                        Path to list of class in yaml file
  --device {cpu,cuda}   Device use (cpu or cuda)

もしcuda 対応GPU のある環境であればコマンドラインオプションに --device cuda を渡すことで速くなると思います.

cli版実行例

--sourcedir (ディレクトリ内の複数画像)か --sourceimg (1つの画像ファイル)で処理対象ディレクトリか処理対象ファイルを指定, --output で結果の出力先を指定,--viz True で可視化画像を有効にして実行(オプション)

$ time ndlocr-lite --sourcedir . --output . --viz True
[INFO] Intialize Model
[INFO] Inference Image
69
[INFO] Saving result on ./viz_digidepo_2436688_0001-0.jpg
Total calculation time (Detection + Recognition): 13.220851182937622
  :
real    2m15.882s
user    10m16.273s
sys     0m5.189s
$ ls
digidepo_2436688_0001-0.jpg   digidepo_2436688_0001-4.json  digidepo_2436688_0001-8.txt
digidepo_2436688_0001-0.json  digidepo_2436688_0001-4.txt   digidepo_2436688_0001-8.xml
digidepo_2436688_0001-0.txt   digidepo_2436688_0001-4.xml   digidepo_2436688_0001-9.jpg
digidepo_2436688_0001-0.xml   digidepo_2436688_0001-5.jpg   digidepo_2436688_0001-9.json
digidepo_2436688_0001-1.jpg   digidepo_2436688_0001-5.json  digidepo_2436688_0001-9.txt
digidepo_2436688_0001-1.json  digidepo_2436688_0001-5.txt   digidepo_2436688_0001-9.xml
digidepo_2436688_0001-1.txt   digidepo_2436688_0001-5.xml   viz_digidepo_2436688_0001-0.jpg
digidepo_2436688_0001-1.xml   digidepo_2436688_0001-6.jpg   viz_digidepo_2436688_0001-1.jpg
digidepo_2436688_0001-2.jpg   digidepo_2436688_0001-6.json  viz_digidepo_2436688_0001-2.jpg
digidepo_2436688_0001-2.json  digidepo_2436688_0001-6.txt   viz_digidepo_2436688_0001-3.jpg
digidepo_2436688_0001-2.txt   digidepo_2436688_0001-6.xml   viz_digidepo_2436688_0001-4.jpg
digidepo_2436688_0001-2.xml   digidepo_2436688_0001-7.jpg   viz_digidepo_2436688_0001-5.jpg
digidepo_2436688_0001-3.jpg   digidepo_2436688_0001-7.json  viz_digidepo_2436688_0001-6.jpg
digidepo_2436688_0001-3.json  digidepo_2436688_0001-7.txt   viz_digidepo_2436688_0001-7.jpg
digidepo_2436688_0001-3.txt   digidepo_2436688_0001-7.xml   viz_digidepo_2436688_0001-8.jpg
digidepo_2436688_0001-3.xml   digidepo_2436688_0001-8.jpg   viz_digidepo_2436688_0001-9.jpg
digidepo_2436688_0001-4.jpg   digidepo_2436688_0001-8.json

ここでのファイル群は以下のようになっています.

digidepo_2436688_0001-“${N}”.jpg

OCR 対象画像

digidepo_2436688_0001-“${N}”.json, digidepo_2436688_0001-“${N}”.txt, digidepo_2436688_0001-“${N}”.xml

OCR 結果

viz_digidepo_2436688_0001-“${N}”.jpg

可視化画像(オプション)

国立国会図書館からダウンロードしたpdf の10コマ(20ページ分)をImagemagick でjpeg 画像に変換したものに対して実行したところ2分16秒ほど掛かりました.1画像あたり13.6秒,1ページあたり6.8秒ほど.英語日本語混じりでも精度良さそうです.
OCR 環境は,LENOVO ThinkPad L13 (G1), CPU: Intel® Core™ i7-10510U CPU @ 1.80GHz, RAM: DDR4 16GB, SSD: NVMe TOSHIBA KXG6AZNV512G にDebian sid amd64 を導入した環境です.

スキャンした画像データはこんな感じ(1コマ2ページ分)

$ file viz_digidepo_2436688_0001-0.jpg
viz_digidepo_2436688_0001-0.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 2481x1761, components 3

GNU time の -f %M でRAM の利用量を見たところこの画像1枚の処理で600MB 近く,10枚で860MB 程でした.

NDLOCR Lite cli01

Note
画像の出典:納谷友一 訳註『黒猫』,健文社,1952. 国立国会図書館デジタルコレクション https://dl.ndl.go.jp/pid/2436688

Linuxデスクトップでキャプチャモード

NDLOCR-Lite GUI版にはキャプチャモードがあり便利そうですが,NDLOCR-Lite を起動しておく必要があります.
同じようなことを以前から tesseract-ocr でやっていました.これはデスクトップ環境に登録したショートカットでスクリーンキャプチャとOCR を行い,クリップボードに結果を返すものでした.これをNDLOCR-Lite で動くように書き換えてみました.

$ cat ~/bin/ndlocr-lite.bash
#!/bin/bash

TMPDIR=$(mktemp -d)
IMAGEFILE="$(mktemp).png"
import png:"${IMAGEFILE}" (1)
#sixelv "${IMAGEFILE}"
convert "${IMAGEFILE}" sixel: (2)
ndlocr-lite --sourceimg "${IMAGEFILE}" --output "${TMPDIR}" (3)

if [ $? ]; then
  cat "${TMPDIR}"/*.txt | pee cat "xsel -b" (4)
  notify-send 'ocr📋(primary)' (5)
else
  notify-send 'ocr error'
  exit 1
fi

rm "${IMAGEFILE}" (6)
rm -r "${TMPDIR}"
  1. Imagemagick のimport コマンドで任意の場所をキャプチャ

  2. デバッグ用に画像出力

  3. NDLOCR-Lite で文字起こし

  4. クリップボードに格納

  5. notify-send でデスクトップに通知

実行するとこんな感じ.動画内のスライドをキャプチャしています.解像度が低いといまいちですが解像度が高いといい感じです.termial で叩くとデバッグ用にSixel でキャプチャ画像も出すようにしました.

NDLOCR Lite bash

Note
画像の出典:オープンソースカンファレンス2026 Tokyo/Spring 2日目ライトニングトークのオープニングより https://www.youtube.com/watch?v=xtb3ZFb6WvA

このbash script をWindowManager に登録しておきます.以下はi3 wm で Super+Shift+o で呼び出せるようにしています.

~/.config/i3/config

$ grep ocr ~/.config/i3/config
#OCR https://gitlab.com/matoken/kagolug-2022.05/-/blob/main/slide/ocr.adoc
bindsym $mod+Shift+o exec --no-startup-id ~/bin/ndlocr-lite.bash

ということで便利に使えそうです.
国立国会図書館の遠隔送信サービスで閲覧可能な書籍などを小さなスマートフォンなどの端末で読むのはいまいちと思っていたのですが,これで文字起こしして読んでみるのもありかもしれません,

環境

$ git log --pretty=oneline -1
4f0748be4244a2e36d4dd43af05d6eebded3d56d (HEAD -> master, origin/master, origin/HEAD) Merge pull request #13 from mattn/fallback-line
$ pipx list | grep uv
   package uv 0.10.7, installed using Python 3.13.3
    - uv
    - uvx
$ dpkg-query -W python3 python3-venv
python3 3.13.9-3
python3-venv    3.13.9-3
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/03/02/ndlocr-lite/feed/ 0
ChangeDetection.ioを更新したらプライベートIPを利用したURLがエラーになる https://matoken.org/blog/2026/02/25/changedetection-io/ https://matoken.org/blog/2026/02/25/changedetection-io/#respond Tue, 24 Feb 2026 22:19:29 +0000 https://matoken.org/blog/?p=5284

ChangeDetection.io を更新したらルーターのアドレスがエラーになってしまいました.

ChangeDetection.io ははてなアンテナのように登録サイトを定期的に巡回して更新を教えてくれるアプリケーションおよびサービスです.
自分はローカルPC に入れて動かしています.

#kagolug 2025.03 で発表したときの資料はこちら.

今回更新通知が来ていたので最新に更新しました.v0.54.1 になりました.

$ w3m -dump http://100.121.84.16:5000/ | grep ^v
v0.54.1

するとrouter の設定が以下のようなエラーになってログが取れなくなっています.

 > DISABLED
> Exception: Invalid URL 'DISABLED': No scheme supplied. Perhaps you meant https://DISABLED?
[Create a link to share watch config with others]

changedetection.io Invalid URL

Edit ボタンを押して編集画面に遷移すると問題なさそう.でも上書き保存しようとしたら怒られます.
エラーメッセージからはURL がおかしそうですが,このURL は普通に開けるしそもそもバージョンアップまでは動いていたものです.

* Watch protocol is not permitted or invalid URL format

changedetection.io edit invalid URL

なんかバグ踏んだ?前バージョンから今回までのdiff 見るか……と思ったのですが,SSRF 対策でプライベートIP が無効にされるようになったようです.

ALLOW_IANA_RESTRICTED_ADDRESSES=true で逃げられるようなので設定してみます.

docker-compose で運用しているので,docker-compose.yml を開き,changedetection 部分の environment:ALLOW_IANA_RESTRICTED_ADDRESSES=true を追加しました.そしてup することでプライベートIP アドレスのURL もまた動作するようになりました.

$ docker compose --file ~/src/changedetection.io/docker-compose.yml up -d

これこのアドレスだけ許可のような設定もできると良さそうですね.

環境

$ docker images ghcr.io/dgtlmoon/changedetection.io:latest
                                                                                                                                                                   i Info     U  In Use
IMAGE                                        ID             DISK USAGE   CONTENT SIZE   EXTRA
ghcr.io/dgtlmoon/changedetection.io:latest   cf4a98d2a980        889MB             0B    U
$ w3m http://127.0.0.1:5000/ | grep ^v
v0.54.1
$ dpkg-query -W docker.io docker-compose-plugin
docker-compose-plugin   5.1.0-1~debian.12~bookworm
docker.io       26.1.5+dfsg1-4+b1
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/02/25/changedetection-io/feed/ 0
中古docomo home 5G HR01で管理画面に入れなくて焦る https://matoken.org/blog/2026/02/23/used-docomo-home-5g-hr01/ https://matoken.org/blog/2026/02/23/used-docomo-home-5g-hr01/#respond Sun, 22 Feb 2026 22:18:23 +0000 https://matoken.org/blog/?p=5273

中古品の販売買取を行っているチェーン店のハードオフに行ったところ,docomo のSHARP製ホームルーターの「home 5G HR01」が550円で売られていたので買ってしまいました.
設定画面に入れなくて嵌ったのでメモしておきます.

buy docomo home 5g HR01

製品についてはこちらを.後継のHR02 が出ていますがまだ収束品ではなさそう.

取扱説明書はこちらにPDF で置いてあります.

取説を眺めながら,初期化を行いました.

  • 電源を入れて起動してから底面の RESET ホール10秒異常長押し,10秒ほどでステータスランプが3つ点いたところで離す

  • 起動後Wi-Fi AP に接続,接続情報は底面にある

  • AP 接続後, http://web.setting/ に繋ぐらしいが繋がらない

  • dig ると 192.168.128.1 が帰ってくるがip でも接続できない

  • Linux Firefox/Chromium,Android Firefox/Chrome で全滅

  • nmap を叩くと
    tcp:53
    udp:53, 67
    しか空いてなさそう?

  • 3度ほど出荷状態試みたけど駄目

  • SIM 挿しても駄目

取扱説明書の「トラブルシューティング(FAQ)」の項目を見ても分からず.
時計が駄目?と時計を手動で合わせてみたり違うSIM を挿してみたりしても駄目です.

という感じでもしかして安かったのはFW update などで壊れてしまっているものだったから?とか不安になってきました.

ここでWeb 検索して以下のYouTube 動画のコメントでそれらしいものが.

管理画面に入れるのは2つあるSSID(Wi-Fiの名前)のうちのどちらか片方だけです。

え,そんなことが?そういえば2,4GHz と 5GHz の2つのSSID が出ていて,干渉が少ないであろう5GHz のSSID しか試していませんでした.
そこで,HR01a-xxxxxx, HR01b-xxxxxx (xxxxxx部分は機種ごとにユニーク) のうちHR01a-xxxxxx の方にに接続し直した後, http://web.setting/ に接続できました.

ここは恐らく底面のQR code を読み取っての接続や有線接続で繋げば問題なかったのだと思います.
マニュアルを見返すとスクリーンショットでは HR01a-xxxxxx に繋いでいますし,以下の説明も見つけました.

●お買い上げ時の設定では、[SSID B]にWi-Fi接続しているパソコンや携帯端末から設定ツールを表示できません。
[SSID A]にWi-Fi接続しているパソコンや携帯端末、または有線LAN接続しているパソコンから設定ツールを表示してください。

ということで管理画面に接続でき,設定も可能になりました.
しかし,LINEMO, povo 2.0 は自宅ではHR01 非対応のBAND 8 とBAND 18 で自宅では圏外となり動作確認できませんでした.
mineo D のdocomo MVNO だと接続できて正常に外に出られて一安心.
こうなると550円で2台売ってたのでもう1台も買っておけばよかったなと思うなど.きっと次行ったら売れていることでしょう.

docomo home 5g HR01 2units

HR01 対応バンド

対応バンドをメモしておきます.

地域 規格 バンド(周波数/注記) 対応

国内

5G

n78(3.7GHz)

対応

国内

5G

n79(4.5GHz)

対応

国内

4G(LTE) FD-LTE

バンド1(2.0GHz)

対応

国内

4G(LTE) FD-LTE

バンド3(1.7GHz)

対応

国内

4G(LTE) FD-LTE

バンド19(800MHz)

対応

国内

4G(LTE) FD-LTE

バンド21(1.5GHz)

対応

国内

4G(LTE) FD-LTE

バンド28(700MHz)

対応

国内

4G(LTE) TD-LTE

バンド42(3.4GHz,3.5GHz)

対応

以下は総務省の「各携帯電話事業者の通信方式・周波数帯」という資料のHR01対応LTEバンド部分に色を付けたものです.

LTE BAND

SEE ALSO

]]>
https://matoken.org/blog/2026/02/23/used-docomo-home-5g-hr01/feed/ 0
yt-dlpでYouTubeの字幕ファイルのダウンロードに失敗(HTTP Error 429: Too Many Requests) https://matoken.org/blog/2026/02/20/yt-dlp_subtitle_429error/ https://matoken.org/blog/2026/02/20/yt-dlp_subtitle_429error/#respond Thu, 19 Feb 2026 22:17:00 +0000 https://matoken.org/blog/?p=5258

Tokyo Linux Users Group のTechnical Meeting のビデオがYouTube にアップロードされていると先日の #kagolug で教えてもらったので観てみようと思いました.
でもTLUG は英語です.以前はWisper.cpp で文字起こし & 機械翻訳で字幕を作っていましたが最近のYouTube の文字起こしは大分良くなっているのでそれを使おうとローカルにビデオと字幕をdl しようとしたところ字幕のダウンロードに失敗しました.

適当な解像度のビデオとオーディオ,それと英語の文字起こし字幕と,それを日本語に翻訳したものをダウンロードしようとしました.

$ yt-dlp -f 244+251 yYgF87nqyKI --write-auto-subs --sub-langs ja,en_orig
[youtube] Extracting URL: yYgF87nqyKI
[youtube] yYgF87nqyKI: Downloading webpage
[youtube] yYgF87nqyKI: Downloading android vr player API JSON
[youtube] yYgF87nqyKI: Downloading web safari player API JSON
[youtube] yYgF87nqyKI: Downloading player 4c5cf06a-tv
[youtube] [jsc:deno] Solving JS challenges using deno
[youtube] yYgF87nqyKI: Downloading m3u8 information
[info] yYgF87nqyKI: Downloading subtitles: ja
[info] yYgF87nqyKI: Downloading 1 format(s): 244+251
[info] Writing video subtitles to: CDImage - Cam [yYgF87nqyKI].ja.vtt
WARNING: The extractor specified to use impersonation for this download, but no impersonate target is available. If you encounter errors, then see  https://github.com/yt-dlp/yt-dlp#impersonation  for information on installing the required dependencies
ERROR: Unable to download video subtitles for 'ja': HTTP Error 429: Too Many Requests

*Too Many Requests* とか言われてしまいました.今日初めて実行したのになんで?

--verbose オプションを付けてみましたがよくわかりません

[info] Writing video subtitles to: CDImage - Cam [yYgF87nqyKI].ja.vtt
[debug] Invoking http downloader on "https://www.youtube.com/api/timedtext?v=yYgF87nqyKI&ei=M4WXaZnECfax2roP_YqAqAc&caps=asr&opi=112496729&xoaf=5&xowf=1&xospf=1&hl=en&ip=0.0.0.0&ipbits=0&expire=1771562915&sparams=ip%2Cipbits%2Cexpire%2Cv%2Cei%2Ccaps%2Copi%2Cxoaf&signature=1B0AC6AA8FB20AFE9B45B2F66DBB1000F04DE626.909918AF43ACD2AFD3E0C2C61E53A3C72E49AB6C&key=yt8&kind=asr&lang=en&fmt=vtt&tlang=ja"
WARNING: The extractor specified to use impersonation for this download, but no impersonate target is available. If you encounter errors, then see  https://github.com/yt-dlp/yt-dlp#impersonation  for information on installing the required dependencies
ERROR: Unable to download video subtitles for 'ja': HTTP Error 429: Too Many Requests
Traceback (most recent call last):
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 4449, in _write_subtitles
    self.dl(sub_filename, sub_copy, subtitle=True)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 3285, in dl
    return fd.download(name, new_info, subtitle)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/downloader/common.py", line 480, in download
    ret = self.real_download(filename, info_dict)
  File "/home/matoken/bin/yt-dlp/yt_dlp/downloader/http.py", line 362, in real_download
    establish_connection()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/downloader/http.py", line 119, in establish_connection
    ctx.data = self.ydl.urlopen(request)
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 4260, in urlopen
    return self._request_director.send(req)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/networking/common.py", line 117, in send
    response = handler.send(request)
  File "/home/matoken/bin/yt-dlp/yt_dlp/networking/_helper.py", line 194, in wrapper
    return func(self, *args, **kwargs)
  File "/home/matoken/bin/yt-dlp/yt_dlp/networking/common.py", line 359, in send
    return self._send(request)
           ~~~~~~~~~~^^^^^^^^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/networking/_requests.py", line 361, in _send
    raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 429: Too Many Requests

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1698, in wrapper
    return func(self, *args, **kwargs)
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1854, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1913, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 3096, in process_video_result
    self.process_info(new_info)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 189, in wrapper
    return func(self, *args, **kwargs)
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 3353, in process_info
    sub_files = self._write_subtitles(info_dict, temp_filename)
  File "/home/matoken/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 4457, in _write_subtitles
    raise DownloadError(msg)
yt_dlp.utils.DownloadError: Unable to download video subtitles for 'ja': HTTP Error 429: Too Many Requests

ISSUES を探すと既知の問題のようでワークアラウンドがありました.

FreeTube is adding a PO token to their subtitles requests. But FreeTube doesn’t use auto-translated subs AFAICT.
# Manual subtitles and original language automatic captions are not affected by this HTTP Error 429 issue.

Only subtitles/captions that have been automatically translated into another language are affected. So you may be able to get the subs you want without a problem if you are precise with your --sub-langs and --write-subs vs --write-auto-subs arguments.

But if you want translated auto subs,
# there are 2 known ways of avoiding this HTTP Error 429:

  • Pass fresh cookies to yt-dlp from a browser session where you’ve very recently loaded auto-translated subs

  • Wait ~60 seconds after extraction and before downloading the auto subs, e.g. --sleep-subtitles 60

(Either of these 2 methods will work individually, you do not need to combine them)

ということでとりあえず --sleep-subtitles 60 を付けて実行することで字幕ダウンロード時にsleep して怒られずに字幕をダウンロードすることができました.

$ yt-dlp -f 244+251 yYgF87nqyKI --write-auto-subs --sub-langs ja,en_orig --sleep-subtitles 60

そしてmpv 等でこんな感じで字幕を2つ表示しながら視聴可能に :)

$ mpv --sub-files='CDImage - Cam [yYgF87nqyKI].en.vtt:CDImage - Cam [yYgF87nqyKI].ja.vtt' --secondary-sid=2 'CDImage - Cam [yYgF87nqyKI].webm'

mpv 2subs

環境
$ yt-dlp --version
2026.02.04
$ deno --version
deno 2.6.8 (stable, release, x86_64-unknown-linux-gnu)
v8 14.5.201.2-rusty
typescript 5.9.2
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/02/20/yt-dlp_subtitle_429error/feed/ 0
snacのユーザーごとのstaticディレクトリ https://matoken.org/blog/2026/02/19/snac-static/ https://matoken.org/blog/2026/02/19/snac-static/#respond Wed, 18 Feb 2026 20:51:26 +0000 https://matoken.org/blog/?p=5251

snac susie

snacのための静的ディレクトリをapache2 httpd で設定してカスタム絵文字の設置場所に利用しています.

実は設定せずともユーザごとに静的ディレクトリがあるのに気づきました.

きっかけはこちら.

${SNAC-URL}/${USER}/s/ の下が使えるようです.
実際に試してみます.

$ cd ${SNAC-DATA}/user/${USER}/static <.>
$ echo test > test <.>
$ w3m -dump_extra https://snac.matoken.org/matoken/s/test | grep ^HTTP/ -A99 <.>
HTTP/1.1 200 OK
Date: Wed, 18 Feb 2026 20:50:37 GMT
Server: Apache/2.4.66 (Debian)
content-type: application/octet-stream
x-creator: snac/2.90
etag: W/”snac-1771444525″
access-control-allow-origin: *
access-control-allow-headers: *
access-control-expose-headers: Link
Content-Security-Policy: script-src ;
content-length: 5
Connection: close

test

  1. ユーザーディレクトリの下の static に移動

  2. テストファイルを作成

  3. ユーザーディレクトリの下の s 以下の該当ファイルを確認

ということでsnac server の ${SNAC-DATA}/user/${USER}/static 以下に置いたファイルが ${SNAC-URL}/${USER}/s/ 以下で確認できます.
theme でこのディレクトリは利用していましたが,theme 以外のファイルもok なんですね.

環境
$ sudo -u snac ~snac/snac2/snac state ~snac/snac-data
server: snac.matoken.org (snac/2.90)
uptime: 1:11:46:03
job fifo size (cur): 0
job fifo size (peak): 11
thread #0 state: waiting
thread #1 state: waiting
thread #2 state: waiting
thread #3 state: waiting
$ lsb_release -dr
No LSB modules are available.
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
$ arch
x86_64
]]>
https://matoken.org/blog/2026/02/19/snac-static/feed/ 0
Firefoxの指定タブを保護(ビデオミーティング離脱防止) https://matoken.org/blog/2026/02/16/firefox-lock-tab/ https://matoken.org/blog/2026/02/16/firefox-lock-tab/#respond Mon, 16 Feb 2026 10:03:27 +0000 https://matoken.org/blog/?p=5235

2683779 64

この土日ウェブブラウザでビデオミーティングに参加していました.1つはzoom.us, もう1つはGalene でした.
どちらも参加中に操作ミスでビデオミーティングのタブから移動してしまいビデオミーティングから離脱してしまいました.
タブを拡張機能で保護できないか試してみました.

はじめ試したのはこちらの「Tabloc」.text chat のリンクを押すと新しいタブで開かれるしこれでいいかと思ったのですが,右上のメニューの履歴から復元したら駄目です.

次に試したのは以下の「タブのページをロックする」.こちらだと履歴を復元しようとしあたりタブを中クリックで閉じようとすると「このページから移動しますか?入力した情報は保存されません。」というポップアップですぐには閉じなくなりました.

fx tablock02
fx tablock01

保護したタブには🔒アイコンが表示されます.

環境
タブのページをロックする: バージョン 1.2025.1227.0
$ dpkg-query -W firefox
firefox 147.0.3-1+b1
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/02/16/firefox-lock-tab/feed/ 0
Nextcloudの自動アップデートに失敗してバックアップでdisk full https://matoken.org/blog/2026/02/10/nextcloud-upgrade-fail/ https://matoken.org/blog/2026/02/10/nextcloud-upgrade-fail/#respond Mon, 09 Feb 2026 20:55:20 +0000 https://matoken.org/blog/?p=5226

サーバがdisk full になり調べたらNextcloud が自動アップデートと自動バックアップ,しかし失敗というのを毎日繰り返してdisk full になっていました.

はじめ1月ほど前にdisk full になり,cron で動かしているデイリーバックアップが溜まっているせいかと思いそこを掃除したのですが今月になってまたdisk full に.
du コマンドなどで確認するとNextcloud の下の data/updater-${instanceid}/backups/ に毎日Nextcloud のバックアップが作られています.これのせいでdisk full になっているようでした.

Note
${instanceid} については config/config.php'instanceid' で確認できます.

ここにNextcloud のバックアップが作られるのはNextcloud のアップデート時です.まずは手動でアップデートを実行してみます.

$ sudo -u www-data php updater/updater.phar

  :

[✘] Verify integrity failed
There are more files than the downloaded archive in the downloads/ folder.

Update failed. To resume or retry just execute the updater again.

ダウンロードしたNextcloud アーカイブがおかしそうです.詳細を知るためにログを確認します.

data/updater.log
2026-02-08T22:30:46+0000 T8hDMIut3r [info] storage location: /var/www/files.matoken.org/data/updater-ocws62au2wl3/downloads/
2026-02-08T22:30:57+0000 T8hDMIut3r [info] end of verifyIntegrity()

この storage location の下を見ると前のバージョンのアーカイブが残っていてこれが怪しそうです.

$ ls -lA  /var/www/files.matoken.org/data/updater-ocws62au2wl3/downloads/
合計 610548
-rw-r--r-- 1 www-data www-data 312581794  1月 16 04:09 nextcloud-32.0.4.zip
-rw-r--r-- 1 www-data www-data 312597357  2月  9 07:24 nextcloud-32.0.5.zip

古いアーカイブを削除します.

$ rm /var/www/files.matoken.org/data/updater-ocws62au2wl3/downloads/nextcloud-32.0.4.zip

再度アップデートを試みます.(先程バックアップは取得しているので今回はバックアップはスキップ)

$ sudo -u www-data php updater/updater.phar --no-backup

  :

"occ upgrade" finished

Keep maintenance mode active? [y/N]
Maintenance mode disabled

Maintenance mode is disabled

今度はアップデートが正常に完了しました.

nextcloud 32.0.5

次の日に確認してもバックアップは作成されていなかったのでこれであたりのようです.

環境
$ sudo -u www-data php /var/www/files.matoken.org/occ --version
Nextcloud 32.0.3
$ lsb_release -dr
No LSB modules are available.
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
$ arch
x86_64
]]>
https://matoken.org/blog/2026/02/10/nextcloud-upgrade-fail/feed/ 0
GNU coreutils 9.10でpasteのデリミタにマルチバイト文字が利用可能に https://matoken.org/blog/2026/02/06/gnu-coreutils-9-10-paste/ https://matoken.org/blog/2026/02/06/gnu-coreutils-9-10-paste/#respond Thu, 05 Feb 2026 21:07:07 +0000 https://matoken.org/blog/?p=5219

GNU coreutils 9.10 がリリースされました.

paste でマルチバイト文字を認識するようになったそうです.まだ対応していなかったんだとちょっと試してみました.

  • paste(1) is now multi-byte character aware

まずは適当なファイルを用意します.

$ echo '1
2
3' > num
$ echo 'い
ろ
は' > data

GNU coreutils 9.7 のpaste で試すと日本語のデータもうまく動いていそうです.

$ paste --version | head -1
paste (GNU coreutils) 9.7
$ paste num data
1       い
2       ろ
3       は

NEWS の下の方を見ると少し詳しく書いてありました.

'paste' now supports multi-byte --delimiters characters.

デリミタにマルチバイト文字が使えるようになったようです.

ということで再度,今度はデミリタを指定します.

GNU coreutils 9.7 のpaste でデリミタに , を指定
$ paste num data -d,
1,い
2,ろ
3,は
GNU coreutils 9.7 のpaste でデリミタに を指定
$ paste num data -d=
1��
2��
3��

たしかにマルチバイト文字を使うとおかしくなります.

GNU coreutils 9.10 を用意
$ wget https://ftp.gnu.org/gnu/coreutils/coreutils-9.10.tar.xz \
	https://ftp.gnu.org/gnu/coreutils/coreutils-9.10.tar.xz.sig
$ echo 'SHA256 (coreutils-9.10.tar.xz) = FlNamt8LEANzZOLWEqrT2fTso6NElJztdNEvr0vVHSU=' | cksum -a sha256 --check
coreutils-9.10.tar.xz: OK
$ gpg --verify coreutils-9.10.tar.xz.sig
gpg: assuming signed data in 'coreutils-9.10.tar.xz'
gpg: Signature made Wed Feb  4 21:46:29 2026 JST
gpg:                using RSA key 6C37DC12121A5006BC1DB804DF6FD971306037D9
gpg: Good signature from "P draig Brady <P@draigBrady.com>" [unknown]
gpg:                 aka "P draig Brady <pixelbeat@gnu.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 6C37 DC12 121A 5006 BC1D  B804 DF6F D971 3060 37D9
$ tar xvf coreutils-9.10.tar.xz
$ cd coreutils-9.10
$ sudo apt build-dep coreutils
$ ./configure
$ make
$ src/paste --version | head -1
paste (GNU coreutils) 9.10
GNU coreutils 9.10 のpaste でデリミタにマルチバイト文字を指定
$ ./src/paste num data -d=
1=い
2=ろ
3=は
$ ./src/paste num data -d🐈
1🐈い
2🐈ろ
3🐈は

ということでGNU coreutils 9.10 のpaste でデリミタにマルチバイト文字が使えるようになっているのが確認できました.
使い道はあまり浮かびませんが…….

環境
$ dpkg-query -W coreutils
coreutils       9.7-3
$ src/paste --version
paste (GNU coreutils) 9.10
Copyright (C) 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David M. Ihnat and David MacKenzie.
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/02/06/gnu-coreutils-9-10-paste/feed/ 0
VirusTotalのcli toolとあまりに小さいAPI制限 https://matoken.org/blog/2026/02/06/virustotal-api-limit/ https://matoken.org/blog/2026/02/06/virustotal-api-limit/#respond Thu, 05 Feb 2026 20:49:13 +0000 https://matoken.org/blog/?p=5214

久々にcli でVirusTotal を使おうとしたらツールが変更になっていたり,API 制限がおかしくなっていました.

以前のblog エントリを確認すると,

以下のツールを使っていたようですが,Archived になっています.

現在は以下のツールがアクティブなようなのでこちらを使うことにしました.

build
$ git clone https://github.com/VirusTotal/vt-cli
$ cd vt-cli
$ make
$ build/vt -h
A command-line tool for interacting with VirusTotal.

Usage:
  vt [command]

Available Commands:
  analysis       Get a file or URL analysis
  collection     Get information about collections
  completion     Output shell completion code for the specified shell (bash or zsh)
  domain         Get information about Internet domains
  download       Download files
  file           Get information about files
  group          Get information about VirusTotal groups
  help           Help about any command
  hunting        Manage malware hunting rules and notifications
  init           Initialize or re-initialize vt command-line tool
  iocstream      Manage IoC Stream notifications
  ip             Get information about IP addresses
  meta           Returns metadata about VirusTotal
  monitor        Manage your monitor account
  monitorpartner Manage your monitor partner account
  retrohunt      Manage retrohunt jobs
  scan           Scan files or URLs
  search         Search for files in VirusTotal Intelligence
  threatprofile  Get information about Threat Profiles
  url            Get information about URLs
  user           Get information about VirusTotal users
  version        Show version number

Flags:
  -k, --apikey string   API key
      --format string   Output format (yaml/json/csv) (default "yaml")
  -h, --help            help for vt
  -s, --silent          Silent or quiet mode. Do not show progress meter
  -v, --verbose         verbose output

Use "vt [command] --help" for more information about a command.
API key 登録
$ build/vt init

██╗   ██╗██╗██████╗ ██╗   ██╗███████╗████████╗ ██████╗ ████████╗ █████╗ ██╗
██║   ██║██║██╔══██╗██║   ██║██╔════╝╚══██╔══╝██╔═══██╗╚══██╔══╝██╔══██╗██║
██║   ██║██║██████╔╝██║   ██║███████╗   ██║   ██║   ██║   ██║   ███████║██║
╚██╗ ██╔╝██║██╔══██╗██║   ██║╚════██║   ██║   ██║   ██║   ██║   ██╔══██║██║
 ╚████╔╝ ██║██║  ██║╚██████╔╝███████║   ██║   ╚██████╔╝   ██║   ██║  ██║███████╗
  ╚═══╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝   ╚═╝    ╚═════╝    ╚═╝   ╚═╝  ╚═╝╚══════╝

VirusTotal Command-Line Interface: Threat Intelligence at your fingertips.

Enter your API key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
API key written to config file: /home/matoken/.vt.toml
Relationships cache written to: /home/matoken/.cache/.vt.relationships.cache
Note

API key はVirusTotal のアカウントを作成してログインした状態で,右上のユーザーをクリックしたときに出てくる「API key」から取得できます.

準備ができたのでスキャンしたいファイルをアップロードします.

ファイルのアップロード
$ build/vt scan file ~/Downloads/briar-desktop-x64-0.6.4-beta.AppImage
/home/matoken/Downloads/briar-desktop-x64-0.6.4-beta.AppImage YTg3MzBiNGEwOWFmODUxMjgwYmFjOGI0YjE1YmQ4MTE6MTc3MDE5NDcyOA==

結果を確認してみようとします.しかし制限に掛かってしまっています.

結果の確認
$ build/vt analysis YTg3MzBiNGEwOWFmODUxMjgwYmFjOGI0YjE1YmQ4MTE6MTc3MDE5NDcyOA==
Quota exceeded

無料アカウントの制限を確認すると1日あたり500リクエストとか1分辺り4件とかで結構広くなぜ制限されたのかわかりません.

Public API constraints and restrictions

The Public API is limited to 500 requests per day and a rate of 4 requests per minute.
The Public API must not be used in commercial products or services.
The Public API must not be used in business workflows that do not contribute new files.
You are not allowed to register multiple accounts to overcome the aforementioned limitations.

自分のAPI ページを確認するとリファレンスページと違い以下のように1日1問い合わせになっています.少なすぎる…….

Access level
 Limited , standard free public API
Upgrade to premium
Usage 	Must not be used in business workflows, commercial products or services.
Request rate 	1 lookups / min
Daily quota 	1 lookups / day
Monthly quota 	31 lookups / month

virustotal limit01
virustotal limit02
virustotal limit03

以下のフォーラムを見ると結構古い問題のようでアカウントを作り直さないと治らなそうです.

If you have an old account with stricter limitations than described, it might be best to set up a new account to ensure you benefit from current limitations stated.

ちなみにプロフィールページはこんな感じで9年前に作ったアカウントのようです.

virustotal userprofile

仕方がないのでVirusTotal のアカウントを削除して作り直します.

virustotal deleteaccount

  • 既存アカウントを削除

  • 既存アカウントからログアウト

  • 新規アカウントを作成

    • このときアカウント名とメールアドレスが同じだと駄目

  • API key を取得して vt init を実行してAPI key 再登録

新しいアカウントは以下のように正い制限になりました.

Access level
 Limited , standard free public API
Upgrade to premium
Usage 	Must not be used in business workflows, commercial products or services.
Request rate 	4 lookups / min
Daily quota 	500 lookups / day
Monthly quota 	15.5 K lookups / month

これで普通に動かせそうな感じです.

$ build/vt analysis YTg3MzBiNGEwOWFmODUxMjgwYmFjOGI0YjE1YmQ4MTE6MTc3MDE5NDcyOA== | tail -10
  stats:
    confirmed-timeout: 0
    failure: 0
    harmless: 0
    malicious: 0
    suspicious: 0
    timeout: 0
    type-unsupported: 12
    undetected: 64
  status: "completed"
環境
$ build/vt version
vt-cli
$ git log --pretty=oneline -1
d3405587c568b6486ccd5ac773cde1a25e4bb762 (HEAD -> master, origin/master, origin/HEAD) chore: upgrade `vt-go` to version 1.1.0.
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/02/06/virustotal-api-limit/feed/ 0
電源ボタンで自動シャットダウンを抑制 https://matoken.org/blog/2026/02/03/do-not-auto-shutdown-with-power-button/ https://matoken.org/blog/2026/02/03/do-not-auto-shutdown-with-power-button/#respond Tue, 03 Feb 2026 10:16:37 +0000 https://matoken.org/blog/?p=5203

laptop を少し移動したらシャットダウン処理が走ってしまいました.ログを見ると電源ボタンが押されてシャットダウン処理が走ったようです.
これを抑制しました.

ログはこんな感じです.

リスト 1. syslog より
2026-02-02T06:38:41.358362+09:00 tp-l13 acpid: received input layer event "button/power PBTN 00000080 00000000"
2026-02-02T06:38:41.359609+09:00 tp-l13 acpid: rule from /etc/acpi/events/powerbtn-acpi-support matched
2026-02-02T06:38:41.362438+09:00 tp-l13 acpid: executing action "/etc/acpi/powerbtn-acpi-support.sh"

/etc/systemd/logind.conf の電源ボタンを押したときの HandlePowerKey のコメントを解除して poweroffignore に書き換えて電源ボタンで何もしないようにします.

$ sudo git -C /etc diff HEAD~~ /etc/systemd/logind.conf
diff --git a/systemd/logind.conf b/systemd/logind.conf
index 02ec007..d7e2dbe 100644
--- a/systemd/logind.conf
+++ b/systemd/logind.conf
@@ -25,7 +25,7 @@
 #InhibitDelayMaxSec=5
 #UserStopDelaySec=10
 #SleepOperation=suspend-then-hibernate suspend
-#HandlePowerKey=poweroff
+HandlePowerKey=igore
 #HandlePowerKeyLongPress=ignore
 #HandleRebootKey=reboot
 #HandleRebootKeyLongPress=poweroff

デーモンを再起動して設定を反映します.

$ sudo systemctl restart systemd-logind

電源ボタンを押してシャットダウン処理が走らないのを確認します.

リスト 2. 環境
$ dpkg-query -W systemd acpi
acpi    1.8-1
systemd 259-1
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
$ sudo lshw -sanitize -json | jq '."vendor", ."version"'
"LENOVO"
"ThinkPad L13"
]]>
https://matoken.org/blog/2026/02/03/do-not-auto-shutdown-with-power-button/feed/ 0
懐かしい感じのターミナルスクリーンセーバーのmystify-term https://matoken.org/blog/2026/01/27/mystify-term/ https://matoken.org/blog/2026/01/27/mystify-term/#respond Mon, 26 Jan 2026 20:48:08 +0000 https://matoken.org/blog/?p=5191

古いWindows を使っていた方は懐かしく感じるかもしれないターミナルスクリーンセーバーのmystify-term というものを見かけたので試してみました.

install

c製で依存も少ないのでmake 一発な感じです.Debian sind amd64/Raspberry Pi bookworm armhf ともに問題なく動きました.

$ git clone https://github.com/adsr/mystify-term
$ cd mystify-term
$ install mystify-term ~/bin/
$ which mystify-term
/home/matoken/bin/mystify-term
$ mystify-term --help
Usage:
  mystify-term [options]

Options:
  -h, --help                  Show this help
  -v, --version               Show program version
  -q, --polys=<int>           Set number of polygons (default=2, max=16)
  -p, --points=<int>          Set number of points per polygon (default=4, max=16)
  -t, --trails=<int>          Set number of trails lines (default=20, max=64)
  -f, --fps=<int>             Set frames per second (default=60)
  -e, --max-velocity=<float>  Set max velocity per point (default=1.00, min=0.01, max=10.00)
  -s, --no-status             Hide status text
  -i, --trail-incr=<int>      Render every nth trail (default=4, max=64)
$ mystify-term --version
mystify-term v0.1.0

実行例

とりあえずオプション無しで起動します.懐かしい感じのスクリーンセーバーが起動します.

スクリーンショットはこんな感じです.

mystify term01

UTF-8 の四角を使っているので,UTF-8 が使えないとこんな感じになったりします.まあこれはこれで.

mystify term02

動いている様子は以下のasciinema を.

キーバインド

下の方にあるとおり以下のキーバインドで操作ができます.

p=pause, s=step, r=reinit, w=status, q=quit

p

一時停止/再開

s

停止/コマ送り(pで再開)

r

再初期化

w

ステータス表示/非表示

q

終了

コマンドラインオプション

スタータスをいじれますが, -s, --no-status くらいであとは既定値でいいかなと言う感じ.

-h, --help                  Show this help

このヘルプを表示

-v, --version               Show program version

バージョン表示

-q, --polys=<int>           Set number of polygons (default=2, max=16)

ポリゴン数

-p, --points=<int>          Set number of points per polygon (default=4, max=16)

ポイント数(例えば3で三角形,4で四角形)

-t, --trails=<int>          Set number of trails lines (default=20, max=64)

トレイルラインの数

-f, --fps=<int>             Set frames per second (default=60)

1秒あたりのフレーム数

-e, --max-velocity=<float>  Set max velocity per point (default=1.00, min=0.01, max=10.00)

最大速度

-s, --no-status             Hide status text

ステータスを隠す

-i, --trail-incr=<int>      Render every nth trail (default=4, max=64)

n番目のトレイルごとに描画

tmux のスクリーンセーバーに設定

ターミナルマルチプレクサのtmux のスクリーンセーバーに設定してみます.

まずは設定ファイルに以下を記述します.

set -g lock-after-time 900 #スクリーンセーバーが起動するまでの秒数
set -g lock-command "mystify-term -s" #スクリーンセーバーコマンド
Note

tmux の設定ファイルは

       ~/.tmux.conf
       $XDG_CONFIG_HOME/tmux/tmux.conf
       ~/.config/tmux/tmux.conf

byobu から起動している場合は

       ~/.byobu/.tmux.conf

次回起動時から反映されますが,現在のtmux セッションに反映したい場合は以下のように tmux source 設定ファイル として反映できます.

$ tmux source ~/.byobu/.tmux.conf
]]>
https://matoken.org/blog/2026/01/27/mystify-term/feed/ 0
軽量ActivityPub Serverのsnac 2.89リリース https://matoken.org/blog/2026/01/25/snac-2-89/ https://matoken.org/blog/2026/01/25/snac-2-89/#respond Sun, 25 Jan 2026 10:16:05 +0000 https://matoken.org/blog/?p=5181

RELEASE NOTES

## 2.89

Fixed crash in pronouns processing (contributed by byte).

Added counters in the people page (contributed by byte).

New command-line option refresh, to refresh all follower and following Actor objects, marking them as broken if they are.

今回の新機能は2つ.

  • people ページにカウンターを追加

snac 2.89 people count

  • コマンドラインオプションにフォロワーとフォロー中のアクターのオブジェクトを更新する refresh を追加.

$ snac | grep refresh
refresh {basedir} {uid}              Refreshes all actors
$ snac snac-data matoken

特に問題がなかったのか何も出力されませんでした.

Debian package はまだ2.88 です.

$ rmadison snac2
snac2      | 2.75-2~bpo12+1 | oldstable-backports       | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
snac2      | 2.75-2~bpo12+1 | oldstable-backports-debug | source
snac2      | 2.75-2         | stable                    | source, amd64, arm64, armel, armhf, i386, ppc64el, riscv64, s390x
snac2      | 2.88-1~bpo13+1 | stable-backports          | source, amd64, arm64, armel, armhf, i386, ppc64el, riscv64, s390x
snac2      | 2.88-1~bpo13+1 | stable-backports-debug    | source
snac2      | 2.88-1         | testing                   | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x
snac2      | 2.88-1         | unstable                  | source, amd64, arm64, armhf, i386, loong64, ppc64el, riscv64, s390x
snac2      | 2.88-1         | unstable-debug            | source
]]>
https://matoken.org/blog/2026/01/25/snac-2-89/feed/ 0
x11上のmltermでマウスアウト時に文字入力ができない https://matoken.org/blog/2026/01/21/mlterm-mouseout/ https://matoken.org/blog/2026/01/21/mlterm-mouseout/#respond Wed, 21 Jan 2026 11:31:37 +0000 https://matoken.org/blog/?p=5167

たくさんの環境で動作する軽量で多機能なターミナルエミュレーターのmlterm(Multi Lingual TERMinal)を近年メインに利用しています.

最近の問題としてmlterm のウィンドウからマウスカーソルが外れるとmlterm がアクティブウィンドウでも文字が入力できません.文字が入力できない→カーソルをmlterm に持ってくるというのが地味に面倒です.
今回これを調べて解決しました.

まず検索して以下の記事を見つけました.

解決方法は、

~/.mlterm/main

input_method=ibus

を追加すること。

直接マウスアウトのときの設定ではないのですが,これを真似すると確かにマウスアウトしても文字が入力できます.

~/.mlterm/main に以下の設定を追加
input_method = fcitx

しかし,今度は日本語が入力できません.
mlterm のドキュメントを見ても設定は大丈夫そう.

doc/ja/README.ja より
      o input_method (*default*) (#)
        使用するインプットメソッド
        default は、x11 版の mlterm では xim、それ以外は、システムが提供する標準
        のインプットメソッドが使用されます。
        フォーマットは以下のようになります。

        [input method];[option1]:[option2]

        [input method] にインプットメソッド(xim/uim/m17nlib/scim/kbd/skk/wnn/
        canna/iiimf)を指定し、必要であれば ":" で区切ってオプションを列挙します。

        各インプットメソッドのオプションは以下の通りです。

        xim の場合: xim:[xim server]:[locale]
        [xim server] で XIM サーバー名(kinput2, Ami, xcin など)を指定します。
        指定しなかった場合は、環境変数 XMODIFIERS で指定した XIM サーバーが
        使用されます。[locale] には XIM サーバーのローケールを指定します。指定し
        なかった場合はシステムのローケールが使用されます。use_xim オプションで
        xim を無効にした場合、xim を指定しても無視されます。

        uim の場合:
        uim:[conversion engine]
        [conversion engine] に変換エンジン(anthy, prime, hangul2など)を指定しま
        す。指定しなかった場合は uim のデフォルト変換エンジンが使用されます。

        m17nlib の場合:
        m17nlib:[language id]:[input method]
        [language id] には ISO-639 に従って言語(ar, zh, ja など)を指定します。
        指定しなかった場合はシステムのローケールから取得した言語が使われます
        [input_method] で使用するインプットメソッド(anthy, py など)を指定します
        指定されなかった場合は [language id] のデフォルトインプットメソッドが使
        用されます。m17nlib を指定した時は key ファイルで IM_HOTKEY を指定して
        ください。

        scim の場合:
        scim (オプション無し)

        ibus の場合:
        ibus:[conversion engine]
        [conversion engine] に変換エンジン(anthy, prime, hangul2など)を指定しま
        す。指定しなかった場合は ibus のデフォルト変換エンジンが使用されます。
        (ibusを使用する際の注意点)
        ibus の preferences 画面からキーボードショートカットを設定する場合、モデ
        ィファイアの Release にはチェックを付けないでください。

        fcitx の場合:
        fcitx (オプション無し)

        wnn の場合:
        wnn:[server]
        [server] には、接続するかな漢字変換サーバを指定します。
        なお、JSERVER 環境変数により指定することも可能です。
        また、WNNENVRC 環境変数により wnnenvrc ファイルの場所を指定することができます。

        canna の場合:
        canna (オプション無し)

        skk の場合:
        skk:dict=[dictionary](:utf8),sskey=[sticky shift key]
        [dictionary] に、接続する辞書サーバ(skkserv)の "ホスト名:ポート番号" 又
        は、辞書ファイルのパスを指定します。辞書が UTF-8 の場合には、末尾に
        :utf8 を付けてください。
        SKK_DICTIONARY 環境変数により指定することも可能です。
        指定しない場合は、localhost の辞書サーバに接続します。
        なお、上記とは別に、~/.mlterm/skk-jisyo をローカルの辞書として使用します。

        [sticky shift key] には、sticky shift key として使用するキーを指定してく
        ださい。印刷可能な文字のキーを指定する場合はその文字(\x3bのように16進数
        で指定することも可)を、それ以外の場合は <X11/keysymdef.h> に定義されたシ
        ンボル(XK_を除く)を指定してください。
        SKK_STICKY_SHIFT_KEY 環境変数により指定することも可能です。

        kbd の場合:
        kbd(:hide):[lang]
        US キーボードで入力された文字を、指定したキーボードレイアウトの文字に変
        換します。
        :hide を指定した場合は、ステータスウィンドウを表示しません。
        [lang]には、次のいずれかを指定することができます。
        arabic, hebrew, de, fr, es, pt, jp106, isciixxx
        なお、[lang]を省略した場合、ISCII モードの時は ISCII 配列、それ以外では
        ローケールにより判定します。
        kbd を指定した時は key ファイルで IM_HOTKEY を指定してください。

        iiimf の場合:
        iiimf:[language id]:[language engine]
        [language id] には RFC1766 に従って言語(ar, zh_CN, ja など)を指定しま
        す。指定されなかった場合はシステムのローケールから取得した言語が使われ
        ます。[language engine] では使用する LE (CannaLE, newpy など)を指定しま
        す。指定されなかった場合は [language id] のデフォルト LE が使用されま
        す。
        なお、HTT_SERVER_ADDRESS 環境変数により、接続するサーバのアドレス(Unix
        Domain Socket の場合はファイルパス)を指定できます。
        また、HTT_SHOW_STATUS_WINDOW=trueを指定することにより、ステータス表示用の
        ウィンドウを表示します。
        HTT_AUX_BASE_DIR 環境変数により、aux モジュールのあるパスを指定するこ
        とができます(デフォルトは/usr/lib/iiim/le)。

mlterm のログを見るとfcitx が読み込めていません.

~/.mlterm/msg.log
    Jan 21 19:22:50[3188254] ERROR(Resource temporarily unavailable): fcitx: Could not load.

この端末にはmlterm のインプットメソッドプラグインの mlterm-im-fcitx パッケージが導入されていませんでした.ibus は入っていたのでfcitx 切替時に入れていなかったのですね.そしてmlterm plugin を使わず日本語入力をしていたと.
mlterm-im-fcitx を導入してmlterm を起動し直すことでマウスアウト時も文字入力できるし日本語入力もできるようになりました.

$ apt-cache search mlterm input method
mlterm-im-fcitx - MultiLingual TERMinal, Flexible Input Method plugin
mlterm-im-ibus - MultiLingual TERMinal, IBus input method plugin
mlterm-im-m17nlib - MultiLingual TERMinal, m17nlib input method plugin
mlterm-im-scim - MultiLingual TERMinal, scim input method plugin
mlterm-im-skk - MultiLingual TERMinal, SKK input method plugin
mlterm-im-uim - MultiLingual TERMinal, uim input method plugin
$ sudo apt install mlterm-im-fcitx

mlterm mouseout

環境
$ dpkg-query -W mlterm*
mlterm  3.9.4-3
mlterm-common:amd64     3.9.4-3
mlterm-im-fcitx:amd64   3.9.4-3
mlterm-im-ibus  3.9.4-3
mlterm-im-m17nlib
mlterm-im-scim
mlterm-im-uim
mlterm-tiny
mlterm-tools    3.9.4-3
$ echo "${XDG_SESSION_TYPE}"
x11
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/01/21/mlterm-mouseout/feed/ 0
軽量なActivityPub Server のsnac 2.88 でミュートワードやメタデータ除去機能追加 https://matoken.org/blog/2026/01/20/snac-2-88-muted_words-strip_metadata/ https://matoken.org/blog/2026/01/20/snac-2-88-muted_words-strip_metadata/#respond Mon, 19 Jan 2026 22:29:13 +0000 https://matoken.org/blog/?p=5160

snac susie

ミニマムで軽量なActivityPub Server のsnac 2.88 がリリースされました.

2.88

If disable_emojireact is set to true in server.json, EmojiReacts (incoming and outgoing) are totally disabled.

New command-line option top_ten, that returns the top ten most popular posts by a user (ordered by the sum of likes and boosts) (contributed by aov).

Added a new set of per-user muted words; if a post contains any of them, it’s hidden behind a dropdown (contributed by byte).

If an account has a metadata named pronouns, it’s shown by the name (contributed by violette).

Mastodon API: children of a post are returned recursively, not just the first level (contributed by violette).

Implemented optional metadata stripping for images and videos using external tools (contributed by Stefano Marinelli).

— https://codeberg.org/grunfink/snac2/src/branch/master/RELEASE_NOTES.md#2-88

それぞれのcommit はこのあたりでしょうか

絵文字リアクションの無効設定

今回の更新で,サーバー設定ファイルの server.json の中に disable_emojireact が設定できるようになりました.これを true にすることで絵文字リアクションの送受信が無効化できます.
自分は有効にしたいのでこの設定はスルー.

$ man doc/snac.8 | grep -A1 disable_emojireact
       disable_emojireact
                   If set to true, all EmojiReact support (for input and output) is disabled.

top_ten コマンド

top_ten という新しいコマンドラインオプションが実装されました.これを実行すると対象ユーザーのいいねとブースト数から最も人気のあった投稿のトップ10が表示できます.オプションで指定件数にもできます.

$ ./snac2/snac top_ten
snac 2.88 - A simple, minimalistic ActivityPub instance
Copyright (c) 2022 - 2026 grunfink et al. / MIT license

top_ten {basedir} {uid} [{N}]        Prints the most popular posts
$ ./snac2/snac top_ten snac-data matoken 5
https://snac.matoken.org/matoken/p/1768641700.668031 1★ 0↺
https://snac.matoken.org/matoken/p/1768600460.460220 0★ 0↺
https://snac.matoken.org/matoken/p/1768690681.713879 0★ 0↺
https://snac.matoken.org/matoken/p/1768690814.893464 0★ 0↺
https://snac.matoken.org/matoken/p/1768690913.716133 0★ 0↺
man doc/snac.1 | grep -A1 top_ten
             top_ten basedir uid [N]
                     Returns the ids of the top ten (or top N) most popular posts (considering the sum of likes and boosts).

ユーザーミュートワード

ユーザーごとにミュートワードが設定できるようになりました.投稿に設定ワードが含まれていた場合隠されるようになります.
設定は,対象アカウントの「private」 → 「Muted words…​」にあります.

snac 2.88 muted words

$ man doc/snac.5 | grep muted
       muted/      This directory contains files which names are hashes of muted actors. The content is a line containing the actor URL.  Messages from these actors will be ignored on input and not shown in any timeline.

画像とビデオのメタデータ除去

外部ツールを利用して画像とビデオからメタデータを除去できるようになりました.
既定値では無効になっています.有効にしたい場合は,server.json"strip_exif": true, を設定します.
画像のメタデータ除去にはImageMagickのmogrify を,動画のメタデータ除去にはffmpeg を利用します.導入していない場合は導入が必要です.
外部ツールがパスの通っていない場所にある場合は,mogrify_path, ffmpeg_path で指定可能です.

server.json 設定例
    "strip_exif": true,
    "mogrify_path": "/usr/local/bin/mogrify",
    "ffmpeg_path": "/usr/local/bin/ffmpeg",

実際にexif 付きの画像を投稿して確認してみます.

サンプル画像の入手と確認
$ wget https://raw.githubusercontent.com/ianare/exif-samples/refs/heads/master/jpg/Pentax_K10D.jpg
$ exif Pentax_K10D.jpg
EXIF tags in '/home/matoken/Downloads/Pentax_K10D.jpg' ('Intel' byte order):
--------------------+----------------------------------------------------------
Tag                 |Value
--------------------+----------------------------------------------------------
Manufacturer        |PENTAX Corporation
Model               |PENTAX K10D
Orientation         |Top-left
X-Resolution        |350
Y-Resolution        |350
Resolution Unit     |Inch
Software            |GIMP 2.4.5
Date and Time       |2008:07:31 15:56:49
Copyright           |Laitche (This file is in the public domain.) (Photographer
XP Author           |www.laitche.com
Compression         |JPEG compression
X-Resolution        |72
Y-Resolution        |72
Resolution Unit     |Inch
Exposure Time       |1/180 sec.
F-Number            |f/11.0
Exposure Program    |Aperture priority
ISO Speed Ratings   |200
Exif Version        |Exif Version 2.21
Date and Time (Origi|2008:05:04 16:47:24
Date and Time (Digit|2008:05:04 16:47:24
Exposure Bias       |0.00 EV
Metering Mode       |Pattern
Flash               |Flash did not fire, compulsory flash mode
Focal Length        |90.0 mm
FlashPixVersion     |FlashPix Version 1.0
Color Space         |sRGB
Pixel X Dimension   |100
Pixel Y Dimension   |72
Sensing Method      |One-chip color area sensor
--------------------+----------------------------------------------------------
EXIF data contains a thumbnail (1349 bytes).

exif 付きの画像を投稿します.

snac 2.88 strip exif

投稿された画像をダウンロードして確認するとexif は消えていました.

$ wget http://127.0.0.1:8001/test/s/post-d2e2931a72bbe1cafaaf94e82ea27e66.jpg
$ exif ./post-d2e2931a72bbe1cafaaf94e82ea27e66.jpg
Corrupt data
The data provided does not follow the specification.
ExifLoader: The data supplied does not seem to contain EXIF data.

以下のようなコマンドを発行しているようです.

mogrify
            xs *cmd = xs_fmt("cd \"%s\" && %s -auto-orient -strip \"%s\" 2>/dev/null", srv_basedir, mp, r_fn);
ffmpeg
 	            /* -map_metadata -1 strips all global metadata */
	            /* -c copy copies input streams without re-encoding */
	            /* we don't silence stderr so we can debug issues */
	            /* we explicitly cd to srv_basedir to ensure relative paths work */
	            xs *cmd = xs_fmt("cd \"%s\" && %s -y -i \"%s\" -map_metadata -1 -c copy \"%s\"", srv_basedir, fp, r_fn, tmp_fn);
man doc/snac.8 | grep -A1 metadata
$ man doc/snac.8 | grep strip_exif -A7
       strip_exif  If  set  to  true,  EXIF and other metadata will be stripped from uploaded images (jpg, png, webp, heic, avif, tiff, gif, bmp) and videos (mp4, m4v, mov, webm, mkv, avi). This requires the mogrify (from ImageMagick) and
                   ffmpeg tools to be installed. If snac cannot find or execute these tools at startup, it will refuse to run.

       mogrify_path
                   Overrides the default "mogrify" command name or path. Use this if the tool is not in the system PATH or has a different name.

       ffmpeg_path
                   Overrides the default "ffmpeg" command name or path. Use this if the tool is not in the system PATH or has a different name.
]]>
https://matoken.org/blog/2026/01/20/snac-2-88-muted_words-strip_metadata/feed/ 0
Let’s Encrypt の短期証明書とIP証明書を少し試す https://matoken.org/blog/2026/01/19/lets-encrypts-short-term-certificates-and-ip-address-certificates/ https://matoken.org/blog/2026/01/19/lets-encrypts-short-term-certificates-and-ip-address-certificates/#respond Mon, 19 Jan 2026 10:36:54 +0000 https://matoken.org/blog/?p=5150

無料で証明書を発行できるLet’s Encrypt で短期証明書と IP アドレス証明書の一般提供が開始されました.

Short-lived and IP address certificates are now generally available from Let’s Encrypt. These certificates are valid for 160 hours, just over six days. In order to get a short-lived certificate subscribers simply need to select the ‘shortlived’ certificate profile in their ACME client.

興味があるので少し試してみました.

certbot コマンドで試そうと思ったのですが,Debian package版のcertbot はunstable でも4.0.0 で対応していません.

$ certbot --ip-address
usage:
  certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
it will attempt to use a webserver both for obtaining and installing the
certificate.
certbot: error: unrecognized arguments: --ip-address
$ certbot --version
certbot 4.0.0
$ rmadison certbot
certbot    | 1.12.0-2      | oldoldstable | all
certbot    | 2.1.0-4       | oldstable    | all
certbot    | 4.0.0-2       | stable       | all
certbot    | 4.0.0-2       | testing      | all
certbot    | 4.0.0-2       | unstable     | all

2日前の 58724f6 でCommit されているようです.

ということでDeveloper Guide を見ながらsource から導入して試しました.

certbot をsource からbuild
$ sudo apt install python3-dev python3-venv libaugeas-dev gcc (1)
$ git clone https://github.com/certbot/certbot (2)
$ cd certbot
$ git log --pretty=oneline -1
58724f68ec46c57dd3c3c8ed4ae686c2d7ad893b (HEAD -> 58724f6) Add CLI flag --ip-address (#10495)
$ python3 tools/venv.py (3)
$ source venv/bin/activate (4)
$ which certbot
/home/matoken/src/certbot/venv/bin/certbot
$ certbot --version
certbot 5.3.0.dev0
  1. 依存パッケージ導入

  2. source 入手

  3. build

  4. certbot環境に入る

今回使うオプションのhelp
$ certbot help all | grep -A2 -- --ip-address
  --ip-address IP_ADDRESSES
                        IP addresses to include. For multiple IP addresses you
                        can use multiple --ip-address flags. All IP addresses
                        will be included as Subject Alternative Names on the
                        certificate. (default: [])
$ certbot help all | grep -A8 -- --preferred-profile
  --preferred-profile PREFERRED_PROFILE
                        Request the given profile name from the ACME server,
                        or fallback to default. If the given profile name
                        exists in the ACME directory, use it to request a a
                        certificate. Otherwise, fall back to requesting a
                        certificate without a profile (which means the CA will
                        use its default profile). This allows renewals to
                        succeed even if the CA deprecates and removes a given
                        profile. (default: None)
IPアドレス証明書を取得
$ sudo bash -c "source venv/bin/activate && certbot certonly --ip-address 84.247.152.162 --preferred-profile shortlived"
出来上がった証明書を確認
$ sudo cat /etc/letsencrypt/live/84.247.152.162/cert.pem | openssl x509 -noout -issuer -subject -dates
issuer=C=US, O=Let's Encrypt, CN=YE2
subject=
notBefore=Jan 18 23:06:01 2026 GMT
notAfter=Jan 25 15:06:00 2026 GMT
$ sudo cat /etc/letsencrypt/live/84.247.152.162/cert.pem | openssl x509 -noout -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            06:e7:4e:65:fe:41:f7:9b:9e:38:12:12:64:13:85:b4:f3:dd
        Signature Algorithm: ecdsa-with-SHA384
        Issuer: C=US, O=Let's Encrypt, CN=YE2
        Validity
            Not Before: Jan 18 23:06:01 2026 GMT
            Not After : Jan 25 15:06:00 2026 GMT
        Subject:
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:d9:d9:68:d2:fe:7b:09:0d:c4:97:1e:fc:e4:1e:
                    65:50:90:cc:63:ec:6a:98:a3:5c:77:b6:d0:33:f5:
                    4d:8f:ec:38:d5:e8:1d:01:75:fb:d6:93:15:b9:f3:
                    f8:7e:a4:a9:7b:bf:d7:4d:a3:5e:d0:ca:8f:74:e5:
                    7a:98:bc:8e:9e
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        X509v3 extensions:
            X509v3 Key Usage: critical
                Digital Signature
            X509v3 Extended Key Usage:
                TLS Web Server Authentication
            X509v3 Basic Constraints: critical
                CA:FALSE
            X509v3 Authority Key Identifier:
                B9:59:F2:8E:CF:22:F0:86:D3:37:48:FF:76:14:18:BA:82:D8:55:87
            Authority Information Access:
                CA Issuers - URI:http://ye2.i.lencr.org/
            X509v3 Subject Alternative Name: critical
                IP Address:84.247.152.162
            X509v3 Certificate Policies:
                Policy: 2.23.140.1.2.1
            X509v3 CRL Distribution Points:
                Full Name:
                  URI:http://ye2.c.lencr.org/94.crl

            CT Precertificate SCTs:
                Signed Certificate Timestamp:
                    Version   : v1 (0x0)
                    Log ID    : 0E:57:94:BC:F3:AE:A9:3E:33:1B:2C:99:07:B3:F7:90:
                                DF:9B:C2:3D:71:32:25:DD:21:A9:25:AC:61:C5:4E:21
                    Timestamp : Jan 19 00:04:31.276 2026 GMT
                    Extensions: none
                    Signature : ecdsa-with-SHA256
                                30:45:02:20:19:47:12:58:F2:D7:9C:08:A5:0D:C0:5B:
                                F0:E7:DF:73:0F:64:77:B2:39:39:A4:3C:A1:D3:F0:39:
                                4E:7B:0D:91:02:21:00:87:BA:CE:E6:6E:F6:D3:52:D2:
                                BC:C4:ED:BE:26:6F:DE:BC:B7:17:5F:B6:47:4A:82:75:
                                A9:95:56:A0:68:FD:1F
                Signed Certificate Timestamp:
                    Version   : v1 (0x0)
                    Log ID    : E3:23:8D:F2:8D:A2:88:E0:AA:E0:AC:F0:FA:90:C9:85:
                                F0:B6:BF:F5:D2:A5:27:B0:01:FC:1C:44:58:C4:B6:E8
                    Timestamp : Jan 19 00:04:31.523 2026 GMT
                    Extensions: 00:00:05:00:2F:CD:F8:E5
                    Signature : ecdsa-with-SHA256
                                30:46:02:21:00:CD:4B:99:89:27:23:A9:B5:4E:68:D9:
                                A0:59:63:45:F5:8F:6A:5C:1F:C2:39:24:AF:60:E4:25:
                                FF:E6:53:08:4E:02:21:00:DE:9F:73:AB:35:BC:7D:5D:
                                E7:7A:CB:DE:A7:25:FE:2E:09:A3:2A:33:6E:3B:E4:4E:
                                D7:AD:67:B9:02:E5:36:B8
    Signature Algorithm: ecdsa-with-SHA384
    Signature Value:
        30:64:02:30:09:90:c5:7b:2d:7c:21:7e:7a:21:77:3a:2d:8e:
        cd:a1:4d:d1:5e:08:2f:8c:e7:b9:ad:19:39:33:d7:67:41:76:
        68:39:26:f5:cf:8e:4d:42:5e:cf:45:69:e2:8a:18:ef:02:30:
        2b:7f:6c:90:27:d1:e5:b1:dd:a2:2a:cb:20:d4:8c:27:0c:7c:
        6d:9b:06:c8:52:bd:23:d6:aa:83:61:f5:13:fd:77:55:e9:ab:
        29:e2:bd:82:84:4d:4f:81:4b:3b:76:8a
有効期限の時間を確認
$ echo $(( $( date +%s --date 'Jan 25 15:06:00 2026 GMT' ) - $( date +%s --date='Jan 18 23:06:01 2026 GMT' ) )) (1)
575999
$ echo $((160*60*60)) (2)
576000
  1. notBefore と notAfter の間の秒数を確認

  2. 160時間を秒数に変換

環境
$ git log --pretty=oneline -1
58724f68ec46c57dd3c3c8ed4ae686c2d7ad893b (HEAD -> 58724f6) Add CLI flag --ip-address (#10495)
$ dpkg-query -W python3-dev python3-venv libaugeas-dev gcc
gcc     4:14.2.0-1
libaugeas-dev:amd64     1.14.1-1+b3
python3-dev     3.13.5-1
python3-venv    3.13.5-1
$ lsb_release -dr
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
$ arch
x86_64
]]>
https://matoken.org/blog/2026/01/19/lets-encrypts-short-term-certificates-and-ip-address-certificates/feed/ 0
絵文字リアクション機能などが追加されたsnac 2.86, 2.87 https://matoken.org/blog/2026/01/12/snac-2-86-2-87/ https://matoken.org/blog/2026/01/12/snac-2-86-2-87/#respond Mon, 12 Jan 2026 10:42:13 +0000 https://matoken.org/blog/?p=5140

snac susie

ミニマムで軽量なActivityPub Server のsnac 2.86, 2.87 がリリースされました.

RELEASE NOTES

RELEASE_NOTES.md を見ると主な変更点は以下のようになっています.

2.87

Hide EmojiReacts from muted actors and blocked instances.

2.86

Truncate RSS titles at UTF-8 character boundaries (contributed by lxo).

Link contacts to single-user people pages. Also, user’s posts are shown (contributed by lxo).

Added emoji reactions (contributed by violette).

Mastodon API: Fix for some client notifications (contributed by violette), fix for a status visibility error (contributed by fruye).

If the query variable terse of a public post page is set to anything, no header is shown.

Fixed search failures when the query string has any leading blank.

絵文字リアクション

興味深い新機能としては絵文字リアクションの対応があります.これによりMastodon やMisskey などの絵文字リアクションに対応したサービスと絵文字リアクションのやり取りができるようになりました.

以下はsnac とMisskey でそれぞれ絵文字リアクションを行ったときのスクリーンショットです.snac からの送信時は絵文字の文字列を記述する必要があります.

snacから絵文字リアクション送信
Misskeyへの絵文字リアクション送信
絵文字リアクション受信

以下は実際の投稿.

どうもこの絵文字リアクションを使った嫌がらせが発生したようでそれの対策としてミュートしたアクターとブロックしたインスタンスからの絵文字リアクションを非表示にする機能が 2.87 としてリリースされました.

もし絵文字リアクション機能を使いたくない場合は 2.86, 2.87 をスキップして絵文字リアクションを設定で無効にできる変更を含んだリリースを待つのが良さそうです.

カスタム絵文字の登録については以下の記事を参照してください.

RRS タイトルをUTF-8 の境界で切り捨てる

RSS のtitle をUTF-8 境界で切り捨てるのは日本語で文字化けすることが無くなりそうです.以下ようにして確認できそうですが修正前の2.85 で確認したところ丁度問題のないタイミングだったようでこのときは問題ありませんでした.

$ curl -s https://snac.kagolug.org/matoken.rss | nkf | xmllint --format - | grep title | head

snac のアップグレード

特に問題なくいつもの手順でアップグレードできました.

snac のアップグレード例(source)

$ cd $SNAC-SRC
$ git pull
$ git checkout 2.87
Previous HEAD position was b84b92d Version 2.86 RELEASED.
HEAD is now at c2b050c Version 2.87 RELEASED.
$ make
$ ./snac | head -2
snac 2.87 - A simple, minimalistic ActivityPub instance
Copyright (c) 2022 - 2026 grunfink et al. / MIT license
$ sudo service snac2 stop
$ sudo -u snac tar cvf snac2-`date +%F_%T-$$`.tar ~snac/snac-data
$ sudo -u snac /home/snac/snac2/snac upgrade ~snac/snac-data
05:52:38 OK
$ sudo service snac2 start

snac のアップグレード例(Debian package)

$ snac | head -2
snac 2.85 - A simple, minimalistic ActivityPub instance
Copyright (c) 2022 - 2025 grunfink et al. / MIT license
$ sudo apt update
$ sudo apt upgrade
$ snac | head -2
snac 2.87 - A simple, minimalistic ActivityPub instance
Copyright (c) 2022 - 2026 grunfink et al. / MIT license
$ sudo service snac2 stop
$ sudo -u debian-snac tar cvf snac2-`date +%F_%T-$$`.tar /var/lib/snac2
$ sudo -u debian-snac snac upgrade /var/lib/snac2
18:56:22 Linux sandbox not compiled in
18:56:22 OK
$ sudo service snac2 start
]]>
https://matoken.org/blog/2026/01/12/snac-2-86-2-87/feed/ 0
NewYear2026 https://matoken.org/blog/2026/01/04/newyear2026/ https://matoken.org/blog/2026/01/04/newyear2026/#respond Sun, 04 Jan 2026 09:36:39 +0000 https://matoken.org/blog/?p=5127

new year2026

 _____________
( I'm pony... )
 -------------
     o      _^^
      o   _- oo\
          \----- \______
                \       )\
                ||-----|| \
                ||     ||
]]>
https://matoken.org/blog/2026/01/04/newyear2026/feed/ 0
Cloudflareの速度テストをTUIで https://matoken.org/blog/2025/12/31/cloudflare-speed-test-with-tui/ https://matoken.org/blog/2025/12/31/cloudflare-speed-test-with-tui/#respond Tue, 30 Dec 2025 22:45:08 +0000 https://matoken.org/blog/?p=5121

Cloudflare の速度計測サイトのspeed.cloudflare.com をTUI で計測できるcloudflare-speed-cli というものを知ったので試してみました.
cloudflare-speed-cli はRust 製でGPL-3.0 license です.

類似のもので,speedtest.net を計測できるspeedtest-cli をよく使っていますが,Cloudflare も使えると便利そうです.

cloudflare-speed-cli はGitHub Releases にはLinux x86_64, aarch64, macOS aarch64, x86_64, Windows x86_64 のバイナリがあります.しかし例によってRaspberry Pi bookworm armhf(Arm 32bit)でも試してみます.

Rust 関連はasciimena 3.0 をbuild したときに入れたものからrustup で1.92.0 にしたものを使います.

cargo install で時間が掛かりますが特につまづいたりせずbuild できました.

$ cargo --version
warning: `/home/matoken/.cargo/config` is deprecated in favor of `config.toml`
  |
  = help: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
cargo 1.92.0 (344c4567c 2025-10-21)
$ cargo install --git https://github.com/kavehtehrani/cloudflare-speed-cli --features tui
$ cloudflare-speed-cli --help
Cloudflare-based speed test with optional TUI

Usage: cloudflare-speed-cli [OPTIONS]

Options:
      --base-url <BASE_URL>
          Base URL for the Cloudflare speed test service [default: https://speed.cloudflare.com]
      --json
          Print JSON result and exit (no TUI)
      --text
          Print text summary and exit (no TUI)
      --download-duration <DOWNLOAD_DURATION>
          Download phase duration [default: 10s]
      --upload-duration <UPLOAD_DURATION>
          Upload phase duration [default: 10s]
      --idle-latency-duration <IDLE_LATENCY_DURATION>
          Idle latency probe duration (pre-test) [default: 2s]
      --concurrency <CONCURRENCY>
          Concurrency for download/upload workers [default: 6]
      --download-bytes-per-req <DOWNLOAD_BYTES_PER_REQ>
          Bytes per download request [default: 10000000]
      --upload-bytes-per-req <UPLOAD_BYTES_PER_REQ>
          Bytes per upload request [default: 5000000]
      --probe-interval-ms <PROBE_INTERVAL_MS>
          Probe interval in milliseconds [default: 250]
      --probe-timeout-ms <PROBE_TIMEOUT_MS>
          Probe timeout in milliseconds [default: 800]
      --experimental
          Enable experimental features (TURN fetch + UDP-like loss probe)
      --export-json <EXPORT_JSON>
          Export results as JSON
      --export-csv <EXPORT_CSV>
          Export results as CSV
      --auto-save <AUTO_SAVE>
          Use --auto-save true or --auto-save false to override (default: true) [default: true] [possible values: true, false]
      --interface <INTERFACE>
          Bind to a specific network interface (e.g., ens18, eth0)
      --source <SOURCE>
          Bind to a specific source IP address (e.g., 192.168.10.0)
      --certificate <CERTIFICATE>
          Path to a custom TLS certificate file (PEM or DER format)
  -h, --help
          Print help
  -V, --version
          Print version
$ cloudflare-speed-cli --version
cloudflare-speed-cli 0.3.1

早速試してみます.cloudflare-speed-cli をオプションなしで実行するとTUI で実行されます.起動してすぐに計測が始まり,既定値では計測結果が保存されます.tab key でHistory ページに遷移すると過去の計測結果を閲覧したりエクスポートしたりできます.

cloudflare speed cli TUI

--text オプションでcli モードですが,プログレスが大量に出てちょっと使いづらい感じです.

プロスレス部分はSTDERR なのでそれを捨ててしまってもいいかもしれません

$ cloudflare-speed-cli --text 2>/dev/null
IP/Colo/ASN: 133.106.160.49 / NRT / 138384 (-)
Download: 23.73 Mbps
Upload:   2.47 Mbps
Idle latency p50/p90/p99: 98.9/110.7/110.7 ms (loss 0.0%, jitter 10.2 ms)
Loaded latency (download) p50/p90/p99: 438.0/578.6/755.2 ms (loss 0.0%, jitter 130.1 ms)
Loaded latency (upload) p50/p90/p99: 654.8/794.1/794.1 ms (loss 45.5%, jitter 144.4 ms)

こんな感じで定期的に計測するのにも便利かもと思いましたが,cli モードでは既定値では結果を保存しないようです.

$ watch -n 3600 -- cloudflare-speed-cli --text

--auto-save true も追加すると結果が保存されます.

$ watch -n 3600 -- cloudflare-speed-cli --text --auto-save true

ただ,以下のようにTUI モードの計測時のログには --interface を指定してもInterface やAP 名は保存されないようです.

│ 3.   2025-12-31 06:30:11 +09:00  DL   20.69 Mbps  UL    4.66 Mbps  Idle p50  103.7 ms  -  (1)
│ 4.   2025-12-31 06:08:33 +09:00  DL   21.73 Mbps  UL    3.16 Mbps  Idle p50  100.7 ms  wlan0  TP-L13💻 (2)
  1. --text でcli モードで実行したときの結果

  2. TUI モードで実行したときの結果

SEE ALSO

$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from Rakuten Mobile Network (133.106.160.42)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by GSL Networks (Tokyo) [0.26 km]: 60.882 ms
Testing download speed................................................................................
Download: 12.70 Mbit/s
Testing upload speed......................................................................................................
Upload: 2.69 Mbit/s
Speedtest CLI: Internet speed test for the command line ※Ookla公式だがプロプライエタリ
$ speedtest

   Speedtest by Ookla

      Server: IPA CyberLab 400G - Tokyo (id: 48463)
         ISP: Rakuten Mobile Network
Idle Latency:    50.15 ms   (jitter: 1.41ms, low: 48.98ms, high: 52.36ms)
    Download:    20.75 Mbps (data used: 19.9 MB)
                262.40 ms   (jitter: 71.32ms, low: 72.73ms, high: 398.26ms)
      Upload:     2.96 Mbps (data used: 1.6 MB)
                779.27 ms   (jitter: 95.79ms, low: 75.05ms, high: 1148.99ms)
 Packet Loss:     0.0%
  Result URL: https://www.speedtest.net/result/c/e1a349cf-53eb-4d63-b8f4-8550dabd772d
n8henrie/fastcli: Python3 speed test via Fast.com fast.com を使いcli で計測……2025-12-27にarchived されていた
$ python -m fastcli -v
Approximate download speed: 17.48 Mbps
]]>
https://matoken.org/blog/2025/12/31/cloudflare-speed-test-with-tui/feed/ 0
プロセスの情報をわかりやすく表示してくれるwitr https://matoken.org/blog/2025/12/29/witr_-why-is-this-running/ https://matoken.org/blog/2025/12/29/witr_-why-is-this-running/#respond Mon, 29 Dec 2025 12:31:39 +0000 https://matoken.org/blog/?p=5113

witr (why-is-this-running) はプロセス名,PID,ポート番号からそれがなぜ実行されているかを調べて表示してくれます.

witr ssh

例えば以下はport 22 を調べています.sshd が実行されていることなどがわかります.

$ sudo ./witr -port 22
Target      : sshd

Process     : sshd (pid 581)
User        : root
Command     : sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
Started     : 4 days ago (Thu 2025-12-25 18:10:39 +09:00)

Why It Exists :
  systemd (pid 1)   sshd (pid 581)

Source      : systemd service (supervisor)

Working Dir : /
Listening   : 0.0.0.0:22
              :::22

Warnings    :
    Process is listening on a public interface
    Process is running as root
    Process is running from a suspicious working directory: /

メモリをたくさん使っている(1GB+)と警告が表示されたりもします

$ sudo ~/usr/local/bin/witr -pid 10522
Target      : firefox.real

Process     : firefox.real (pid 10522) [high-mem]
User        : matoken
Command     : /usr/bin/firefox.real
Started     : 2 days ago (Sat 2025-12-27 05:39:41 +09:00)

Why It Exists :
  systemd (pid 1) → firefox.real (pid 10522)

Source      : systemd service (supervisor)

Working Dir : /home/matoken

Warnings    :
  • Process is using high memory (>1GB RSS)

以下はプロセスID 524 からglance がcron から起動しているのがわかります.

$ ./witr -pid 524
Target      : glance

Process     : glance (pid 524) {forked}
User        : matoken
Command     : /home/matoken/bin/glance -config /home/matoken/.config/glance.yml
Started     : 4 days ago (Thu 2025-12-25 18:10:36 +09:00)
Restarts    : 1

Why It Exists :
  systemd (pid 1) → cron (pid 448) → cron (pid 492) → sh (pid 523 glance (pid 524)

Source      : systemd service (supervisor)

Working Dir : /home/matoken
Listening   : :::8080

Warnings    :
    Process is listening on a public interface

ポートスキャンしてopen しているポート全てに対してwitr を実行してみたりも.

$ sudo nmap -p 0-65535 localhost | grep open | cut -f1 -d\/ | xargs -n1 sudo ./witr -port

witr の導入

witr の導入はinstall.sh がおすすめされていますがあまり好みの方法ではありません.中を見るとGitHub Releases から環境にあったバイナリをダウンロードして, /usr/local/bin 以下にインストールしています.バイナリはLinux amd64, arm64 が用意してあります.
amd64 環境でには以下のような手順で手動で導入しました.

Note
v0.1.1 でmacOS amd64/arm64 も追加されました.
$ wget -c https://github.com/pranshuparmar/witr/releases/latest/download/witr-linux-amd64 (1)
$ install -m 755 ./witr-linux-amd64 ~/usr/local/bin/witr (2)
$ which witr
/home/matoken/usr/local/bin/witr
$ rm witr-linux-amd64
$ witr (3)
Usage: witr [--pid N | --port N | name] [--short] [--tree] [--json] [--warnings] [--no-color] [--env] [--help] [--version]
  --pid <n>         Explain a specific PID
  --port <n>        Explain port usage
  --short           One-line summary
  --tree            Show full process ancestry tree
  --json            Output result as JSON
  --warnings        Show only warnings
  --no-color        Disable colorized output
  --env             Show only environment variables for the process
  --help            Show this help message
  --version         Show version and exit
$ witr --version
witr v0.1.1 (commit b50f08b, built 2025-12-28)
  1. witr の最新のlinux amd64 バイナリ版をダウンロード

  2. 好みの場所にインストール

  3. USAGE

Linux armhf(arm 32bit) でも動かす

Raspberry Pi bookworm armhf でも動かしたいと思います.
build しようとしたらまずgolang が古いと言われたのでまずは新しいgolang の入手から.

package版golang は1.23 だが1.25.5+ が必要
$ /usr/bin/go build -ldflags "-X main.version=0.1.0 -X main.commit=$(git rev-parse --short HEAD) -X 'main.buildDate=$(date +%Y-%m-%d)'" -o witr-linux-arm32 ./cmd/witr
go: errors parsing go.mod:
/home/matoken/src/witr/go.mod:3: invalid go version '1.25.5': must match format 1.23
go.dev からarmv6 バイナリを入手してパスを通す
$ wget -c https://go.dev/dl/go1.25.5.linux-armv6l.tar.gz (1)
$ mkdir -p ~/usr/local
$ tar -C ~/usr/local -xzf go1.25.5.linux-armv6l.tar.gz (2)
$ rm go1.25.5.linux-armv6l.tar.gz
$ PATH=~/usr/local/go/bin:$PATH (3)
$ which go
/home/matoken/usr/local/go/bin/go
$ go version (4)
go version go1.25.5 linux/arm
$ cat << EOF > hello.go (5)
package main
import "fmt"
func main() {
	fmt.Println("Hello World")
}
EOF
$ go run hello.go (6)
Hello World
  1. Linux armv6l のバイナリをダウンロード

  2. アーカイブを適当な場所に展開

  3. パスを通しておく(一時的な例)

  4. バージョン確認

  5. hello world を用意

  6. 動作確認

witr をビルド
$ git clone https://github.com/pranshuparmar/witr/
$ cd witr
$ go build -ldflags "-X main.version=0.1.0 -X main.commit=$(git rev-parse --short HEAD) -X 'main.buildDate=$(date +%Y-%m-%d)'" -o witr-linux-arm32 ./cmd/witr
$ ./witr-linux-arm32 --version
witr 0.1.0 (commit a2dc413, built 2025-12-28)
]]>
https://matoken.org/blog/2025/12/29/witr_-why-is-this-running/feed/ 0
ssh tiny.christmas https://matoken.org/blog/2025/12/25/ssh-tiny-christmas/ https://matoken.org/blog/2025/12/25/ssh-tiny-christmas/#respond Wed, 24 Dec 2025 21:04:00 +0000 https://matoken.org/blog/?p=5097

去年はいくつかのターミナルクリスマスツリーを集めました.

ssh で接続するとツリーが表示されます.

$ ssh tiny.christmas

クリスマスツリーが表示され,「O Christmas Tree」の歌詞が流れます.
tree がUnicode点字を使って書かれているのが最近ぽいですね.

詳細は以下に.

]]>
https://matoken.org/blog/2025/12/25/ssh-tiny-christmas/feed/ 0
ターミナル特化MisskeyクライアントのsayakaちゃんとBlurHash https://matoken.org/blog/2025/12/24/sataka-and-blurhash/ https://matoken.org/blog/2025/12/24/sataka-and-blurhash/#respond Wed, 24 Dec 2025 13:37:08 +0000 https://matoken.org/blog/?p=5089

ターミナルに特化した Misskey ストリームクライアントのsayaka ちゃんというソフトウェアがあります.Sixel 対応端末で実行すると画像付きでMisskey をストリーミングしてとても楽しいです.

このsayaka ちゃんに --force-blurhash オプションが実装されたので少し試してみました.

BlurHash?

BlurHash はフードデリバリーサービスのWolt の開発した画像読み込みのプレースホルダーなどに利用できるコンパクトな20〜30文字で表せるぼかした画像です.
この容量の小さい画像をプレースホルダーに埋め込むと空っぽより彩りが豊かになったり,NSFW 画像をモザイクする代わりに使ったり出来ます.
BlurHash はJSON, HTML, Shell で安全な次のキャラクタを使ったBase 83 で表現されます.

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~

BlurHash はMITライセンスでたくさんの言語で実装されています.

以下はDebian logo をC 実装のBlurHash にコンポーネント数ごとにかけてみています.コンポーネント数により7〜133byteで表されています.

$ git clone https://github.com/woltapp/blurhash (1)
$ cd blurhash/C/
$ make blurhash_encoder (2)
$ make blurhash_decoder (3)
$ wget https://www.debian.org/logos/openlogo-nd-100.png (4)
$ file openlogo-nd-100.png
openlogo-nd-100.png: PNG image data, 101 x 124, 8-bit colormap, non-interlaced
$ for i in {1..8}; do ./blurhash_encoder $i $i openlogo-nd-100.png; done (5)
00SFLy
AJSFLyixHXx]
KJSFLyixR5HXx]kCWBj[%#
UJSFLyixR5xuHXx]kCofWBj[%#yDeTV@yXR5
eJSFLyixR5xuVsHXx]kCofj[WBj[%#yD%#eTV@yXR5tRV@o|%}kCRP
oJSFLyixR5xuVsiwHXx]kCofj[VsWBj[%#yD%#tleTV@yXR5tRofV@o|%}kCRPMJ%gV@ozozRPoz
yJSFLyixR5xuVsiwtlHXx]kCofj[VsozWBj[%#yD%#tlkCeTV@yXR5tRofkCV@o|%}kCRPMJMd%gV@ozozRPozRPozaytlR5H?kBRP
:JSFLyixR5xuVsiwtlt7HXx]kCofj[VsozVsWBj[%#yD%#tlkCj[eTV@yXR5tRofkCtRV@o|%}kCRPMJMdV@%gV@ozozRPozRPozozaytlR5H?kBRPtRxukCtRVsR5kCfkae
$ for i in {1..8}; do ./blurhash_encoder $i $i openlogo-nd-100.png | wc -c; done (6)
7
13
23
37
55
77
103
133
$ for i in {1..8}; do ./blurhash_decoder $( ./blurhash_encoder $i $i openlogo-nd-100.png ) 101 124 blur-$i.png; done (7)
$ lsix (8)
  1. BlurHash のsource 入手

  2. encoder build

  3. decoder build

  4. Debian logo file 入手

  5. プレースホルダー枚にBlurHash に変換

  6. バイト数確認

  7. BlurHash をpng に変換

  8. png に変換したBlurHash を表示

blurhash debian logo

昔はhtml のimg タグにlowsrc でサイズの小さい代替画像を指定したりしていましたが(現在は非推奨)それよりも小さくなると思います.

sayaka の –force-blurhash オプションを試す

sayaka ちゃんの –force-blurhash オプションを試してみます.
まずはbuild.
Linux でのbuild 時に引っかかりやすいのがGNU Make ではなくbmake を使うところ.

$ git checkout a4e143d50ceee29a61610d1ee76e4030b0bba273
Previous HEAD position was d76cb2c ver 3.8.1 (2024/09/21)
HEAD is now at a4e143d src/misskey: --force-blurhash オプションを実装してみる。 画像表示を Blurhash だけにするモード。
$ ./configure
$ bmake -DRELEASE all
$ src/sayaka
usage: sayaka <command> [<options...>]
 <command>
  -h,--home           : Home timeline mode (needs --server and --token)
  -l,--local          : Local timeline mode (needs --server)
  -p,--play=<file|->  : Playback mode
 <options>
  -s,--server=<host>  : Set misskey server
  -t,--token=<file>   : Set misskey access token file
  -c,--color=<color>  : 256,16,8,2,1 and gray[2-256] (default:256)
  --show-cw           : Open CW(Contents Warning) part
  --nsfw=<show|blur|alt|hide> : How to show NSFW contents (default:blur)
  --show-image=<yes|no|auto>  : Whether to show image or not (default:auto)
  -r,--record=<file>  : Record JSON to <file>
  --help-all          : More details

build 出来たので早速 --force-blurhash を試してみます.例えば misskey.io をこんな感じで.

$ src/sayaka --force-blurhash -l -s misskey.io

これまでは既定値ではNSFW コンテンツがBlurHash で表示されていましたが,--force-blurhash では全てのアイコン画像も添付画像もBlurHash になります.

sayaka blurhash

Note
アカウントや本文にはモザイクを掛けてあります.

BlurHash で画像サイズが小さくなるってことは通信料もデータ量も小さくなっていてプアな回線でもいい感じにストリーミングできそうな気がします.

BlurHash とSixel を60秒ずつ --record オプションでファイルに保存してみました.期待に反してBlurHash のほうが大分大きいです.

$ timeout 60 src/sayaka --record=blurhash.rec --force-blurhash -l -s misskey.io
$ timeout 60 src/sayaka --record=sixel.rec -l -s misskey.io
$ ls -s *.rec
436 blurhash.rec   44 sixel.rec

ttyrec でも同じような感じ.

$ ttyrec -f blurhash.ttyrec -- timeout 60 src/sayaka --force-blurhash -l -s misskey.io
$ ttyrec -f sixel.ttyrec -- timeout 60 src/sayaka -l -s misskey.io
$ ls -s *.ttyrec
1768 blurhash.ttyrec   228 sixel.ttyrec

通信量はどうだろうとnethogs コマンドで $ sudo nethogs -P $(pgrep sayaka) -l な感じで見てみるとやはりBlurHash のほうが通信量が多いような?

BlurHash
NetHogs version 0.8.8

    PID USER     PROGRAM          DEV                   SENT      RECEIVED
      ? root     unknown TCP                          435.079      11.067 kB/s
2782477 matoken  src/sayaka -..   enx349971e11a0f       0.252       6.934 kB/s

  TOTAL                                               435.331      18.001 kB/s
Sixel
NetHogs version 0.8.8

    PID USER     PROGRAM          DEV                   SENT      RECEIVED
      ? root     unknown TCP                          432.206      11.271 kB/s
2787797 matoken  src/sayaka -..   enx349971e11a0f       0.150       0.885 kB/s

  TOTAL                                               432.356      12.156 kB/s

録画データを見ると件数が違います.Sixel のときになにかボトルネックがありそうです.回線の問題?
後でVPS でも確認してみようと思います.

$ jq .body.type blurhash.rec | wc -l
119
$ jq .body.type sixel.rec | wc -l
10
]]>
https://matoken.org/blog/2025/12/24/sataka-and-blurhash/feed/ 0
ターミナルエミュレータのkittyで日本語入力 https://matoken.org/blog/2025/12/23/japanese-input-with-kitty/ https://matoken.org/blog/2025/12/23/japanese-input-with-kitty/#respond Tue, 23 Dec 2025 10:02:19 +0000 https://matoken.org/blog/?p=5082

icon 32x32

マルチプラットホーム,GPUベースなkitty というターミナルエミュレータがあります.

ターミナルグラフィックのkitty や同じターミナル内での文字サイズ変更など面白い機能もあったりしてGUI 環境でよく使っています.

新規環境でkitty で日本語入力が出来ず設定したのでこちらにもメモしておきます.

今回の環境はDebian trixue amd64 のほぼ初期環境,Wayland ではなくX.org にしてあります.kitty はDebian パッケージマネージャから導入して,日本語入力環境はfcitx + mozc です.
kitty 以外の環境では日本語入力は出来ていますが,kitty ではうまく行きません.

以下のissue を見ると GLFW_IM_MODULE=ibus をせっていすることでibus/fcitx 環境で日本語入力できるようです.

GLFW_IM_MODULE=ibus works for me with fcitx5.

とりあえず別の端末からこんな感じで環境変数を指定してkitty を起動すると日本語入力できます.

$ GLFW_IM_MODULE=ibus kitty

kitty の.desktop ファイルに環境変数を加えてGUI からのkitty 起動時に日本語入力できるようにしておきます.

$ dpkg -L kitty | grep desktop
/usr/share/applications/kitty.desktop
/usr/share/doc/kitty/examples/kitty-open.desktop
$ cp /usr/share/applications/kitty.desktop ~/.local/share/applications/
$ diff -u /usr/share/applications/kitty.desktop ~/.local/share/applications/kitty.desktop
--- /usr/share/applications/kitty.desktop       2025-06-23 03:52:56.000000000 +0900
+++ /home/matoken/.local/share/applications/kitty.desktop       2025-12-23 18:21:14.623247581 +0900
@@ -6,7 +6,7 @@
 Comment=Fast, feature-rich, GPU based terminal
 TryExec=kitty
 StartupNotify=true
-Exec=kitty
+Exec=env GLFW_IM_MODULE=ibus kitty
 Icon=kitty
 Categories=System;TerminalEmulator;
 X-TerminalArgExec=--

これでGUI からkitty を起動して日本語入力できるようになりました.

kitty im toot

環境
$ dpkg-query -W fcitx kitty
fcitx   1:4.2.9.9-2
kitty   0.41.1-2+b1
$ lsb_release -dr
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
$ arch
x86_64
]]>
https://matoken.org/blog/2025/12/23/japanese-input-with-kitty/feed/ 0