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

Linux Shell

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.

Solved kubelet E1103 Orphaned Pod

今年在公司一个小项目上部署了 k8s,学以致用。

这两天检查 kubelet 日志的里面发现有这样的错误日志:

1
Nov  3 18:12:26 k8s-02 kubelet: E1103 18:12:26.572010    1324 kubelet_volumes.go:154] orphaned pod "930d1c27-a975-4de5-9e8f-6e74d42d39e5" found, but volume paths are still present on disk : There were a total of 82 errors similar to this. Turn up verbosity to see them.

经查,使用 kubectl delete --force 删除 pod 或者系统异常关闭都会导致该问题出现,即:pod异常退出均有可能出现上面的报错。

一个安全的 Web-Console 的实现思路

该文转自:熊喵君的博客

0x00 基础

本文将描述如何实现一个具备安全认证的 WebConsole,基于 Golang-SSH 库 实现。WebConsole 的核心实现是打通了 WebSocket+SSH 的输入输出流,使得用户直接使用浏览器就可以运行 SSH 终端,非常适合于轻便运维的场景。WebSocket 基于 TCP 传输协议,并复用 HTTP 的握手通道,关于 WebSocket 和 Golang 的开发可以参见:How to Use Websockets in Golang: Best Tools and Step-by-Step Guide