TMUX Scrolling with Mouse

TMUX Scrolling with Mouse



# Add these in ~/.tmux.conf
set -g mouse on    #For tmux version 2.1 and up  
set -g @scroll-down-exit-copy-mode "off"
set -g terminal-overrides 'xterm*:smcup@:rmcup@' # Sane scrolling


# RELOAD the conf file:  
# tmux source-file ~/.tmux.conf

# If you get Error: protocol version mismatch (client 8, server 7)
# sudo killall -9 tmux

# If conf error, make sure you have tmux version >2.1
# tmux -V
# Update tmux. Ex: sudo yum install tmux

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

Host a static website in Ubuntu using Nginx

 Install Ngnix Web Server

sudo apt-get install nginx

Controlling Nginx

sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx

Firewall

sudo ufw allow 'Nginx Full'
sudo ufw reload

Nginx Configuration Directory

cd /etc/nginx
sudo cp nginx.conf nginx.conf.bak

sudo nano nginx.conf

Verify this line is uncommented, include /etc/nginx/sites-enabled/*;

cd sites-available
sudo nano default

server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /home/ravi/www/html; index index.html; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } }

Restart Server

sudo systemctl restart nginx


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...