You may receive PermissionError: [WinError 5] Access is denied: ‘C:\\Windows\\to_your_path’ while you use shutil.rmtree python code in windows environment.
shutil.rmtree is utility with a function that can remove directory in windows even if it contains files or subdirectories.
But what happens when you encounter WinError 5?
It may be while you use explorer.exe to enter the directory you want to delete and go back to the parent folder in some cases.So, it may be explorer.exe occupy the directory handles while you use explorer to check it and go back and run the python script.
Solution: Just close the explorer window which contains the history of the directory you want to remove.
All posts by publisher
how to run python in linux bash
If I have a python script in linux, touch run.sh:
#!/bin/bash
python3 script_name.py
chmod +x run.sh
How to update telegram
How to show all notication icon on task tray in windows 11
1.Run cmd.exe with admin privilege
2. run the following command in cmd. It will display a new dialog.
explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}
3.Operation on the dialog.
Reference:https://www.cnblogs.com/lalaza/p/17235965.html
tplink tl-sg2016d 802.1q vlan settings
I want to divide wan_net,lan_net and iptv net in the home ethernet. 2 switches are response to divide vlan, which are tl-sg2016d and tl-sg2008d.
I always use 1 cable cat-6 line of port 1 for single line multiplexing. Port 1 is responsible for the transmission of 3 VLAN. Port 2 is responsible for wan_lan. Port 3 is responsible for iptv. Port 4 and all the remaining ports are responsible for lan network.
1.set 802.1Q VLAN of switches
1.1 set tl-sg2016d

Set wan_net, lan_net, iptv of tl-sg2016d respectively. like pic 1.
1.2 set tl-sg2008d

Set wan_net, lan_net, iptv of tl-sg2008d respectively. like pic 2.
2.modified 802.1Q VLAN PVID to assign vlan tag
2.1 set tl-sg2016d

Assign port 4-16 as VLAN 3(lan_net).Assign port 2 as VLAN 2(wan_net).Assign port 3 as VLAN 4(iptv).Assign port 1 as VLAN 1(default).
2.2 set tl-sg2008d

Assign port 4-8 as VLAN 3(lan_net).Assign port 2 as VLAN 2(wan_net).Assign port 3 as VLAN 4(iptv).Assign port 1 as VLAN 1(default).
3. Other thing about ip address
You can assign a lan_net ip address and gateway to switch to replace ip 10.18.18.251 to manage it in the local network.
reference:
1.https://resource.tp-link.com.cn/pc/docCenter/showDoc?productId=1239&type=USER_MANUAL&id=1734588904915967
Upgrade wordpress to 4.1.40
We have upgrade word press from 3.8.3 to 4.1.40 on 17th, Jan,2025.
Just stop web server, and rename the old site directory name, and rename the 4.1.40 to original directory name, chmod the right of directories. Copy the upload content if it exists.
Execute the wp-admin/upgrade to alter the database structure.
Excute the Permalinks to re-generate the pages link.
Stay for a while, and remove snapshot on vps and backup.
Finally, we could use WordPress app on ipad of ios 17.
How to disable comment on a post article?
If you have disabled comments in the settings, but you can still receive comments on some post article, do this.
Just click “quick edit” of a post article , then un-click the “allow comment” and “allow ping” checkbox, update it.
To alter all the post articles by using “quick edit”.
How to move steam game to another disk without update?
1. Make your steam offline.
Just click offline in the left-up corner of “steam” menu.
2.Find your game .acf file.
Assuming G disk is your old steam library. In the directory, G:\SteamLibrary\steamapps\, you find “appmanifest_2358720.acf” file.
You could query the game number id on the steam website. In this case, this file is about “black myth: WuKong”.
3.Change the state.
Open the file, find “StateFlags”, and change the any other state number to 4.
Known state: 4. All update; 6.unknown state, could run game; 38, an unknown state, need to update, couldnot run the game.
4.After succeed move the game, change the state code again.
“appmanifest_2358720.acf” is in your new directory. You should do step 3 to lunch the game in new location.
Moving iCloudDrive content from C: drive on Windows
1.Install iCloudSetup.exe in windows. You can not do anything such as alter the install directory, or change the content storage path.
2. Kill “iCloudDrive.exe” and “iCloudService.exe” process by taskmgr.
3.open cmd.exe, assuming the [username] represent the username you are logged in. Input command: cd c:users[username] . The command is case insentive.
4.Change the directory name.
ren c:users[username]iCloudDrive c:users[username]iCloudDrive.old
5.Create your new storage directory, such as You:pathtoiCloudDrive
6.Create a junction use command:
C:Users[username]>mklink /j "iCloudDrive" "You:pathtoiCloudDrive"
You get a junction directory to new destination, and the storage will not occupy your c drive space.
You can also use command to get a SYMLINKD directory:
C:Users[username]>mklink /d "iCloudDrive" "You:pathtoiCloudDrive"
It also does not occupy your c drive space.
chat ai
Artifical Intellgence chat talk.
chatgpt: https://chat.openai.com
Bard, now as gemini. https://bard.google.com
bing ai chat, not confirm:/*https://bing.com/chat*/
https://copilot.microsoft.com
https://claude.ai/
https://opencat.app
Integrated platform: https://poe.com
perplexity: https://perplexity.ai