Block WordPress spam comment with .htaccess

If you have self hosted WordPress and always got lots of spam comment, you may actually blocked them through your .htaccess file.

The source code as below was get from AllGuru.Net,

RewriteEngine On
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*xyz.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

Open the .htaccess file and place the code as above then you shall be able to filter the spam automatically.

Linux apt-get

With Debian-based of the Linux system, you will need to use apt-get as the package handle utility to handle your Linux Distro packages.

The Basic of apt-get,
apt-get update
– Resynchronise installed packages with their sources. (Always do this before an upgrade.)

apt-get upgrade
– Install the newest version of all packages installed on the system.

apt-get dist-upgrade
– Upgrade to the latest version of your distribution.

apt-get install package1 package2 package3
– Install programs package1, package2 and package3 along with all their dependencies.

apt-get remove package1 package2 package3
– Remove programs package1, package2 and package3.

apt-get purge package1 package2 package3
– Remove programs package1, package2 and package3 and delete any configuration files that they used.

apt-get check
– Update the package cache and check for any broken dependencies.

apt-get clean
– Clean out retrieved package files.

apt-get autoclean
– Clean out retrieved package files, but only those that are no longer needed.

apt-get autoremove
– Remove any packages that were installed to satisfy dependencies but are no longer required.

For advance usage,

apt-get source package1
– Retrieve source files for package package1.

apt-get build-dep package1
– Get all the dependencies needed to build package package1.

apt-get source package1 -b
– Fetch the source code then compile it.