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
size 100M
/sbin/killall -HUP syslogd

Manage linux logs with logrotate

Understand logrotate

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:

Upgrade KDE 4.4 to 4.5 on Fedora 13

sudo curl -o /etc/yum.repos.d/kde.repo
sudo yum update @kde –enablerepo=kde*e,u*g