電子發票Turnkey 3 無法在ARM cpu上執行UI介面-解決方式

Turnkey 3 linux版本,裡面的javafx並未支援aarch64 cpu的元件,原本的javafx 11版也未有可用的元件,所以可以直接把javafx 更新至17.07 LTS版本,支援jdk11 ,再向上就無法使用jdk11開啟了。

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /home/yku/.openjfx/cache/11-ea/libprism_es2.so: /home/yku/.openjfx/cache/11-ea/libprism_es2.so: 無法開啟共用物件: 沒有此一檔案或目錄 (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)
java.lang.UnsatisfiedLinkError: /home/yku/.openjfx/cache/11-ea/libprism_es2.so: /home/yku/.openjfx/cache/11-ea/libprism_es2.so: 無法開啟共用物件: 沒有此一檔案或目錄 (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2445)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2501)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2700)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
	at java.base/java.lang.Runtime.load0(Runtime.java:768)
	at java.base/java.lang.System.load(System.java:1837)
	at javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:217)
	at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:197)
	at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:138)
	at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
	at javafx.graphics/com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:63)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at javafx.graphics/com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:52)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
	at java.base/java.lang.Thread.run(Thread.java:829)

可以建一個maven專案來下載需要的元件,其它classifier不使用的話會下載windows平台的元件,使用<classifier>linux</classifier>會下載AMD平台的linux元件,<classifier>linux-aarch64</classifier>就可以下載支援arm cpu的元件了,可由C:\Users\users\.m2\repository\org\openjfx找到需要的元件。

Read More

docker xrdp遠端桌面

在docker裡安裝rdp,這裡有二個範例,一個是ubuntu為範本製作的,另一個使用rockylinux為基底,基本上可使用注音及倉頡輸入法、中文字型及firefox browser。

catyku/UbuntuXRDP: with chinese input ime and firefox (github.com)

catyku/RockyLinux9XRdpDocker: RockyLinux 9 install xrdp to docker (github.com)

rockylinux (centos)為基底的image,很多UI應用程式都可以使用yum 直接安裝。

而以ubuntu為基底的image,因為ubuntu本身UI應用程式都需要使用snap都支持,安裝上就相對比較麻煩。

docker run -d --name containerName -p 3389:3389 catyku/ubuntu-xrdp:22.04 createUser password rootYesNo
docker run -d --name containerName -p 3389:3389 catyku/rockylinuxrdp createUser password rootYesNo

之後就可以使用遠端桌面連入docker裡了

ubuntu 22.04 安裝clamav防毒軟體

當在使用 Ubuntu 22.04 時,可能需要安裝 ClamAV 來檢查系統中是否有病毒和惡意軟體。在本篇文章中,將介紹如何安裝 ClamAV,以保護 Linux 系統免受惡意軟體和病毒的侵害。

  • 首先,打開終端terminal機並更新系統。請輸入以下命令:
sudo apt update && sudo apt upgrade
  • 接下來,輸入以下命令以安裝 ClamAV:
sudo apt install clamav clamav-daemon -y 
  • 安裝完成後,可以執行以下命令來更新 ClamAV 的病毒定義庫:
sudo freshclam
  • 接下來,可以使用以下命令來掃描您的系統:
sudo clamscan -r /path/to/folder
  • 如果希望 ClamAV 在系統啟動時自動運行,請使用以下命令:
sudo systemctl enable clamav-daemon

這將自動啟用 ClamAV 並在系統啟動時運行。

Kobo clara hd電子書閱讀器更換記憶卡

Kobo clara hd原本內建的使用class 4 8G SDCard(SanDisk),在寫入及讀取上表現上並不理想,如果只拿來存放電子書容量應該十分足夠了,不過如果需要拿來閱讀漫畫,可能沒多久就滿了。

不管在容量及速度上都可以考慮昇級一下原本的記憶體。參考的資料如下:

Hacking the Kobo Clara HD

1.關閉電源

長按電源鈕關閉主機

2.打開(移除)背蓋

利用一字螺絲起子或是會員卡(建議)從電源按鈕處小心翹開

Read More

postgresql安裝設定筆記

1.centos server安裝方法,參考以下連結

https://www.postgresql.org/download/linux/redhat/

2.遠端連線方法

如果連線client要安裝跟server一起,則此點可不用設定,就像是phpMyAdmin的使用方式

  • 打開及設定防火牆,增加一個firewall zone
  • 修改postgresql listen_address
  • 修改postgresql 客戶端憑證控制檔pg_hba.conf
nano /var/firewalld/zones/vpn.xml #內容如下
firewall-cmd --reload
firewall-cmd --list-all-zones
<zone>
<short>OpenVPN</short>
<description>OpenVPN network firewall</description>
<source address="10.8.0.0/24"/>
<service name="postgresql" />
</zone>
nano /var/lib/pgsql/11/data/postgresql.conf #內容如下
#修改要監控的ip,使用分號區格
listen_addresses='localhost,10.8.0.1'   
nano /var/lib/pgsql/11/data/pg_hba.conf
#增加授權連線的remote
host    all     all     10.8.0.0/24     md5
#重啟postgresql 11
systemctl restart postgresql-11
Read More