Tuesday, September 26, 2023

How to install OCI CLI in CentOS 8 Stream

 How to install OCI CLI in CentOS 8 Stream

The steps mentioned in the internet is not working for me. So this is the working commands.

# yum install python38 -y

# ll /usr/bin/pip3.8

# ll /usr/bin/pip-3.8

# pip3.8 install oci-cli

# oci --version

Monday, September 18, 2023

How to redirect 404 error to the home page

 How to redirect 404 error to the home page

Following steps helps to redirect all 404 error pages to the home page. Assume you already installed httpd in this server.

  • Make sure you enabled "rewrite_modile" (httpd - M | grep rewrite)
  • vi /etc/httpd/conf/httpd.conf (enable AllowOverride from "None" to "All"). Based on your configuration path.
  • vi /var/www/html/.htaccess (ErrorDocument 404 https://example.com)
  • systemctl restart httpd
  • Test it

How to install letsencrypt on Amazon linux 2023

 How to install letsencrypt on Amazon linux 2023

In Amazon linux 2023, EPEL is not available. All the documentations avaialble in internet is about EPEL and then install certbot. But here we need to use a different approach.

  • Login to the server
  • dnf install python3 augeas-libs
  • dnf remove certbot
  • python3 -m venv /opt/certbot/
  • /opt/certbot/bin/pip install --upgrade pip
  • /opt/certbot/bin/pip install certbot certbot-apache
  • ln -s /opt/certbot/bin/certbot /usr/bin/certbot
  • certbot --apache
This works perfectly for me. 🙋🙋
Here is the video tutorial. Have a look and install.


Wednesday, September 6, 2023

Single command to checkout all branches in git

 Single command to checkout all branches in git


[yourserver #] for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do; git branch --track ${branch#remotes/origin/} $branch; done;


This is useful when we do git migrations.