$handle = popen("tail -f /path/to/my/logfile.log 2>&1", 'r');
while(!feof($handle)) {
$buffer = fgets($handle);
// здесь будет вызов API
ob_flush();
flush();
}
pclose($handle);
tcpdump -i any port 80 -A | grep -A 10 -P '(GET|POST|OPTIONS|PUT|DELETE).*?HTTP/1.[01]' | perl -ne 's/^.*?(?=(GET|POST|OPTIONS|PUT|DELETE))//g; print;'
tcpflow -p -c -i eth0 port 80
MAILTO="admin@mail.ru"
* * * * * /bin/myjob.sh
MAILTO="admin@mail.ru"
* * * * * /bin/myjob.sh > /dev/null
r = 4
w = 2
x = 1
- = 0
/var/lib/mysql/mysqld.log {
.....
postrotate
if test -x /usr/bin/mysqladmin && /usr/bin/mysqladmin ping &>/dev/null
then
/usr/bin/mysqladmin flush-logs
fi
endscript
}
apt-cache search php
for w in "for" "if" "continue"; do tmp=$(mktemp); grep -P "\b$w\b" * -R | grep -v 'Binary file' | awk -F":" '{print $1}' > $tmp; echo "word: $w"; cat $tmp | sort | uniq -c | sort -hr | head -n 10; rm -f $tmp; done
word: for
471 __init__.py
141 depsolve.py
127 rpmsack.py
104 sqlitesack.py
93 packageSack.py
88 comps.py
81 history.py
74 packages.py
73 yumRepo.py
58 updateinfo.py
word: if
1024 __init__.py
317 yumRepo.py
297 packages.py
248 depsolve.py
235 rpmsack.py
233 sqlitesack.py
189 history.py
155 misc.py
149 pgpmsg.py
116 config.py
word: continue
144 __init__.py
47 depsolve.py
35 rpmsack.py
30 sqlitesack.py
19 yumRepo.py
16 history.py
14 updateinfo.py
14 transactioninfo.py
14 packages.py
14 misc.py
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
<VirtualHost myhost.com>
CustomLog /var/log/httpd/myhost.com.access.log combined
....
</VitrualHost>
server {
access_log /var/log/nginx/myhost.com.access.log;
}
select h.name, i.name, i.key_, hs.clock, hs.value
from
hosts h
join items i on h.hostid = i.hostid
join history_log hs on i.itemid = hs.itemid
where h.name = 'zabbix'