I know this sounds crazy, but trust me, it’s the right solution.
One command to find out which process prevents your PC from sleeping
When you click down the button of sleep, only screen is off but the PC is still running. After rebooting, sleep will work.
Why? Because some process is running and preventing your PC from sleeping. After rebooting the PC, the process will be terminated so that you can sleep the PC.
We can use just one command to find out the process.
Open your CMD or Powershell, and input this command:
Well, we can find that a process named NeatDM.exe is preventing sleeping. It’s a download software. After closing it, I can sleep my PC at once.
Remember, this is for the situation where you sleep your PC but it wakes up at once.
However, sometimes you would face the situation where the PC slept successfully, but it wakes up later for a while. For this situation, you need to use this command to check which device woke your PC up last time:
However, sometimes things get wired. You just see the woke device is Fixed Power Button, but you didn’t press the button! OK, for this strange thing, I find it caused by Wake on LAN. Some devices in your LAN woke your PC up but Windows recorded it as Fixed Power Button.
Finally, maybe you need to check your Power Plan settings. Disabling Wake Timer is very useful. Many programmes, including Microsoft, will use some methods to wake your PC up. If you want to control the PC by yourself, just disable Wake Timer.
Windows 11: Microsoft Unofficially Announce Old Hardware PC Support Suspended
Well, for many years, Windows and Linux are two main operating systems which support many old hardware PCs. If you are familiar with the history of Mac OS and iOS, you will find how radical Apple is. Even for Android, one of the largest open source free OS, it would drop old devices very far away very quickly.
Most impressed, my old PC built in 2008 still can install and run Windows 10. Every function is good and experience is very smooth. However, good days have gone.
On official website, Microsoft lists requirements for Windows 11:
- Processor: 1 gigahertz (GHz) or faster with two or more cores on a compatible 64-bit processor or system on a chip (SoC).
- RAM: 4 gigabytes (GB) or greater.
- Storage: 64 GB* or greater available storage is required to install Windows 11.
- Additional storage space might be required to download updates and enable specific features.
- Graphics card: Compatible with DirectX 12 or later, with a WDDM 2.0 driver.
- System firmware: UEFI, Secure Boot capable.
- TPM: Trusted Platform Module (TPM) version 2.0.
- Display: High definition (720p) display, 9″ or greater monitor, 8 bits per color channel.
- Internet connection: Internet connectivity is necessary to perform updates, and to download and use some features.
- Windows 11 Home edition requires an Internet connection and a Microsoft Account to complete device setup on first use.
First, we notice that the CPU is x64 only. It actually drops the support for old CPUs. But this is not a main problem because nearly all mainstream CPU running today is x64 compatible.
If you are ready to run x64 OS, you must have at least 4GB RAM, 8GB or 16GB recommended. But this is not a problem either: RAM is usually cheap, especially old DDR3 RAM. You can buy RAM to upgrade.
Then we find GPU should be compatible with DX12. Most recent GPUs, including Core Graphics Cards built in CPU, will be fine. But I’m not sure if it should be native DX12 support or just compatible with DX12. If the requirement is native DX12, I think many old GPUs need to be upgraded. And the laptops which only have old Core Graphics Cards would be dropped totally because they cannot upgrade their GPUs. The only method is to buy a new laptop.
Until now, there is no real challenge for upgrading. But the true trouble is there.
The most important thing here is that Windows 11 needs two things: UEFI and Secure Boot, TPM. These two things are very awful for old PCs because they cannot support them.
UEFI and Secure Boot usually come with motherboards produced around 2010. This means old PCs should change their motherboard. But changing motherboard means change a whole new PC because CPU, RAM and Motherboard are based on the same platform. If you change your motherboard, you change the whole platform. You would buy motherboard, CPU and RAM.
TPM usually comes with two solutions: hardware chips and CPU support.
Most of motherboards doesn’t have hardware chips on them because the chips are very expensive. And also, these motherboards would not build a preserved slot to let you install hardware chips because manufacturers think you will never buy any hardware chips.
CPU support TPM is much easier. However, it requires very latest CPU. That’s why we will find Microsoft’s support CPU list for Windows 11 is radical: 8th generation Intel later and AMD Ryzen 2000 later. I would like to say it’s very insane. But if you want your PC supports TPM, you must have those latest CPUs.
So, the truth is that Microsoft suspends old PCs. They are not allowed to install Windows 11.
But what I want to say is that it shouldn’t be like that. UEFI and TPM should be an optional requirement and they are only secure methods for PC. If you want to have best safe environment, you should have them, or you could still use your PC with new Windows 11. No functions will lose effects. If your PC can run Windows 10 well, it should run Windows 11 well too.
I don’t know why Microsoft chooses this radical policy. It’s weird.
There are three months for launching the new system, maybe Microsoft will change its minds.
The ironic thing is that even Apple is so radical to enforce every Mac device has TPM hardware chip, the Hackintosh is still so popular. Maybe there will be Hackindows in the future to let the device which doesn’t support UEFI, Secure Boot or TPM can install and run Windows 11.
VS Code SSH remote connect to Linux Server (Hand-by-hand Full Solution)
First of all, forget the one who told you using Putty to generate the key, it’s outdated now.
Why? Because in the past, only Linux supports SSH so that Windows should use third party tool to realize SSH remote connection. But now Windows 10 supports native SSH Client, so you must get used to this one and avoid strange errors or wrongs.
Then, let’s see how to generate SSH key by native SSH Client. It’s easy. Open your local terminal (Linux or Windows) and execute:
In fact, though there is many options can be added, I only recommend one:
ssh-keygen -C username
Must be uppercase C and you can change the username to be any name you want to use, but that should be used to log in your Linux Server as its username later. It should be the same as your Linux username.
To get best experience, please considering to use root by default, or you will confront some strange problems related to permissions.
After you execute the command, you just follow the instructions on the screen. If you want not to overwrite the existing key files, change the default directory. If it suggests you to input Phrase, that can be empty, just enter directly.
When done, remember the default directory in the instruction just now? For Windows, you can cd into
C:\Users\your_username\.ssh\; for Linux, you can cd into home/username/.ssh/.
Private Keys and Public Keys
Now you can see two files: id_rsa and id_rsa.pub.
pub means public, so its a public key. For the other with no extension, it’s a private key.
Here is the annoying question: where should I put them?
Well, if you look up on the internet and you will find too much information about that but you will be more confused.
Exactly, ssh-keygen is just a tool to generate keys, that’s all. It’s not about how to connect. So whatever you generate on Windows or Linux, Client or Server, that’s fine, don’t care about it. You just use a tool to generate two files.
But then the following question again is: So where should I put them indeed?
Well, maybe there is many theories behind the scene, but let me tell you the simple truth: client stores the private key and server stores the public key.
For example, you have PC A and PC B, you want to use PC A connect to PC B, so you should store the private key on PC A and store the public key on PC B.
But you should always make sure they are in a pair because you may have generated many key pairs before or later.
Why the server should store the public key? In fact, it’s easy to understand. The server will show the public key to anyone, but only allow connecting with who holds the private key. Due to the key stored on the server is public, so we called it public key.
Store Public Keys to the Server
Now that we have known we should upload our public key on the server, let’s do it. If your client is Linux, thats easy, using:
But if you are using Windows, ssh-copy-id should not work. So we need to understand what ssh-copy-id does.
Okay, we find a new file called authorized_keys. Go to your Linux server (use shell, SFTP or GUI), create that authorized_keys file under home/user/.ssh/ and copy the pub file contents (you can open it by VS Code) and paste into the new empty file. Save it.
In case, reboot your Linux server now.
If you are familiar with Linux command line, you can create (touch or nano or vim) a file with filename authorized_keys and paste the text contents of the public key files into it, and then save it.
And now we should care about our path to store the private key. If you generate the keys on Windows directly, you should store it under C:\Users\username\.ssh\. If you generate it on Linux but you want to let it be stored on your Windows, you should download it from the Linux first. How to download it? I think SFTP is the best way. Use your SFTP tool to download it from Linux path home/username/.ssh and then store it under the same path on Windows.
Now we should check what we have done before we go on:
- we generate SSH Keys in a pair using ssh-keygen
- we store the private key on our client Windows PC (under C:\Users\your_username\.ssh\)
- we store the public key on our server Linux PC (under home/username/.ssh/authorized_keys)
VS Code Connects to the Server
Open your VS Code, install SSH extensions in Extension Store. After installation, you will find a new icon on the side bar. Click it.
You can add new connection by “+” button. Follow the instruction on the top popped out dialog. After done, click ⚙ button. It will let you choose the path where SSH key files store. Then you will open a config file.
You can edit something here:
Host will change the UI display on the panel.
Hostname: the IP address or URL of your server.
User: should be the same as ssh-keygen -C username.
Port: the SSH port. Default is 22.
If you are using Virtual Machine like VirtualBox, you need to forward your Virtual Machine port (like 22) to the Host Machine port (like 12345).
IdentityFile: if you don’t add this option, VS Code will use the default ssh path (C:\Users\username\.ssh). But if you have many SSH key files to store in different paths, you should tell VS Code where is that file. On Windows, the “\” should be changed to “\\”.
Edit this file as your condition and save it.
Sometimes, there’s a problem on connecting a server by a forwarded port. You need to use the server real IP directly. You need use “ifconfig” command on your server shell screen. If it doesn’t work, just use apt install net-tools to get it. Type ifconfig, you will see server IP on the shell screen. Use this IP in your vscode config file, and set Port as 22(or delete Port line because the default port is 22).
Before we go, a small thing we need to deal with: go to C:\Users\username\.ssh, you will find a file called known_hosts. Delete it, it will be regenerated itself.
Return your VS Code panel, move your cursor on the server you want to connect, an icon will be shown on the right. Click it and you will begin connection in the new window. Follow the instruction on the top pop out dialog, then everything should be done.
If you want to connect to the server by tools like Putty or Shell…
Remember, you must use the same username as your keys generated, or the server will deny connection. (Error message: Permission denied (publickey))
For example, if we generated the key with username jaylin, and you want to connect to the server by Shell, you must use the command below:
After log in as jaylin, if you want to get root permission, you can use
If your private keys stored in some specific path, you should use command below:
ssh -i /path/id_rsa jaylin@ipaddress
If you still meet strange problems, try to delete the known_hosts file under C:\Users\username\.ssh.
最近尝试各种开发环境后，逐渐明白所谓的开发环境，还是原生态最好。Continue reading “开发应与开发环境相适应：Windows下的开发环境最优解”
You will never disable Windows Defender in Windows 10 1909 (Solutions attached)
As of the year 2021, Windows Defender has been improved very much. Though its UI not changed a lot, the efficiency (CPU consumption) and accuracy are very close or equal to those famous antivirus softwares.
Today the ransomware and coin mining malwares are extremely wild, I recommend you enabling at least one security software. I think for those home users, Windows Defender is enough.
If you still want to know how to disable Windows Defender, you can go on reading.
My PC has been naked for many years because I nearly use anything unknown or dangerous.
For the older versions of Windows, which is before 1909, I disable Windows Defender in the Group Policy (gpedit.msc). Howerve, I find it doesn’t work any more.
If you install the OS all freshly and disable Windows Defender as soon as possible in the Group Policy, it will be fine. The Defender is totally sleeped.
But if you have opened and updated it once, the defender will be awakened and you won’t come back. It’s so annoying.
Even if you disable the real-time protection in the Group Policy, it will still update the data library automatically and turn on the real-time protection again.
Why must we focus on this problem?
Well, it’s funny.
You can open your task manager and find a progress or a service named Antimalware Service Executable. Click the “>” button, you will find a service named Windows Defender Antivirus Service.
The memory usage of it is very incredible, up to 100MB! And if you open a new program, it will check first, you PC will be slow, the opening of the software is slow and the memory usage will be added more.
Well, it’s not funny at all.
How to disable it?
As I said before, the Group Policy doesn’t work any more.
Here are two solutions.
You can exclude the root folder of disk drivers in Windows Defender.
Forget the Chinese language and I wish you will find the option by yourself.
Do as following. Copyright belongs to the original writer or the website.
The Latest Version of Visual C++ I Have Known So Far
- 2005 (it’s hard to download latest version directly from Microsoft.com, you need to get it via Windows Update after you have installed the older version)
- x86: 8.0.61001
- x64: 8.0.61000
- 2008 (it’s hard to download latest version directly from Microsoft.com, you need to get it via Windows Update after you have installed the older version)
- 2010 (you can get it from Microsoft.com)
- 2012 (you can get it from Microsoft.com)
- 2013 (you can get it from Microsoft.com)
一开始觉得是显卡的问题，但是不想折腾硬件，于是先自行调整了系统特效选项，发现故障依旧。Continue reading “已确认新版Nvidia驱动在Win10双显卡下存在切换窗口卡顿问题（376.54驱动已解决）”
我用U盘引导进入Ubuntu Live，发现WLAN默认开启，使用正常。Fn+F5可以实现开关WLAN的操作。接着我又尝试着开关了几次，然后我发现和在Win10下一样，再也无法打开开关了。不甘心，重启进入Ubuntu Live，看了看打开着的开关和一行行SSID，心想，算了，就让它这么留着吧，回Win10看看去。重启返回Win10，WLAN默认开启，可以反复开关，接管成功。至此，问题得以解决。
所以总结一下，如果出现Win10无法打开WLAN开关的问题，确实要到另一个操作系统去先开启WLAN开关，然后Win10就可以接管操作了，具体原因未知。而另一操作系统则未必要重装一个新系统，除非你正好打算重装。最佳的办法应当是刻录一个Ubuntu Live或者找一个可以开关WLAN的PE（虽然我没见过这样的PE，不过假如这是Win10的bug的话，那么今后PE带WLAN开关也许会是一个必备的功能吧）。另外还有各种装在U盘里的操作系统，更是不在话下了。但是如果只是为了解决这个问题，大概选择刻录Ubuntu Live会是最好的选择。
Win10 Update just updated the Nvidia driver to 376.54 today and I have a method to install the old version which you want to restore
Win10’s update cannot be set to not update the driver and it always includes the driver that just released internal, not public. These versions’ drivers may cause some problems, especially compatibility problem.Continue reading “Win10 Update just updated the Nvidia driver to 376.54 today and I have a method to install the old version which you want to restore”