FrontPage
みよ@わさもん.ねっと
遊んだこととか、ちょっとしたメモを書いています。
最近の更新
Diary/2026-2-23 / Diary/2026-2-22 / Diary/2026-2-21 / Diary/2026-2-19 / Diary/2026-2-13
Miyo's Diaryの最新の5件
2026-2-23
akonadiでカレンダみてみる
KOrganizerのバックエンドであAkonadiにSQLiteでアクセスできるようなので,
Python使ってアクセスしてみた.
とりあえずベーシックにはこんな感じ.
SQL文でデータ減らせるのが望ましいけど,複雑な条件書くのも面倒だよね,という感じ.
ちなみに,PartTableはblob形式で文字列ではないので注意.
import os
import sqlite3
from icalendar import Calendar
from datetime import datetime, date
import pytz
def main():
db = f'{os.environ["HOME"]}/.local/share/akonadi/akonadi.db'
conn = sqlite3.connect(db)
cur = conn.cursor()
cur.execute(f'''
SELECT p.id,
CAST(pt.data AS TEXT)
FROM PimItemTable p
JOIN PartTable pt ON pt.pimItemId = p.id
WHERE p.mimeTypeId = 3
AND instr(pt.data, 'BEGIN:VCALENDAR') > 0
''')
count = 0
for item in cur:
count += 1
k,v = item
print(v)
print(f'#. of items = {count}')
if __name__ == '__main__':
main()
ちょっとビューワ作ってみようかと思ったけど,
繰り返しの予定(RRULE)で,日付が変更になったり取消しがあったりするものの扱い(RECURRENCE-ID,EXDATE)や
複数の日に渡る終日の予定など,結構,扱いが面倒なものがあって,一旦ペンディング.
ちなみに,データの更新は,
busctl --user call org.freedesktop.Akonadi.Agent.akonadi_google_resource_0 / org.freedesktop.Akonadi.Resource synchronize busctl --user call org.freedesktop.Akonadi.Agent.akonadi_google_resource_2 / org.freedesktop.Akonadi.Resource synchronize
とした.
ここで,引数の,
org.freedesktop.Akonadi.Agent.akonadi_google_resource_0
と,
org.freedesktop.Akonadi.Resource synchronize
は,
busctl --user list | grep Akonadi
で得られた結果
org.freedesktop.Akonadi.Agent.akonadi_google_resource_0 876669 akonadi_google_ miyo :1.854 session-c3.scope c3 -
をみて,さらに,
busctl --user introspect org.freedesktop.Akonadi.Agent.akonadi_google_resource_0 /
とすると,
org.freedesktop.Akonadi.Resource interface - - - .name method - s - .requestItemDelivery method axaay - - .setName method s - - .synchronize method - - no-reply .synchronizeCollection method x - no-reply .synchronizeCollection method xb - no-reply .synchronizeCollectionAttributes method x - no-reply .synchronizeCollectionTree method - - no-reply .synchronizeRelations method - - no-reply .synchronizeTags method - - no-reply .attributesSynchronized signal x - - .collectionTreeSynchronized signal - - - .nameChanged signal s - - .synchronized signal - - -
と,して探し出す.
2026-2-22
自転車出勤
天気が良いようなので久しぶりに.
今日は,少し遠回りになるけど分かりやすい道を選んでのんびりと.
おかげで,会社についてすぐに仕事に取りかかれる程の疲労感.
2026-2-21
KOrganizer
個人で取得しているGoogleアカウントとQ社のGoogle Workspaceのカレンダを
切り替えるのが面倒と思いながらも,
Q社のGoogle Workspaceで独自のOAuthトークン取るのが面倒(仕事用なのでなんか違う気もする)
という状況で,両方のカレンダをうまく閲覧する解決策を思いついてなかった.
正確に言うとmacOSやiPadのカレンダアプリは便利だなと思いながら,
普段の生活環境がLinuxなのでどうにかならないかなと思っていた.
というところで,KDEのakonadiだと独自にOAuthトークンとらなくても
認証通せるようなので,akonadiとkorganizer環境を作ってみることに.
ホストはXUbuntu 24.04.インストールは,
sudo apt install korganizer akonadi-backend-sqlite
でOK.
korgnaizerを起動して,Settings -> Configure KOrganaizer...で設定ダイアログひらいて,
GeneralのCalendarsでGoogleカレンダを登録する.
とりあえず,どちらのカレンダも表示することができた.
しばらく生活してみるか.
しかし,OkularといいKOrganaizerといい,随分KDEアプリが増えてきた.
そのうち,デスクトップ環境をKDEに移行するかなあ.
ちなみに,akonadiのDBは,SQLiteなので,sqlite3で叩ける.
$ sqlite3 ~/.local/share/akonadi/akonadi.db sqlite> .database main: /home/miyo/.local/share/akonadi/akonadi.db r/w sqlite> .tables CollectionAttributeTable PimItemTagRelation CollectionMimeTypeRelation RelationTable CollectionPimItemRelation RelationTypeTable CollectionTable ResourceTable FlagTable SchemaVersionTable MimeTypeTable TagAttributeTable PartTable TagRemoteIdResourceRelationTable PartTypeTable TagTable PimItemFlagRelation TagTypeTable PimItemTable sqlite> SELECT COUNT(*) FROM PimItemTable;
とか.楽しいかも.
2026-2-19
T2UB Nano
Ryzen 7 5825UでセットアップしたPCでは,
UGREEN WiFiアダプタ(AX900)を使っていたけど,
どうも動作が不安定なことがあるのでtp-linkのT2UB Nanoを試すことに.
ドライバは,https://github.com/lwfinger/rtw88 から.
git clone https://github.com/lwfinger/rtw88 cd rtw88 make sudo make install sudo make install_fw sudo make sign-install
とした.Bluetoothもうまく動いたのでBSBT5D200BKもお役ご免に.とてもすばらしい.
lsusbの結果はこんな感じだった.
Bus 003 Device 004: ID 0bda:c820 Realtek Semiconductor Corp. 802.11ac NIC Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 [unknown] bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x0bda Realtek Semiconductor Corp. idProduct 0xc820 802.11ac NIC bcdDevice 2.00 iManufacturer 1 Realtek iProduct 2 802.11ac NIC iSerial 3 123456 bNumConfigurations 1 Configuration Descriptor: ...
2026-2-16
systemd-resolved
になってから,DNS設定が必要なときにはアドホックに対応していた
(/etc/resolv.confを一時的に書き換えたりしてた)のだけど,
VPNなんかでいろんな環境を利用することも増えてきたので,そろそろちゃんとした手順を覚えておきたい.
覚えるべきは resolvectl コマンド.
このコマンドの存在は,man systemd-resolved でもわかる.
簡単には,
resolvectl status
で,
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (wlp0s20f3)
Current Scopes: DNS
Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.100.1
DNS Servers: 192.168.100.1
Link 3 (docker0)
Current Scopes: none
Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 5 (vboxnet0)
Current Scopes: none
Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
とかでてくる.
書き換えければ,たとえば,
resolvectl dns 2 8.8.8.8
と,dnsコマンド使って,リンク先にDNSサーバーを設定できる
resolvectl status
で見てみると,
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (wlp0s20f3)
Current Scopes: DNS
Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 8.8.8.8
DNS Servers: 8.8.8.8
Link 3 (docker0)
Current Scopes: none
Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 5 (vboxnet0)
Current Scopes: none
Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
と,書き換わっていることがわかる.
同様に,domainコマンドでドメイン名(resolv.confのsearch)の設定ができる.