win11 延長更新時間

1.regedit
2.電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings\ 右邊新增 (DWORD-32) , 名稱 FlightSettingsMaxPauseDays 十進位 36500

發表於 windows | 發表迴響

docker 掛 volumes

-v volumes
#使用 -v 如本地目錄不存在,docker 會自動建立目錄

docker run -itd -P –name web -v /webapp training/webapp python app.py
#建立 volume /webapp 掛載至 training/webapp , /webapp 位在 /var/lib/docker/volumes
可以用 "docker volume ls" 命令觀察 volumes 建立位置

docker run -itd -P –name web -v /docker/webapp:/opt/webapp:ro training/webapp python app.py
#將 Host /src/webapp 掛到 /opt/webapp (目錄須是絕對路徑), 來源若沒有會自動建立
#ro 唯獨

docker run –rm -it -v ~/.bash_history:/.bash_history ubuntu /bin/bash
# 檔案掛載 ,編輯會造成 inode 改變 ,建議掛載檔案的目錄
root@2affd44b4667:/# history
1 ls
2 diskutil list
#這樣可以記錄在容器輸入的命令

#下面是用另一種方式掛載 –mount
$ docker run -d -P \
–name web \
# -v /src/webapp:/usr/share/nginx/html \
–mount type=bind,source=/src/webapp,target=/usr/share/nginx/html \
nginx:alpine

#以唯讀readonly方式,默認是讀寫
–mount type=bind,source=/src/webapp,target=/usr/share/nginx/html,readonly \
# –mount 如果本地目錄不存在,Docker 會報錯。

# 以下是 掛載 .bash_history,紀錄命令 history
–mount type=bind,source=$HOME/.bash_history,target=/root/.bash_history \
ubuntu:18.04 \
bash

發表於 docker | 發表迴響

pve 7to8

apt update
apt dist-upgrade
pveversion

sed -i ‘s/bullseye/bookworm/g’ /etc/apt/sources.list

發表於 proxmox | 發表迴響

Linux 文件系統的強大磁碟使用量追蹤器

curl https://sh.rustup.rs -sSf | sh
cargo install –git https://github.com/nachoparker/dutree.git

https://www.tecmint.com/dutree-analyze-disk-usage-in-linux/?fbclid=IwAR0fg_9HAep7WSLVASTKsaht4imxTZ6LQCc-K6LMupolrxhqznZLr-oBdrU

發表於 linux | 發表迴響

Windows 指定主要ip

Windows server 在還沒有啟用 SNMP 之前已先加入1 ~ 2個 IP ,啟用後會以數字較大的 IP 當 SNMP 來源 IP

ex: 2 個 IP 分別是 1.1.1.1 與 1.1.1.2,會以 1.1.1.2 為來源 IP

但需求 1.1.1.1 才是我們要 GET 的 IP ,所以我們要取消 1.1.1.2 成為主要的 IP

指令如下

netsh int ipv4 delete address "區域連線" 1.1.1.2
netsh int ipv4 add address "區域連線" 1.1.1.2 255.255.255.0 skipassource=true

發表於 windows | 發表迴響

Python: json load Python List

import json
#json dumps to List
books =[
{
'username':"張三",
'age':18,
'country':'china'
},
{
'username':"李四",
'age':21,
'country':'Taiwan'
}
]

json_Str = json.dumps(books)
print("json_格式: " + str(type(json_Str)))
print(json_Str)

#json dump to file.json
# encoding=’utf-8′ and ensure_ascii=False
with open(‘test_json.json’,'w+’,encoding=’utf-8′) as fp:
#fp.write(json_Str)
json.dump(books,fp,ensure_ascii=False)

發表於 python | 發表迴響

Win10無法存取共用資料夾解決方法 

HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ LanmanWorkstation \ Parameters\AllowInsecureGuestAuth
0 改為 1

發表於 windows | 發表迴響

intel 等寬字型

https://github.com/intel/intel-one-mono

發表於 未分類 | 發表迴響

pve 重新尋找網卡代號

1.
ls /sys/class/net -al
確認網卡代號

2.
vi /etc/netowrk/interface
修改改有關 enp代號 2處

3.
if up enpx
systemctl restart networking

發表於 proxmox | 發表迴響

autocad 遮蔽

docs.autodesk.com
help.autodesk.com
genuine-software2.autodesk.com

發表於 未分類 | 發表迴響