https://www.gravatar.com/avatar/5f48da38e786436afece6f2e46196202?s=240&d=mp

Linux Shell

rsync 原理

最近研究如何实时的通过rsync传输日志文件,找到下面的文章,很详细。

在开始分析算法原理之前,简单说明下rsync的增量传输功能。

假设待传输文件为A,如果目标路径下没有文件A,则rsync会直接传输文件A,如果目标路径下已存在文件A,则发送端视情况决定是否要传输文件A。rsync默认使用"quick check"算法,它会比较源文件和目标文件(如果存在)的文件大小和修改时间mtime,如果两端文件的大小或mtime不同,则发送端会传输该文件,否则将忽略该文件。

在google voice app上接听电话

一朋友刚到漂亮国的前几天,因没提前准备当地的电话卡,网申又需要好几天,而他又需要买买买,我给他推荐了google voice,又因为自己是键盘出国,当使用时才发现别人呼叫进来的全进了语音信箱,遂研究解决方案并记录一下。

SSH 多路复用加速Ansible

前言

最近发现ansible 执行速度非常慢,执行一次playbook任务部分服务器甚至7秒以上,开启 facts 缓存、pipelining 、mitogen plugin等提升均不大,pipelining 会影响 sudo,而 mitogen 又会影响 api 的执行;正一筹莫展时,灵机一动想到了为什么不建立SSH长连接呢?这样就只需要建立一次连接,第二次直接复用大大减少ssh连接时间。遂上网查资料,并记录一下

2021,平平淡淡

https://statics.lshell.com/images/vaccination-g7bf5b1576_640.jpg

工作

公司继续效益下滑,仅有的几个项目,上线后,效果也并不好,我去看了一下,发现是新瓶装老酒,作为一个不玩游戏的技术,我都知道这一套已经过时了;之前的高仿项目也全部关停了。不过新成立的盲盒貌似还不错。

Zsh Bindkey Table

Zsh Line Editor

VIA

If the ZLE option is set (it is by default) and the shell input is attached to the terminal, the user is allowed to edit command lines.

There are two display modes. The first, multi-line mode, is the default. It only works if the TERM parameter is set to a valid terminal type that can move the cursor up. The second, single line mode, is used if TERM is invalid or incapable of moving the cursor up, or if the SINGLE_LINE_ZLE option is set. This mode is similar to ksh, and uses no termcap sequences. If TERM is emacs', the ZLE` option will be unset by the shell.