Showing posts with label Amazon Linux2. Show all posts
Showing posts with label Amazon Linux2. Show all posts

Install ClamAV on Amazon Linux 2

Install ClamAV Scan on Amazon Linux 2

sudo amazon-linux-extras install epel
sudo yum install clamav clamd -y
sudo sed -i -e "s/Example/#Example/" /etc/freshclam.conf
sudo sed -i -e "s:#DatabaseDirectory /var/lib/clamav:DatabaseDirectory /var/lib/clamav:" /etc/freshclam.conf
sudo sed -i -e "s:#UpdateLogFile /var/log/freshclam.log:UpdateLogFile /var/log/freshclam.log:" /etc/freshclam.conf
sudo sed -i -e "s/#DatabaseOwner clamupdate/DatabaseOwner clamupdate/" /etc/freshclam.conf
sudo vi /etc/clamd.d/scan.conf 
# Change MaxThreads if desired.

sudo freshclam
clamscan -r / 2>&1 | tee openvinoami_clamav_scan.txt

# If problems arise, restart
sudo pkill freshclam
sudo freshclam
clamscan -r / 2>&1 | tee openvinoami_clamav_scan.txt

Set Python3 as default in CentOS or Amazon Linux2


# Install Python3
sudo yum install -y python3
# Start by registering python2 as an alternative
sudo alternatives --install /usr/bin/python python /usr/bin/python2 50

# Register python3.5 as an alternative
sudo alternatives --install /usr/bin/python python /usr/bin/python3.5 60

# Select which Python version to use
sudo alternatives --config python

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...