小编tes*_*ter的帖子

确认搜索文字字符串

当我想搜索 html 标签的一部分时,我厌倦了不得不逃避的事情。

我怎样才能准确搜索我输入的内容不必转义?

例如

ack-grep 'console.log(foo'
Run Code Online (Sandbox Code Playgroud)

我得到:

Unmatched ( in regex; marked by <-- HERE in m/console.log( <-- HERE par/
Run Code Online (Sandbox Code Playgroud)

grep regex

16
推荐指数
1
解决办法
6942
查看次数

使用涓流来减慢浏览器的速度

根据涓流的手册页,http://linux.die.net/man/1/trickle我可以限制一个进程的下载速度,例如

trickle -u 10 -d 20 ncftp 启动 ncftp(1) 将其上传容量限制为 10 KB/s,下载容量为 20 KB/s。

我将如何限制google-chromefirefox使用trickle

编辑:对于那些问我为什么问这么明显的问题的人,我试过了

trickle -u 10 -d 20 firefox

我收到一个错误

trickle: Could not reach trickled, working independently: No such file or directory

Firefox 随即打开,但绝对不受速率限制...

http rate-limiting

9
推荐指数
2
解决办法
5922
查看次数

virtualbox 查看主机端口 80 上的访客端口 80

所以我试图将访客端口 80 转发到我的主机端口 80,以便我可以在我的主机浏览器中查看在我的访客上运行的 apache。

如果我设置如下:(8080/80),我可以查看 localhost:8080 并看到访客 apache 服务器。

80端口

当我将主机设置为 80 并将来宾设置为 80 时,它不起作用。我如何让客人 80 直接与主人 80 联系?

假设在 NAT 模式下运行是强制性的。

virtualbox port-forwarding apache-2.2

4
推荐指数
1
解决办法
6199
查看次数

在 bash 中缩进输出的特定部分

说我有以下 bash 脚本,可以找到所有 error.logs 给他们一个标题,然后在它下面拖尾 5 行..

#!/bin/bash
for ERR in `find -name "error.log"`;
do
    echo -e "---- LOG: $ERR ----";
    tail -n 5 $ERR;
done;
Run Code Online (Sandbox Code Playgroud)

我想让它像这样输出:

---- LOG: foo/error.log ----
    [error ....]
    [error ....]
---- LOG: foo/error.log ----
    [error ....]
    [error ....]
---- LOG: foo/error.log ----
    [error ....]
    [error ....]
Run Code Online (Sandbox Code Playgroud)

其中tail“d部缩进字符的一些量(例如4或任何一个制表符是)

我将如何缩进该特定部分的输出?

bash

3
推荐指数
1
解决办法
2425
查看次数

ps辅助| grep su,如何杀死所有 su 进程?

如果我ps aux | grep su在切换用户几次后我目前有以下内容:

fmaster  24811  0.0  1.3  10652  7000 pts/3    S    23:11   0:00 -su
root     24932  0.0  0.2   5352  1464 pts/3    S    23:12   0:00 su - root
root     24941  0.0  0.8   7772  4256 pts/3    S    23:12   0:00 -su
fmaster  27148  0.0  0.2   5352  1436 pts/3    S    23:28   0:00 su - fmaster
fmaster  27155  0.0  1.3  10652  7044 pts/3    S    23:28   0:00 -su
root     27284  0.0  0.2   5352  1468 pts/3    S    23:29   0:00 su -
root     27293 …
Run Code Online (Sandbox Code Playgroud)

bash sudo

0
推荐指数
1
解决办法
1019
查看次数