Tuesday, January 30, 2024

How to connect OpenVPN 3 client in Ubuntu 22

 How to connect OpenVPN client in Ubuntu 22

In linux, Open VPN client is connected using the configuration file.

First, Install the open vpn3 client.

#apt install apt-transport-https curl
#mkdir -p /etc/apt/keyrings
#curl -sSfL https://packages.openvpn.net/packages-repo.gpg >/etc/apt/keyrings/openvpn.asc
#echo "deb [signed-by=/etc/apt/keyrings/openvpn.asc] https://packages.openvpn.net/openvpn3/debian 
            DISTRIBUTION main" >>/etc/apt/sources.list.d/openvpn3.list
Replace the DISTRIBUTION in the above command with yours. For me mine is "jammy"
#apt update
#apt install openvpn3
Now you have installed openvpn3 in your ubuntu machine.
Type openvpn3 --help you will see bunch of commands.

Second, we need to generate the configuration file from the open vpn server

Login to your openvpn Admin UI
Under User Management, select User Profiles
Click on the "New Profile" for the user which you want to connect
Generate the profile
Download the profile file

Third, connect the VPN client

# openvpn3 session-start --config {path to the above configuration file}
Enter your username (only username no need for username@IP)
Enter password
It connects, please make sure don't close this terminal. If you need you can run as a background process.

Wednesday, December 27, 2023

How to Archiving Amazon S3 Data to Amazon Glacier

 How to Archiving Amazon S3 Data to Amazon Glacier

As you know in AWS S3 we have different tier of storage. Based on our requirement we need to use the correct one to save cost and to meet the purpose. One of such requirement is to move the old backup files from S3 to amazon Glacier.


In this video you will learn how to archiving amazon s3 data to amazon glacier.






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.

Monday, July 24, 2023

The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository.

 OS : CentOS 7

Error while installing Mysql

The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.

Check that the correct key URLs are configured for this repository.


Fix:


Import new key from rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022


Yum update

yum install mysql-server