Linux基本
reptyr
ubuntu 可以直接利用apt进行安装。
reptyr is a utility for taking an existing running program and attaching it to a new terminal. Started a long-running process over ssh, but have to leave and don’t want to interrupt it? Just start a screen, use reptyr to grab it, and then kill the ssh session and head on home.
reptyr works by attaching to the target program using ptrace(2), redirecting relevant file descriptors, and changing the program’s controlling terminal (See tty(4)) It is this last detail that makes reptyr work much better than alternatives such as retty(1).
</br>
ALIAS
今天在编辑macos的zshrc的时候忘记了``的作用。 创建了一个每天9点01分的计划任务,用来创建一个文件,文件名为: date +%Y-%m-%d’-record.md, 然后在zshrc里面创建alias, alias trd=”cd /Users/ls3686/my_daily_record && vi `date +%Y-%m-%d-record.md`”,
就可以每天用trd来编辑当天的文件了。
</br>
Strace
strace -e execve ls -alhc output: execve(“/bin/ls”, [“ls”, “-alhc”], 0x7ffc848b1f78 /* 25 vars */) = 0
In the simplest case strace runs the specified command until it exits. It intercepts and records the system calls which are called by a process and the signals which are received by a process. The name of each system call, its arguments and its return value are printed on standard error or to the file specified with the -o option.
strace is a useful diagnostic, instructional, and debugging tool. System administrators, diagnosticians and trouble-shooters will find it invaluable for solving problems with pro‐ grams for which the source is not readily available since they do not need to be recompiled in order to trace them. Students, hackers and the overly-curious will find that a great deal can be learned about a system and its system calls by tracing even ordinary programs. And programmers will find that since system calls and signals are events that happen at the user/kernel interface, a close examination of this boundary is very useful for bug isola‐ tion, sanity checking and attempting to capture race conditions.
</br>
windows 10 multi rdp session
默认的windows桌面操作系统,rdp的时候只能有一个session,后面尝试登录的session会将前一个强制注销掉,或者要求前一个的批准。 这个工具可以让桌面操作系统提供多达15的远程连接session。