First download GPG key. sudo apt -y install lsb-release apt-transport-https ca-certificates sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg Next, add SURY to the repository. echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list sudo apt update -y sudo apt upgrade -y sudo reboot
apache2 的 php 從 7.3 轉到 8.3 時,許多東西異常,需要花時間處理,先轉回來! /* sudo a2dismod php7.3 sudo a2enmod php8.3 sudo service apache2 restart sudo update-alternatives --set php /usr/bin/php8.3 sudo update-alternatives --set phar /usr/bin/phar8.3 sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.3 sudo update-alternatives --set phpize /usr/bin/phpize8.3 sudo update-alternatives --set php-config /usr/bin/php-config8.3 */
安裝 pecl sudo apt-get install php-pear
sudo pecl channel-update pecl.php.net sudo apt-get install php8.3-dev (這樣就有phpize) sudo pecl install openswoole-22.1.2 中間跑很久,僅節錄最後結果 Build process completed successfully Installing '/usr/lib/php/20230831/openswoole.so' Installing '/usr/include/php/20230831/ext/openswoole/config.h' Installing '/usr/include/php/20230831/ext/openswoole/php_openswoole.h' install ok: channel://pecl.php.net/openswoole-22.1.2 configuration option "php_ini" is not set to php.ini location You should add "extension=openswoole.so" to php.ini sudo nano /etc/php/8.3/cli/php.ini 增加 extension=openswoole.so php -i | grep swoole (可知 swoole 已啟用) composer require openswoole/core:22.1.5
sudo apt install mesa-utils
sudo apt install blender
MESA_GL_VERSION_OVERRIDE=3.3 blender
這樣可以畫圖,至於是否可以渲染,還沒機會測試!
Settings / Keyboard / Keyboard Shortcuts / Typing 可以修改,把 Win+Space 的切換變成 Ctrl+Space 切換輸入法。
sudo apt install chromium-browser
安裝 line 的 plugin 即可使用網頁版本的 line
刪掉內建的 libreoffice (有些不能執行)
sudo apt purge libreoffice-common
sudo apt autoremove
<?php require('tfpdf/tfpdf.php'); class newPDF extends tFPDF { function Footer() { // Go to 1.5 cm from bottom $this->SetY(-15); // Select Arial italic 8 $this->SetFont('Arial', 'I', 8); // Print centered page number $this->Write(8,'Page '.$this->PageNo() . '/{nb}'); //$this->Cell(0, 10, 'Page '.$this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new newPDF('Portrait', 'mm', array(130,130)); $pdf->AliasNbPages(); $pdf->AddFont('中文','','NotoSansTC-Regular.ttf',true); $pdf->AddPage(); $pdf->SetFont('中文','',14); $txt = '您好,許蓋功氷!hello, world!'; $pdf->Write(8,$txt); $pdf->AddPage(); $pdf->SetFont('中文','',16); $txt = '這是第二頁囉!'; $pdf->Write(8,$txt); $pdf->Output(); ?>
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link id="mylink" rel="stylesheet" type="text/css"> </head> <body> <div><button type="button" onclick="load_style();">load_style</button></div> <div id="div1">中文字!Hello, world!</div> <script> function load_style() { document.getElementById('mylink').href ="data:text/css;base64," +btoa("#div1 { font-size: 24pt; color: red; }"); } </script> </body> </html>