2025/9/2

mediawiki 升級

到 special page (特殊頁面) 去,然後把網址的 : 後面改 "Version" 就會出現版本頁面,例如
  • http://192.168.145.166:9090/index.php/Special:Version
所以知道版本是
  • MediaWiki: 1.25.2
  • PHP: 5.3.3
  • MySQL:5.1.73
安裝的套件有
  • Image Map
  • WikiEditor: 0.4.0
Tag Extension 有:
gallery,imagemap,indicator,nowiki 和 pre

把原 server 的文章,user account 倒出來
mysqldump -u wikiusername -p wikipassword > wikidb.sql
把upload 的 image 倒出來
tar -zcvf wikiimage.tar.gz /path/to/mediawiki/imagepath
這個path 在 LocalSetting.php 中的變數定義
$wgUploadDirectory=/var/lib/www/mediawiki/

2025/8/21

codex-cli

codex 安裝就跟 claude-code, gemini-cli 依樣,用 npm
npmm i -g @openai/codex
authentication 依樣會開browser,但是在 headless server (console only)就不能用以前gemini-cli 的方法。
codex提供更簡單的方法: 就是把 auth 過的機器上的 ~/.codex/auth.json copy 到要 auth 的機器上就可以了。

和 claude-code 的比較:
  • codex-cli 有明顯的"thinking"時間,以default model: gpt5-medium 來說,隨便一個簡單小命令都會花 30sec以上的thinking 時間,改用gpt-5 low 也要10sec以上,claude-code大部分回應都很快,幾乎是立即,少數會等待5,6 sec。
  • utility script: 以產生某工作的 script 來看(舉例來說:生成一個在 ubuntu 24.04 server 安裝 docker service 和 nvidia-container-toolkit),claude-code 的 script 比較接近真人寫的,比較容易了解,codex-cli 的 script 比較複雜,比較難了解。雖然script 達成的結果一樣
  • 解決問題/bug時,claude-code解決bug後會自動全面展開,找還有沒有類似的bug沒修正,codex-cli 則是遇到一個改一個。
  • claude-code 有搜尋網路的能力,需要的時候,claude-code 會自動搜尋需要的api 文件,codex-cli 不行,他說因為安全問題,它沒有access internet 的權限,其實這是用mcp agent來達成,不是權限問題。
  • 對於Android 系統和 application 的知識,還是 gemini-cli 最高,codex-cli 反覆debug 的問題,gemini-cli 馬上就找到問題點。
整體來看就是:claude-code 的動作和寫的code比較接近software engineer,codex-cli 則比較像 llm ,猜這是因為 prompting 的關係,codex-cli 可能還在開發中,所以 prompting, mcp agent都寒不完整
codex-cli 目前快速改版中,應該會越來越好。

codex-cli 無法搜尋的解法,就是請它給一個prompt,讓我訊問 chatgpt,之後再把reply 貼回 codex-cli
gemini-cli 也有搜尋能力,是用 mcp:websearch 作到,所以能在無網路存取能力下作到 search internet.

本來以為不會遇到的:
🖐 You've hit your usage limit. Upgrade to Pro (https://openai.com/chatgpt/pricing), 
   or wait for limits to reset (every 5h and every week.).


25/08/27

0.24.0 更新,果然增加 websearch 功能了,thinking 的內容也不輸出了。

2025/7/22

$ python3 development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libcrypto
....
error: external/crosvm/rutabaga_gfx/Android.bp:59:1: "rutabaga_gfx_test_src_lib" depends on undefined module "libgfxstream_backend".
Or did you mean ["libfastdeploy_host" "libtistress-defaults" "slab_test_tests_slab" "zlib_deflate_fuzzer" "zlib_fuzz_defaults" "zlib_inflate_fuzzer"]?
error: external/crosvm/rutabaga_gfx/Android.bp:13:1: "librutabaga_gfx" depends on undefined module "libgfxstream_backend".
Or did you mean ["libfastdeploy_host" "libtistress-defaults" "slab_test_tests_slab" "zlib_deflate_fuzzer" "zlib_fuzz_defaults" "zlib_inflate_fuzzer"]?
..
要加上 -product
python3 development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libcrypto -product rk3576_u

2025/7/7

TP-LINK TL-WN725N, RTL8188EU , on ubuntu 24.04

是 ubuntu-24.04-preinstalled-server-arm64-orangepi-5-plus...
dmesg
[  954.209502] usb 4-1: new high-speed USB device number 4 using ehci-platform
[  954.355029] usb 4-1: New USB device found, idVendor=0bda, idProduct=8179, bcdDevice= 0.00
[  954.355048] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  954.355058] usb 4-1: Product: 802.11n NIC
[  954.355067] usb 4-1: Manufacturer: Realtek
[  954.355075] usb 4-1: SerialNumber: 00E04C0001
[  954.499151] usb 4-1: RTL8188EU rev D (TSMC) romver 0, 1T1R, TX queues 2, WiFi=1, BT=0, GPS=0, HI PA=0
[  954.499173] usb 4-1: RTL8188EU MAC: e8:94:f6:0b:34:f5
[  954.499184] usb 4-1: rtl8xxxu: Loading firmware rtlwifi/rtl8188eufw.bin
[  954.499387] usb 4-1: Firmware revision 11.1 (signature 0x88e1)
[  955.112461] rtl8xxxu 4-1:1.0 wlxe894f60b34f5: renamed from wlan0
原來 loading firmware failed,所以
apt install firmware-realtek
他說是 virtual package,選一個 armbian-firmware,install 玩重新插拔 wifi usb.dmesg 就完成了。
然後 ip link 就可以看到 wlxe894f60b34f5

然後開始
harles-chang@orangepi5-plus:~$ nmcli device wifi list
IN-USE  BSSID              SSID                 MODE   CHAN  RATE        SIGNAL>
        54:78:C9:D4:03:EE  123456789012         Infra  1     65 Mbit/s   100   >
..
然後就可以連線了:
sudo nmcli device wifi connect "ssid" password "thepassword"

2025/7/2

gemini cli, ssh 通過auth

ref: 使用 gemini-cli 要先通過google account 認證。auth 的時候會開啟 browser。
但是在 ssh remote 就沒辦法開啟。
所以可以用上面 ref 的方法。
但是第一步browser 開啟的url 可以直接用 "gemini --debug" 模式啟動 gemini,就會在auth 的時候把 url 印出來。
copy 出來用 browser 打開,login google account, sign in 後,browser 會被重導到一格localhost 的位址,把這個位址 copy 下來。
用 ref 的方法,到 ssh remote 去用 curl 打開就可以。

做上面的事情的時候,gemini 都不能關掉,一職到 gemini 由 waiting 變成 authorize 後才可以關掉。



25/7/16 update

果然 cli 然後要人家開browser未免太無...
所以 0.1.11 版之後,支援no browser
NO_PROWSER=true gemini
這樣啟動後,就會出現一個 url,要你用 browser 去 login,login 玩會顯示一個 code,把她貼回來。

2025/7/1

Windows 登入 Samba 一直失敗

Windows 的網路芳鄰就是很多事,又蠢。
所以常常發生記住錯誤認證,導致無法登入 samba share 的問題,處理這種問題真是浪費生命。

處理方法就是就是把windows 記住的認證/連線刪除。
要用 net use
C:\net use
狀態       本機        遠端                    網路

-------------------------------------------------------------------------------
OK           N:        \\ABC\abc                 Microsoft Windows Network

中斷連線               \\192.168.145.150\MyShare Microsoft Windows Network
命令已經成功完成。
刪除 150 那個
C:\net use \\192.168.145.150\MyShare /delete
\\192.168.145.150\MyShare 已經刪除。
這樣,在重新開啟 檔案夾,用 \\192.168.145.150\charles-chang 加上 username,確保跟 username 比對。
dialog 又會出現 default,錯的 workgroup,username用 \\workgroup\charles-chang 指定用 workgroup (samba defatul)。
之後dialog 就會一直說你錯,但是你就一直按確認,大約3次,他就認輸了,用你心輸入的 username/password 登入。

軟體開發人員還是不要再用windows 了....

2025/6/28

some memo, gen key, sign key and gradlew

apksigner 在
./out/host/linux-x86/bin/apksigner 
要用 java 來run,所以要設定好 JAVA_HOME 和 PATH。
在 AOSP 中,lunch 完就都設定好了。
在 AOSP 中signkey 就是:
./out/host/linux-x86/bin/apksigner sign --key build/target/product/security/platform.pk8 \
--cert build/target/product/security/platform.x509.pem \
--out ~/SysApp-signed.apk \
out/target/product/vsoc_x86_64_only/system/priv-app/SysApp/SysApp.apk
platform.pk8 在
./build/make/target/product/security/platform.pk8
./build/make/target/product/security/platform.x509.pem
AOSP 中 OTA 相關的 generate key 說明:Sign build for release

可以使用這個 app 來測試 privilege 的權限:

使用 android-studio 的 java - jetbrain runtime,是在 android-studio/jbr,所以要用 gradlew build 的話,在console就要指定 JAVA_HOME
~/sysapp$ JAVA_HOME=~/android-studio/jbr ./gradlew -version

------------------------------------------------------------
Gradle 8.13
------------------------------------------------------------

Build time:    2025-02-25 09:22:14 UTC
Revision:      073314332697ba45c16c0a0ce1891fa6794179ff

Kotlin:        2.0.21
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM:  21.0.6 (JetBrains s.r.o. 21.0.6+-13391695-b895.109)
Daemon JVM:    /home/charles-chang/android-studio/jbr (no JDK specified, using current Java home)
OS:            Linux 6.11.0-28-generic amd64
這個 folder 是android studio sync 丸的 folder,也就是說 gradle/wrapper/ 下 download 好是當版本的 gradle-wrapper.jar 和 gradle-wrapper.properties



叫 geminil-cli 找到 Makefile 中 signkey 的地方:

Here's a high-level overview of how it works:
  • Build APKs: The build system first compiles your application's source code and resources to create an unsigned APK file.
  • Create Target Files Zip: The build system then creates a "target files" zip archive. This zip file contains all the files that will be included in the final
    system image, including your unsigned APK.
  • Sign Target Files: The sign_target_files_apks script is then called. This script takes the unsigned target files zip as input, signs all the APKs within it usingn
    the keys specified in build/target/product/security/, and produces a new, signed target files zip.
  • Create System Image: Finally, the build system uses the signed target files zip to create the system.img and other partition images.
The following snippet from /mnt/ssd2t/charles-chang/aosp/build/make/core/Makefile (around line 5623) shows how the sign_target_files_apks script is called:
   1 .PHONY: signed-target-files
   2 signed-target-files: $(BUILT_TARGET_FILES_PACKAGE)
   3    @echo"Package target files: $@"
   4 $(hide) ./build/make/tools/releasetools/sign_target_files_apks.py \
   5        --default_key_mappings build/make/target/product/security \
   6       $(INTERNAL_OTA_SIGNING_ARGS) \
   7        -o$(OPTIONS_RECOVERY_AS_BOOT) \
   8       $(BUILT_TARGET_FILES_PACKAGE) $@
In this rule:
  • $(BUILT_TARGET_FILES_PACKAGE) is the unsigned target files zip.
  • ./build/make/tools/releasetools/sign_target_files_apks.py is the signing script.
  • --default_key_mappings build/make/target/product/security tells the script to use the keys in your build/target/product/security directory.
  • $@ represents the output file, which is the signed target files zip.
This signed zip is then used by other parts of the build system to generate the final system images.