ClamAV is a virus scanner for Linux/Unix file systems. In this tutorial I will show you how to install ClamAV on Debian and how to keep it updated and also how to do a daily scan.

ClamAV will report only if infected threats are found. You can also scan only specific folders and remove infected files automatically.

Step1. Install ClamAV:

apt-get install clamav

Step2. Update virus database:

freshclam is a virus database update utility for ClamAV antivirus.
Update virus database simply by running the following command:

freshclam

Continue Reading…

PNG “Portable Network Graphics”  is a image format designed to replace limitations of GIF image format in terms of data compression and color precision. The sizes of  PNGs image files can vary based on several factors like color depth , precompression filter, etc.

Optipng is a Linux command line script that performs multiple optimizations on PNG image files including size compression, integrity checks and more.
I will show you how to use and install Optipng on Debian Linux.

Step1. Install Optipng on Debian:

apt-get install optipng

Step2. Now you can compress a PNG image using the following command:

optipng -o 7 image.png

You can choose between 7 levels of compression from 0 to 7. The 7 level is very slow.

Now I will show you how to compress all images on your server:
First search all PNG images and put them into a list.

find /home/www/debian-tutorials.com/public_html/ -path -prune -o -name "*.png" > pngfiles.list Continue Reading...

I just enabled InnoDB on my  MySQL server and I’ve made the necessary changes into my.cnf. When I restarted the MySQL server I got the following error in the log:

InnoDB: The InnoDB memory heap is disabled

After  some checking I’ve found that I need to set the value of innodb_use_sys_malloc to 0. After I added  this entry innodb_use_sys_malloc =  0 into the my.cnf and restarted the MySQL Server the error was gone.

NOTE: More info here: www.innodb.com/doc/innodb_plugin-1.0-doc-A4.pdf (see page 38)

It is often the case that you have multiple terminals open on one system. With bash with default settings once you press the up button you can’t see the previous command entered on other terminal but you can see the commands entered on the same terminal. This problem is getting even worst. On default, bash history is  saved only for the last closed session.

Now if you want to save all bash history for all open sessions do the followings: Open the .bashrc file from your home directory and add the lines:

shopt -s histappend export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"

Continue Reading…

There are many discussions about this topic and an endless debate between which database engine to choose InnoDB or MyISAM.

Both options are practical and efficient  the oldest and the default used is usually MyISAM  and in most cases we can change our engine when we want or need. Now I come with this question:

What engine is more efficient?

MyISAM:

  • The structure of the tables in MyISAM are simpler and is most recommended for users.
  • MyISAM allows table locking.
  • With MyISAM you get high speed on SELECT because they don’t have integrity checks.

InnoDB:

  • Support for transaction type ACID (Atomicity, Consistency, Isolation and Durability) that guarantees the integrity of the tables.
  • Record locking.
  • Recovery of unexpected problems through the transaction log.

Continue Reading…