xonsh has rich history per session which includes session id, command exit code, timestamp, environment variables etc.
1 | # view input history |
To view the commands:
1 | cat <history_json_file> | jq .data.cmds |
general purpose terminal recorder, available in most *nix platforms:
1 | script <record_filename> |
to render the recorded file as plain text, run the following python script:
1 | import pyte |
for ipython one use %history
for viewing history.
1 | # view current session history |
terminal jupyter notebook
jpterm original rewrite of nbterm, with textualize
运行py的交互式命令行 如果想输出最近的操作 可以运行下面的代码
1 | # please define "history_output_path" beforehand |
在pdb中 或者在breakpoint断点中 只能获取到当前会话的历史
1 | import readline; print([readline.get_history_item(i+1) for i in range(readline.get_current_history_length())]) |
Hackers are good at converting arbitrary actions into scripts.
At every step below we need file records.
1 | Thoughs -> Actions -> Scripts -> Programs -> Systems |
Human learn from trial and error, which is the origin of every good program, and REPL can be a better place than web based jupyter notebook. So we might want to find some command line alternative to jupyter.
Typically we need history, command output, filter out those errorneous commands, and save the output.
R has that functionality.
1 | # only current session history is keeped. |
metasploit history file location: ~/.msf4/history