Vim配合grep/ack打开多文件
1 | vim $(grep -rl test .) |
或者Vim内
1 | :args `grep -rl test .` |
参考: https://unix.stackexchange.com/questions/77395/grep-l-xargs-vim-generates-a-warning-why
1 | vim $(grep -rl test .) |
或者Vim内
1 | :args `grep -rl test .` |
参考: https://unix.stackexchange.com/questions/77395/grep-l-xargs-vim-generates-a-warning-why
对于Linux命令参数中被误解析成-xxx的参数问题,如
1 | [root@HBSpy extreme]# rename -mib |
可以在参数前加–
1 | [root@HBSpy extreme]# rename -- -mib .mib extreme-* |
参考: https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean
More precisely, a double dash (–) is used in most bash built-in commands and many other commands to signify the end of command options, after which only positional arguments are accepted.
Example use: lets say you want to grep a file for the string -v - normally -v will be considered the option to reverse the matching meaning (only show lines that do not match), but with – you can grep for string -v like this:
grep – -v file
从CentOS-7-x86_64-Minimal编译安装Vim8
1 | yum install python3 python3-devel |
1 | ./configure --enable-pythoninterp=yes --enable-python3interp=yes --enable-multibyte --enable-luainterp=yes --enable-perlinterp=yes --enable-rubyinterp=yes --with-python3-command=python3 --enable-cscope |
1 | cd src # 官方推荐你去src目录make |
enable了不等于装上了,之后最好vim --version查看下
1 | [root@localhost vim]# vim --version |
你看这个lua和ruby的interp其实就没装上
UI Recorder jWebDriver 不支持括号开头的XPath, 如
1 | (//input)[2] |
原因在于jWebDriver错误的认为括号开头的是css selector
修改lib/elements.js
1 | // using = /^\.?\//.test(value)?'xpath':'css selector'; |
1 | $input = shell_exec($cmd = '/usr/bin/python3 ' . APP_PATH . "/library/OpsKG/input_jieba.py $input"); |
无输出,python其实并没有收到正确的中文输入,exec的中文编码问题
需要先设置exec的环境变量
1 | putenv('LC_ALL=en_US.UTF-8'); |
或在命令前export LANG=en_US.UTF-8;
Win10 内置的MD5 sum
1 | $ CertUtil -hashfile /d/BaiduYunDownload/绳缚本事高清PDF版.pdf |
lrzsz在tmux下并不可用,但有方法取消rz/sz的卡死状态
rz: 5次ctrl+x
sz: 4次ctrl+x
fg
命令恢复。比如top -d1 然后ctrl+z,到后台,然后fg,重新恢复源自https://mariadb.com/kb/en/library/group-by/#group-by-examples
Use the GROUP BY clause in a SELECT statement to group rows together that have the same value in one or more column, or the same computed value using expressions with any functions and operators except grouping functions. When you use a GROUP BY clause, you will get a single result row for each group of rows that have the same value for the expression given in GROUP BY.
于是
1 | mysql> select count(*), channel from wlan_client group by channel; |
这是最常见的操作,没毛病,channel的每一个值都会get a single result row
1 | mysql> select count(*), channel from wlan_client group by channel > 15; |
说实话我并没有找到有明确的文档说明此用法,但从上面引用的文档原文来看,也能说通,所有channel > 15的被归为了一类,其它的归为更一类,所以结果有两行
可以用简单的count验证
1 | mysql> select count(*), channel from wlan_client where channel > 15; |
You can also use a single integer as the grouping expression. If you use an integer n, the results will be grouped by the nth column in the select expression.
这里是另一种用法,N代表select中的第N项,如上面的select count(), channel from wlan_client group by channel就可写成select count(), channel from wlan_client group by 2
1 | mysql> select count(*), channel from wlan_client group by 2; |
恩,此时mysql不会认为1+1=2,然后同[3], 也不会认为2是channel然后同[2],而是只返回了一条
1 | mysql> select count(*), channel from wlan_client group by 2 > 15; |
这里的count(*)的确是该表的总行数,那么这又是什么意思呢
猜测,这里并没有可以分组的列维度,所以结果应该跟直接count(*)没有group by一样,但既然有group by,又没有找到可以用来计算分组维度的列,mysql竟然没有报错,很是神奇
明明这样是会报错的
1 | mysql> select count(*), channel from wlan_client group by 0; |
由于目前的Catalina安全策略
在macOS Catalina中,Apple推出了一种新的文件系统分区结构。新的文件系统分区结构将一个分区作为包含操作系统本身的专用“只读”系统卷,并且与所有用户数据完全分开。除了经过Apple签名的代码(例如:系统更新)之外的任何内容都无法覆盖操作系统文件。这样的机制,基本上使系统完整性保护到达了一个新的水平。现在,整个分区都是封闭的,而不再仅仅是在未受保护的分区中仅仅保护特定位置的内容。
由于在改动后,安装路径不再像之前那么明显,因此可能会存在一些初步的混淆。例如,用户数据位于何处?在此前版本中,用户数据位于/Users/
。但在Catalina新版本中,用户数据将位于/System/Volumes/Data/Users/ 。传统意义上的根目录/,现在将作为一个系统专用的卷。
对于企业来说,最开始要习惯修改后的路径命名约定可能会有一些困难,但从安全性原则上来看,将系统和用户数据的分区之间划分出明确的界限可能是一个良好的举措。这样一来,会使系统恢复和备份变得更加直接。Apple在先前的展示中表示,如果在安装第三方更新后出现问题,macOS Recovery将能够更轻松地从快照恢复。我们可以肯定,这一功能是依赖于新的磁盘分区方案。
/System/Library/LaunchDaemons/ssh.plist 已变的完全不可修改,或者修改方法未知,实测csrutil enable/disable都改不了
重启 command
+ r
进入 Recovery Mode
在终端中输入
1 | csrutil disable |
1 | vim /System/Library/LaunchDaemons/ssh.plist |
原
1 | <key>SockServiceName</key> |
把ssh修改为要使用的端口号
1 | <key>SockServiceName</key> |