(grok)Best Practice for Writing Bash Scripts
what is the best practice for writing bash scripts
what is the best practice for writing bash scripts
提升 Linux
性能。
今天在看这篇介绍 Linux 性能调优 的博客(Linux Performance: Almost Always Add Swap Space),其中涉及到如何调整内核内存的调整机制。主要的参数有
swappiness
: This control is used to define how aggressively the kernel will swap memory pages. Higher values will increase aggressiveness; lower values decrease the amount of swap. (default = 60, recommended values between 1 and 60) Remove your swap for 0 value, but it is usually not recommended in most cases.vfs_cache_pressure
: Controls the kernel’s tendency to reclaim the memory, which is used for caching of directory and inode objects. (default = 100, recommend value 50 to 200)最近在研究如何使用 nvim-dap
进行 debugging
。在 gdb
,我们可以很方便的使用单个按键就可以触发一些行为,如
r
: run
c
: continue
s
: step-in
那么,我的想法也是在 nvim-dap
实现这样快捷键 r
来模拟 run
的行为。现在的问题是:由于在 normal mode
,单个按键 r
代表 replace one character
。
因此,我们需要在 nvim
的 buffers
去识别是否启动了 nvim-dap
dap-repl
,则映射 r
;replace
的功能。