Ubuntu 管理心得

搜尋此網誌

2021年11月28日 星期日

Phpmyadmin error: OpenDocument:group:OpenDocument/OpenOffice :group:OpenDocument/OpenOffice

 cf: 

Edit /usr/share/phpmyadmin/libraries/classes/Config/Form.php, add

protected function cleanGroupPaths(array $form): array
{
  foreach($form as &$name) {
      if (mb_strpos((string) $name, ‘:group:’) === 0) {
         $name = str_replace(‘/’, ‘-‘, $name);
     }
  }
  return $form;
}


public function loadForm($form_name, array $form)
{
  $this->name = $form_name;
  $form = $this->cleanGroupPaths($form);
  $this->readFormPaths($form);
  $this->readTypes();


phpmyadmin using zip to export database

  1. Edit php.ini, set zlib.output_compression = On
  2. sudo apt install php7.4-zip

2021年11月27日 星期六

.htaccess: Options not allowed here

cf: https://serverfault.com/questions/680563/apache-2-4-9-on-debian-7-8-htaccess-options-not-allowed

Edit /etc/apache2/mods-enabled/userdir.conf, change the line

AllowOverride FileInfo AuthConfig Limit Indexes
to
AllowOverride FileInfo AuthConfig Limit Indexes Options
  

 

Cannpt login as mysql user root from normal user account

 cf: https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-from-normal-user-account-in-ubuntu-16-04


$ sudo mysql -u root
mysql> DROP USER 'root'@'localhost';
mysql> CREATE USER 'root'@'localhost' IDENTIFIED BY '<root_password>';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; 
mysql> FLUSH PRIVILEGES;
 
In above, One replace 'root' e.g. with 'chiao' to create the a mysql user as root.  

2021年11月25日 星期四

Unexpected 'new' (T_NEW) in /usr/share/php/Spreadsheet/Excel/Writer/Workbook.php

cf: https://stackoverflow.com/questions/45057005/when-i-am-trying-to-export-excel-file-in-php-7-same-code-is-working-in-php5

Because Error msg:
Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/php/Spreadsheet/Excel/Writer/Workbook.php on line 180

Edit the line 180 as:

#        $this->_parser           =& new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);
        $this->_parser           =new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);

And line 194 as:

#        $this->_tmp_format       =& new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
        $this->_tmp_format       =new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
 

2021年11月7日 星期日

Clone drupal9 to pi4

  1. The source directory chiao@pi4:~/public_html/drupal9 does not need to be changed.
  2. Export drupal database from kpci7 as sql source file from here.
  3. Save the sql as drupal_kpci72004_20211108.sql
  4. sed 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' drupal_kpci72004_20211108.sql > drupal_kpci72004_20211108_update.sql
  5. Import drupal_kpci72004_20211108_update.sql to pi4 MySQL database (by phpmyadmin):
    1. Clone drupal database in pi4 as drupal_pi4_20211108
    2. Drop drupal database in pi4
    3. Import drupal_kpci72004_20211108_update.sql
  6.  Done.
  1. 下載 clonzilla zip 檔.
  2. 在USB上產生FAT32分割區(至少 200 MB) "mkfs.vfat -F 32 /dev/sdd1"
  3. mount /dev/sdd1 /media/usb
  4. 解壓縮檔案, 如: "unzip clonezilla-live-2.7.3-19-amd64.zip -d /media/usb/"
  5. 讓 USB 裝置可開機:
       cd /media/usb/utils/linux
       sudo bash makeboot.sh /dev/sdd

2021年11月5日 星期五

Power off unplug usb disk drive

sudo udisks --detach /dev/sdb

網誌存檔