If you have a compressed MySQL database in bz2 format that you need to import, just do the following:
bunzip2 < db_filename.sql.bz2 | mysql -u root -p target_db_name
If you have a compressed MySQL database in bz2 format that you need to import, just do the following:
bunzip2 < db_filename.sql.bz2 | mysql -u root -p target_db_name
grep is capable of color-highlighting the matched string in its output. But, by default, that option is turned off.
$ grep abc a_file.txt
abcdef
There are 3 color options available to you:
–color=auto
–color=always
–color=never
Read More
Whenever you add or change a filter you will want to test that the regular expressions are correct by running it over an existing logfile.
The tool for doing this is fail2ban-regex which is used as follows:
fail2ban-regex /var/log/fail2ban.log /etc/fail2ban/filter.d/fail2ban-smtp.conf
Set JAVA_HOME / PATH for a single user
Login to your account and open .bash_profile file
$ vi ~/.bash_profile
Set JAVA_HOME as follows using syntax export JAVA_HOME=
export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java Read More
Installing OpenDKIM:
yum install opendkim
Create private and public key:
mkdir /etc/opendkim/keys/myhostname.lt /usr/sbin/opendkim-genkey -D /etc/opendkim/keys/myhostname.lt/ -d myhostname.lt -s default chown -R root:opendkim /etc/opendkim/keys/myhostname.lt chmod 640 /etc/opendkim/keys/myhostname.lt/default.private chmod 644 /etc/opendkim/keys/myhostname.lt/default.txt
In order to set the network adapter and get get CentOS to communicate on the network the Ethernet adapter will need to be configured. In this lesson I will set a static IP address for the network adapter. To view a list of your network adapters use the command ip addr.
The configuration file for the network adapter should be located at /etc/sysconfig/network-scripts/ifcfg-enp0s3. With the minimal installation of CentOS there are not many options available to configure the network adapter. One option is to use the vi editor or nano to configure ifcfg-enp0s3. Another option is to use the nmtui utility to edit the network adapter. Read More
Of course there are several types of DOS attacks , in this post I will demonstrating the use if iptables to limit the traffic on port 80.
The goal is to keep your web server “responsive” to legitimate traffic, but to throttle back on excessive (potential DOS) traffic.
In this demonstration iptables is configured :
From terminal:
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
CentOS timezone config files and directories
Install & Configure AWStats
Now that YUM has its additional repository we are ready to install. From the commandline type:
yum install awstats
Modify AWStats Apache Configuration:
nano /etc/httpd/conf.d/awstats.conf
Read More