Projectile Notes

重新生成 项目 cache

  • 调用函数 M-x projectile-invalidate-cache

忽略文件问题

https://docs.projectile.mx/projectile/2.2/projects.html#ignoring-files

  • 使用 .projectile 配置
  • 或者 设置变量

    • projectile-globally-ignored-files
    • projectile-globally-ignored-directiories

.projectile 文件配置

只包含的文件夹 "+"

  • 注意

    • "+" 后面只能跟目录
    • 对文件使用无效
1
2
+/src/foo
+/tests/foo

忽略的文件 或者 文件夹 "-"

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 文件夹
-/log
-/tmp
-/vendor
-/public/uploads


# 文件
-tmp
-*.rb
-*.yml
-models
  • 注意

WSL Notes

工具收集

访问 windows 网络文件

可以使用的方法

  • mount -t drvfs

    1
    2
    3
    4
    
    sudo mount -t drvfs '\\server\share' /mnt/share
    sudo mount -t drvfs '\\freenas\public' /mnt/freenas
    
    sudo mkdir -p /mnt/wsl/ubuntu && sudo mount -t drvfs '\\wsl$\Ubuntu-20.04' /mnt/wsl/ubuntu

无效方法

mklink 法

  • 在 windows 中 mklink /D \\server\share d:\share
  • 再在 wsl 中 访问 /mnt/d/share
  • 原因

threading ---- python multi-threading Python 多线程

强制终止线程

https://blog.csdn.net/A18373279153/article/details/80050177?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import threading
import time
import inspect
import ctypes


def _async_raise(tid, exctype):
    """raises the exception, performs cleanup if needed"""
    tid = ctypes.c_long(tid)
    if not inspect.isclass(exctype):
        exctype = type(exctype)
    res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype))
    if res == 0:
        raise ValueError("invalid thread id")
    elif res != 1:
        # """if it returns a number greater than one, you're in trouble,
        # and you should call it again with exc=NULL to revert the effect"""
        ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None)
        raise SystemError("PyThreadState_SetAsyncExc failed")


def stop_thread(thread):
    _async_raise(thread.ident, SystemExit)


def test():
    while True:
        print('-------')
        # time.sleep(0.5)
        pass


if __name__ == "__main__":
    t = threading.Thread(target=test)
    t.start()
    time.sleep(5.2)
    print("main thread sleep finish")
    stop_thread(t)