0%

應用 Docker 在 Win10 Home 版

Win10 Home 版因為沒有支援 Hyper-V
所以 Docker Desktop for Windows 無法安裝
Docker Desktop for Windows
只有 Windows 10 Professinal or Enterprise 64-bit 才可以

Home版只能安裝 Docker Toolbox 去模擬 Linux 環境跑 Docker
安裝完畢後跑跑看新手教學
MsDoc: Use Docker
最後執行 Localhost:5000 跑不起來

最後找到解法
必須先在模擬環境內下 docker-machine ip 取得IP位置
先能正確的 Run 起來
StackOverflow: This site can’t be reached

LINQ 依照多個 Columns 的排序方法

1
2
3
var list = new List<MyObject>{...};

var newList = list.Orderby(x => x.Id).ThenByDescending(x => x.Name).ToList();

Git Push 上雲端有時出現 Authentication fail 的問題 然後又不給你輸入帳號密碼

解決方法1

1
git config --system --unset credential.helper

解決方法2

我個人是用這招
因為方法1無效

刪除 .gitconfig [credential]部分

1
2
3
4
5
[user]
name = luozheng
email = qssq666@foxmail.com
[credential]
helper = manager

改成

1
2
3
[user]
name = luozheng
email = qssq666@foxmail.com

參考資料

fatal: Authentication failed for又不弹出用户名和密码 解决办法

C# 標示方法已過時

這樣做

1
2
3
[Obsolete("Method1 is deprecated, please use Method2 instead.")]
public void Method1()
{ … }

也可以這樣

1
[Obsolete("Method1 is deprecated, please use Method2 instead.", true)]

其中 True 表示編譯時 Error

1
Obsolete(String Message, Bool error)

Redis Commander 在 Local 端跑

先把這個弄成一個 File 可叫做 docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
version: '3'
services:
redis:
container_name: redis
hostname: redis
image: redis
ports:
- "6379:6379"

redis-commander:
container_name: redis-commander
hostname: redis-commander
image: rediscommander/redis-commander:latest
restart: on-failure
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8081:8081"

然後 Run 下面這行指令

1
docker-compose up

看這裡

https://www.rickvanrousselt.com/send-your-application-insights-alert-data-to-microsoft-teams/

https://blog.poychang.net/how-to-query-and-analytics-application-insights-log/

https://docs.microsoft.com/en-us/azure/kusto/query/iiffunction

1
2
3
union (traces),(exceptions)
| where (tostring(customDimensions[‘StatusCode’]) == ‘500’) and (timestamp > ago(4h))
| top 101 by timestamp desc