vault backup: 2025-03-04 11:17:00
This commit is contained in:
88
21.02. Windows/Windows 11 重灌.md
Normal file
88
21.02. Windows/Windows 11 重灌.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# 要保存/恢復的檔案
|
||||
- `%userprofile%/.config`
|
||||
- `%userprofile%/.ssh`
|
||||
- `%userprofile%/.bash_profile`
|
||||
- `%userprofile%/.bashrc`
|
||||
- `%userprofile%/.gitconfig`
|
||||
- `%userprofile%/.vimrc`
|
||||
|
||||
# 安裝工具
|
||||
## 安裝 Chocolatey
|
||||
1. 安裝[Chocolatey](https://chocolatey.org/),用Administrator身份打開powershell,輸入下列指令:
|
||||
```
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||
```
|
||||
2. 用安裝常用的工具
|
||||
```
|
||||
choco install powertoys 7zip vscode hxd sublimetext4 androidstudio intellijidea-community git winmerge freefilesync freedownloadmanager gsudo firacode cascadiacode sourcecodepro delta googlechrome googledrive enpass.install sharex win32diskimager k-litecodecpackmega obsidian anki enpass.install --yes
|
||||
```
|
||||
|
||||
可以在 [https://community.chocolatey.org/packages](https://community.chocolatey.org/packages) 找到其他工具,再加到清單後面即可。
|
||||
|
||||
上面的指令安裝了下列的軟體,可以依自己需求增刪:
|
||||
|
||||
- [powertoys](https://community.chocolatey.org/packages/powertoys)
|
||||
- [7zip](https://community.chocolatey.org/packages/7zip)
|
||||
- [vscode](https://community.chocolatey.org/packages/vscode)
|
||||
- [hxd](https://community.chocolatey.org/packages/hxd)
|
||||
- [sublimetext4](https://community.chocolatey.org/packages/sublimetext4)
|
||||
- [androidstudio](https://community.chocolatey.org/packages/androidstudio)
|
||||
- [intellijidea-community](https://community.chocolatey.org/packages/intellijidea-community)
|
||||
- [git](https://community.chocolatey.org/packages/git)
|
||||
- [winmerge](https://community.chocolatey.org/packages/winmerge)
|
||||
- [freefilesync](https://community.chocolatey.org/packages/freefilesync)
|
||||
- [freedownloadmanager](https://community.chocolatey.org/packages/freedownloadmanager)
|
||||
- [gsudo](https://community.chocolatey.org/packages/gsudo)
|
||||
- [firacode](https://community.chocolatey.org/packages/firacode)
|
||||
- [cascadiacode](https://community.chocolatey.org/packages/cascadiacode)
|
||||
- [sourcecodepro](https://community.chocolatey.org/packages/sourcecodepro)
|
||||
- [delta](https://community.chocolatey.org/packages/delta)
|
||||
- [googlechrome](https://community.chocolatey.org/packages/googlechrome)
|
||||
- [googledrive](https://community.chocolatey.org/packages/googledrive)
|
||||
- [enpass.install](https://community.chocolatey.org/packages/enpass.install)
|
||||
- [sharex](https://community.chocolatey.org/packages/sharex)
|
||||
- [win32diskimager](https://community.chocolatey.org/packages/win32diskimager)
|
||||
- [k-litecodecpackmega](https://community.chocolatey.org/packages/k-litecodecpackmega)
|
||||
- [obsidian](https://community.chocolatey.org/packages/obsidian)
|
||||
- [anki](https://community.chocolatey.org/packages/anki)
|
||||
- [Enpass Password Manager](https://community.chocolatey.org/packages/enpass.install)
|
||||
|
||||
## 用 Chocolatey 升級軟體
|
||||
|
||||
```shell
|
||||
choco upgrade all -y
|
||||
```
|
||||
|
||||
## 手動安裝
|
||||
3. Python 3.6.3
|
||||
4. Python 3.9
|
||||
7. Visual Studio 2022
|
||||
8. Office 365
|
||||
9. Lightroom
|
||||
11. [ShareX](https://getsharex.com/)
|
||||
12. [win32diskimager](https://sourceforge.net/projects/win32diskimager/)
|
||||
13. [卡巴斯基](https://www.kaspersky.com.tw/)
|
||||
14. 字型
|
||||
- [Caskaydia](\\diskstation\share\Tools\字型\Caskaydia Cove Nerd Font\)
|
||||
|
||||
## `~/.bashrc`
|
||||
1. 打開`~/.bashrc`。
|
||||
2. 內容如[[bashrc|bashrc]]
|
||||
|
||||
## Setup Windows Terminal
|
||||
1. 開啟Windows Terminal。
|
||||
2. 按`ctrl + ,`打開設定,之後參考[[Windows Terminal]]。
|
||||
|
||||
## 恢復右鍵選單
|
||||
- 以admin身份打開PowerShell,執行 `reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve`
|
||||
- 要恢復Windows 11的右鍵選單則是執行:`reg delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f`
|
||||
|
||||
## 設定使用者環境變數
|
||||
- `PYTHON_INCLUDE`: `C:\Python363\include`
|
||||
- `PYTHON_LIB`: `C:\Python363\libs`
|
||||
- `RobotRunCommonLib`: `C:\SynologyDrive\codes\CommonLib\RobotRunCommonLib`
|
||||
- `SWIGCmd`: `C:\SynologyDrive\PortableApps\swigwin-4.0.2\swig.exe`
|
||||
|
||||
# 參考
|
||||
- [How to open the full right-click menu by default on Windows 11](https://www.xda-developers.com/how-to-open-full-right-click-menu-by-default-windows-11/)
|
||||
- [【教學】Windows 11 系統優化](https://ofeyhong.pixnet.net/blog/post/225581177)
|
||||
25
21.02. Windows/_Map.canvas
Normal file
25
21.02. Windows/_Map.canvas
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"nodes":[
|
||||
{"id":"e724a0b36766d3a9","type":"group","x":440,"y":-480,"width":475,"height":880,"label":"應該是可用的流程"},
|
||||
{"id":"0138bfb5c46d71f1","type":"text","text":"1. 用[[powercfg powerthrottling]]關閉 VirtualBox power throttling。","x":-149,"y":-191,"width":329,"height":91},
|
||||
{"id":"d34f3157e07cb50d","type":"text","text":"開始","x":-200,"y":40,"width":100,"height":50,"color":"2"},
|
||||
{"id":"c276871e8748cbfe","type":"text","text":"[PowerWriteDCValueIndex](https://learn.microsoft.com/zh-tw/windows/win32/api/powersetting/nf-powersetting-powerwritedcvalueindex)\n```c\nPowerWriteDCValueIndex(NULL, scheme,\n &GUID_PROCESSOR_SETTINGS_SUBGROUP, \n &GUID_PROCESSOR_THROTTLE_MAXIMUM, percent);\n```","x":460,"y":-88,"width":429,"height":149},
|
||||
{"id":"b89cd7d463506018","type":"text","text":"[PowerSetActiveScheme](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powersetactivescheme)","x":549,"y":100,"width":252,"height":60},
|
||||
{"id":"dd89a32995de8e4a","type":"text","text":"# 參考\n- [Tweak CPU Power Elegantly on Windows - kkocdko's blog](https://kkocdko.site/post/202110041950)\n- [Powersetting.h header - Win32 apps | Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/)","x":460,"y":200,"width":435,"height":180},
|
||||
{"id":"154d88218d26f035","type":"text","text":"[PowerWriteACValueIndex](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powerwriteacvalueindex)\n```c\nPowerWriteACValueIndex(NULL, scheme, \n &GUID_PROCESSOR_SETTINGS_SUBGROUP,\n &GUID_PROCESSOR_THROTTLE_MAXIMUM, percent);\n```","x":460,"y":-255,"width":429,"height":151},
|
||||
{"id":"bb0881e617ca2f52","type":"text","text":"[PowerGetActiveScheme](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powergetactivescheme)\n```c\nGUID guid, *scheme = &guid; PowerGetActiveScheme(NULL, &scheme);\n```","x":502,"y":-460,"width":346,"height":125},
|
||||
{"id":"1b7a2018be9a2542","type":"text","text":"- [[設定CPU Power mode]]","x":80,"y":35,"width":250,"height":60},
|
||||
{"id":"034536d7a91d7b62","x":-100,"y":320,"width":133,"height":60,"type":"text","text":"工具設定"},
|
||||
{"id":"197b4dc40754a989","x":-201,"y":460,"width":335,"height":211,"type":"text","text":"- [[Chrome]]\n- [[freefilesync]]\n- [[Obsidian 操作]]\n- [[SublimeText]]\n- [[vim]]\n- [[Visual Studio Code]]\n- [[Windows 11 重灌]]\n- [[Windows Terminal]]"}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"5c4879a42c2db8ac","fromNode":"d34f3157e07cb50d","fromSide":"top","toNode":"0138bfb5c46d71f1","toSide":"bottom"},
|
||||
{"id":"631e78e7dee93490","fromNode":"d34f3157e07cb50d","fromSide":"right","toNode":"1b7a2018be9a2542","toSide":"left"},
|
||||
{"id":"f60c6e07e0ef6a98","fromNode":"c276871e8748cbfe","fromSide":"bottom","toNode":"b89cd7d463506018","toSide":"top"},
|
||||
{"id":"7fada69bb11ae874","fromNode":"154d88218d26f035","fromSide":"bottom","toNode":"c276871e8748cbfe","toSide":"top"},
|
||||
{"id":"d4c1beba2bea0171","fromNode":"bb0881e617ca2f52","fromSide":"bottom","toNode":"154d88218d26f035","toSide":"top","label":"SchemeGuid"},
|
||||
{"id":"7000cd2de2280a0a","fromNode":"1b7a2018be9a2542","fromSide":"right","toNode":"e724a0b36766d3a9","toSide":"left"},
|
||||
{"id":"82d29d89f73fd716","fromNode":"d34f3157e07cb50d","fromSide":"bottom","toNode":"034536d7a91d7b62","toSide":"top"},
|
||||
{"id":"035012a29ceb315e","fromNode":"034536d7a91d7b62","fromSide":"bottom","toNode":"197b4dc40754a989","toSide":"top"}
|
||||
]
|
||||
}
|
||||
15
21.02. Windows/command.md
Normal file
15
21.02. Windows/command.md
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
### 取得日期時間
|
||||
在 batch 檔裡面可以用 `%date%` 與 `%time%` 來取得日期時間。
|
||||
用 `%date:~0,4%` 來擷取特定欄位。
|
||||
`~0,4` 表示**從 index 0 開始取 4 位**,所以假設原本 `%date%` 會輸出 `2024/05/29`, `%date:~0,4%` 則會輸出 `2024`。
|
||||
|
||||
取得年、月、日、時、分、秒下:
|
||||
```bat
|
||||
set YYYY=%date:~0,4%
|
||||
set MM=%date:~5,2%
|
||||
set DD=%date:~8,2%
|
||||
set HOUR=%time:~0,2%
|
||||
set MIN=%time:~3,2%
|
||||
set SEC=%time:~6,2%
|
||||
```
|
||||
6
21.02. Windows/powercfg powerthrottling.md
Normal file
6
21.02. Windows/powercfg powerthrottling.md
Normal file
@@ -0,0 +1,6 @@
|
||||
對於特定的軟體,使用 `powercfg` 來關閉 powerthrottling。例如,讓 [VirtualBox](https://www.virtualbox.org/) 最大效能執行:
|
||||
```cmd
|
||||
powercfg /powerthrottling DISABLE /PATH "C:\Program Files\Oracle\VirtualBox\VirtualBoxVM.exe"
|
||||
powercfg /powerthrottling DISABLE /PATH "C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe"
|
||||
powercfg /powerthrottling list
|
||||
```
|
||||
8
21.02. Windows/設定CPU Power mode.md
Normal file
8
21.02. Windows/設定CPU Power mode.md
Normal file
@@ -0,0 +1,8 @@
|
||||
用 [`PowerWriteACValueIndex()`](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powerwriteacvalueindex) 或是 `PowerWriteDCValueIndex()` 來設定,然後用 `PowerSetActiveScheme()` 使其生效。
|
||||
|
||||
關於 scheme 的 GUID: https://learn.microsoft.com/en-us/windows/win32/power/power-setting-guids
|
||||
|
||||
C#的使用:[C#使用WinAPI 修改电源设置,临时禁止笔记本合上盖子时睡眠(使用PowerGetActiveScheme等函数,以及C#对WINAPI的调用) - findumars - 博客园](https://www.cnblogs.com/findumars/p/6298724.html)
|
||||
使用 API 的例子:[qt - Disable CPU package idle states in Windows from C++ code - Stack Overflow](https://stackoverflow.com/questions/69346153/disable-cpu-package-idle-states-in-windows-from-c-code)
|
||||
|
||||
[API for Minimum(Maximum) Processor State , C++ - Stack Overflow](https://stackoverflow.com/questions/22523708/api-for-minimummaximum-processor-state-c)
|
||||
Reference in New Issue
Block a user