2023-01-04

Linux Lutris 安裝 Battle.net 及 World of Warcraft (WOW)

安裝過程中遇到了一些雷,把解決過程順便紀錄下來。
  1. 從lutris按左上的+號,找尋lutris上的遊戲,找battle.net並安裝,安裝時可參考https://github.com/lutris/docs/blob/master/Battle.Net.md
    https://github.com/lutris/docs/blob/master/InstallingDrivers.md

  2. 因預設用的wine版本是lutris-7.2-2-x86_64,啟動battle.net介面時會直接噴錯,中間有改用wine 8.0 staging試,可以進battle.net安裝WOW,但會一直卡更新(初始化 2145571...)

  3. 安裝ProtonUp-Qt,幫lutris安裝GE的proton7-35版本,並在lutris設定battle.net的wine版本為此版本,順便設定啟用DPI縮放

  4. 此時開啟battle.net應可正常登入並下載WOW,在battle.net設定把限制下載頻寬關閉。若仍無法正常下載或更新,請繼續以下步驟

  5. 設定battle.net的winetricks,安裝vcrun2015及corefonts

  6. 開linux terminal並進安裝battle.net的資料夾(假設放在/home/<user>/Games/battlenet/),找到
    /home/<user>/Games/battlenet/drive_c/Program Files (x86)/Battle.net
    /home/<user>/Games/battlenet/drive_c/ProgramData/Battle.net
    這二個資料夾,分別在這二個資料夾下執行:
    find -exec setfattr -x user.DOSATTRIB {} \;

    並再到/home/<user>/Games/battlenet/drive_c/Program Files (x86)/Battle.net/Battle.net.13894執行:
    setfattr -x user.DOSATTRIB platforms/qwindows.dll

  7. 有些比較舊的顯卡(我有在一台只有內顯Intel HD Graphics 520的筆電試裝),VULKAN的支援度可能沒那麼好,若遊戲無法執行或噴錯,可以試著分別關閉VXDK或VXD3D試試,用的是intel i915系列driver的話(如上述顯卡)再執行:
    sudo sysctl dev.i915.perf_stream_paranoid=0

  8. 另外開啟lutris的log會發現一直無法載入32bit的gamemode library,可參考以下解法:
    https://github.com/FeralInteractive/gamemode/issues/254#issuecomment-643648779

ref:
https://www.linuxuprising.com/2021/11/easily-install-and-manage-custom-wine.html
https://appdb.winehq.org/objectManager.php?sClass=version&iId=28855
https://us.forums.blizzard.com/en/blizzard/t/last-update-completely-breaks-wine-compatibility/33122
https://lutris.net/games/battlenet/
https://github.com/lutris/docs/blob/master/Battle.Net.md
https://github.com/lutris/docs/blob/master/InstallingDrivers.md
https://www.reddit.com/r/wow/comments/zfrkpd/stuck_initializing_2145571/
https://github.com/FeralInteractive/gamemode/issues/254

2022-12-28

在Rocky9使用openssl_sign及openssl_verify失敗的原因

 

在Rocky 9 (RHEL 9),一些已被認為不安全的cipher suites 及 protocols預設是停用的,

因此像在php8使用openssl_sign或openssl_verify,若不加第四個參數,預設都是用不安全的OPENSSL_ALGO_SHA1,因此會簽章或驗證失敗,但從錯誤訊息(-1)是看不出原因的(openssl_verify 來說,1=驗證成功,0=驗證失敗,-1/false=發生錯誤)。

還有使用ssh連線到別台主機時,可能別台主機還是用舊的sha1簽章,因此連線交握過程會失敗。

若在Rocky 9(RHEL 9)要啟用不安全的湊雜及加密演算法,必須下指令:
update-crypto-policies --set LEGACY

update-crypto-policies --set DEFAULT:SHA1 #只增加SHA1

以上指令會修改以下檔案(其實還會修改其它backend設定檔,如java/openssh/nss/gnutls等,以下單指openssl):
/etc/pki/tls/openssl.cnf:
[ crypto_policy ]
.include = /etc/crypto-policies/back-ends/opensslcnf.config

/etc/crypto-policies/back-ends/opensslcnf.config
[evp_properties]
rh-allow-sha1-signatures = yes

openssl-libs所包含的設定檔:
dnf repoquery -l openssl-libs | grep etc

ref:
https://bugs.launchpad.net/ubuntu/+source/crypto-policies/+bug/1926664/comments/6
https://gitlab.com/redhat-crypto/fedora-crypto-policies
https://forums.rockylinux.org/t/php-8-0-13-openssl-verify-fails-on-rocky-9/7478
https://github.com/php/php-src/issues/9686
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening
https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9

2022-11-26

在macbook pro m1/m2 上 safari 無法觀看 youtube HDR 影片的問題

 MBP在chrome/chromium上是可以正常觀看YOUTUBE HDR影片的,但在safari要設定幾樣東西才行:

  1. 在safari選單 Develop (開發) > Experimental Features (試驗性功能),打開 HDR Media Capabilities,至於 VP9 sw decoder on battery 選項若連下面2的設定也無效的話,再打開試試。

  2. 在設定裡的 電池 > 電池 選項,關閉(disable) 使用電池時最佳化影片串流 (Optimise video streaming while on battery)

  3. 若還不行,在選單 開發 > 使用者代理,改為Chrome試試 (應該是不需要)

  4. 若是要看Netflix的4K HDR或Dolby Vision,目前就只能用Safari看
ref:

2022-11-24

"libglib2.0-0:i386 相依於 zlib1g (>= 1:1.2.2)" 造成套件無法安裝問題

 dpkg: error processing package libglib2.0-0:i386 (--configure):

 dependency problems - leaving triggers unprocessed
================

dpkg: dependency problems prevent processing triggers for libglib2.0-0:i386:

 libglib2.0-0:i386 相依於 zlib1g (>= 1:1.2.2)﹔然而:

  zlib1g:i386 套件尚未設定。
================

dpkg: dependency problems prevent processing triggers for libglib2.0-0:i386:

 libglib2.0-0:i386 depends on zlib1g (>= 1:1.2.2); however:

  Package zlib1g:i386 is not configured yet.

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

解法:
dpkg --force depends -P libglib2.0-0:i386


ref:

https://github.com/pop-os/pop/issues/1276#issue-716376795

2022-11-02

Rocky Linux/Cenots/RHEL 9 用對拷完的硬碟開機,結果systemd卡在mount lvm的logical volume導致timeout

 這二天同事在建立了一個新的rocky linux 9的server後,因為要建立很多台再發放到各單位,所以請廠商複製原本能正常運作的硬碟再放到每一台NUC內,但是發現每一台都無法開機,卡在開機boot時要mount lvm裡的logical volume(lv)的/dev/mapper/rl-home 邏輯磁碟區,然後因mount不起來timed out後,也因為 root (/,根目錄)也是建在lvm內故也進不去emergency mode,導致很難查找問題。

2022-10-03

php-fpm + nginx + codeigniter 使用 virtual host設定調校

 當使用nginx + php-fpm建立virtual host (server block)時,要注意權限問題,最好不同的site用不同的使用者去存取php-fpm的pool,以下以建立site1及site2二個網站為例:

1.建立使用者,並記得修改/etc/passwd為nologin
sudo groupadd site1
sudo useradd -g site1 site1
sudo groupadd site2
sudo useradd -g site2 site2

2022-09-08

Netbeans 啟動 tomcat 時,顯示"Starting of Tomcat failed, the server port 8084 is already in use."(8084端口被占用)

 在netbeans設定tomcat時,若port設定為8084,且又打開 HTTP monitor功能的話,會導致tomcat開啟不了,顯示"Starting of Tomcat failed, the server port 8084 is already in use."

這是因為HTTP Monitor打開後,netbeans會啟動內建的tomcat 3 server,導致占port 8084,
要嘛將Server port改掉,要嘛關掉HTTP Monitor (這功能是會在HTTP Server Monitor顯示GET/POST等訪問紀錄)


另外,netbeans的web專案要是出現 "Deployment descriptor directory could not be found" 訊息,那可能就是少了web.xml 或WEB-INF資料夾,在專案按右鍵新增web.xml檔案即可。