我想知道是否有运行以下命令的最佳方法
cat cisco.log-20151103.log | grep -v "90.192.142.138" | grep -v "PIX" | grep -v "Intrusion"
Run Code Online (Sandbox Code Playgroud)
我试过
cat cisco.log-20151103.log | grep -v "90.192.142.138|PIX|Intrusion"
Run Code Online (Sandbox Code Playgroud)
但它不起作用。
我设法编写了以下脚本:
#!/bin/bash
#files list
file1=/tmp/1wall_long.txt
file2=/tmp/1wall_test1.txt
file3=/tmp/1wall_test2.txt
file4=/tmp/1wall_test3.txt
file5=/tmp/3mt_long.txt
file6=/tmp/3mt_OpenSpace_test1.txt
file7=/tmp/3mt_OpenSpace_test2.txt
file8=/tmp/3mt_OpenSpace_test3.txt
file9=/tmp/3rooms_test1.txt
file10=/tmp/3rooms_test2.txt
file11=/tmp/3rooms_test3.txt
file12=/tmp/20mt_OpenSpace_test1.txt
file13=/tmp/20mt_OpenSpace_test2.txt
file14=/tmp/20mt_OpenSpace_test3.txt
#script for 1wall_long file
if [ ! -e "$file1" ]; then #check if the file exist
echo "File 1wall_long.txt does not exist" #if not exist print echo output
else
sed -i -e 's/- /-/g' $file1 #remove space on the first 10 values
awk '{print $7}' $file1 > /tmp/1wall_long_S.txt #print the column number 7 and copy the output in a file
rm $file1 …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 -o 选项挂载分区,但是出现此错误
root@blackbox:~# mount /dev/sda1 /media/ownclouddrive -o uid=33,gid=33
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
[ 365.432693] EXT4-fs (sda1): Unrecognized mount option "uid=33" or missing value
Run Code Online (Sandbox Code Playgroud)
如果我检查我的 /etc/passwd 我可以在那里看到用户
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
Run Code Online (Sandbox Code Playgroud)
知道为什么吗?
谢谢
自从上周我在我的机器上运行了 apt-get 升级之后,我观察到 perl 进程的 CPU 使用率非常高,并且定期使用
21392 112 39 19 10332 7552 3592 R 53.0 1.5 0:01.63 perl
426 root 20 0 5088 2476 2256 S 0.0 0.5 0:00.33 `- cron
24709 root 20 0 6484 2560 2200 S 0.0 0.5 0:00.03 `- cron
24713 112 20 0 1900 1100 1024 S 0.0 0.2 0:00.01 `- sh
24714 112 20 0 4604 2640 2476 S 0.0 0.5 0:00.02 `- copy-local-and-
24719 112 20 0 1900 1204 1128 S 0.0 …
Run Code Online (Sandbox Code Playgroud) 我有这个 bash 脚本:
gunzip -c /var/log/cisco/cisco.log-$(date +%Y%m%d).gz | awk '/ath_bstuck_tasklet/ { print $4 }' | sort | uniq -c > /tmp/netgear_beacon.txt
echo "There are `wc -l /tmp/netgear_beacon.txt | awk '{print $1}'` Stuck beacon; resetting" >> /tmp/netgear_beacon.txt
gunzip -c /var/log/cisco/cisco.log-`date +%Y%m%d`.gz | awk '/Virtual device ath0 asks to queue packet/ { print $4 }' | sort | uniq -c > /tmp/netgear_buffer_queue.txt
echo "There are `wc -l /tmp/netgear_buffer_queue.txt | awk '{print $1}'` routers with 'Virtual device ath0 asks to queue packet' errors" …
Run Code Online (Sandbox Code Playgroud) 我已经在 RasperryPi Debian Jessie 上安装了 syslog-ng 3.5。当我尝试启动服务时,它失败了
-- Unit syslog.socket has begun starting up.
Feb 10 12:29:28 blackbox systemd[1]: Socket service syslog.service not loaded, r
Feb 10 12:29:28 blackbox systemd[1]: Failed to listen on Syslog Socket.
-- Subject: Unit syslog.socket has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit syslog.socket has failed.
--
-- The result is failed.
Feb 10 12:29:28 blackbox systemd[1]: Starting System Logger Daemon...
-- Subject: Unit syslog-ng.service has begun with start-up
-- Defined-By: systemd …
Run Code Online (Sandbox Code Playgroud) 我有一个客户在我的 DNS 服务器上发送大量针对特定域的查询。我想阻止该查询,我找到了可以实现的十六进制字符串。那是字符串:
iptables -I INPUT 1 -p udp --dport 53 --match string --algo kmp --hex-string '|77 70 61 64 2e 64 6f 6d 61 69 6e 2e 6e 61 6d 65|' -j DROP
Run Code Online (Sandbox Code Playgroud)
——
0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:53 STRING match "wpad.domain.name" ALGO name kmp TO 65535
Run Code Online (Sandbox Code Playgroud)
但似乎这不起作用,因为当我对该服务器查询该名称时,我可以看到回复并且计数器保持为零
root@banana:~# dig @5.172.120.59 wpad.domain.name
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> @5.172.120.59 wpad.domain.name
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: …
Run Code Online (Sandbox Code Playgroud)