2019年11月26日 星期二

MySQL 資料庫優化


資料量太大,導致 MySQL 程序在執行時的 cpu 超過 170%,而且時間很長,嚴重影響到網頁存取的效率。

依主機、資料庫的狀態,提供建議:

  • SHOW VARIABLES LIKE '%buffer%'; 
    這行指令可以查看主機現有的狀態
  • MySQLTuner-perl, https://github.com/major/MySQLTuner-perl
  • phpMyAdmin, 「狀態 / 建議」可以看看建議值,另外,在「變數」這裡可以看到 mysql 目前的設定值為何。

討論及優化 MySQL 的效率部份:
  • https://itw01.com/Z9FLEC6.html
  • https://www.opencli.com/mysql/mysql-tuning-after-installation
  • https://blog.toright.com/posts/4912/%E6%B7%BA%E8%AB%87-mysql-%E6%95%88%E8%83%BD%E9%81%8B%E4%BD%9C%E6%A9%9F%E5%88%B6.html
  • https://dev.mysql.com/doc/refman/5.7/en/memory-use.html
  • https://www.insoler.com/blogs/entry/15559547344645.htm


2019年9月29日 星期日

Linux Mint 19.2 install Nvidia Cuda


底下這篇的動作比較簡單,又沒出問題~~
https://mrprajesh.blogspot.com/2018/11/install-cuda-10-on-linux-mint-19-or.html

其中連到 Nvidia Cude 的網站如下
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal

2019年9月25日 星期三

composer require 發生 timeout 的狀況







這是 IPv6 的問題,官方所提供的解決方案如下:

$ sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

2019年9月17日 星期二

指令模式下啟動 VirtualBox VMs


以下指令可以在指令模式下,先列出目前的 VirtualBox VMs 的項目有那些:
VBoxManage list vms

若要啟動其中某一個 vm 的話,可以用下方的方式:
VBoxManage startvm "Ubuntu Server" --type headless

ref:  https://www.techrepublic.com/article/how-to-run-virtualbox-virtual-machines-from-the-command-line/

MySQL dump all databases


若想將系統移機,以下指令可以很方便的將所有的資料庫備份出來、移轉到新的主機裡。

若想一次備份所有的 databases ,可以用以下指令:
mysqldump -u root -p --all-databases > alldb.sql


以下指令,可以匯入所有的 databases 。
mysql -u root -p < alldb.sql

T480 雙顯卡在系統無法順利從 intel 切換為 Nvidia 的解決方案


T480 雙顯卡在 Linux MInt 18.3 ,安裝完 cuda driver 後,發現可以在視窗介面下從 Nvidia 轉換為 Intel ,但,就再也開不起它的對話框。
可以從指令模式下,簡單的用底下的指令就可以從 Intel 切換為 Nvidia 了。

sudo prime-select nvidia

重新登入後就可以了。

ref: https://unix.stackexchange.com/questions/438908/mint-18-3-does-not-boot-after-i-changed-graphics-card-from-nvidia-to-intel

2019年6月27日 星期四

ubuntu 18.04/Linux Mint 19.1 setting thinkpad Trackpoint


from: http://nrvale0.github.io/posts/adjusting-thinkpad-trackpoint-sensitivity-on-ubuntu-1604-and-others/

說明如下:
  1. 編輯 /etc/tmpfiles.d/trackpoint.conf 檔案
  2. 貼上以下內容
    w /sys/devices/platform/i8042/serio1/serio2/speed - - - - 255
    w /sys/devices/platform/i8042/serio1/serio2/sensitivity - - - - 175
  3. 執行以下指令
    sudo systemd-tmpfiles --prefix=/sys --create 
  4. 接著,要到 系統設定/滑鼠,將 自定義靈敏度 功能關閉
  5. 重新啟動系統,trackpoint 就很好用了~