2019年1月10日 星期四

Set System Timezone in Debian 9

引用自:https://www.server-world.info/en/note?os=Debian_9&p=timezone

功能一:顯示 timezone 清單
指令:#timedatectl list-timezones

功能二:設定 timezone
指令:#timedatectl set-timezone Asia/Taipei

功能三:顯示 timezone 設定
指令:#timedatectl 


無法重置 MariaDB 的 root 密碼該怎麼做? [引用自 goodjack.blogspot.com]

關鍵字: reset mariadb root password {not working | plugin | socket}

本問題的解法, 請參考網址: http://goodjack.blogspot.com/2018/02/mariadb-root.html
解決的關鍵在資料欄位 plugin 的內容是否清空。

2019年1月5日 星期六

Domjudge users can not login, 500 internal server error

Keyword: Domjudge, Domserver, PHP, Symfony, Proxy, Error

現象1: 安裝完 Domjudge 6.0.3 後,發現 admin 帳號可以登入管理介面, 但由 admin 新建的一般 user 帳號卻無法登入, 而出現 Apache2 server 的 "500 internal error" 訊息。

現象2: 觀察  /var/log/apache2/error.log 後, 會看到以下訊息:
--------------------------------------------------------------------------------------------------------------------------
[Fri Jan 04 17:48:08.602178 2019] [:error] [pid 3784] [client 10.7.21.241:56024] PHP Fatal error:  require(): Failed opening required '/opt/domjudge/domserver/webapp/var/cache/prod/doctrine/orm/Proxies/__CG__DOMJudgeBundleEntityTeam.php' (include_path='/opt/domjudge/domserver/lib/vendor/phpseclib/phpseclib/phpseclib:.:/usr/share/php') in /opt/domjudge/domserver/lib/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209, referer: http://10.7.21.242/domjudge/login
--------------------------------------------------------------------------------------------------------------------------
此訊息描述了 PHP 的 prod cache 出了問題。

現象3: 以 php symfony proxy error 為關鍵字 google 搜尋後, 可找到網址 https://stackoverflow.com/questions/36255440/symfony-cache-doctrine-orm-proxies-failed-to-open-stream-proxy-abstractproxyfac 的說明, 其意為在執行 application 前的 cache 未事先建立。

解法:
在 /opt/domjudge/domserver/webapp/bin/ 資料夾下, 執行 console 程式如下, 來 warmup prod 的 cache。
-------------------------------------------------------------------------------
sudo /opt/domjudge/domserver/webapp/bin/console cache:warmup --env=prod
-------------------------------------------------------------------------------

執行後, 會出現以下訊息:
-------------------------------------------------------------------------------------------------------
 // Warming up the cache for the prod environment with debug
 // false


 [OK] Cache for the "prod" environment (debug=false) was successfully warmed.
--------------------------------------------------------------------------------------------------------

這樣子就可以讓 users 登入 Domjudge 了。

2018年12月27日 星期四

Switch command output language from native language to English

現象: Ubuntu 在下達 command 之後, 系統回應的訊息會包含中文字。這樣的狀況會讓系統在需要維護時, command line interface 的訊息會完全無法閱讀。

解決方法:
[參考網址: https://askubuntu.com/questions/264283/switch-command-output-language-from-native-language-to-english]

使用 'LC_ALL=C bash' 指令, 在提示符號下達此指令後, 訊息就會以英文顯示;
如果要恢復為原語系設定,則再下達 'unset LC_ALL' 指令即可。


2018年9月1日 星期六

[Solved] Linux: Set Default App

Keyword:
1. Xfce4 desktop "Terminal Emulator" didn't show up.
2. Xfce4 desktop didn't launch Terminal Emulator.

相關連結:
http://xahlee.info/linux/linux_set_default_app.html

現象:
在使用 Xfce4 桌面時, 發現 Terminal Emulator 圖示按下後, 系統沒有任何反應。
理想上, 在按下 Terminal Emulator 圖示或選項時, 系統會執行相對應的 Terminal 程式。

原因:
系統預設的 Terminal Emulator 程式, 與我們所期待執行的 Terminal 程式不同。

解法:
先執行任何一個可以用鍵盤下達指令的 Terminal 程式 (如: 'xterm' 或直接輸入 'xfce4-terminal', 然後輸入 "exo-preferred-applications" 命令, 使其叫出 "Preferred Applications" 程式視窗 (如下圖)。
再於其內設定 "Terminal Emualtor" 為系統已安裝的 "Xfce Terminal" 即可。