2020年11月6日 星期五

SSD Format 4K using command

進入command模式
shift+F10

或直接windows cmd
cmd

打開diskpart
diskpart

列出硬碟清單,找出要操作的編號
list disk

選擇硬碟
select disk 0

清除硬碟
clean

初始化磁區
create partition primary align=1024

列出磁區,找出要操作的編號
list partition

選擇磁區
select partition 1

啟用磁區
active

格式化
format fs=ntfs unit=4096 quick

2020年11月4日 星期三

「調校」 透過關閉一些服務解決 Windows 10 CPU 使用率高的問題

https://zi.media/@yidianzixun/post/pbnXDf

簡單來說關閉以下服務
1. Connected User Experiences and Telemetry
2. Diagnostic Policy Service
3. Diagnostic Service Host
4. Diagnostic System Host

關閉P2P的windows update
1. 在找到最佳化傳遞並關掉它

關閉

[工作排程器]-[Microsoft]-[Windows]-[Application Experience]刪除或停用[Microsoft Compatibility Telemetry]排程



還有一些優化
關閉Windows Search
關閉superfetch(現叫sysmain)
關閉虛擬記憶體
https://kknews.cc/zh-tw/news/e4v5ejy.html


提高指定程式的優先權
https://superuser.com/questions/620724/changing-windows-process-priority-via-command-line

wmic process where name="node.exe" CALL setpriority "above normal"
wmic process where name="webstorm64.exe" CALL setpriority "above normal"

之類的

2020年8月27日 星期四

bash 的載入順序

打開bash後,要編寫變數可以寫在 ~/.bash_profile 或 ~/.bashrc。

也許還聽過 /etc/profile

位置不同但效果相同,有想過這些順序和情境到底怎麼使用嗎?

  • /etc/profile
  • ~/.bash_profile
  • ~/.bashrc
  • ~/.bash_login
  • ~/.profile
  • ~/.bash_logout
// 一般順序
execute /etc/profile
IF ~/.bash_profile exists THEN
    execute ~/.bash_profile
ELSE
    IF ~/.bash_login exist THEN
        execute ~/.bash_login
    ELSE
        IF ~/.profile exist THEN
            execute ~/.profile
        END IF
    END IF
END IF
// 互動登出
IF ~/.bash_logout exists THEN
    execute ~/.bash_logout
END IF
//互動式非登入
IF ~/.bashrc exists THEN
    execute ~/.bashrc
END IF


參考文章在此

Execution sequence for .bash_profile, .bashrc, .bash_login, .profile and .bash_logout

 https://www.thegeekstuff.com/2008/10/execution-sequence-for-bash_profile-bashrc-bash_login-profile-and-bash_logout/

2020年6月30日 星期二

Enable shutdown button on windows logon screen

For Windows 7 & 10 Regedit \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System shutdownwithoutlogon 1: Enable 0: Disable

2020年6月29日 星期一

[Git] unable to get local issuer certificate 解決

假設 git pull 時遇到

Cloning into 'project'...

fatal: unable to access 'https://myproject.mattmytech.com:31001/project/project.git/': SSL certificate problem: unable to get local issuer certificate



有一個簡單但不安全的作法就是暫時關掉 HTTPS SSL 的檢查
git config --global http.sslVerify false


如果不要全域就拿掉 global
git config http.sslVerify false


再次 pull code 就成功了

但要記得你把 sslVerify 關了喔!

2020年6月18日 星期四

不建議在 Windows 10 中關閉固態硬碟的磁碟重組(Trim)

在 Windows 10,相信大部份使用者是使用 SSD (固態硬碟)。
為了避免不必要的操作 SSD。可以照下列步驟關閉「磁碟重組」這項功能。
但是 Windows 10 系統會自動判斷磁碟硬體是固態硬碟或傳統硬碟,若是固態硬碟所執行的為 Trim 指令,傳統機械硬碟才是 Defrag 重組。

根據狐大的介紹,我們還是不要去動這些設定比較好!
參考連結:https://www.fox-saying.com/blog/post/47402717





1. 在開始的地方輸入「重組」就能快速找到系統內建的重組工具




2. 選擇每個「固態硬碟」並點選右下側的變更設定




3. 取消勾選「依排程執行」



所以結論就是:固態硬碟就讓 Windows 10 自動最佳化。傳統機械硬碟就由使用者自行決定是否要自動重組。

2020年6月1日 星期一

移除Win10檔案總管中 [3D物件][文件][桌面][音樂] 那些不想看到的資料夾

移除Win10檔案總管中 [3D物件][文件][桌面][音樂] 那些不想看到的資料夾

參考1 https://zhuanlan.zhihu.com/p/25942015
參考2 https://www.howtogeek.com/331361/how-to-remove-the-3d-objects-folder-from-this-pc-on-windows-10/

// Remove 64
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

// Restore 64
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

// Remove 32
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

// Restore 32
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

最後將檔案存成 .reg 即可