正在顯示「 2021 年 11 月 」的所有結果
11月 28, 2021 Docker
### 一次處理多個 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>
```

有了它們之後覺得非常方便 !
11月 23, 2021 Git Github
### 長話短說

每一次整個新 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
```
11月 22, 2021 Network Ubuntu
### 長話短說

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
```
11月 09, 2021 MySQL
### 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

當然還有很多設定如果不夠大的話,都會出錯。上面只是其中一部份。
11月 09, 2021 Ubuntu
### 方法

首先修改 hostname 檔案 :

```sh
sudo vi /etc/hostname
```

然後修改 hosts 檔案 :

```sh
sudo vi /etc/hosts
```

最後重新開機便可 :

```sh
sudo reboot
```
11月 05, 2021 Linux
### 長話短說

可以使用輸出 command 方法把空值寫入到檔案內:

```sh
> hello.text
```
11月 05, 2021 MySQL
### 長話短說

改 host 先: 

```sql
update mysql.user set host='%' where user='root';
```

然後改認證方法:

```sql
alter user 'root'@'%' identified with mysql_native_password by 'password';
```

完 !
過去文章
2025 (9)
4 (5)
3 (1)
2 (3)
2024 (25)
11 (3)
10 (3)
9 (1)
3 (18)
2022 (6)
10 (1)
6 (2)
5 (1)
3 (1)
1 (1)
2021 (21)
11 (7)
7 (1)
6 (2)
5 (2)
4 (6)
3 (2)
2 (1)
2020 (92)
12 (1)
11 (2)
10 (4)
9 (10)
8 (5)
7 (1)
6 (3)
5 (1)
4 (4)
3 (25)
2 (7)
1 (29)
2019 (57)
12 (25)
11 (7)
9 (25)