2025年12月17日 星期三

Mint Linux安裝 GlobalProtect-openconnect 完整教學

 Ubuntu/Debian 安裝 GlobalProtect-openconnect 完整教學

前言

GlobalProtect 是 Palo Alto Networks 開發的 VPN 解決方案,但官方並未提供友善的 Linux 客戶端。本文將介紹如何在 Ubuntu/Debian 系統上安裝開源的 GlobalProtect-openconnect 客戶端,它提供了完整的圖形介面,使用體驗接近官方客戶端。

什麼是 GlobalProtect-openconnect?

GlobalProtect-openconnect 是一個開源專案,基於 OpenConnect 協議實作的 GlobalProtect VPN 客戶端,具有以下特點:


✅ 完整的圖形化介面 (GUI)

✅ 支援 SAML 單一登入認證

✅ 系統托盤整合

✅ 支援多種認證方式

✅ 開源且持續更新維護


系統需求


Ubuntu 18.04 或更新版本

Debian 10 或更新版本

需要有 sudo 權限


安裝步驟

GlobalProtect-openconnect 是獨立完整的解決方案,不需要額外安裝 gp-saml-gui 或其他套件。只需要執行以下三個指令:

bash# 新增 PPA 套件庫

sudo add-apt-repository ppa:yuezk/globalprotect-openconnect


# 更新套件列表

sudo apt update


# 安裝 GlobalProtect-openconnect

sudo apt install globalprotect-openconnect

安裝過程中會自動安裝所需的相依套件,包括 OpenConnect。

啟動 GUI 介面

安裝完成後,使用以下指令啟動圖形介面:

bashgpclient launch-gui

使用方式

首次連線設定


啟動 GUI 後,在 Portal 欄位輸入您的 VPN 伺服器地址


例如: vpn.your-company.com



如果伺服器使用自簽憑證,勾選 「Ignore TLS errors」 選項

點擊 Connect 按鈕

在彈出的瀏覽器視窗中完成登入認證


輸入帳號密碼

完成 MFA 雙因素認證(如果有啟用)



認證成功後,VPN 連線會自動建立






Ubuntu 安裝 RTL8852AU USB Wi-Fi 驅動記錄

前言

最近入手了一張 ASUS USB-AX56 (USB ID: 0b05:1997) Wi-Fi 6 無線網卡,這張網卡使用的是 Realtek RTL8852AU 晶片。由於 Linux 核心預設不包含這個驅動,需要手動編譯安裝。本文記錄完整的安裝過程和遇到的問題。

系統環境

  • 作業系統: Ubuntu 23.10
  • 網卡型號: ASUS USB-AX56
  • 晶片組: Realtek RTL8852AU
  • USB ID: 0b05:1997

安裝步驟

1. 安裝編譯所需套件

首先需要安裝編譯工具和核心標頭檔:

sudo apt-get update
sudo apt-get install make gcc linux-headers-$(uname -r) build-essential git

2. 下載驅動原始碼

使用 lwfinger 維護的驅動版本(這個版本比 Realtek 官方版本更穩定):

git clone https://github.com/lwfinger/rtl8852au.git
cd rtl8852au

3. 編譯與安裝

make
sudo make install

4. 載入驅動模組

sudo modprobe 8852au

驅動載入確認

安裝完成後,可以透過以下指令確認驅動是否成功載入:

# 檢查模組是否載入
lsmod | grep 8852

# 檢查 USB 裝置
lsusb | grep ASUS

# 查看核心訊息
sudo dmesg | tail -20
成功訊息範例:
usbcore: registered new interface driver rtl8852au
rtl8852au 9-1:1.0 wlxc87f549a5c4e: renamed from wlan0

網路介面命名問題

現代 Linux 系統會使用基於 MAC 位址的可預測網路介面命名,因此 Wi-Fi 介面不會叫做 wlan0,而是類似 wlxc87f549a5c4e 這樣的名稱。

查看無線介面

# 使用 iwconfig
iwconfig
使用 ip 指令
ip link show
使用 NetworkManager
nmcli device

啟用網路介面

如果介面沒有自動啟用,手動啟用:

sudo ip link set wlxc87f549a5c4e up

設定自動連接

為了避免每次重開機都要手動啟用,需要設定自動連接:

# 查看現有連線
nmcli connection show

# 設定 Wi-Fi 連線自動連接
nmcli connection modify "你的WiFi名稱" connection.autoconnect yes

# 設定裝置自動連接
nmcli device set wlxc87f549a5c4e autoconnect yes

連接 Wi-Fi 網路

方法 1: 使用 NetworkManager CLI

# 掃描可用網路
nmcli device wifi list
連接到 Wi-Fi
nmcli device wifi connect "WiFi名稱" password "密碼"

方法 2: 使用圖形界面

安裝成功後,直接在 Ubuntu 系統設定的 Wi-Fi 選項中就能看到可用的無線網路,點擊連接即可。

核心更新後的處理

每次系統核心更新後,需要重新編譯驅動:

cd ~/rtl8852au
git pull
make clean
make
sudo make install

使用 DKMS 自動重新編譯(推薦)

DKMS (Dynamic Kernel Module Support) 可以在核心更新時自動重新編譯驅動:

# 加入 DKMS
sudo dkms add .

# 編譯
sudo dkms build rtl8852au -v 1.15.0.1

# 安裝
sudo dkms install rtl8852au -v 1.15.0.1

# 載入驅動
sudo modprobe 8852au
提示:設定完成後,之後核心更新就不需要手動重新編譯了。

疑難排解

問題 1: 執行 modprobe 後沒有錯誤,但看不到無線介面

解決方法:檢查 dmesg 訊息,確認驅動是否真的載入成功:

sudo dmesg | grep -i rtl8852

問題 2: D-Link DWA-X1850 裝置顯示為 USB 儲存裝置

如果你的裝置是 D-Link DWA-X1850,lsusb 顯示 ID 為 0bda:1a2b,表示裝置處於 USB 儲存模式。

解決方法:編輯 /usr/lib/udev/rules.d/40-usb_modeswitch.rules/lib/udev/rules.d/40-usb_modeswitch.rules,加入:
# D-Link DWA-X1850 Wifi Dongle
ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="usb_modeswitch '/%k'"

然後重新載入 udev 規則:

sudo udevadm control --reload-rules
sudo udevadm trigger

拔掉後重新插入 USB 裝置。

問題 3: 編譯時出現錯誤

解決方法:確認核心標頭檔版本與目前執行的核心版本一致:

uname -r
dpkg -l | grep linux-headers

如果不一致,安裝對應版本的標頭檔。

支援的裝置列表

這個驅動支援以下裝置(來自官方文件):

裝置名稱 USB ID
BUFFALO WI-U3-1200AX2(/N) 0411:0312
ASUS USB-AX56 0b05:1997 或 0b05:1a62
EDUP EP-AX1696GS 0bda:8832
Fenvi FU-AX1800P 0bda:885c
D-Link DWA-X1850 2001:3321
TP-Link AX1800 2357:013f 或 2357:0141
ipTIME AX2000U 0bda:8832
ELECOM WDC-X1201DU3 056e:4020
Realtek 展示板 0bda:8832, 0bda:885a, 0bda:885c

效能測試

安裝完成後測試連接速度,在 Wi-Fi 6 路由器下:

  • 連接速度: 1200 Mbps (理論值)
  • 實際下載速度: 約 600-800 Mbps
  • 延遲: 穩定在 2-5ms
  • 訊號強度: 表現良好

結論

雖然 Linux 對於較新的硬體支援需要手動安裝驅動,但整個過程並不複雜。lwfinger 維護的這個驅動版本相當穩定,安裝後運作正常,效能表現也很好。建議使用 DKMS 來管理驅動模組,可以省去核心更新後手動重新編譯的麻煩。

參考資源

本文記錄於 2024 年 12 月,使用 Ubuntu 23.10 系統

2025年12月13日 星期六

在 Mint Linux 21.3 (Ubuntu 22.04 LTS) 裝嘸蝦米 with fcitx4

想在 Mint Linux 上安裝嘸蝦米,簡單來說

在 Mint Linux 21.3 (Ubuntu 22.04 LTS) 裝嘸蝦米 with fcitx 4

在 Mint Linux 22.1 (Ubuntu 24.04 LTS) 裝嘸蝦米 with fcitx 5

=====================================================

Mint Linux 22.1 安裝很簡單,只要在「軟體管理員」搜尋 fcitx5-table-boshiamy

安裝好後重新登入,在 Fcitx 設定裡就可以看到嘸蝦米可選,並將其加入。

=====================================================

在 Mint Linux 21.3 則要用指令的方式

sudo apt update
sudo apt install fcitx fcitx-table-boshiamy im-config


若你曾經裝過fcitx5,須先移除後再裝一次
sudo apt purge fcitx5* im-config

安裝好後輸入 im-config 來設定選擇以 fcitx 作為輸入器


======================================================

22.1 安裝方式乃參考jute的
[無需指令] 在 Linux Mint 22.1 Cinnamon 上安裝嘸蝦米輸入法
https://jute.im/boshiamy/installing-boshiamy-on-linux-mint-22-1-cinnamon-without-any-command/
Linux 與嘸蝦米(feat. Fcitx)
https://jute.im/boshiamy/my-review-of-installing-fcitx-with-boshiamy-table-on-linux/




2025年9月16日 星期二

Win10, set default browser by registry

modify regesitry, set default browser

 reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge /v DefaultBrowserSettingEnabled /t REG_DWORD /d 0 /f

2024年6月20日 星期四

Fix Git CRLF issue

git config --global core.autocrlf input


 https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf



https://www.huanlintalk.com/2011/05/git-coreautocrlf.html

2024年5月27日 星期一

Use nvm-windows but not able to switch to correct node version

 Install NVM-Windows

remove the nodejs windows version

nvm install 18

nvm ls (see 18)

nvm use 18 (say used)

node -v

'node' is not recognized as an internal or external command,

operable program or batch file.

solve: Go to C:\Programs\nodejs

remove the folder C:\Programs\nodejs

then check again will success

2023年2月14日 星期二

NET::ERR_CERT_INVALID 頁面沒有繼續前往XXX網站的連結

 開啟一個沒有SSL的網站,會被 Chrome 認為是不安全的網站,由於憑證不被信任的關係會出現錯誤代碼 NET::ERR_CERT_INVALID

若已知是安全的,通常點擊「進階」會出現「繼續前往 XXXX 網站(不安全)」後就能進入



但有時候不知為何Chrome會擋住,連點擊的連結都消失了,例如下圖:


別緊張,這時候在網頁空白處,點擊一下,並輸入「thisisunsafe」,就可以連線了喔!







2021年10月26日 星期二

Docker Desktop Upgrade Failed

 

Docker Desktop Upgrade Failed



Here is a new update version could install

Click Install & Restart but not working.


Or select "Download update" to upgrade Docker Desktop


It starts to downloading, but always failed or no response.


Says installation failed.



The problem might be the service won't stop, let us stop it manually.


Go to Windows Services, find out Docker Desktop Service, then stop it.



Then it's stoping.


Download install file from official website: 
Docker Desktop


Execute the install package, start to install.


If you see it's unpacking, sound good.



It might occur some warning, ignore it.



Finally, the installation succeeded.



Chck out the About dialog, it's updated.


2021年8月7日 星期六

How to remove OneDrive 如何移除

Terminated process first.
(首先停止正在執行的OneDrive程序)

 taskkill /f /im OneDrive.exe

According to your OS type:
(根據OS版本)

open cmd with administrator permission
(以系統管理員身份執行)

32bit
%SystemRoot%\System32\OneDriveSetup.exe /uninstall

64bit
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

2021年5月4日 星期二

Webstorm can't resolve module with vue-cli, setup webpack config for alias. 解決Webstorm無法解析路徑的問題

WebStorm can't resolve alias if project created by vue-cli.

Because vue-cli didn't set up via webpack, the alias can't resolved without webpack config.

To fix this problem, we can specify a webpack config for WebStorm to recognize alias.

[Setting] > [Language & Frameworks] > [JavaScript] > [Webpack]



Here are my references.

[1] https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000556284/comments/360000093780

[2] https://juejin.cn/post/6844903802185891848

[3] https://cli.vuejs.org/guide/webpack.html#inspecting-the-project-s-webpack-config


Updated

In unknown problem, all above action can't fix the resolution issue. But I found some trick: Go to any *.vue file, move to import block, right click on any component then install it. And it will solved. Unbeleible. Amazing.


Updated-2

No need to set webpack config because it always says: 
Can't analyse webpack.config.js: coding assistance will ignore module resolution rules in this file.
The rest current setting: node_module was excluded. src was rescouce root.
Rewritre vue.config.js, let it re-index, then it can resolved correctly.
I rewrite 

config.resolve.alias
.set('@img', path.resolve(__dirname, 'src/asset/images'))
.set('@common', path.resolve(__dirname, 'src/components/common'))
.set('Source', path.resolve(__dirname, 'src'));
to
config.resolve.alias
.
set('_img', path.resolve(__dirname, 'src/asset/images'))
.
set('_common', path.resolve(__dirname, 'src/components/common'))
.
set('Source', path.resolve(__dirname, 'src')); then re-write back
config.resolve.alias
.set('@img', path.resolve(__dirname, 'src/asset/images'))
.set('@common', path.resolve(__dirname, 'src/components/common'))
.set('Source', path.resolve(__dirname, 'src'));

Updated-3

[Setting] > [Language & Frameworks] > [JavaScript] > [Webpack]
=> Set as Automatic.


Select node_module folder, right click to popup menu, click "Optimize Imports"
=> it's work!

Or, select "src" root, do "Optimize Imports".
=> it's work!

Or, select any single *.vue, do "Optimize Imports".


[1] https://youtrack.jetbrains.com/issue/WEB-27933



2021年4月1日 星期四

解決執行Bat檔案,第一行是亂碼。不是內部或外部命令、可執行的程式或批次檔。


 如上圖,每次執行BAT檔第一行一定會出現亂碼報錯。

這有可能是該BAT檔的文件編碼選到UTF-8。

要正確顯示BAT檔,需改成ANSI格式。

可利用Notepad++或以記事本開啟BAT檔後另存新檔時將編碼改選為ANSI

以上

2021年1月22日 星期五

Turn on HPET

How to TURN ON HPET

[Credit] NavJack27 

 to enable HPET - bcdedit /set useplatformclock true

to disable HPET - bcdedit /deletevalue useplatformclock

2021年1月12日 星期二

AWS S3 SDK 下載物件時強迫設定 Content-Disposition 為 attachment

 串AWS S3 SDK時

要下載一個項目,使用 Signature的下載方式

const getS3SignedDocumentURL = (docName) => {
  const url = s3.getSignedUrl('getObject', {
    Bucket: <aws-s3-bucket-name>,
    Key: <aws-s3-object-key>,
    Expires: <url-expiry-time>,
  });

  return url;
};
但會因為檔案預設的 Content-Type 被 Browser 處理(例如txt就直接打開)
所以需要指定一個 Content-Disposition
兩個方法
1.在網址後加上
String url = serverURL+'/'+bucketName+'/'+codedFilename+'?response-content-disposition='+EncodingUtil.urlEncode('attachment; filename=abc.doc','UTF-8')+'&AWSAccessKeyId='+awskey+'&Expires='+Lexpires+'&Signature='+codedsigned;

然後含這串signed的文字給後端去算signed

2.直接在Header裡加上ResponseContentDisposition: 原因是若後端已經拿算好的URI去計算Signed的話,只能靠在呼叫AWS s3 sdk 時加上ResponseContentDisposition
const getS3SignedDocumentURL = (docName) => {
  const url = s3.getSignedUrl('getObject', {
    Bucket: <aws-s3-bucket-name>,
    Key: <aws-s3-object-key>,
    Expires: <url-expiry-time>,
    ResponseContentDisposition: `attachment; filename="${docName}"`
  });

  return url;
};


參考資料https://stackoverflow.com/questions/59684182/s3-presigned-url-multiple-content-disposition-headers
https://stackoverflow.com/questions/19046718/aws-s3-force-file-download-using-response-content-disposition

2020年11月6日 星期五

SSD Format 4K using command

進入command模式
shift+F10

或直接windows cmd
cmd

打開diskpart
diskpart

列出硬碟清單,找出要操作的編號
list disk

選擇硬碟
select disk 0

清除硬碟
clean

初始化磁區
create partition primary align=1024

列出磁區,找出要操作的編號
list partition

選擇磁區
select partition 1

啟用磁區
active

格式化
format fs=ntfs unit=4096 quick

2020年11月4日 星期三

「調校」 透過關閉一些服務解決 Windows 10 CPU 使用率高的問題

https://zi.media/@yidianzixun/post/pbnXDf

簡單來說關閉以下服務
1. Connected User Experiences and Telemetry
2. Diagnostic Policy Service
3. Diagnostic Service Host
4. Diagnostic System Host

關閉P2P的windows update
1. 在找到最佳化傳遞並關掉它

關閉

[工作排程器]-[Microsoft]-[Windows]-[Application Experience]刪除或停用[Microsoft Compatibility Telemetry]排程



還有一些優化
關閉Windows Search
關閉superfetch(現叫sysmain)
關閉虛擬記憶體
https://kknews.cc/zh-tw/news/e4v5ejy.html


提高指定程式的優先權
https://superuser.com/questions/620724/changing-windows-process-priority-via-command-line

wmic process where name="node.exe" CALL setpriority "above normal"
wmic process where name="webstorm64.exe" CALL setpriority "above normal"

之類的

2020年8月27日 星期四

bash 的載入順序

打開bash後,要編寫變數可以寫在 ~/.bash_profile 或 ~/.bashrc。

也許還聽過 /etc/profile

位置不同但效果相同,有想過這些順序和情境到底怎麼使用嗎?

  • /etc/profile
  • ~/.bash_profile
  • ~/.bashrc
  • ~/.bash_login
  • ~/.profile
  • ~/.bash_logout
// 一般順序
execute /etc/profile
IF ~/.bash_profile exists THEN
    execute ~/.bash_profile
ELSE
    IF ~/.bash_login exist THEN
        execute ~/.bash_login
    ELSE
        IF ~/.profile exist THEN
            execute ~/.profile
        END IF
    END IF
END IF
// 互動登出
IF ~/.bash_logout exists THEN
    execute ~/.bash_logout
END IF
//互動式非登入
IF ~/.bashrc exists THEN
    execute ~/.bashrc
END IF


參考文章在此

Execution sequence for .bash_profile, .bashrc, .bash_login, .profile and .bash_logout

 https://www.thegeekstuff.com/2008/10/execution-sequence-for-bash_profile-bashrc-bash_login-profile-and-bash_logout/

2020年6月30日 星期二

Enable shutdown button on windows logon screen

For Windows 7 & 10 Regedit \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System shutdownwithoutlogon 1: Enable 0: Disable

2020年6月29日 星期一

[Git] unable to get local issuer certificate 解決

假設 git pull 時遇到

Cloning into 'project'...

fatal: unable to access 'https://myproject.mattmytech.com:31001/project/project.git/': SSL certificate problem: unable to get local issuer certificate



有一個簡單但不安全的作法就是暫時關掉 HTTPS SSL 的檢查
git config --global http.sslVerify false


如果不要全域就拿掉 global
git config http.sslVerify false


再次 pull code 就成功了

但要記得你把 sslVerify 關了喔!

2020年6月18日 星期四

不建議在 Windows 10 中關閉固態硬碟的磁碟重組(Trim)

在 Windows 10,相信大部份使用者是使用 SSD (固態硬碟)。
為了避免不必要的操作 SSD。可以照下列步驟關閉「磁碟重組」這項功能。
但是 Windows 10 系統會自動判斷磁碟硬體是固態硬碟或傳統硬碟,若是固態硬碟所執行的為 Trim 指令,傳統機械硬碟才是 Defrag 重組。

根據狐大的介紹,我們還是不要去動這些設定比較好!
參考連結:https://www.fox-saying.com/blog/post/47402717





1. 在開始的地方輸入「重組」就能快速找到系統內建的重組工具




2. 選擇每個「固態硬碟」並點選右下側的變更設定




3. 取消勾選「依排程執行」



所以結論就是:固態硬碟就讓 Windows 10 自動最佳化。傳統機械硬碟就由使用者自行決定是否要自動重組。

2020年6月1日 星期一

移除Win10檔案總管中 [3D物件][文件][桌面][音樂] 那些不想看到的資料夾

移除Win10檔案總管中 [3D物件][文件][桌面][音樂] 那些不想看到的資料夾

參考1 https://zhuanlan.zhihu.com/p/25942015
參考2 https://www.howtogeek.com/331361/how-to-remove-the-3d-objects-folder-from-this-pc-on-windows-10/

// Remove 64
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

// Restore 64
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

// Remove 32
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

// Restore 32
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

最後將檔案存成 .reg 即可