一、Jupyter-Note#
局域网访问#
- 方法1:
- 使用
jupyter notebook --generate-config生成配置文件 - 修改配置文件中
c.NotebookApp.allow_root(因为安卓用的Termux跑的,所以伪root),c.NotebookApp.ip这样就能通过局域网和Token访问了 - 如果想要使用密码(长期使用局域网的话),可以使用
from notebook.auth import passwd;passwd()生成加密密码,配置到c.NotebookApp.password
- 使用
- 方法2:
- 如果只是临时的,那传入运行命令肯定最好了,如下可以使用如下格式:
jupyter-notebook --allow-root --ip=0.0.0.0自动补全#
- 安装插件:
pip install jupyter_contrib_nbextensions -i https://pypi.tuna.tsinghua.edu.cn/simple(此命令包含代理) - 到
Nbextensions中将Disable改为Enable - 开始
二、Vim#
1. vim 查看日志中文乱码(2021)#
.bash_profile#
export LC_ALL=en_US.utf-8.vimrc#
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8双管齐下, 一个解决系统配置, 一个解决vim配置
2. 中文乱码问题(2018)#
在.bash_profile中增加
export LANG=zh_CN.utf8
export LC_ALL=zh_CN.utf8即可增加中文支持。 不过,还是
export LANG=en_US.utf8
export LC_ALL=en_US.utf8比较香,因为中文字体这里渲染出来很难看… ^_^: 2019年5月5日19点46分
3. Ctrl + v被封印#
在 Windows 中使用 Vim 时,Ctrl+V 快捷键被系统或终端占用于粘贴操作,导致无法直接执行竖列(块)选择。以下是三种解决方案:
方法 1:使用替代键 Ctrl+Q#
在 Vim 的 普通模式 下,按下 Ctrl+Q 即可触发竖列选择(替代 Ctrl+V 的功能):
- 按
Esc进入普通模式 - 移动光标到起始位置
- 按
Ctrl+Q进入块选择模式 - 用方向键(或
h/j/k/l)选择竖列区域 - 执行编辑操作(如
d删除、I插入、c修改等)
✅ 推荐:这是最通用的解决方案,适用于 Windows 终端、GVim 及大部分场景。
方法 3:重映射 Vim 快捷键(高级)#
在 _vimrc(GVim)或 .vimrc(终端 Vim)中添加配置:
" 将 Ctrl-B 映射为竖列选择(可自定义键)
nnoremap <C-B> <C-V>此后在普通模式按 Ctrl+B 即可触发竖列选择。
三、vscode vs code#
venv#
Python#
Command Palette...(Ctrl+Shift+p)
>Python: Select Interpreter然后选择就好了.
当然不会那么安逸(.vscode/launch.json)
2022-01-18 11:34
.vscode/launch.json配置(图形化都是骗人的)#
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File", // 自定义名称
"type": "python",
"pythonPath": "{配置python解释器路径}",
//调试程序时的工作目录,一般为${workspaceRoot}即代码所在目录
"cwd": "${workspaceRoot}",
"request": "launch",
"program": "${file}", // 可直接指定文件
"console": "integratedTerminal"
}
]
}四、find + vim 查找打开一条龙#
find * -name "*wd.csv" -exec vim {} \;来自find --help的解释: -exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;
-exec兼容多条命令, bash监控;,但find也用;中断,所以在bash运行需要转义一层….也就变成了\;
五、三兄弟『grep sed awk』#
搬迁 -> [[文本三剑客]]