2024年10月24日 星期四
Windows remote desktop session timeout
2024年5月29日 星期三
Windows 2019 install Teams (new)
Add-AppPackage -path .\MSTeams-x64.msix
2024年4月15日 星期一
2023年4月21日 星期五
2022年7月26日 星期二
Windows 11 使用 IE
2022年1月22日 星期六
2021年9月28日 星期二
Hyper-V VM 壓縮
$VHDx = "D:\Hyper-V\Virtual Hard Disks\Disk.vhdx"
mount-vhd -path $VHDx -readonly
optimize-vhd -path $VHDx -mode full
dismount-vhd -path $VHDx
optimize-vhd -path $VHDx -mode full
需要注意的是 OS 必須有 Hyper-V Role 才有能力執行 optimize-vhd
如果只是裝了 Hyper-V Management Feature 是不行執行 Compact 的
2021年7月20日 星期二
Windows command 計算行數
搜尋一或多個檔案中的文字字串。
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]
/V 顯示所有不包含指定字串的行。
/C 只顯示包含字串的行數。
/N 顯示每一行及它的行號。
/I 當搜尋字串時,忽略字元的大小寫。
/OFF[LINE] 不要略過有離線屬性集的檔案。
"string" 指定要尋找的文字字串。
[drive:][path]filename
指定要搜尋的一或多個檔案。
如果沒有指定路徑,FIND 會搜尋在提示時所輸入的文字
或者在其他的命令中搜尋。
- 計算所有行數
- Ex: netstat -ano | find /v /c ""
- 計算符合的行數,不分大小寫
- Ex: netstat -ano | find /c "listen"
2021年1月20日 星期三
Zerologon (CVE-2020-1472) 修補
2021年1月19日 星期二
Hyper-V 實體檔案壓縮
Reference:
Complete Guide on How to Shrink and Compact Virtual Hard Disks in Hyper-V
Hyper-V可以壓縮實體檔案放出沒用到的空間,但要先關閉VM。實測200GB壓縮後為182GB。從VM查看使用了120GB,還有不少空間放不掉。
2021年1月6日 星期三
setup docker on Windows 2019 for linux & Windows docker image
Reference:
Getting Started with Docker on Windows Server 2019
Docker Linux Container running on Windows Server 2019 #Winserv #Docker #Containers
Getting started with Linux Containers on Windows Server 2019
Docker Mysql 配置使用(windows server 2019)
Error running linux container on windows 2019 server
Run Hyper-V in a Virtual Machine with Nested Virtualization
2021年1月4日 星期一
Windows shadow copy
Reference:
Windows Server 2012 R2 的陰影複製設定
陰影複製(Volume Shadow Copy Service, VSS)
陰影複製說明:
- 存取舊版本資料和救回刪除檔案
- 可以排程定期追蹤磁碟上的檔案異動
- 不能用來取代備份
2020年12月16日 星期三
查看 DLL 內容的工具
Reference:
How to open .dll files to see what is written inside?
方法一:Visual Studio
- 在Visual Studio 2019的Developer Command Prompt for VS 2019中,
- 執行 ILDASM
方法二:ILSPY (open source)
2020年9月2日 星期三
Disable weak versions of SSL/TLS Protocols on Windows Server 2012 R2
Reference:
Microsoft IIS: Disabling the SSL v3 Protocol
How to Enable TLS 1.2 as the Default Security Protocol on Windows Servers
How to disable weak versions of SSL/TLS Protocols on Windows Servers
Windows 2012 R2 預設有 SSL 2.0, SSL 3.0, TLS 1.0, TLS 1.1, TLS 1.2,只保留 TLS 1.2 其餘關閉。
步驟:
執行 regedit.exe,切換到 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\Protocols\
新增機碼,沒有的就手動加上
SSL 2.0\Server\Enabled = 0 (Dword)
SSL 2.0\Client\DisabledByDefault = 1 (Dword)
SSL 3.0\Server\Enabled = 0 (Dword)
SSL 3.0\Client\DisabledByDefault = 1 (Dword)
TLS 1.0\Server\Enabled = 0 (Dword)
TLS 1.0\Client\DisabledByDefault = 1 (Dword)
TLS 1.1\Server\Enabled = 0 (Dword)
TLS 1.1\Client\DisabledByDefault = 1 (Dword)
重開機後生效。
驗證:
用 https://www.ssllabs.com/ssltest/ 確認狀態
2020年6月23日 星期二
Get disk usage via snmpwalk
[網管應用] Windows系統的snmp測試工具 - snmpwalk
Install or configure SNMP for Windows
Windows 透過 snmp 監控系統資源的方法
Linux系統監控常用到的SNMP OID
How do you get snmpwalk to return numeric oids instead of MIB resolutions?
安裝 snmpwalk
for Linux: yum install yum install net-snmp-utils
for Windows: 從這裡下載 https://www.snmpsoft.com/cmd-tools/snmp-walk/
Windows server 設定 snmp service
Install or configure SNMP for Windows
Linux 設定 snmp service
yum install net-snmp
vi /etc/snmp/snmpd.conf
增加一行 view systemview included .1
將 disk / 10000 的 # 拿掉
service snmpd restart
Windows Disk usage 指令
snmpwalk -v2c -c public hostname .1.3.6.1.2.1.25.2
Linux Disk Usage 指令
snmpwalk -v 1 -c public hostname .1.3.6.1.4.1.2021.9.1
2020/7/4 update:
Reference: snmpwalk parameter
snmpwalk 執行後,查出一部分資料就Timeout: No Response from。(如下圖)
加上 -t 10 減少 timeout 狀況。
Ex: snmpwalk -v2c -t 10 -c public hostname .1.3.6.1.2.1.25.2
2020年5月29日 星期五
2020年5月2日 星期六
如何處理Windows虛擬機ping包顯示Destination host unreachable
夜路走多了總是會遇到鬼.....
ㄟ.... 不是啦,應該是工作久了就會遇到比較多奇怪的狀況。
狀況:
Windows server 2003虛擬機當機重開,開機很久才完成(大約10分鐘)。
開機後網路不通,檢查網路設定正常,也有收送封包,但無法ping通。
搞了好久,最後同事在Event Log看到錯誤訊息(如下)。
IPSec 驅動程式已經進入區塊模式。IPSec 將捨棄開機時 IPSec 豁免原則不允許的所有輸入或輸出 TCP/IP 網路流量。 使用者動作: 若要復原到完全無安全性的 TCP/IP 連結,請停用 IPSec 服務,然後重新啟動電腦。 請檢視安全性事件日誌中的事件,以取得更多疑難排解的詳細資訊。
找一台正常的Windows 2003 匯出 registry,再把 registry 匯入有問題的 Windows 2003 後恢復。
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\IPSec]
2020年3月28日 星期六
虛擬延伸桌面軟體 (無限大的桌面)
我的筆電螢幕解析度只有1366x768,有一個軟體的視窗高度超過768,它又沒設計捲軸,下面的 "確定" 按鈕點不到....
解法:
找到 Infinite Screen 可以做虛擬延伸桌面。
http://ynea.futureware.at/cgi-bin/infinite_screen.pl
操作方法:
執行 Infinite Screen 程式後,按住鍵盤左邊的 Ctrl+Shift,移動滑鼠會變成有無限的桌面。
這軟體太酷了!
2020年3月22日 星期日
2020年2月28日 星期五
Windows 10 檔名、目錄 區分大小寫
wind10 檔名區分大小寫
讓Windows 10 檔名、目錄可以區分大小寫
作法:
- Windows 10 版本必須 1803 以上
- 用系統管理員身分執行PowerShell
- 執行 Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux (安裝 Linux 子系統)
- 執行 fsutil.exe file setCaseSensitiveInfo D:\Study enable (在D:\Study啟用 區分大小寫)