Posted in Linux

A stop job is running for Snap daemon on Ubuntu [Soulution and Thinking]

Ubuntu has a snap service built in, sometimes it is hard to kill when reboot or shutdown. If the progress cannot be killed easily, system will handle some time (default value is 90s).

So one solution is change the killing time for progress.

First, we need to have Administrator Permission on Linux. Execute the command:

sudo su

Then follow the message on screen to enter your passwords.

Next we need to edit system files:

“Nano” is a text editor built in Ubuntu, so we can use it. Execute the command:

nano /etc/systemd/system.conf

Don’t be fear because you will find nearly all the text is blue. Why? Because they all comment out with “#” so that no line is effective for the system. What we need to do is uncomment a line and let that line effect.

Use your keyboard arrow keys to move cursor down to find a line called:


Delete the # and change the time to be 10s, like below:


You’ll find the color becomes white because it will be effective for the system.

Then press your keyboard with Ctrl+X, you will see the message on the screen to remind you to save changes. We press Y on the keyboard. Then it shows that you can change the file name, but we do nothing, just press Enter key directly.

Use cat command to see the contents of the edited file.

cat /etc/systemd/system.conf

If you are sure there is no error of that file, then you can reboot your system to see the effect, but may be only the second time to reboot will see the effect. You will see the kill time when shutdown will only be 10s. That’s fine.

To reboot quickly, use command:


But why Snap cannot be stopped as usual? If you’re using Virtual Machine, I think the answer should be there: maybe the snap service in Ubuntu has conflict with Virtual Machine software.

For example, while using VirtualBox, I just use snapshot function restored a snapshot for my Ubuntu server, the conflict will be there. If you just use the console to normally shut down several times, the problem will be gone. To normally shut down, just close the VM window and choose the second option to shut down.

I have changed the system config to 10s once before but I have never seen stuck any more after I normally shut down the machine.

Good luck to you!

Posted in Network






首先,我们需要下载安装一个软件,这款软件的名字叫做Fiddler (。




  • 典型场景:UWP版本的Outlook无法添加Gmail账号,原因就是没有让*******************(一串乱码)通过代理。

备注: Clash客户端自带的Loopback插件就是截取自Fiddler的,如果你下载安装了Clash,就不用再另外安装Fiddler了。


Posted in Windows

You will never disable Windows Defender in Windows 10 1909 (Solutions attached)

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.

Solution 1:

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.

Solution 2:

Do as following. Copyright belongs to the original writer or the website.

Posted in Xiaomi&MIUI

How to deal with Error 7 when you try to flash the Lineage OS for Xiaomi devices

Error 7 or “xiaomi.verify_trustzone(“TZ.BF.4.0.6-00124″,”TZ.BF.4.0.6-00130″) == ‘1’” is very annoying. How can we fix it? Reflash TWRP? Wipe System and Data?

No, you shouldn’t do that. 

First of all, this error is not about any problems for TWRP, so don’t waste your time seeking for other versions of TWRP.

And then, we should learn about one thing: firmware.

Firmware is a low-level code to drive your phone, you can think them as drivers. For example, when you power off your phone, the style of charging is controlled by the firmware.

Usually, firmware files are only included in the official ROMs. That’s why we always hearing people telling us to all-newly flash an official ROM. It can help us make the phone all new like just out of the factory, but also, it can help us get the right firmware.


From now on, just all new flash an official ROM when you want to get an all new device, or you want to unbrick the phone. Only this two reasons are recommended.

Now we know what is a firmware. Let’s see how does error 7 make sense.

In the ROM of Lineage OS, there is a file named updater-script. (How to find it: ROM =>META-INF => com => google => android => updater-script ) In this file, you can see some code to check if current firmware matches the phone. If matched, flash the ROM, or will assert the error 7.

So the right way to fix it is to change the firmware. But remember one thing: don’t always try to find a newer version, maybe the ROM just needs an older one.

For Xiaomi devices, we can easily get all the firmware from this website: It’s very convenient. (Please make sure what you download is matching your device model)

Flashing firmware is very easy. Boot into TWRP => Flash firmware zip. You don’t need do any wiping. So awesome.

But just as I said before, don’t always try to use the latest firmware, for ROM may just want an older one. Because Xiaomi updates their code very frequent, third-party cannot follow them that fast.


Some people try to edit the updater-script to skip the check of firmware. Or some people choose to flash the older firmware to cheat the check and then flash back a newer one to boot the system. These ways are totally wrong.

Why? You should think about why the developers want to check the firmware. They are only responsible for the matched firmware, not others. If you change the firmware outside the range which is defined by the developer, you will meet many strange problems. For example, the fingerprint sensor cannot work properly.

So here is the method to deal with the error 7. Enjoy it.

Posted in Impression

What does Ruel 2 mean in Ray Dalio’s video “How The Economic Machine Works”?

First of all, if you haven’t seen this video before, I strongly recommend you to watch it. You will get thoroughly new ideas for your life.

Here is the video:

And in the end of the video, Ray Dalio suggests you three rules:

1. “Don’t have debt rise faster than income …

… because your debt burdens will eventually crush you.”

2. “Don’t have income rise faster than productivity …

… because you’ll eventually become uncompetitive.”

3. “Do all that you can to raise your productivity …

… because in the long run, that’s what matters most.”

These three rules are very simple but very important. But I get confused by Rule 2. Why he says that I will lose my competitivity if my income grows faster than productivity?

This is stange and nonsense. Nowadays people all over the world are chasing the chance to rise their wages or salaries, and most of they think it is the most important thing in their lives. They change jobs and locations to get the higher payments.

I searched online for some time but can’t get an ideal answer. However, I find something later and know the meaning of it.

Just as what simple knowledges showed in the video, let’s see Rule 2 in the aspect of demand and supply.

If your income grows faster than your productivity, that means the supply is more than demand. Productivity should match your income at the same level. You just should gain what you pay. Too much incomes will lead you lazy and don’t want to improve your productivity.

Meanwhile, higher income will get you in a trap: you think of yourself is strong and have the enough power to earn money. Think about what said in the video: in the fake and foam periods of economy, most people think they have power, money and status etc., but they suddenly find they lost everything in one night.

The last thing is that too much incomes will make you willing to spend your money and extend your loans or debts, and you will find you can’t offset these.

So to sum up, “you’ll eventually become uncompetitive.”

This reminds me of a meme in Chinese:

There are three big unfortunate in the life:

1. Achieve ultimate goal of life or get ultimate reputations and status in the early life
2. Get the windfall
3. Born in the emperor family

In fact, all these three things in China is thought as fortunate or luck that common people can’t get in their whole lives. But if you research some cases in the history, you will find it’s not true.

Many people want to be an emperor, but nearly all the emperors in the history don’t have happy endings. Even those emperors who have happy endings, also pay too much effort to keep their chairs and avoid being killed while they are eating or sleeping. I think the principle behind this meme is the same as Ray Dalio’s Rule 2.

Life is long enough to grow, but few chance to regret. Cherish your life and your family. Don’t be blinded by money.

Posted in Comment





































Posted in Python

Some interesting things about Tuple in Python


The contents in Tuple cannot be changed. But if there is something changeable in Tuple, it can be changed.


t = (“a”, “b”, 1, False, [1, 2, 3])

t[4][0] = 6

print(t)   ### (“a”, “b”, 1, False, [6, 2, 3])


If there is only an element in  tuple, like (1), you should plus a “,” after it, like (1, ). Why?

Because in python, (1) will be recognized as the whole number 1 in maths, so be careful.