trixie – matoken's blog https://matoken.org/blog Is there no plan B? Wed, 04 Nov 2026 21:23:25 +0000 ja hourly 1 https://wordpress.org/?v=7.1.5 https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9-32x32.jpeg trixie – matoken's blog https://matoken.org/blog 32 32 VPSのDebianをunattended-upgradeで自動アップグレード https://matoken.org/blog/2026/10/30/automatically-upgrade-debian-on-vps-with-unattended-upgrade/ https://matoken.org/blog/2026/10/30/automatically-upgrade-debian-on-vps-with-unattended-upgrade/#respond Thu, 29 Oct 2026 22:08:06 +0000 https://matoken.org/blog/?p=5793

VPSをいくつか契約しています。システムのアップグレードは手動で行っています。
でも数日PCに触れないことなんかもあり最近の情勢からすると不安。ということでシステムの自動アップグレードを設定しました。

今回の対象はDebian trixie amd64環境。これまではapticronを動かしてパッケージの更新とダウンロードは自動化していました。
以前はcron-aptを使っていましたが、今回 unattended-upgradesを試してみました.

unattended-upgrades を導入

aptでunattended-upgradesを導入して設定します。

$ sudo apt install unattended-upgrades (1)
$ sudo dpkg-reconfigure unattended-upgrades (2)
Package configuration



  ┌───────────────────┤ Configuring unattended-upgrades ├───────────────────┐
  │                                                                         │
  │ Applying updates on a frequent basis is an important part of keeping    │
  │ systems secure. By default, updates need to be applied manually using   │
  │ package management tools. Alternatively, you can choose to have this    │
  │ system automatically download and install important updates.            │
  │                                                                         │
  │ Automatically download and install stable updates?                      │
  │                                                                         │
  │                    <Yes>                       <No>                     │
  │                                                                         │
  └─────────────────────────────────────────────────────────────────────────┘





Replacing config file /etc/apt/apt.conf.d/20auto-upgrades with new version
$ cat  /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
  1. unattended-upgradesパッケージを導入

  2. dpkg-reconfigure で <Yes> を選択

unattended upgrades

メール通知を有効にする

$ sudo vi /etc/apt/apt.conf.d/50unattended-upgrades
$ sudo git -C /etc diff /etc/apt/apt.conf.d/50unattended-upgrades
diff --git a/apt/apt.conf.d/50unattended-upgrades b/apt/apt.conf.d/50unattended-upgrades
index 26f84e133..007af9182 100644
--- a/apt/apt.conf.d/50unattended-upgrades
+++ b/apt/apt.conf.d/50unattended-upgrades
@@ -92,13 +92,13 @@ Unattended-Upgrade::Package-Blacklist {
 // If empty or unset then no email is sent, make sure that you
 // have a working mail setup on your system. A package that provides
 // 'mailx' must be installed. E.g. "user@example.com"
-//Unattended-Upgrade::Mail "";
+Unattended-Upgrade::Mail "user@example.com"; (1)

 // Set this value to one of:
 //    "always", "only-on-error" or "on-change"
 // If this is not set, then any legacy MailOnlyOnError (boolean) value
 // is used to chose between "only-on-error" and "on-change"
-//Unattended-Upgrade::MailReport "on-change";
+Unattended-Upgrade::MailReport "always"; (2)

 // Remove unused automatically installed kernel-related packages
 // (kernel images, kernel headers and kernel version locked tools).
$ sudo unattended-upgrade --dry-run --debug (3)
$ sudo unattended-upgrade --debug
  1. 通知を送るメールアドレス

  2. 実行舞に通知。しばらく動かしたら on-change に変更予定

  3. 動作確認

apticronはアンインストール
$ sudo apt remove apticron

しばらく動かして見て問題なければ別のVPSにも反映しようと思います。

環境

$ dpkg-query -W unattended-upgrades
unattended-upgrades     2.12
$ lsb_release -dr
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
$ arch
x86_64

追記

数日動かして今のところいい感じ。と思ったらKernel updateで再起動が必要になりこれどうしようになっています。live patch……?

というだけじゃあれなので、届いたメールを貼っておきます。
今のところ正常パターンしかないのですが、再起動が必要なときにはSubjectに `[reboot required] ` が付くようです。

実行時のメール

アップデートがなかったとき

Subject: unattended-upgrades result for example.com: SUCCESS
From: root@example.com

Unattended upgrade result: No packages found that can be upgraded
unattended and no pending auto-removals

Unattended-upgrades log:
Checking if system is running on battery is skipped. Please install powermg=
mt-base package to check power status and skip installing updates when the =
system is running on battery.
Starting unattended upgrades script
Allowed origins are: origin=3DDebian,codename=3Dtrixie,label=3DDebian, orig=
in=3DDebian,codename=3Dtrixie,label=3DDebian-Security, origin=3DDebian,code=
name=3Dtrixie-security,label=3DDebian-Security
Initial blacklist:=20
Initial whitelist (not strict):=20
No packages found that can be upgraded unattended and no pending auto-remov=
als

更新があったとき

Subject: unattended-upgrades result for example.com: SUCCESS
From: root@example.com

Unattended upgrade result: All upgrades installed

Warning: A reboot is required to complete this upgrade, or a previous one.

Packages that were upgraded:
libnss3 vim vim-common vim-runtime vim-tiny xxd

Package installation log:
Log started: 2026-11-02 06:50:53
apt-listchanges: Reading changelogs…​
apt-listchanges: Reading changelogs…​
Preparing to unpack …​/vim_2%3a9.1.1230-2+deb13u1_amd64.deb …​
Unpacking vim (2:9.1.1230-2+deb13u1) over (2:9.1.1230-2) …​
Preparing to unpack …​/vim-common_2%3a9.1.1230-2+deb13u1_all.deb …​
Unpacking vim-common (2:9.1.1230-2+deb13u1) over (2:9.1.1230-2) …​
Preparing to unpack …​/vim-tiny_2%3a9.1.1230-2+deb13u1_amd64.deb …​
Unpacking vim-tiny (2:9.1.1230-2+deb13u1) over (2:9.1.1230-2) …​
Preparing to unpack …​/vim-runtime_2%3a9.1.1230-2+deb13u1_all.deb …​
Unpacking vim-runtime (2:9.1.1230-2+deb13u1) over (2:9.1.1230-2) …​
Preparing to unpack …​/xxd_2%3a9.1.1230-2+deb13u1_amd64.deb …​
Unpacking xxd (2:9.1.1230-2+deb13u1) over (2:9.1.1230-2) …​
Setting up xxd (2:9.1.1230-2+deb13u1) …​
Setting up vim-common (2:9.1.1230-2+deb13u1) …​
Setting up vim-runtime (2:9.1.1230-2+deb13u1) …​
Setting up vim (2:9.1.1230-2+deb13u1) …​
Setting up vim-tiny (2:9.1.1230-2+deb13u1) …​
Processing triggers for mailcap (3.74) …​
Processing triggers for hicolor-icon-theme (0.18-2) …​
Processing triggers for man-db (2.13.1-1) …​
Log ended: 2026-11-02 06:51:09

Log started: 2026-11-02 06:51:11
apt-listchanges: Reading changelogs…​
apt-listchanges: Reading changelogs…​
Preparing to unpack …​/libnss3_2%3a3.110-1+deb13u5_amd64.deb …​
Unpacking libnss3:amd64 (2:3.110-1+deb13u5) over (2:3.110-1+deb13u4) …​
Setting up libnss3:amd64 (2:3.110-1+deb13u5) …​
Processing triggers for libc-bin (2.41-12+deb13u4) …​
Log ended: 2026-11-02 06:51:17

Unattended-upgrades log:
Checking if system is running on battery is skipped. Please install powermgmt-base package to check power status and skip installing updates when the system is running on battery.
Starting unattended upgrades script
Allowed origins are: origin=Debian,codename=trixie,label=Debian, origin=Debian,codename=trixie,label=Debian-Security, origin=Debian,codename=trixie-security,label=Debian-Security
Initial blacklist:
Initial whitelist (not strict):
Packages that will be upgraded: libnss3 vim vim-common vim-runtime vim-tiny xxd
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
All upgrades installed

kernelの更新があり再起動が必要なとき

Subject: [reboot required] unattended-upgrades result for example.com: SUCCESS
From: root@example.com

Unattended upgrade result: All upgrades installed

Warning: A reboot is required to complete this upgrade, or a previous one.

Packages that were upgraded:
linux-image-amd64 linux-libc-dev

Packages that were auto-removed:
linux-image-6.12.113+deb13-amd64

Package installation log:
Log started: 2026-11-03 06:16:00
apt-listchanges: Reading changelogs…​
apt-listchanges: Reading changelogs…​
Selecting previously unselected package linux-image-6.12.115+deb13.1-amd64.
Preparing to unpack …​/linux-image-6.12.115+deb13.1-amd64_6.12.115-2_amd64=
.deb …​
Unpacking linux-image-6.12.115+deb13.1-amd64 (6.12.115-2) …​
Preparing to unpack …​/linux-image-amd64_6.12.115-2_amd64.deb …​
Unpacking linux-image-amd64 (6.12.115-2) over (6.12.113-1) …​
Setting up linux-image-6.12.115+deb13.1-amd64 (6.12.115-2) …​
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.12.113+deb13-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-6.12.113+deb13-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-6.12.115+deb13.1-amd64
I: /initrd.img is now a symlink to boot/initrd.img-6.12.115+deb13.1-amd64
/etc/kernel/postinst.d/dkms:
dkms: WARNING: Linux headers are missing, which may explain the above failu=
res.
please install the linux-headers-6.12.115+deb13.1-amd64 package to fi=
x this.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.12.115+deb13.1-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file …​
Found linux image: /boot/vmlinuz-6.12.115+deb13.1-amd64
Found initrd image: /boot/initrd.img-6.12.115+deb13.1-amd64
Found linux image: /boot/vmlinuz-6.12.113+deb13-amd64
Found initrd image: /boot/initrd.img-6.12.113+deb13-amd64
Found linux image: /boot/vmlinuz-6.1.0-42-amd64
Found initrd image: /boot/initrd.img-6.1.0-42-amd64
Warning: os-prober will not be executed to detect other bootable partitions=
.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings …​
done
Setting up linux-image-amd64 (6.12.115-2) …​
Log ended: 2026-11-03 06:16:35

Log started: 2026-11-03 06:16:37
apt-listchanges: Reading changelogs…​
apt-listchanges: Reading changelogs…​
Preparing to unpack …​/linux-libc-dev_6.12.115-2_all.deb …​
Unpacking linux-libc-dev (6.12.115-2) over (6.12.113-1) …​
Setting up linux-libc-dev (6.12.115-2) …​
Log ended: 2026-11-03 06:16:43

Log started: 2026-11-03 06:16:45
Removing linux-image-6.12.113+deb13-amd64 (6.12.113-1) …​
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.1.0-42-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-6.1.0-42-amd64
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.12.113+deb13-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file …​
Found linux image: /boot/vmlinuz-6.12.115+deb13.1-amd64
Found initrd image: /boot/initrd.img-6.12.115+deb13.1-amd64
Found linux image: /boot/vmlinuz-6.1.0-42-amd64
Found initrd image: /boot/initrd.img-6.1.0-42-amd64
Warning: os-prober will not be executed to detect other bootable partitions=
.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings …​
done
Log ended: 2026-11-03 06:16:51

Unattended-upgrades log:
Checking if system is running on battery is skipped. Please install powermg=
mt-base package to check power status and skip installing updates when the =
system is running on battery.
Starting unattended upgrades script
Allowed origins are: origin=3DDebian,codename=3Dtrixie,label=3DDebian, orig=
in=3DDebian,codename=3Dtrixie,label=3DDebian-Security, origin=3DDebian,code=
name=3Dtrixie-security,label=3DDebian-Security
Initial blacklist:=20
Initial whitelist (not strict):=20
Packages that will be upgraded: linux-image-amd64 linux-libc-dev
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.l=
og
All upgrades installed
Packages that were successfully auto-removed: linux-image-6.12.113+deb13-am=
d64
Packages that are kept back:=20

タイマー

/lib/systemd/system/apt-daily.timer (アップデートタイマー)
[Unit]
Description=Daily apt download activities

[Timer]
OnCalendar=*-*-* 6,18:00
RandomizedDelaySec=12h
Persistent=true

[Install]
WantedBy=timers.target
/lib/systemd/system/apt-daily-upgrade.timer (アップグレードタイマー)
[Unit]
Description=Daily apt upgrade and clean activities
After=apt-daily.timer

[Timer]
OnCalendar=*-*-* 6:00
RandomizedDelaySec=60m
Persistent=true

[Install]
WantedBy=timers.target
]]>
https://matoken.org/blog/2026/10/30/automatically-upgrade-debian-on-vps-with-unattended-upgrade/feed/ 0
Debian trixieのGnome環境で時計合わせできていなかった https://matoken.org/blog/2026/10/16/debian-trixie-gnome-ntp/ https://matoken.org/blog/2026/10/16/debian-trixie-gnome-ntp/#respond Fri, 16 Oct 2026 11:44:25 +0000 https://matoken.org/blog/?p=5738

持ち運び端末にPanasonicのCF-RZ6というLaptopを利用しています.2017年1月発売の端末で結構古くバッテリーも弱っていますが,液晶が回転してタブレットとしても使え,1kgほどで軽量,トリガーケーブルを使いモバイルバッテリーから給電できて結構便利に使えています.

OSは慣れているDebianで,外出先でトラブルになると面倒なのでstableのtrixieかつデスクトップもGnomeという標準的な環境にしています.

先日時計が結構ずれているのに気づきました.通常はntpか何かでネットワーク経由で時計合わせをしてくれると思うのですが設定項目が見当たりません.

NICTのJST clockを見るとこんな感じで5分以上ずれています.

debian trixie ntp01

GUIで設定できたはずと設定を探すも見当たりません.近そうな「自動タイムゾーン設定」を有効にしてみましたがやはり関係無いようで数日経っても変わりません.

debian trixie ntp02

GUIは一旦置いておいてターミナルに降ります.timedatectlを見るとこんな感じで System clock synchronized: no となっています.

$ timedatectl
               Local time: Fri 2026-10-16 18:28:14 JST
           Universal time: Fri 2026-10-16 09:28:14 UTC
                 RTC time: Fri 2026-10-16 09:28:15
                Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: no
              NTP service: n/a
          RTC in local TZ: no

ntpを有効にしようとするとNTPが設定できません.

$ sudo timedatectl set-ntp true
Failed to set ntp: NTP not supported

systemd-timesyncd が必要そうですが入っていません.手動で導入します.

$ dpkg -l | grep systemd-timesyncd
ic  systemd-timesyncd                                        257.8-1~deb13u2                             amd64        minimalistic service to synchronize local time with NTP servers
$ sudo apt install systemd-timesyncd

有効になりました.

$ timedatectl
               Local time: Fri 2026-10-16 18:32:41 JST
           Universal time: Fri 2026-10-16 09:32:41 UTC
                 RTC time: Fri 2026-10-16 09:32:41
                Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

この状態で再度設定画面を見ると,勝手に画面が更新されて「自動日時設定」という設定項目が増えています.

debian trixie ntp03

JST clockページを見ると一気に時間が飛んでいます.時計が戻っているのでログなんかはおかしくなってしまっている可能性がありますね…….この辺を気にするならntpdやchronyにしたほうが良いのかもしれません.

debian trixie ntp04

ntp serverは *.debian.pool.ntp.org を見に行ってると思います.

$ timedatectl timesync-status | grep Server
       Server: 162.159.200.1 (0.debian.pool.ntp.org)

このあたりを変更したい場合は /etc/systemd/timesyncd.conf で変更できると思います.ISPや近所,NICTなんかにしておいてもいいかもしれません.
が,この端末はあちこちの回線で使うのでこのままでいいかな?

$ grep NTP /etc/systemd/timesyncd.conf
#NTP=
#FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org

Laptop情報

$ cat /sys/class/dmi/id/sys_vendor
Panasonic Corporation
$ cat /sys/class/dmi/id/product_name
CFRZ6-2
$ grep -m1 model\ name /proc/cpuinfo
model name      : Intel(R) Core(TM) i5-7Y57 CPU @ 1.20GHz
$ free -h
               total        used        free      shared  buff/cache   available
Mem:           7.7Gi       4.1Gi       665Mi       1.0Gi       4.0Gi       3.6Gi
Swap:          7.9Gi       3.9Gi       4.0Gi

バッテリーはもうほとんど売っていないし高価になっているのでモバイルバッテリーをトリガーケーブル経由で利用している.

モバイルバッテリーはINIU BI-B62という2000mAh/45W出力のものを利用している.この製品は現在Amazon商品ページはなくなっているよう.スペック的には以下のあたりが近い?

少し高く重くなるけど以下のあたりも良さそう.25000mAh, 100W出力.

トリガーケーブルというかアダプタはこちらの15V, 5.5mmx2.5mmmのものを利用.このLaptopのACアダプタは16Vだが15Vでも使えている.ケーブルはダイソーの60W対応の安いものを利用.

]]>
https://matoken.org/blog/2026/10/16/debian-trixie-gnome-ntp/feed/ 0
WordPressで任意の拡張子ファイルをアップロードできるようにする https://matoken.org/blog/2026/08/29/wordpress-add-mime/ https://matoken.org/blog/2026/08/29/wordpress-add-mime/#respond Fri, 28 Aug 2026 22:37:17 +0000 https://matoken.org/blog/?p=5626

このblogはWordPressというOSSのCMSを利用しています.このなかにファイルアップロード機能があり,画像のアップロードができます.
でも他の形式もアップロードしたいことがあります.今回は log
標準状態で非対応のファイル形式をupしようとするとエラーとなります.

このファイルタイプをアップロードする権限がありません。

WordPressのプラグインを利用して任意のファイル形式をアップロードできるようにしました.

plaintextのlogファイルなので適当なPastebinサービスに置くとかも考えましたがこのblogも10年以上運用していてそういった物がサービス終了して見えなくなるとかもよくあります.
ここは自分の管理しているサーバーなので,適当にディレクトリを掘ってそこにファイルを置くのでもいいかとも思いましたが,引っ越しをしたい場合やバックアップ取得時に少し手間が増えそうです.

ということでプラグインを探します.検索して利用者が多そうなもので以下を使ってみました.

WordPressの管理画面のプラグインページから「プラグインを追加」→「プラグインの検索」から該当のプラグインの「今すぐインストール」から導入しました.
プラグインの導入に成功したらプラグインが有効になっているのを確認して,「設定」→「Mime Type設定」で設定できます.

設定画面の下部の「追加の項目」から追加したい拡張子とMIME タイプを記述していきます.除外の設定もあります.
一通り書いたら「設定を保存」ボタンで反映します.

add mime01

保存した結果は上部の「List of allowed mime types and file extensions by WordPress」で確認できます.黒文字は規定の設定で,赤文字が追加した設定のようです.

add mime02

セキュリティオプションという項目もありました.

*プラグインは、WordPress コアによるいくつかのセキュリティチェックを回避します。それらを避けたくない場合は、次の設定をオンにしてください。

ということでonにしたほうがセキュアそうです.規定値は全部外れていました.今のところ全部onにしても動いていそうです.

add mime03

追加したファイル形式のファイルをアップロードしてみるとうまく行きました.

add mime04

以下が実際のファイルへのリンクです.

ということで好きなファイルをアップロードできるようになりました.
ファイルアップロードは気を使うところですが,今回は自分しかアップロードしないので問題ないはず…….

環境
  • WordPress 7.1

  • Add MIME Types 3.2.0

]]>
https://matoken.org/blog/2026/08/29/wordpress-add-mime/feed/ 0
ターミナルグラフィックウェブブラウザのterminal-browser https://matoken.org/blog/2026/08/27/terminal-graphic-webbrowser-terminal-browser/ https://matoken.org/blog/2026/08/27/terminal-graphic-webbrowser-terminal-browser/#comments Wed, 26 Aug 2026 21:42:49 +0000 https://matoken.org/blog/?p=5577

先日,ターミナルグラフィックウェブブラウザのBrow6elを知って試しています.

このとき似ているterminal-browserも知ったのですが,macOS専用でした.

その後,v0.5.0でLinuxにも対応したので試してみました.

導入

公式ではcurl | bash が紹介されていますが,これは嫌いなので手動で導入します.
現時点ではmacOS arm64,Linux adm64, Linux arm64のバイナリアーカイブが用意されています.これをダウンロードして展開します.

ダウンロード
$ wget -c https://github.com/zenbu-labs/terminal-browser/releases/latest/download/terminal-browser-linux-x64.tar.gz
ハッシュとファイルサイズの確認
$ sha256sum terminal-browser-linux-x64.tar.gz (1)
7c2375593623a12109615eca94ceaeece6a6193c4cc955ba159215f0f6c09ff7  terminal-browser-linux-x64.tar.gz
$ wc -c terminal-browser-linux-x64.tar.gz (2)
137362872 terminal-browser-linux-x64.tar.gz
$ curl -s https://terminal-browser.sh/install | grep terminal-browser-linux-x64.tar.gz (3)
linux-x64 https://terminal-browser.sh/install/dl/stable/v0.6.0/terminal-browser-linux-x64.tar.gz 7c2375593623a12109615eca94ceaeece6a6193c4cc955ba159215f0f6c09ff7 137362872"
  1. sha256sumの確認

  2. ファイルサイズの確認

  3. sha256sumとファイルサイズはinstall scriptの上の方にある

アーカイブの展開
$ fuse-archive terminal-browser-linux-x64.tar.gz
fuse-archive: Created mount point 'terminal-browser-linux-x64'

terminal-browserの実行環境

terminal-browserはSixelに対応しておらず,Kittyに対応しています.Kittyに対応したターミナルエミュレータを使う必要があります.
今回はKitty Graphicの元となっているKittyを選びました.

Tip
Kitty terminalで日本語入力を行いたい場合環境変数 GLFW_IM_MODULE=ibus が必要です.これは Fcitx 5 を利用する場合でも ibus と設定するようです.

ちなみにKittyグラフックプロトコル非対応な端末でterminal-browserを実行するとGhosttyをお薦めされます.こだわりなどなければGhosttyが無難かもしれません.

  This terminal cannot show images, which terminal-browser needs.

  We recommend Ghostty:
  https://ghostty.org/download

  Note: any terminal that supports the kitty graphics protocol is supported

terminal-browserの実行

引数なしで起動したり,

$ ./terminal-browser-linux-x64/terminal-browser/bin/terminal-browser

urlを指定して開いたりいくつかのコマンドラインオプションやコマンドもあります.

$ ~/Downloads/terminal-browser-linux-x64/terminal-browser/bin/terminal-browser --help
Usage: terminal-browser [url] [options]
       terminal-browser <command> [args]

  open      Open the browser in a terminal pane
  ls        List running browsers and their tabs
  setup     Configure installed terminals so terminal-browser works best
  upgrade   Upgrade to the latest release
  new-tab   Open a tab here, and a browser too if there is none
  shutdown  Stop the daemon
  action    Use the open browser through the agent-browser CLI

terminal-browser <command> --help for one command's options
terminal-browser --version prints the installed version

操作はショートカットキーが用意されていたりしますがほぼマウス操作で済む感じです.

terminal browser01
terminal browser02
Note

この記事を書いていて気づきましたが,タブ上のタイトルやアドレスバーのサジェストなどの日本語が豆腐になってしまいますね…….以下のissueによると中国語は本文も豆腐になるようです.

ssh経由でリモート起動

VPSにもterminal-browserをダウンロードしてssh経由で利用してみます.

$ ssh ${user}@${remote}
$ wget -c https://github.com/zenbu-labs/terminal-browser/releases/latest/download/terminal-browser-linux-x64.tar.gz
$ wc -c terminal-browser-linux-x64.tar.gz
137362872 terminal-browser-linux-x64.tar.gz
$ sha256sum terminal-browser-linux-x64.tar.gz
7264ca86fd0b5f5ad597e0fe5517da7a67e7079633151067c51f13238ee0cc45  terminal-browser-linux-x64.tar.gz
$ tar tvzf terminal-browser-linux-x64.tar.gz
$ tar xzf terminal-browser-linux-x64.tar.gz
$ ./terminal-browser/bin/terminal-browser
terminal browser03
terminal browser04

v0.5.0時点では動作が妙に重くなったりすることがありましたが,現在の最新版のv0.6.0では問題なく動いていそうです.

sshモード

v0.6.0 でsshモードが付きました.
このsshモードはssh経由でリモートサーバーに接続して利用するのですが,Chromiumはローカルで動作してChromiumが要求した通信をリモートから取得します.
--ssh ${user}@${remote} のように指定しますが, ~/.ssh/config を見てくれるようなので助かります.ポートや鍵を指定したい場合はこれで設定すれば良さそうです.

$ ~/terminal-browser-linux-x64/terminal-browser/bin/terminal-browser --ssh ${user}@${remote}

ローカルからリモートにデータを取りに行くのでローカルで動かすのと同じくらいの通信速度です.(fast.comではupが数倍に見える?)
使いどころがあまり思いつきませんが,VPN的な使い方がいいのかな?

terminal browser05
Note

VS Codeをターミナルで利用するterminal-codeというツールがあるのですが,このツールも同時にsshモードに対応して既視感があるなと思ってよく見ると同じ作者でした.ちなみにこのツールはterminal-browser内蔵でjsを呼んでいるようです.試してみようと思いましたがpathが固定で面倒で諦めちゃいました.

Zellij経由での利用

先週あたりにリリースされたターミナルワークスペースのZellij v0.45.0でちょうどKitty Graphics Protocolに対応していたのでちょっと試してみます.

うまく表示されることもあれば動かないことも?kitten icatでの画像表示でも同様.挙動がまだよくわかりません.ZellijはKittyに対応したばかりなのでバグかも?

terminal browser06

Brow6elとの比較

Brow6elはAppImageがあったりSixel/Kitty両対応,カスタマイズもしやすい感じです.
対してterminal-browserはChromiumを使っているのでWeb互換性が高く操作もマウスで大体okなので学習コストも低く感じます.

用途により使い分けでしょうか.

環境

$ ./terminal-browser-linux-x64/terminal-browser/bin/terminal-browser --version
terminal-browser v0.6.0
$ dpkg-query -W kitty
kitty	0.48.2-1
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/08/27/terminal-graphic-webbrowser-terminal-browser/feed/ 1
グラフックターミナルウェブブラウザのBrow6elをリモートVPSで実行 https://matoken.org/blog/2026/08/03/run-brow6el-remotely/ https://matoken.org/blog/2026/08/03/run-brow6el-remotely/#comments Sun, 02 Aug 2026 22:04:21 +0000 https://matoken.org/blog/?p=5556

グラフックターミナルウェブブラウザのBrow6elをリモートのVPSで動かしてみました.

普通にVPS上でbuildしてもいいのですが,Brow6elにはAppImageを作成する build_appimage.sh が提供されているのでローカルPCでこれを使い,Brow6elのAppImageを作って利用することにします.
build.sh が終わって ./build/run_brow6el.sh でBwow6elが動作する状態で実行します.

$ ./build_appimage.sh
   :
✓ AppImage created: build/brow6el-x86_64.AppImage

linuxdeployを使ってAppImageをパッケージングしてくれます.

$ ls -l build/brow6el-x86_64.AppImage
-rwxr-xr-x 1 matoken matoken 167807480 Aug  3 06:26 build/brow6el-x86_64.AppImage
$ file build/brow6el-x86_64.AppImage
build/brow6el-x86_64.AppImage: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=804289becc7fc6672c279ca50542e32508c1e518, stripped

出来上がった brow6el-x86_64.AppImage を実行するとBrow6elが起動します.
リモートのVPSにコピーして,

$ rsync -avcP build/brow6el-x86_64.AppImage $REMOTE:~/bin/

ssh経由で実行すると失敗?

$ ssh ${REMOTE} ~/bin/brow6el-x86_64.AppImage
Profile mode: temporary
Profile path: /tmp/brow6el_809104_3878246043
Brow6el - Terminal Web Browser with Sixel Support
Graphics detection: Sixel=NO, Kitty=NO
Error: Your terminal does not support graphics rendering
Please use a terminal emulator with graphics support:
  Sixel: mlterm, xterm, wezterm, foot, etc.
  Kitty: kitty, ghostty, wezterm, etc.

ssh ${REMOTE} convert rose: sixel: は大丈夫なのでSixel周りは問題ないと思うのですが.
とりあえず,ssh loginした後 brow6el-x86_64.AppImage を実行すれば起動します.

$ ssh ${REMOTE}
$ brow6el-x86_64.AppImage -v
Brow6el ec0bc3f
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.7778.96 Brow6el/ec0bc3f
$ brow6el-x86_64.AppImage

VPSでfast.comで速度を見ると恐らくVPSのリミット上限になっているのかなという感じの速度.

brow6el fast.com

ちなみに同じ時間の自宅はこんな感じです.

$ speedtest-cli --simple
Ping: 64.723 ms
Download: 13.05 Mbit/s
Upload: 2.78 Mbit/s

回線によっては地図系のサービスで一部レイヤーの読み込みに失敗してしまうことがあり,例えば台風の後などトヨタの通れた道マップでこの道路のがけ崩れ未だ治ってないのかと思っていたら実は読み込めていないだけだったたこともありました.こういうときなどVPSなどのリモートでBrow6elを動かすと良さそうです.

brow6el toyotamap

ただ,EmbeddedとはいえChromiumなので結構RAMを使います.そこそこRAMの載ったものを使ったほうが良さそうです.
無料だとXServerの無料VPSがRAM 2GB/4GBなので動かしやすそうです.でも今見ると受付停止中でした.

ちなみにGNU timeコマンドでメモリを確認するとこんな感じ.長時間だとまた増えそうです.

time -f %M

217312

URL指定なしで開いて閉じる

293456

www.google.comを開いて閉じる

371624

SperkerDeckでスライドを1つ読む

397432

AsciiDoctor Reveal.jsで作られた45pのスライドを閲覧

417480

YouTubeで検索した後90秒の動画を再生

486984

NextcloudにloginしてNoteでメモをしたり

1875016

comic-walker.comで漫画を5話分読んで閉じる

Note
最後のcomic-walkerがとてもRAM消費量が多いですが,何か間違ったかフルスクリーンで読んだせいかもしれません.
]]>
https://matoken.org/blog/2026/08/03/run-brow6el-remotely/feed/ 6
1bit LLMのBonsaiをLinux amd64環境で試す https://matoken.org/blog/2026/04/09/bonsai/ https://matoken.org/blog/2026/04/09/bonsai/#respond Wed, 08 Apr 2026 22:33:24 +0000 https://matoken.org/blog/?p=5427

以下の記事を見てBonsai という1bit LLM に興味を持ちました.持ち運びマシンはあまり使っていないけどRAM 8GB あります.世代はIntel Core iの7世代目と少し古いけど遅くてもそこそこの速度で動くならいいかもと思い試してみました.

端末の主なスペックはざっくりこんな感じ.こうやって見ると古すぎるかもしれない…….

Panasonic CF-RZ6RFRVS
Intel(R) Core(TM) i5-7Y57 CPU @ 1.20GHz
Memory LPDDR3 4GiB x2
VGA Intel Corporation HD Graphics 615
Disk M.2 SATA 256 GB(used)
OS Debian Trixie amd64

Bonsai の導入

導入は以下のREADME.md の通りに, setup.sh でvenv 環境を作って導入されました.

$ git clone https://github.com/PrismML-Eng/Bonsai-demo (1)
$ cd Bonsai-demo
$ BONSAI_MODEL=8B ./setup.sh (2)
  1. リポジトリをclone

  2. 8B モデルで setup.sh を実行. .venv 以下に導入

Bonsai の実行

先ずはexample をそのまま叩いてみます.動きません.

$ BONSAI_MODEL=8B ./scripts/run_llama.sh -p "What is the capital of France?"
[OK]   Model:  models/gguf/8B/Bonsai-8B.gguf
[OK]   Binary: /home/matoken/src/Bonsai-demo/bin/cuda/llama-cli
[OK]   Using -c 0 (auto-fit to available memory)
[WARN] Auto-fit not supported, falling back to -c 8192

-c 8192 をつけても -c 4096 とかしても駄目です.

script 野中を見ると, 2>/dev/null となっていてSTDERR が出なくなっていそうです.
ということで呼ばれていそうな llama-cli を直に叩いてみるとエラーが出ました.

$ BONSAI_MODEL=8B bin/cuda/llama-cli
bin/cuda/llama-cli: error while loading shared libraries: libcudart.so.12: cannot open shared object file: No such file or directory

libcudart.so.12 が見つからないと言われるので関連パッケージを導入してこれで動くようになりました.

$ apt-file search -x /libcudart.so.12$
libcudart12: /usr/lib/x86_64-linux-gnu/libcudart.so.12
$ sudo apt install libcudart12 nvidia-cuda-dev

2回目以降はこんな感じで実行

$ cd Bonsai-demo
$ source .venv/bin/activate
$ BONSAI_MODEL=8B ./scripts/run_llama.sh -p "What is the capital of France?"

しかし遅すぎます.8B モデルでこんな感じでちょっと辛い.

[ Prompt: 0.0 t/s | Generation: 0.0 t/s ]
Bonsai

Bonsai モデルダウンロード

他のモデルも試してみます.

$ BONSAI_MODEL=4B ./scripts/download_models.sh
$ BONSAI_MODEL=1.7B ./scripts/download_models.sh

1.7B でもこんな感じでまだ遅いです.

[ Prompt: 0.1 t/s | Generation: 0.1 t/s ]

もう少し新しいマシンだとどうだろうと以下の端末でも少し試してみましたがやはり遅い.

CPU Intel Core i7-10510U
RAM DDR4 8GiB *2
8B
[ Prompt: 0.1 t/s | Generation: 0.1 t/s ]
1.7B
[ Prompt: 0.4 t/s | Generation: 0.2 t/s ]

t/s では速度がわからないと思うので以下にcast をupload してみました.

大まかに
〜0:45 でモデル読み込み.
〜3:28 位から回答が帰って来はじめ,
〜8:40 くらいで回答完了.

生成AI での画像生成ならまだしもchat で壁打ちみたいな使い方には辛そうです.

と思ったらこんなニュースが.Llama.cpp 用の OpenVINO バックエンドが追加されたそうで,これを使うとiGPU でも速くなりそうです.

Note

OpenVINO は以前Stable Diffusion で試したことが.

]]>
https://matoken.org/blog/2026/04/09/bonsai/feed/ 0
Twitterで配信された動画アーカイブをダウンロード https://matoken.org/blog/2026/04/01/twitter-broadcast-download/ https://matoken.org/blog/2026/04/01/twitter-broadcast-download/#respond Tue, 31 Mar 2026 22:10:47 +0000 https://matoken.org/blog/?p=5405

Twitterで配信されたライブ動画のアーカイブをダウンロードしてみました.

とあるイベントがTwitter で配信されていたらしくYouTube にもあるのではと思ったけど見当たりません.Twitter にアーカイブが残っているのですが,なんか再生がすぐ止まるので辛い.
ということでダウンロードできないかなと検索するとX/Twitter Broadcast Downloader というものを見つけました.これでダウンロードしてみました.

venv 環境に導入して試す.
$ git clone https://github.com/offish/twitter-x-broadcast-downloader (1)
$ cd twitter-x-broadcast-downloader
$ python3 -m venv venv (2)
$ source venv/bin/activate (3)
$ pip install -r "requirements.txt" (4)
$ python main.py (5)
What is the broadcast URL? https://x.com/i/broadcasts/1qGvvkWeqdBGB (6)
Got media key 28_2038539604165640192
Got playback URL https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/hls/PTdVIXd-pzzuOcGNlng6TG9haAxe5-rcN7QaIridcZbNbingfwGFrSiqe9DsliGqOpoLNO8lZ2Pk9a_owkY3aw/non_transcode/ap-northeast-1/periscope-replay-direct-prod-ap-northeast-1-public/master_dynamic_16671870457049479117.m3u8?type=replay
Downloading the broadcast as 28_2038539604165640192.mp4...
[generic] Extracting URL: https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/hls/PTdVIXd-pzzuOcGNlng6TG9haAxe5...117.m3u8?type=replay
[generic] master_dynamic_16671870457049479117: Downloading webpage
[generic] master_dynamic_16671870457049479117: Downloading m3u8 information
[generic] master_dynamic_16671870457049479117: Checking m3u8 live status
[info] master_dynamic_16671870457049479117: Downloading 1 format(s): 5500
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 6385
[download] Destination: /home/matoken/src/twitter-x-broadcast-downloader/downloads/28_2038539604165640192.mp4
[download] 100% of    3.64GiB in 00:03:49 at 16.24MiB/s
[FixupM3u8] Fixing MPEG-TS in MP4 container of "/home/matoken/src/twitter-x-broadcast-downloader/downloads/28_2038539604165640192.mp4"


What is the broadcast URL? (7)
  1. source clone

  2. venv 環境を作る

  3. venv を有効に

  4. venv 環境にインストール

  5. X/Twitter Broadcast Downloader を実行

  6. ダウンロードしたいURL を渡す

  7. 次のダウンロードしたいURL 待ち

ダウンロードできました.

$ ls -lA downloads/
total 3722204
-rw-rw-r-- 1 matoken matoken 3811532277 Mar 31 18:03 28_2038539604165640192.mp4
-rw-rw-r-- 1 matoken matoken          0 Mar 31 17:57 .gitkeep
$ ffprobe downloads/28_2038539604165640192.mp4 2>&1 | grep -A 99 ^Input
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'downloads/28_2038539604165640192.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf61.7.100
  Duration: 03:35:23.76, start: 0.000000, bitrate: 2359 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080, 2187 kb/s, 30 fps, 30 tbr, 90k tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]

以下余録.

リモートのVPS でダウンロードしたのですが結構大きいので小さくしてダウンロードします.

ffmpeg コマンドで動画を小さく
$ ffmpeg -i downloads/28_2038539604165640192.mp4 -vcodec libx264 -crf 33 -vf "scale=720:-2" -c:a copy downloads/28_2038539604165640192-720.mp4
$ ls -1s downloads/
total 4172176
 449972 28_2038539604165640192-720.mp4
3722204 28_2038539604165640192.mp4
動画の音声を取り出してWhisper.cpp で字幕作成
$ ffmpeg -i ~/Downloads/28_2038539604165640192-720.mp4 -ar 44100 -ac 1 -sample_fmt s16 -af silenceremove=1:0:-50dB  clawcon.wav
$ ./build/bin/whisper-cli -m ./models/ggml-large-v3-turbo.bin --output-srt --language auto -f ./clawcon.wav
$ ls -1s clawcon.wav*
1067548 clawcon.wav
    152 clawcon.wav.srt
$ head  clawcon.wav.srt
1
00:00:00,000 --> 00:00:06,660
Alright everyone, we'll be starting in 10 minutes. Please make your way to the stage area. We'll be starting in 10 minutes.

2
00:00:30,000 --> 00:00:59,980
 Thank you.

3
00:01:00,000 --> 00:01:29,980
ダウンロード環境
$ dpkg-query -W python3 python3-venv ffmpeg
ffmpeg  7:7.1.3-0+deb13u1
python3 3.13.5-1
python3-venv    3.13.5-1
$ lsb_release -dr
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
$ arch
x86_64
動画編集,文字起こし環境
$ dpkg-query -W ffmpeg
ffmpeg  7:8.1-3+b1
a$ git remote -v
origin  https://github.com/ggerganov/whisper.cpp.git (fetch)
origin  https://github.com/ggerganov/whisper.cpp.git (push)
$ git log --pretty=oneline -1
95ea8f9bfb03a15db08a8989966fd1ae3361e20d (HEAD -> master, origin/master, origin/HEAD) sync : ggml
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64
]]>
https://matoken.org/blog/2026/04/01/twitter-broadcast-download/feed/ 0
軽量ActivityPub Serverのsnac 2.91リリース https://matoken.org/blog/2026/03/26/snac-2-91/ https://matoken.org/blog/2026/03/26/snac-2-91/#respond Thu, 26 Mar 2026 11:39:29 +0000 https://matoken.org/blog/?p=5367 @grunfink) 作者のtoot Release N […]]]>

susie64 cool

c言語で作られている軽量ActivityPub Server のsnac 2.91 がリリースされました.

Release Notes

## 2.91

Fixed some local posts not being shown if the replied post is deleted.

Fixed web UI incorrect links to public posts for some configurations.

Fixed encoding bug in Mastodon-style share links.

Fixed an error that made imposible to leave empty the following hashtags or blocked hashtags from the web UI.

Include post attachments in the RSS feed entries.

Added some OpenBSD-specific documentation (contributed by oxzi).

Fixed some timezones (contributed by matoken).

Fixed some crashes (special thanks to Louis Merlin for helping me with this).

Updated Docker scripts to avoid generating a useless log file.

Fixed several memory leaks, key generation errors and HTML inconsistencies (contributed by dandelions).

Added ostatus.org and FEP-3b86 data to Webfinger objects.

Added a new CONTRIBUTING.md file. Among other guidelines, I explicitly say there that AI contributions are NOT accepted.

snac is now available as a [Yunohost app](https://apps.yunohost.org/app/snac). Thank you very much to Bruno Cesar Rocha for this.

今回のリリースでは CONTRIBUTING.md ファイルが追加され貢献について明確化されました.そして所謂生成AIやLLMを使ったものは受け取れないとも.
後は大体バグ修正でしょうか.自分の送った小さいパッチや報告したバグ修正も含まれていたりします.

その他,Yunohost app としても登録され,Yunohost 環境で簡単に利用できるようになったようです.

自環境のsnacアップグレード

個人用のsnac はsource からbuild してリリース後数時間後にはアップグレードしました.
#kagolug のsnac はDebian stable-backports(trixie-backports) のパッケージを利用していて,数日遅れの今日アップグレードしました.

自分の環境のamd64 だと問題なかったですが,Debian package は一部環境でコケていそう.

$ 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.90-1~bpo13+1 | stable-backports          | source, riscv64
snac2      | 2.90-1~bpo13+1 | stable-backports-debug    | source
snac2      | 2.90-1         | testing                   | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x
snac2      | 2.90-1         | unstable                  | source, riscv64
snac2      | 2.90-1         | unstable-debug            | source
snac2      | 2.91-1~bpo13+1 | buildd-stable-backports   | source, amd64, arm64, armel, armhf, i386, ppc64el, s390x
snac2      | 2.91-1~bpo13+1 | stable-backports          | source, amd64, arm64, armel, armhf, i386, ppc64el, s390x
snac2      | 2.91-1~bpo13+1 | stable-backports-debug    | source
snac2      | 2.91-1         | buildd-unstable           | source, amd64, arm64, armhf, i386, loong64, ppc64el, riscv64, s390x
snac2      | 2.91-1         | unstable                  | source, amd64, arm64, armhf, i386, loong64, ppc64el, riscv64, s390x
snac2      | 2.91-1         | unstable-debug            | source
Migration status for snac2 (2.90-1 to 2.91-1): BLOCKED: Maybe temporary, maybe blocked but Britney is missing information (check below)
Issues preventing migration:
∙ ∙ Missing build on riscv64
∙ ∙ Autopkgtest deferred on riscv64: missing arch:riscv64 build
∙ ∙ Autopkgtest for snac2/2.91-1: amd64: Pass, arm64: Pass, i386: Test triggered, ppc64el: Test triggered, s390x: Test triggered
∙ ∙ Lintian check waiting for test results - info
∙ ∙ Too young, only 0 of 5 days old
Additional info (not blocking):
∙ ∙ Piuparts tested OK - https://piuparts.debian.org/sid/source/s/snac2.html
∙ ∙ Reproducibility check waiting for results on amd64
∙ ∙ Reproducibility check waiting for results on arm64
∙ ∙ Reproduced on armhf
∙ ∙ Reproducibility check waiting for results on i386
∙ ∙ Reproducibility check waiting for results on ppc64el
Not considered
]]>
https://matoken.org/blog/2026/03/26/snac-2-91/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
軽量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 @grunfink) 作者のtoot snac2/RELEASE_NOTES […]]]>

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
軽量な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 @grunfink) snac2/RELEASE_NOTES.m […]]]>

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
ターミナルエミュレータの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
snacとBluesky連携 https://matoken.org/blog/2025/12/20/snac-bluesky-bridge/ https://matoken.org/blog/2025/12/20/snac-bluesky-bridge/#comments Sat, 20 Dec 2025 12:53:53 +0000 https://matoken.org/blog/?p=5033

snac susie

さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.

ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はsnac とBluesky 連携について.

Bluesky はポストTwitter の一つでAT Protocol を利用した分散型SNS です.とはいえ現時点ではActivityPub ほど分散している感じはしません.
このBluesky とfediverse (snac のActivityPub も含む)とWeb を連携させるブリッジとしてBridgy Fed というサービスがあります.
Bridgy Fed を使ってsnac とBluesky を連携してみます,

ActivityPub から連携するには https://fed.brid.gy/login で認証後,「Enable」ボタンを押すとなっているのですがログインしてもボタンが見当たりません.Mastodon としてsnac のアカウントを認証したのでなにかAPI の違いや不足があるのかもしれません.

以下のページを見ると別の方法も紹介されています.

if login isn't supported for your fediverse server, search for and follow @bsky.brid.gy@bsky.brid.gy in the fediverse. That account will then follow you back. Accept its follow to make sure your fediverse posts get sent the bridge and make it into Bluesky. You can unfollow it afterward if you want, you'll still stay bridged. (Here's how to disable.)

snac の該当アカウントで @bsky.brid.gy@bsky.brid.gy をfollow します.するとこのアカウントからfollow が返されるので承認すると連携完了です.この後は unfollow しても連携は維持されるそうです.

このときの連携元アカウントが, @[user]@[instance] の場合Bluesky ブリッジアカウントのハンドルは [user].[instance].ap.brid.gy になります.

なにか投稿して確認しましょう.

snac bsky bridge

Bridgy Fed は単に投稿を転送するだけでなく返信やlikes, (元の投稿がブリッジされている場合は)repost なども連携されるようです.元の投稿を削除した場合も反映されます.

Which stuff of mine from the fediverse will get bridged?

Once you’ve enabled the bridge, anything that’s fully public and interacts with Bluesky users. This includes your posts, replies, likes, and reposts if the original post was bridged. Posts on Bluesky are limited to 300 characters, so longer posts from the fediverse are truncated and ellipsized. Hashtags, links, link previews, images, videos, and even alt text are also included.

ブリッジアカウントの削除を行いたい場合は,Bridgy Fedボットユーザー( @bsky.brid.gy@bsky.brid.gy )をブロックすることで削除できるようです.

If you’re on the fediverse or Bluesky, and you’ve opted in but now want to opt out, block the Bridgy Fed bot user for the network you want to opt out of. For example, on the fediverse, block @bsky.brid.gy@bsky.brid.gy. On Bluesky, block @ap.brid.gy.

(However, if you’re on a Pixelfed instance, DM the word stop to @bsky.brid.gy@bsky.brid.gy instead. Pixelfed doesn’t yet send the ActivityPub Block activity, so blocking won’t work. Hopefully they’ll fix that soon!)

If you’re on the web, email us from an address at your web site’s domain to show that you own it, or you can put the text #nobridge in the profile on your home page and then update your profile on your user page.

Once you’ve done this, Bridgy Fed will deactivate your bridged profile in that network, and it will no longer bridge any of your posts or interactions there.

You can undo this later and reactivate bridging for your account, but depending on the network, not everything will be perfectly restored. For example, when you disable bridging into the fediverse, the bridged fediverse account is deleted and all followers are disconnected. If you later re-enable it, fediverse users will have to search for your account by address manually to find and follow it again.

]]>
https://matoken.org/blog/2025/12/20/snac-bluesky-bridge/feed/ 1
snacの自動投稿機能 https://matoken.org/blog/2025/12/19/implementing-post-bots/ https://matoken.org/blog/2025/12/19/implementing-post-bots/#respond Fri, 19 Dec 2025 14:57:13 +0000 https://matoken.org/blog/?p=5024

snac susie

さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.

ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はsnac のbot 向け投稿機能について.

bot やアナウンスなど向けのアカウントで自動投稿をしたいことがあります.
例えばいま考えているのはCalDav から今日のイベントを投稿するアカウント.現在はWebhook 経由でDiscord にpost したりしています.
snac でもいくつか自動投稿する機能があります.

Implementing post bots

snac makes very easy to post messages in a non-interactive manner. This example posts a string:

uptime | snac note $SNAC_BASEDIR $SNAC_USER –

You can setup a line like this from a crontab(5) or similar. Take note that you need a) command-line access to the same machine that hosts the snac instance, and b) write permissions to the storage directories and files.

You can also post non-interactively using the Mastodon API and a command-line http tool like curl(1) or similar. This has the advantage that you can do it remotely from any host, anywhere; the only thing you need is an API Token. This is an example:

curl -X POST https://$SNAC_HOST/api/v1/statuses \
–header “Authorization: Bearer ${TOKEN}” -d “status=$(uptime)”

You can obtain an API Token by connecting to the following URL:

— man(1) より
note basedir uid text [file file ... [-r inReplyTo [-d YYYYmmddHHMMSS]]]
        Enqueues a Create + Note message to all followers. If the text argument is -e, the external editor defined by  the  EDITOR  environment  variable
        will  be invoked to prepare a message; if it's - (a lonely hyphen), the post content will be read from stdin.  The rest of command line arguments
        are treated as media files to be attached to the post. The LANG environment variable (if defined) is used as the post language. An  optional  URL
        to  a  Fediverse post, prefixed by -r, can be specified for this note to be a reply to. If a date in YYYYmmddHHMMSS format is followed by -d, the
        note is scheduled for that moment instead of immediately posted (this date must be in the same timezone the user has configured in the web UI).
note_unlisted basedir uid text [file file ... [-r inReplyTo [-d YYYYmmddHHMMSS]]]
        Like the previous one, but creates an "unlisted" (or "quiet public") post.
note_mention basedir uid text [file file ... [-r inReplyTo [-d YYYYmmddHHMMSS]]]
        Like the previous one, but creates a post only for accounts mentioned in the post body.
block basedir instance_url
— man(1) より

snac note コマンドでの投稿

snac の動作している環境で実行できるのであればお手軽なsnac のnote コマンドがあります.
man(1) にある例を真似してみます.

uptime | snac note $SNAC_BASEDIR $SNAC_USER –

$ uptime | pee "./snac note snac-test test -" cat
 23:32:36 up 4 days, 10:17,  1 user,  load average: 1.56, 1.90, 1.69
23:32:36 [test] enqueue_message http://127.0.0.1:8001/test/p/1766154756.511450/Create
8       /�

投稿を確認するとこんな感じ.

snac note 1

日本語もそのままでok でした.

snac note 2

pfetch を流し込んでみるとこんな感じで整形を考えないとダメそう.

snac note 3

curl を使ってAPI 経由で投稿

こちらは一般的なネットワーク経由でリモートで投稿可能な方法です.token を入手してcurl コマンドで投稿します.

まず以下のようなURL でtoken を取得します.

以下のような画面になるので対象アカウントの情報を入手します.

snac get token

以下のようなトークンが取得できるのでメモします.

1f3ea50e9ab7cc85f5ff01b8f43fb1ae

後はcurl などで以下のようにPOST.
json で返り値が帰ってきます.

$ curl -X POST http://127.0.0.1:8001/api/v1/statuses --header "Authorization: Bearer 1f3ea50e9ab7cc85f5ff01b8f43fb1ae" -d "status=$(uptime)"
{
    "id": "1766155742b0f5ed692a273ff5b6ef59b696ddde76",
    "uri": "http://127.0.0.1:8001/test/p/1766155742.788170",
    "url": "http://127.0.0.1:8001/test/p/1766155742.788170",
    "account": {
        "id": "488d5ffe15e31aa0be5002853e8006f7",
        "username": "test",
        "display_name": "test",
        "discoverable": true,
        "group": false,
        "hide_collections": false,
        "indexable": true,
        "noindex": false,
        "roles": [
        ],
        "acct": "test@127.0.0.1:8001",
        "created_at": "2025-11-14T19:38:38Z",
        "last_status_at": "2025-12-19",
        "bot": false,
        "note": "<br>",
        "url": "http://127.0.0.1:8001/test",
        "uri": "http://127.0.0.1:8001/test",
        "avatar": "http://127.0.0.1:8001/susie.png",
        "avatar_static": "http://127.0.0.1:8001/susie.png",
        "header": "",
        "header_static": "",
        "emojis": [
        ],
        "locked": false,
        "followers_count": 0,
        "following_count": 0,
        "statuses_count": 0,
        "fields": [
        ]
    },
    "created_at": "2025-12-19T14:49:02.000Z",
    "content": "23:49:02 up 4 days, 10:34,  1 user,  load average: 1.48, 1.57, 1.68<br>",
    "visibility": "public",
    "sensitive": false,
    "spoiler_text": "",
    "media_attachments": [
    ],
    "mentions": [
    ],
    "tags": [
    ],
    "emojis": [
    ],
    "favourites_count": 0,
    "favourited": false,
    "reblogs_count": 0,
    "reblogged": false,
    "replies_count": 0,
    "in_reply_to_id": null,
    "in_reply_to_account_id": null,
    "reblog": null,
    "card": null,
    "language": "en",
    "filtered": [
    ],
    "muted": false,
    "text": " 23:49:02 up 4 days, 10:34,  1 user,  load average: 1.48, 1.57, 1.68",
    "edited_at": null,
    "poll": null,
    "bookmarked": false,
    "pinned": false
}
]]>
https://matoken.org/blog/2025/12/19/implementing-post-bots/feed/ 0
snacの通知について https://matoken.org/blog/2025/12/18/snac-notifigcations/ https://matoken.org/blog/2025/12/18/snac-notifigcations/#respond Thu, 18 Dec 2025 11:28:14 +0000 https://matoken.org/blog/?p=5007

snac susie

さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.

ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はsnac の通知について.

snac の通知は以下のように「notifications」の横に数字で通知されます.「notifications」リンクをクリックすることで詳細が表示されます.

snac notifications

しかしこの通知はsnac のページが読み込まれたタイミングにならないと通知がわかりません.
しかし代替の通知がいくつか実装されています.これらを利用することでほぼリアルタイムな通知が可能となります.

e-mail

一般的なe-mail です.サーバーのメールシステムが設定済であればユーザーの「User Settings…​」から「Email address for notifications:」に宛先のe-main address を入力するることで利用可能です.
サーバーのメールシステムの設定がされていなかったり,外部のメールシステムを利用したい場合 server.json の以下の項目を設定することでもメールが送信できます.

Email address for notifications
        If this field is not empty, an email message will be sent to this address whenever a post written by you is liked, boosted or replied to.
— snac(1)より
smtp_url    Since version 2.76, email notifications can be sent via direct connection to an SMTP server instead of the traditional behaviour of piping the mes‐
            sage to /usr/sbin/sendmail.  Set this value to the SMTP url to be used for sending email notifications (for example, smtp://localhost). It may  in‐
            clude a port number if it's not running on the usual one, like in smtp://mail.example.com:587.
smtp_user
smtp_password
            To be filled if the SMTP server defined by the previous directive needs credentials.
— snac(8)より

snac notification email

Telegram で通知

インスタントメッセージアプリケーションのTelegram にも対応しています.ただ,Telegram bot を作成して利用する必要があるので期設定が少し初面倒です.

Telegram notifications
        To  enable  notifications  via Telegram, fill the two provided fields (Bot API key and Chat id). You need to create both a Telegram channel and a
        bot for this; the process is rather cumbersome but it's documented everywhere. The Bot API key is a long string of  alphanumeric  characters  and
        the chat id is a big, negative number.
— snac(1)より

以前Telegram bot をNextcloud のTOTP の通知設定に利用するために書いたエントリがあります.

Telegram bot が作成できたら各ユーザの「User Settings…​」の「Telegram notifications (bot key and chat id):」に設定することで利用できます.

ntfy で通知

OSS でセルフホスト可能でウェブブラウザやスマートフォンに通知ができるntfy というサービスがあります.これを利用してsnac の通知を行うことも可能です.

ntfy notifications
        To  enable  notifications  via  ntfy  (both self-hosted or standard ntfy.sh server), fill the two provided fields (ntfy server/topic and, if pro‐
        tected, the token).  You need to refer to the https://ntfy.sh web site for more information on this process.
— snac(1)より

セルフホスト可能ですが,とりあえずntfy.sh を利用して試すと良さそうです.

「User Settings…​」の「ntfy notifications (ntfy server and token):」に設定することで通知できるようになります.

Webhook で通知

色々なサービスが対応しているWebhook も利用可能です.

Notify webhook
        If this is set to an URL, an HTTP POST will be sent to it whenever a new notification happens (see the 'Webhook for notifications' section  below
        for more information).
— snac(1)より

例えばDiscord であれば,「チャンネルの編集」→「連携サービス」→「ウェブフックを作成」で生成されるURL を利用して通知できます.
これを「User Settings…​」の「Notify webhook:」に入力することで通知可能です.

mastodon アプリケーションでの通知

snac はmastodon API に対応しています.そのためmastodon アプリケーションが利用可能です.
mastodon アプリケーションの通知機能を使って通知を受けることが可能です.

]]>
https://matoken.org/blog/2025/12/18/snac-notifigcations/feed/ 0
snacのthemeを設定 https://matoken.org/blog/2025/12/17/snac-theme/ https://matoken.org/blog/2025/12/17/snac-theme/#respond Wed, 17 Dec 2025 12:04:10 +0000 https://matoken.org/blog/?p=4987

snac susie

さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.

ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はsnac のtheme 変更.

snac はCSS ファイルを編集することでテーマを設定することが出来ます.
CSS ファイルは2種類あり,インスタンス全体のスタイルを設定する, {basedir}/style.css と,各ユーザー用のプライベートCSSファイルの {basedir}/user/{ユーザー名}/static/style.css です.

Tip

手元のsnac 2.8.5 で試したところ,各ユーザーのプライベートCSSファイルはログインした状態でないと効かないようです.
つまり,各ユーザーの公開ページはグローバル設定が反映されます.
そして,設定にはtheme ファイルを該当場所に設定する必要がありますが,ウェブ上からは出来ないので管理者にお願いするなどの手間がかかります.

自分で設定しなくても, README.md の Incredibly awesome CSS themes for snac 部分にいくつかのtheme が紹介されているのでこれを使わせてもらったりそれを元にカスタマイズするのでも良さそうです.

$ grep -A5 'Incredibly awesome CSS themes for snac' README.md
## Incredibly awesome CSS themes for snac

- [A compilation of themes for snac (by Во )](https://codeberg.org/voron/snac-style).
- [A cool, elegant theme (by Haijo7)](https://codeberg.org/Haijo7/snac-custom-css).
- [A terminal-like theme (by Tetra)](https://codeberg.org/ERROR404NULLNOTFOUND/snac-terminal-theme).

以下は Pika というtheme を設定した例です.3ペインになり,PC等の横長画面での操作性が良さそうです.

snac theme pika

]]>
https://matoken.org/blog/2025/12/17/snac-theme/feed/ 0
snacのWelcome pageを設定ファイルでカスタマイズ https://matoken.org/blog/2025/12/16/snac-welcome-page-costomsetting/ https://matoken.org/blog/2025/12/16/snac-welcome-page-costomsetting/#respond Tue, 16 Dec 2025 10:19:40 +0000 https://matoken.org/blog/?p=4973

snac susie

さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.

ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はsnac でのWelcome pageのカスタマイズについてその2.
以前のカスタマイズではhtml ファイルの書き換えを行いましたが今回は設定ファイルでの書き換えです.

snac のtop page は以下のような挨拶ページが表示されます. greeting.html ファイルを書き換えることでこのページをカスタマイズ出来ますが,他にもサーバー設定ファイルの server.json でもカスタマイズ項目があります.

$ w3m -dump https://snac.kagolug.org/
snac.kagolug.org is a Fediverse instance that uses the ActivityPub protocol. In
other words, users at this host can communicate with people that use software
like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

The following users are part of this community:

    @info@snac.kagolug.org (info)
    @matoken@snac.kagolug.org (matoken)

This site is powered by snac.

snac greeting page

show_instance_timeline これを true に設定するとWelcome page に最新のユーザーが投稿したタイムラインが表示されるようになります.
また,以下の設定項目が設定されていた場合それも表示されます.

admin_email
インスタンス管理者の電子メールアドレス

admin_account
インスタンス管理者のアカウント

title
インスタンスのタイトル

short_description
インスタンスに対する短い説明

short_description_raw
short_description を生の文字列として解釈するか,HTML に変換するか

例えばこの様に設定すると,

$ grep -A5 show_instance_timeline snac-data/server.json
    "show_instance_timeline": true,
    "admin_email": "",
    "admin_account": "matoken",
    "title": "🐈🐈🐈",
    "short_description": "matokenの個人ActivityPub インスタンスです.",
    "short_description_raw": false,

こんな感じになりました.

snac welcome page customsettings

注意点として,show_instance_timeline を true にすると greeting.html は無視されるようです.用途や好みに合わせてどちらかを利用する感じでしょうか.

]]>
https://matoken.org/blog/2025/12/16/snac-welcome-page-costomsetting/feed/ 0
snacでのSPAM対策 https://matoken.org/blog/2025/12/15/snac-spam-mitigation/ https://matoken.org/blog/2025/12/15/snac-spam-mitigation/#respond Mon, 15 Dec 2025 10:50:27 +0000 https://matoken.org/blog/?p=4962

snac susie

さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.

ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はsnac でのSPAM 対策について.

SPAM が来ないに越したことはありませんがActivityPub でも偶に見かけます.もしSPAM が来るときのことを考えて対策を確認しておきます.
snac では2つの対策があるようです.

SPAM Mitigation
    There have been some SPAM attacks on the Fediverse and, as too many instances and server implementations out there still allow automatic account creation, it will only get worse.  snac includes some (not very strong) tools for try‐
    ing to survive the SPAM flood that will eventually happen.
The  min_account_age field in the main configuration file allows setting a minimum age (in seconds) to consider too recently created accounts suspicious of being a potential source of SPAM. This is a naïve assumption, because spam‐
mers can create accounts, let them dormant for a while and then start to use them. Also, some ActivityPub implementations don't even bother to return a creation date for their accounts, so this is not very useful.
From version 2.50, post content can be filtered out by regular expressions.  These weapons of mass destruction can be written into the filter_reject.txt file in the server base directory, one per line;  if  this  file  exists,  all
posts'  content  will  be  matched (after being stripped of HTML tags) against these regexes, one by one, and any match will make the post to be rejected. Use lower case, the regex will be case insensitive by default.  If you don't
know about regular expressions, don't use this option (or learn about them inw some tutorial, there are gazillions of them out there), as you and your users may start missing posts. Also, given that every regular expression  imple‐
mentation supports a different set of features, consider reading the documentation about the one implemented in your system.
— snac(8) より

アカウント作成から日の浅いアカウントを拒否

1つ目はメイン設定ファイルの server.json で設定できる min_account_age で,投稿を受け付けるアカウントが作成されてからの時間が設定できます.
ただし,SPAM アカウントを作成して寝かせてから運用したり,アカウントの作成日を返さない実装もあるらしいのであまり役に立たないようです.
既定値は 0 になっています.

$ jq .min_account_age server.json
0

投稿内容を正規表現でフィルタリング

2つめは投稿内容を正規表現でフィルタリングできるようです.snac データディレクトリに filter_reject.txt を用意してこのファイル中に1行ずつ記述できるようです.これにより全ての投稿をHTML タグを取り除いた後正規表現と1つずつ照合され一致する投稿は拒否されます.
正規表現なのでテストを十分して設定したほうが良さそうです.

Reverse proxy やFirewall などsnac の外で対策も考えられます.その他以下のようなものもあるようです.e-mail もこんな感じで多段にしたりしますね.そうなるとReceived のようなものが見たいなと思ったりも.

]]>
https://matoken.org/blog/2025/12/15/snac-spam-mitigation/feed/ 0
snacのrobots.txt https://matoken.org/blog/2025/12/14/snac-robots-txt/ https://matoken.org/blog/2025/12/14/snac-robots-txt/#respond Sun, 14 Dec 2025 09:26:00 +0000 https://matoken.org/blog/?p=4953

susie64 cool

さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.

ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はsnac でのrobots.txt について.

検索エンジンで「site:snac.kagolug.org」のように検索してみると何も出てきません.運用開始からそう時間が経っていないからかな?と思いつつ念の為 robots.txt を確認するとこんな感じで全て拒否るすようになっていました.

$ w3m -dump https://snac.kagolug.org/robots.txt
User-agent: *
Disallow: /

source を確認すると httpd.c の中でハードコーディングされているようです.

$ grep -n -A5 robots.txt httpd.c
321:    if (strcmp(q_path, "/robots.txt") == 0) {
322-        status = HTTP_STATUS_OK;
323-        *ctype = "text/plain";
324-        *body  = xs_str_new("User-agent: *\n"
325-                            "Disallow: /\n");
326-    }

snac の設定でどうにかできればいいですが恐らく無理.ISSUE を探すと以下のものが.404エラーが邪魔なので用意しているだけでカスタマイズしたい人は前段のhttp proxy でルールを追加する感じのようです.

ISSUE を立てた方はnginx でカスタムrobots.txt を返すようにしているようです.

Actually, I am able to work around this by returning a custom robots.txt with nginx:

location = /robots.txt {
		return 200 'User-agent: FediFetcher\nAllow: /\nUser-agent: *\nDisallow: /\n';
}

自分の環境はApache2 httpd ですが同じような設定はできるので設定してみます.

Apache2 httpd のAlias でrobots.txt を設定

以前Nitter を公開していたときにもやっていたのでこれを参考に設定します.

Apache2 httpd のsnac 部分の設定を以下のように修正しました.これでLinux ファイルシステム内の /var/lib/snac2/robots.txt が /robots.txt になるはずです.

$ sudo git diff /etc/apache2/sites-available/011-snac.kagolug.org.conf
diff --git a/apache2/sites-available/011-snac.kagolug.org.conf b/apache2/sites-available/011-snac.kagolug.org.conf
index f5b5c7f..7bb72c1 100644
--- a/apache2/sites-available/011-snac.kagolug.org.conf
+++ b/apache2/sites-available/011-snac.kagolug.org.conf
@@ -58,6 +58,11 @@
        </Location>

        Alias /static /var/www/static
+       Alias /robots.txt /var/lib/snac2/robots.txt
+       <Location "/robots.txt">
+               ProxyPass !
+               Require all granted
+       </Location>

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.

設定を確認してから反映します.

$ sudo apache2ctl configtest
$ sudo systemctl reload apache2

このファイルが,

$ sudo -u www-data cat /var/lib/snac2/robots.txt
User-agent: *
Allow: /

/robots.txt に反映されました.

$ w3m -dump https://snac.kagolug.org/robots.txt
User-agent: *
Allow: /

これで各種bot からのアクセスが許可されました.

source 書き換え

source からbuild している環境ではsource 書き換えでもrobots.txt をカスタマイズできました.でもアップデートのたびにパッチを当てるのは面倒なのでやはりproxy で設定するほうが良さそうです.

robots.txt を無くす(404 エラーがたくさんなのであまり良く無さそう)
$ git diff httpd.c
diff --git a/httpd.c b/httpd.c
index a8cd849..976fdd6 100644
--- a/httpd.c
+++ b/httpd.c
@@ -318,13 +318,6 @@ int server_get_handler(xs_dict *req, const char *q_path,
         *body  = xs_json_dumps(j, 4);
     }
     else
-    if (strcmp(q_path, "/robots.txt") == 0) {
-        status = HTTP_STATUS_OK;
-        *ctype = "text/plain";
-        *body  = xs_str_new("User-agent: *\n"
-                            "Disallow: /\n");
-    }
-    else
     if (strcmp(q_path, "/style.css") == 0) {
         FILE *f;
         xs *css_fn = xs_fmt("%s/style.css", srv_basedir);
$ w3m -dump https://snac.matoken.org/robots.txt
404 Not Found (snac/2.85)
全て許可に書き換え
$ git diff httpd.c
diff --git a/httpd.c b/httpd.c
index a8cd849..c0bcaef 100644
--- a/httpd.c
+++ b/httpd.c
@@ -322,7 +322,7 @@ int server_get_handler(xs_dict *req, const char *q_path,
         status = HTTP_STATUS_OK;
         *ctype = "text/plain";
         *body  = xs_str_new("User-agent: *\n"
-                            "Disallow: /\n");
+                            "Allow: /\n");
     }
     else
     if (strcmp(q_path, "/style.css") == 0) {
$ w3m -dump https://snac.matoken.org/robots.txt
User-agent: *
Allow: /
]]>
https://matoken.org/blog/2025/12/14/snac-robots-txt/feed/ 0