我们都知道从当前行往下删除 n 行很容易, ndd 就好了。但往上删除呢? 我以前是不知道的,最近搜索了一下,找到了答案,而且额外学到了其他的技巧,你想听吗(不想听我也会写,哈哈
8dd其实是dd重复8次,容易记忆,但效率很低。正确的姿势是 7dj 或者 d7j。我想你看到这里已经猜到应该怎么向上删除了。如果打算从当前行往上删除n行,你需要 {n-1}dk 或者 d{n-1}k
故事到这里应该结束了,然而.... 试试 V3kd, V4jd,注意是大写的V。你会对vim的强大有更多的理解。
By the way, 如果你要从当前行删除到你知道行号的某一行,举例来说,你要从当前行一直删到第434行,无所谓是向上删还是向下删,用 d434G 就可以了。
- 长叹一声。Linux 上就没有一个好用的远程桌面服务器。虽然不喜欢,留个 teamviewer 进程一直开着以应不时之需是有必要的。
- vagrant 的 public_network 在 usb 无线网卡有bug...(服务器好好的千兆网卡你不用用什么无线网卡....不是手头没有网线嘛
- "Ansible for DevOps" 据说是一本好书。那待读书单里就加一本吧
- CentOS8内置了一个叫 cockpit 的web管理器,还挺好用的。它的端口是9090,咋改成用正儿把经的https证书我还不知道。
- Gnome桌面有一个叫 Vinagre 的远程桌面客户端,支持的服务器类型挺多的。(然而并不好用)
- 不应该把对应数据表的 entity model 直接用在 web API 里。别嫌麻烦,那个应该是贫血的,除了主键并不需要有其他的约束。把完整的表结构和所有字段暴露给客户端是不好的。
- AutoMapper 有什么用?应该怎么用? ,这篇09年的老文章和里面的评论可能会有点用。
- chrome OS 开了开发者模式,按
ctrl + alt + -> root 登录即可设置默认用户的密码。
想深入了解Linux了,所以又开始看 Linux From Scratch。
There are 3 options, you probably want #3
-
This will keep the local file for you, but will delete it for anyone else when they pull.
git rm cached or git rm -r cached
-
This is for optimization, like a folder with a large number of files, e.g. SDKs that probably won't ever change. It tells git to stop checking that huge folder every time for changes, locally, since it won't have any. The assume-unchanged index will be reset and file(s) overwritten if there are upstream changes to the file/folder (when you pull).
git update-index --assume-unchanged
-
This is to tell git you want your own independent version of the file or folder. For instance, you don't want to overwrite (or delete) production/staging config files.
git update-index --skip-worktree
It's important to know that git update-index will not propagate with git, and each user will have to run it independently.
I haven't used my old MBP 13 for nearly a month. This evening I picked it up and opened the iTerm2 then connected to my home server through ssh. I noticed I get a white-black colored terminal. What's wrong? I remembered it was colorful when I logged into this machine last time using iTerm2 on my MBP 15.
Firstly, I checked the version of iTerm2, it was a bit old, so I updated it first. Unfortunately, it doesn't help.
I noticed I was using bash instead of zsh on this machine. So I ran chsh and changed the shell from bash to ssh. It also doesn't help.
Then I find this answer from stackoverflow.com. A comment in this answer reminded me: I should check and compare the terminal configuration in iTerm2. So I found the secret!
Command + , open the preference, then click the profiles tab, then change the Report terminal type from xterm to xterm-256 color, that's it!
- safely convert Unix TimeStamp to string :
DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture.NumberFormat)
source
- DI with parameters in constructor
services.AddScoped<SmsSentLogRepo>(s => new SmsSentLogRepo(Configuration.GetConnectionString("sms")));
- You should use ConfigureAwait(false) in your library code. source