Ubuntu 管理心得

搜尋此網誌

2022年1月18日 星期二

vnc for preview using raspistill

  1. Click top right VNC icon:
  2. Click the top right setting in VNC server windows:
  3. Select Options:
  4. In Options window, select Troubleshooting:

  5. Turn on  Enable direct capture mode :
  6. Done.

2022年1月15日 星期六

wifi password

Because wpa_supplicant.conf contains readable wifi passwords, it can be replaced by the psk unreadable codes. 

cf: https://raspberrypi.stackexchange.com/questions/91616/wpa-supplicant-conf-in-raspberry-pi-3

  1. Run wpa_passphrase "chiao-dlink842"
  2. Enter password, e.g. aaa123456, Press enter
    1. Some lines come out. e.g.
      network={
          ssid="chiao-dlink842"
          #psk="aaa123456"

               key_mgmt=WPA-PSK

          psk=<codes>
      }
  3. Delete the line with #psk="aaa123456", Then, add the rest lines to  /etc/wpa_supplicant/wpa_supplicant.conf
  4. Done.
  5. Also, for one (or some) of the AP not connected automatically, one can add this:
    disabled=1

2022年1月8日 星期六

記憶體的功能分類

cf: https://isite.tw/2016/05/20/15923

  • ECC: 錯誤更正能力
  • Buffered or Registered: 暫存緩衝的功能 (Registered)


  1. Non-ECC Unbuffered DIMM: 一般個人電腦使用的就是這種記憶體,價格最為低廉,但是既不具備錯誤更正能力,也沒有暫存緩衝的功能ECC 
  2. Unbuffered DIMM: 比起 Non-ECC Unbuffered DIMM 來說,多了一顆記憶體顆粒
  3. ECC Registered DIMM: 除了錯誤更正能力,還加入了暫存器緩衝區的設計,目前 Intel 只有 Xeon E5 處理器搭配伺服器主機版才能使用這類記憶體。

 

2022年1月7日 星期五

PCIE speed

sudo lspci -vv | grep -E 'PCI bridge|LnkCap|LnkSta:' 

00:1b.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #21 (rev f0) (prog-if 00 [Normal decode])
        LnkCap:    Port #21, Speed 8GT/s, Width x4, ASPM L0s L1, Exit Latency L0s <1us, L1 <16us
        LnkSta:    Speed 8GT/s (ok), Width x4 (ok)
00:1c.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #8 (rev f0) (prog-if 00 [Normal decode])
        LnkCap:    Port #8, Speed 8GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <1us, L1 <16us
        LnkSta:    Speed 5GT/s (downgraded), Width x1 (ok)
        LnkCap:    Port #0, Speed 8GT/s, Width x4, ASPM L1, Exit Latency L1 <8us
        LnkSta:    Speed 8GT/s (ok), Width x4 (ok)
        LnkCap:    Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 unlimited
        LnkSta:    Speed 5GT/s (ok), Width x1 (ok)

Check pcie gen3 or gen4 gen version

sudo lspci -vv | grep -E 'PCI bridge|LnkCap|LnkSta:' 

 

 

PCI Express 3.0
PCI-SIG 的 PCI Express 3.0 規格,新版每條 Lane 的單向頻寬增到 8Gbps.
但因為編碼方式改變了,相較於 2.0 之前採用 8b/10b (每10個bit只有8個是有效資料)而 3.0 編碼方式為 128/130,所以資料傳輸頻寬以及原始傳輸率基本當都可以算成 8Gbps.
x1 8Gbps (1GB/sec)
x4 32Gbps (4 GB/sec)
x8 64Gbps (8 GB/sec)
x16 128Gbps (16 GB/sec)

PCI-E 4.0 x4 ,提供最高 16GT/s×4=8GB/s 頻寬,

是 Gen3 NVMe SSD ( 8GT/s×4 =4GB/s )

PCIE
Gen
year
原始
傳輸率
頻寬(每個方向)
×1 ×2 ×4 ×8 ×16
1.02003
2.5 GT/s 250 MB/s 0.50 GB/s 1.0 GB/s 2.0 GB/s 4.0 GB/s
2.0 2007
5.0 GT/s 500 MB/s 1.0 GB/s 2.0 GB/s 4.0 GB/s 8.0 GB/s
3.0 2010
8.0 GT/s 984.6 MB/s 1.97 GB/s 3.94 GB/s 7.88 GB/s 15.8 GB/s
4.0 2017
16.0 GT/s 1969 MB/s 3.94 GB/s 7.88 GB/s 15.75 GB/s 31.5 GB/s
5.0 2019
32.0 GT/s 3938 MB/s 7.88 GB/s 15.75 GB/s 31.51 GB/s 63.0 GB/s
6.0 2021
64.0 GT/s 7877 MB/s 15.75 GB/s 31.51 GB/s 63.02 GB/s 126.03 GB/s

2022年1月6日 星期四

2021年12月31日 星期五

Remove ibus input method 輸入法

cf: https://askubuntu.com/questions/860780/how-to-remove-old-ibus-keyboard-input-menu-items 

Enter dconf-editor and go to org.gnome.desktop.input-sources.sources then delete the input method not needed, e,g, ('ibus', 'fuzzy_table')

2021年12月30日 星期四

Inquiry about paper staus

 cf: https://www.editage.com/insights/how-do-i-write-an-inquiry-to-the-editor-about-my-manuscripts-current-status


Dear Mr./Ms. XXX [Editor's Name],

I have submitted my revised manuscript titled XXXX [manuscript id: xxxx] to your journal via the online submission system on dd/mm/yyyy [date of submission]. Two days later, the status changed to ‘with editor.’ However, the status has remained unchanged ever since.

I would be grateful if you could let me know whether there has been any further progress on my submission.

Sincerely,

XXXX [Your name and contact details]

2021年12月5日 星期日

Clean /var/log/journal

cf: https://j7.lb168.tw/2019/07/vacuum-var-log-journal/


  1. sudo vim /etc/systemd/journald.conf
  2. Add the lines:
  3. SystemMaxUse=10M
    SystemMaxFileSize=10M
  4. sudo systemctl restart systemd-journald.service

cf: https://askubuntu.com/questions/1238214/big-var-log-journal 

  1. sudo journalctl --vacuum-size=10M
  2. sudojournalctl --vacuum-time=10d

2021年12月4日 星期六

Configure Thunderbird for localhost

 cf :  https://gist.github.com/raelgc/6031274

  1. 帳號設定 -> 新增其他帳號 -> Unix Mailspool(Movemail)(U)
  2. 您的大名: chiao
  3. 電子郵件地址: chiao@localhost
  4. 寄件伺服器: localhost

As of Thunderbird 87beta.x.x, Movemail support is removed. 

https://www.thunderbird.net/en-US/thunderbird/87.0beta/releasenotes/ 

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

cf: https://stackoverflow.com/questions/54184707/warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-u

 

 Error while exporting excel from FAHP online system:

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/share/php/OLE.php on line 319

sudo vim +319 /usr/share/php/OLE.php

Change "continue" to "continue 2" as follows:

  default:
#chiao, 2021-12-5               
#                continue;
                continue 2;

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

網誌存檔