Cloning KVM virtual machine using CLI

To clone your VM and spawn new instances in KVML

# virt-clone --original {Domain-Vm-Name-Here} --auto-clone

OR

# virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone

OR

# virt-clone --original {Domain-Vm-Name-Here} \
--name {New-Domain-Vm-Name-Here} --file {/var/lib/libvirt/images/File.Name.here}

Continue reading “Cloning KVM virtual machine using CLI” »

Share

Install and Secure Redis on CentOS 7

Step 1 – Install and Enable Remi Repository

Firstly, we will add the Remi repository to the CentOS 7 system. The Remi repository provides the latest version of Redis package for our installation.

Before adding the Remi repository, let’s install the EPEL repository and yum utility packages.

sudo yum install epel-release yum-utils

Now add the Remi repository for CentOS 7 using the yum command below.

sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

After that, enable the ‘remi’ repository using the yum-config-manager tool as below.

sudo yum-config-manager --enable remi

The Remi repository has been added and enabled on the CentOS 7 system, check using the yum command Continue reading “Install and Secure Redis on CentOS 7” »

Share

Install Lancache on Debian 10

Step 1: Installing Docker

The Docker installation package available in the official Debian repository may not be the latest version. To ensure we get the latest version, we’ll install Docker from the official Docker repository. To do that, we’ll add a new package source, add the GPG key from Docker to ensure the downloads are valid, and then install the package.

First, update your existing list of packages:

sudo apt update

Next, install a few prerequisite packages which let apt use packages over HTTPS:

sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common

Then add the GPG key for the official Docker repository to your system: Continue reading “Install Lancache on Debian 10” »

Share

Upgrade Debian 9 to Debian 10

Update ALL existing installed packages

Before you upgrade your Debian version to 10, you must apply all security patches and pending upgrades to Debian 9 itself Hence, Type the following apt command or apt-get command:

sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt --purge autoremove

OR

sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
sudo apt-get --purge autoremove

Reboot the Debian 9.x stretch to apply the kernel and other updates: Continue reading “Upgrade Debian 9 to Debian 10” »

Share

Large file split and join in linux

Let’s assume we have a large file of 102 GB and named as “vzdump-lxc-103-2021_07_19-12_05_06.tar.lzo”. We’d like to split this large file into 10GB of partial file. Let’s apply the split command as below-

split -b 102400M vzdump-lxc-103-2021_07_19-12_05_06.tar.lzo repo.

Wait for a while, the execution continues, and once over, you’ll find 11 split files altogether- Continue reading “Large file split and join in linux” »

Share

Install MongoDB on CentOS 7

Follow the steps below to install the latest stable version of MongoDB on your CentOS server :

Enabling MongoDB repository

To add the MongoDB repository to your system, open your text editor and create a new YUM repository configuration file named mongodb-org.repo inside the /etc/yum.repos.d/ directory:

nano /etc/yum.repos.d/mongodb-org.repo
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

If you want to install an older version of MongoDB, replace each instance of 4.0 with your preferred version. Continue reading “Install MongoDB on CentOS 7” »

Share

Using multiple gateways on Windows system

If Windows has multiple interfaces connected to several networks that use DHCP, it installs default gateways for all those interfaces.

By default, Windows sets the metric of the default gateways to the same, effectively leading to random selection of default gateway.

If you want to make Windows to select certain gateway always, you can change interface metrics for the interfaces’ configuration you don’t want to use:

  1. Go to your Network adapter properties.
  2. Select Internet Protocol v4.
  3. Click the Advanced button on General tab.
  4. Uncheck Automatic metric.
  5. Enter a number higher than 10 to the Interface metric field.
  6. The default automatic metric for interfaces is 10. The lower the metric, the higher the preference to use it.
  7. So, you have to enter metric higher than 10 for the interfaces you don’t want to use.

EDIT: These instructions are for Windows 7, XP might be different. You shouldn’t be using XP anyway.

Src: https://superuser.com/questions/735479/how-does-a-windows-computer-behave-when-it-has-multiple-default-gateways/735569

Share

CentOS 7 XFS disk resizing

Couldn’t find any article that explained step by step how to resize the main disks volume in a CentOS 7 vm. In my example I started witha single disk of 8GB and expanded to 20GB. I have two partitions on disk sda

sda1 type Linux for boot
sda2 type Linux LVM for the remaining logical volumes

Space utilisation as following:

[root@vcd-c1-s1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 8.8M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root 6.2G 1.9G 4.4G 31% /
/dev/sda1 1014M 179M 836M 18% /boot
tmpfs 783M 0 783M 0% /run/user/0

We basically need to: Continue reading “CentOS 7 XFS disk resizing” »

Share