### 一次處理多個 docker container 的生命 在測試使用 docker 時常常都會進行生成/斬掉 container 的動作,在 command line 內一個一個斬掉重續實在太多字要打,以下幾個 command 可以省回不少的時間。 ### 一次過停用所有的 container ```sh $ docker kill $(docker ps -q) ``` ### 一次過移除所有的 container ```sh $ docker rm $(docker ps -a -q) ``` ### 一次過移除所有的 images ```sh $ docker rmi $(docker images -q) ``` ### 停用並移除 container ```sh $ docker rm -f <container_name> ``` 有了它們之後覺得非常方便 !
### 長話短說 每一次整個新 VM 出來試野都要搞個 GIT,同埋 Github 要改左一定要強制用 person access token 先可以登入,好難可以記得一個水蛇春咁長的 token 來用,所以不可能每次都打密碼來 clone 同埋 pull。 下面呢句係用來記住 git 登入資料的。 ```sh # 使用 store 方法來記低你的登入資料 $ git config --global credential.helper store ``` 另外如果需要 push 的話,就需要設定埋 user name 同埋 email 了。 ```sh # 設定 username $ git config --global user.name YOURNAME # 設定 email $ git config --global user.email YOUREMAIL ```
### 長話短說 Down interface ```sh # sudo ifconfig enp0s23 down // 舊方法 # sudo ip link set enp0s23 down ``` Up interface ```sh # sudo ifconfig enp0s23 up // 舊方法 # sudo ip link set enp0s23 up ```
### Error "The table XXX is full" 在起 ndb cluster 時很容易會遇到這個問題,原因有很多,以下會主要介紹幾個。 參考文件 : https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-ndbd-definition.html 以下這幾個項目如果的內容不夠的話,就會引起 The table is full 錯誤。 - DataMemory - IndexMemory - MaxNoOfOrderedIndexes - MaxNoOfUniqueHashIndexes 當然還有很多設定如果不夠大的話,都會出錯。上面只是其中一部份。
### 方法 首先修改 hostname 檔案 : ```sh sudo vi /etc/hostname ``` 然後修改 hosts 檔案 : ```sh sudo vi /etc/hosts ``` 最後重新開機便可 : ```sh sudo reboot ```
### 長話短說 改 host 先: ```sql update mysql.user set host='%' where user='root'; ``` 然後改認證方法: ```sql alter user 'root'@'%' identified with mysql_native_password by 'password'; ``` 完 !