Manage iptables log

Enable iptables log

-A INPUT -m state --state INVALID -j LOG --log-prefix "IPTABLES INPUT INVALID" --log-level 7 --log-tcp-options --log-ip-options
-A INPUT -i ! lo -j LOG --log-prefix "IPTABLES INPUT " --log-level 7 --log-tcp-options --log-ip-options
-A FORWARD -m state --state INVALID -j LOG --log-prefix "IPTABLES FORWARD INVALID" --log-level 7 --log-tcp-options --log-ip-options
-A FORWARD -p tcp -m tcp --dport 25 -j LOG
-A FORWARD -i ! lo -j LOG --log-prefix "IPTABLES FORWARD " --log-level 7 --log-tcp-options --log-ip-options
-A OUTPUT -m state --state INVALID -j LOG --log-prefix "IPTABLES OUTPUT INVALID" --log-level 7 --log-tcp-options --log-ip-options
-A OUTPUT -o ! lo -j LOG --log-prefix "IPTABLES OUTPUT " --log-level 7 --log-tcp-options --log-ip-options

Save log into a separate file

Add a line into /etc/syslog.conf:

kern.=debug /var/log/kern.debug.log

Create a log rotate configuration for kern.debug.log:

vim /etc/logrotate.d/kern.debug

/var/log/kern.debug.log {
rotate 7
daily
size 100M
compress
missingok
notifempty
postrotate
/sbin/killall -HUP syslogd
endscript
}
Advertisements

Manage linux logs with logrotate

Understand logrotate

http://www.rackspace.com/knowledge_center/article/understanding-logrotate-part-1

Logrotate and move to backup directory

http://www.ashishnepal.com/logrotate-and-move-to-backup-directory/

Load flat text file into a Berkeley DB database

cat INPUT_FILE | sed ‘s/\\/\\\\/g’ | db_load -T -t hash DB_FILE

“-T” is requirable if input file is just flat text file instead of being from db_dump. The input file consists of two-line pairs, in which the first line in a pair is key and the second is value.

Install nVidia 173xx driver on Fedora 13

Reference page: http://www.fedoraforum.org/forum/showthread.php?t=249330

Upgrade KDE 4.4 to 4.5 on Fedora 13

sudo curl http://apt.kde-redhat.org/apt/kde-redhat/fedora/kde.repo -o /etc/yum.repos.d/kde.repo
sudo yum update @kde –enablerepo=kde*e,u*g