Ubuntu – Linux Hint https://linuxhint.com Exploring and Master Linux Ecosystem Fri, 12 Mar 2021 15:08:05 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.2 How to Install Netdata Monitoring Tool on Ubuntu 20.04 https://linuxhint.com/how-to-install-netdata-monitoring-tool-on-ubuntu-20-04/ Fri, 12 Mar 2021 12:45:58 +0000 https://linuxhint.com/?p=94136 Getting real-time statistics on various system metrics is a top priority for system administrators, developers, and operation teams in general. It helps in monitoring systems in realtime and quickly picking up faults or errors and resolving them to ensure things get back on track.

Netdata is a free and open-source distributed, real-time monitoring application that runs across various computing devices; physical servers, cloud servers, containers, and even IoT devices. It collects a great deal of data and visualizes it on sleek and interactive dashboards. We are going to install Netdata on Ubuntu 20.04 LTS and then demonstrate just how various metrics are visualized.

Step 1: Install Netdata using kickstart.sh script

This is the most preferred way of installing Netdata because it allows you to pass other arguments on the same command to customize the installation process. Most importantly, this method seamlessly works across all distros.

At the start you might want to view more information about Netdata. Use the APT command as follows.

$ apt show netdata

The output provides Netdata information such as the latest version, origin, installation size, and a description of the package.

To install Netdata, simply run the kickstart script as follows.

$ bash <(curl -Ss https://my-netdata.io/kickstart.sh)

As you will notice, the script performs a bunch of operations. First, it autodetects the Linux Operating system and distribution you are running and later install the requisite packages.

From the output below, you can see that our OS information has been retrieved and displayed to stdout by the script.

The script then proceeds to check if you have an existing instance of Netdata, and if there is one, the script updates Netdata instead of installing Netdata afresh.

Thereafter, the script pulls Netdata from the Git repository and stores it in /usr/src/netdata.git. Path. All the required files and dependencies are thereafter installed and the package index updated.

Along the way, the location of Netdata files including configuration files, web files, db files and log files will be displayed as shown.

Towards the end, basic instructions on how to access Netdata dashboard along with starting and stopping Netdata will be displayed.

The updater script netdata-updater.sh is then added to /etc/cron-daily f to ensure that Netdata is continually updated.

As the installation wraps up , the script will inform you that Netdata was successfully installed and is now running.

The entire installation takes quite a while you might want to take a short break or simply hang around until it is completed.

Step 2: Confirm Netdata is running

Netdata is finally installed. However, it’s prudent to verify that indeed Netdata service is active and running.

By default, Netdata listens on port 19999. To confirm this, run the netstat command below:

$ sudo netstat -pnltu | grep 19999

Also, you can confirm that Netstat systemd service is running by invoking:

$ sudo systemctl status netdata

The output confirms that indeed, Netdata is running as we would expect.

Step 3: Configure firewall

At this point, you can access Netdata from the browser from your host system. However, if UFW firewall is enabled, this will not be possible. With that in mind, port 19999 needs to be allowed.

So run the following commands:

$ sudo ufw allow 19999/tcp
$ sudo ufw reload

Then confirm that port 19999 is allowed on the firewall.

$ sudo ufw status

Step 4: Access Netdata dashboard

All the configurations are done and dusted. As we wrap up, we are going to access Netdata by browsing the following URL. Replace the host-ip with your host’s real IP address.

http://host-ip:19999

And voila! Netdata dashboard will come into view with elegant and beautiful visualizations displaying a System overview of the main system metrics such as CPU utilization, network bandwidth stats, disk read/write and RAM utilization.

On the right sidebar are additional system metric options that you can click on to view dashboards that visualize real-time statistics.

For instance, to have a glance at the network bandwidth, select the ‘Network Interfaces’ icon as shown.

The ‘Network Interfaces’ dashboard will be displayed with bandwidth statistics on various network adapters.

Conclusion

Netdata provides an excellent solution for monitoring your single node in real-time. You can configure alarms and notifications which can be triggered when a certain event or threshold is exceeded. Give Netdata a try and let us know about your experience.

]]>
How to Automatically Empty the Trash in Ubuntu 20.04 https://linuxhint.com/how-to-automatically-empty-the-trash-in-ubuntu-20-04/ Fri, 12 Mar 2021 12:30:33 +0000 https://linuxhint.com/?p=94123 When you delete a file in Linux, it is not immediately deleted from the system. Instead, it is moved to the Trash in case you need to restore it. Trash is the first place where you look for the accidentally deleted files. Because the file is not removed from the system, it continues to take space on the system and in the end, can fill up large storage space. Although we can empty the trash manually to avoid wasting system space, however, we often forgot to do such a simple task. Luckily, Linux OS offers a utility known as “Autotrash” that can automatically delete the data in the Trash based on the options you specify.

In this post, we will explain how to install the Autotrash utility to automatically empty the trash in Ubuntu. This way you can get rid of old and useless files and make room for important files.

Note: The commands discussed here have been tested on Ubuntu 20.04 LTS (Focal Fossa). You must have be root user or have sudo privileges to install Autotrash on your Linux system.

Installing Autotrash

Autotrash utility is by default not installed in the Ubuntu OS. However, it is available as a snap package that can be easily installed using the snapd.

Step 1: Install Snapd

First, install snapd on your system. Execute the below command to do so:

$ sudo apt install snapd

Enter sudo password, after that the installation of snapd will be started on your system. Once snapd is installed, you can use it to install Autotrash snap.

Step 2: Install Autotrash

Execute the below command in Terminal to install Autotrash utility on your system:

$ sudo snap install autotrash-unofficial

Once the Autotrash is installed you will see the below output:

installing autotrash

Step 3: Create an alias for Autotrash

After installation of Autotrash via snap, you will have to run every command by typing the complete snap name that is autotrash-unofficial. You can just use autotrash instead of complete snap name autotrash-unofficial by creating an alias as follows:

$ sudo snap alias autotrash-unofficial autotrash

The alias will support calling the autotrash-unofficial as just autotrash.

Note: In case, you want to remove the alias, execute the below command:

$ sudo snap unalias autotrash

To verify if the Autotrash has been successfully installed and to view its version, execute the below command in Terminal:

$ autotrash -V

autotrash version

Using Autotrash to Automatically Empty the Trash in Ubuntu

Autotrash allows you to automatically empty the trash based on certain options that you need to specify. It can automatically delete files based on age, size, and free space on the trash location.

Automatically Deleting Files older than x number of days

This is the most commonly used Autotrash functionality. The following command syntax can be used to automatically delete the files that exist in the trash for more than x number of days:

$ autotrash -d [number of days]

This will automatically delete the files that have been in the trash over the period you specified. For instance, the below command will delete the files that have been in the trash for more than 45 days:

$ autotrash -d 45

If you want to restore any deleted file, you can do that within 45 days.

Automatically Deleting files based on free-space left

Using the Autotrash utility, you can make sure a specific amount of disk space is free in the Trash location. Here is the syntax of the command:

$ autotrash --min-free [free-space in MB]

For instance, the below command will make sure there is a minimum of 512 MB of free space:

$ autotrash --min-free 512

Automatically Deleting M number of megabytes

Using Autotrash –delete option, you can allow it to automatically delete at least M megabytes, removing the oldest trashed items first. Here is the syntax of the command:

$ autotrash --delete [data size in megabytes]

This option removes the trashed entries, not the individual files. To explain it, consider you have an older trashed directory of 1 GB. If you request Autotrash to delete 512 MB (M=512), it will remove 1 GB.

$ autotrash --delete 512

Uninstalling Autotrash

In case you no longer need Autotrash on your system, you can easily remove it using the following command in Terminal:

$ sudo snap remove autotrash-unofficial

Enter password for sudo, after which Autotrash will be removed from your system.

In this post, we have explained how to install Autotrash on Ubuntu system. Now the Autotrash will automatically delete the files residing in the Trash based on the conditions you specified.

]]>
How to Install and Use Veracrypt on Ubuntu 20.04 https://linuxhint.com/how-to-install-and-use-veracrypt-on-ubuntu-20-04/ Fri, 12 Mar 2021 12:23:27 +0000 https://linuxhint.com/?p=94115

If you do not want others to have access to your data, then encryption is essential. When you encrypt your sensitive data, unauthorized persons cannot easily get to it. This how-to guide focuses on the installation and basic usage of Veracrypt disk encryption software on Ubuntu Linux. Veracrypt is an open-source software and it is free.

Install Veracrypt

As seen on the official downloads page (link: https://www.veracrypt.fr/en/Downloads.html), two options are available for using Veracrypt on Ubuntu Linux, namely: GUI and console. GUI means graphical-based and console means text-based(command-line.)

Install Veracrypt: GUI

Run the following command in the Ubuntu terminal to download the Veracrypt GUI installer package.

$ sudo wget https://launchpad.net/veracrypt/trunk/1.24-update7/+download/veracrypt-1.24-Update7-Ubuntu-20.04-amd64.deb

Now, you may install the downloaded package as follows.

$ sudo apt-get install ./veracrypt-1.24-Update7-Ubuntu-20.04-amd64.deb

Enter y to continue with the installation if prompted. After a successful installation, you can launch Veracrypt from the Applications menu > Accessories > Veracrypt.

Install Veracrypt: Console

Run the following command in the Ubuntu terminal to download the Veracrypt console installer package.

$ sudo wget https://launchpad.net/veracrypt/trunk/1.24-update7/+download/veracrypt-console-1.24-Update7-Ubuntu-20.04-amd64.deb

You may now proceed to install the downloaded package. Run the command below.

$ dpkg -i ./veracrypt-console-1.24-Update7-Ubuntu-20.04-amd64.deb

When the installation completes successfully, you may begin to use Veracrypt in the Ubuntu terminal. To see usage info, run the following command.

$ veracrypt -h

Encrypt Your Sensitive Data

Let us imagine that you have a folder named folder1 on your Ubuntu desktop which contains sensitive documents. We are going to create an encrypted volume via the GUI and the console to serve as a personal vault for storing such sensitive documents.

GUI Method:

Create an encrypted volume

1. Launch Veracrypt from the Applications menu > Accessories > Veracrypt 2.  Click Create 3.  In the Veracrypt volume creation wizard, choose Create an encrypted file container 4.  Click Next Figure 1: Create an encrypted file container 5.  On the Volume Type page, choose the first option labeled Standard Veracrypt volume 6.  Click Next 7.  Under Volume Location, click Select File 8.  Choose your desired location on the left and then enter a name for the encrypted file container at the top

Figure 2: Name your new encrypted file container 9.  Click Save at the bottom of the window 10.  Back to the Volume Location page, click Next 11.  Under Encryption Options, leave the default selections: AES and SHA-512, and click Next 12.  Under Volume Size, enter the desired volume size. Click the drop-down menu to switch between Gigabytes, Megabytes and Kilobytes

Figure 3: Specify the size of the encrypted file container 13.  Click Next 14.  Under Volume Password, enter an encryption password 15.  Click Next 16.  Under Format Options, you may choose Linux Ext3 from the drop-down menu

Figure 4: Choose filesystem type for the encrypted volume 17.  Click Next 18.  Under Cross-Platform Support, let us go with the default selection 19.  Click Next and then click OK when prompted 20.  Under Volume Format, begin to move your mouse randomly for at least 1 minute

Figure 5: Move your mouse randomly 21.  When you are done, click Format 22.  When prompted, enter your Linux user password and click OK 23.  Wait for a message indicating that your Veracrypt volume was successfully created 24.  Click OK 25.  Click Exit

Mount the encrypted volume

1.  Back to the main VeraCrypt window, click any free slot in the list 2.  Click Select File 3.  Choose the encrypted file container which you created earlier 4.  Click Open at the bottom of the Window 5.  Click Mount Figure 6: Mount encrypted volume 6.  When prompted, enter your encryption password and click OK 7.  You should now see a new device icon on your desktop The mounted device will also be listed under Devices when you open File Manager by accessing your home directory for instance. Figure 7 below shows the default mount directory path.

Figure 7: Encrypted volume mount directory path You may now proceed to move your sensitive folder into your personal vault.

Figure 8: Mounted volume listed under devices

Dismount the encrypted volume

1.  To dismount the encrypted volume, make sure that the appropriate slot is selected in the main Veracrypt window 2.  Click Dismount 3.  The slot entry should now be blank 4.  Also, you should no longer see the encrypted volume on your desktop or listed under Devices

Figure 9: Dismount encrypted volume

Console Method:

Create an encrypted volume

Run the command below in the Ubuntu terminal to begin creating your encrypted volume.

$ veracrypt --create

When prompted to choose a volume type, enter 1 for a Normal volume

Volume type: 1) Normal 2) Hidden Select [1]: 1

Next, you would be prompted to enter volume path and volume size. In the example below, the encrypted volume is called personal_vault and will be created in my home directory. The size of the personal vault will be 2 Gigabytes.

Enter volume path: /home/shola/personal_vault Enter volume size (sizeK/size[M]/sizeG): 2G

For encryption algorithm and hash algorithm, the default AES and SHA-512 values are recommended. Enter 1 in both cases.

Encryption Algorithm: 1) AES 2) Serpent 3) Twofish 4) Camellia 5) Kuznyechik 6) AES(Twofish) 7) AES(Twofish(Serpent)) 8) Camellia(Kuznyechik) 9) Camellia(Serpent) 10) Kuznyechik(AES) 11) Kuznyechik(Serpent(Camellia)) 12) Kuznyechik(Twofish) 13) Serpent(AES) 14) Serpent(Twofish(AES)) 15) Twofish(Serpent) Select [1]: 1 Hash algorithm: 1) SHA-512 2) Whirlpool 3) SHA-256 4) Streebog Select [1]: 1

For filesystem, Linux Ext3 would suffice. You may enter 4 to choose that.

Filesystem: 1) None 2) FAT 3) Linux Ext2 4) Linux Ext3 5) Linux Ext4 6) NTFS 7) exFAT 8) Btrfs Select [2]: 4

Now, it is time to choose a strong encryption password. You will get a warning if your chosen password is determined to be weak. Note: Using a short password is NOT recommended.

Enter password: WARNING: Short passwords are easy to crack using brute force techniques! We recommend choosing a password consisting of 20 or more characters. Are you sure you want to use a short password? (y=Yes/n=No) [No]: y Re-enter password:

When you are prompted to enter PIM, press the enter key on your keyboard to accept the default value. Do the same when you are prompted to enter the keyfile path. PIM is a number that specifies how many times your password is hashed. A keyfile is used alongside a password, such that any volume that uses the keyfile cannot be mounted if the correct keyfile is not provided. As we are focusing on basic usage here, the default values would suffice.

Enter PIM: Enter keyfile path [none]:

Finally, you would need to randomly type on the keyboard for at least 1 minute and quite fast too. This is supposed to make the encryption stronger. Avoid the enter key while you type. Press Enter only when you are done typing and then wait for the encrypted volume to be created.

Please type at least 320 randomly chosen characters and then press Enter: Done: 100% Speed: 33 MiB/s Left: 0 s The VeraCrypt volume has been successfully created.

Mount the encrypted volume

To access the content of the encrypted volume, you need to first mount it. The default mount directory is /media/veracrypt1 but you can create yours if you wish. For example, the following command will create a mount directory under /mnt.

$ sudo mkdir /mnt/personal_vault

The next command below will begin mounting the encrypted volume.

$ veracrypt --mount /home/shola/personal_vault

When you are prompted, either press the enter key to use the default mount directory or type your own mount directory path. You would be prompted to enter your encryption password next. For PIM, keyfile and protect hidden volume prompts, hit the enter key to use the default values.

Enter mount directory [default]: /mnt/personal_vault Enter password for /home/shola/personal_vault: Enter PIM for /home/shola/personal_vault: Enter keyfile [none]: Protect hidden volume (if any)? (y=Yes/n=No) [No]:

Run the following command to list mounted volumes.

$ veracrypt --list
1: /home/shola/personal_vault /dev/mapper/veracrypt1 /mnt/personal_vault

You may now move your sensitive folder to your personal vault as follows.

$ sudo mv /home/shola/folder1 /mnt/personal_vault

To list the contents of your personal vault, run:

$ ls -l /mnt/personal_vault

Dismount the encrypted volume

The following command will dismount the encrypted volume.

$ veracrypt --dismount /mnt/personal_vault

If you run veracrypt –list again, you should get a message indicating that no volume is mounted.

Conclusion

Veracrypt has some very advanced capabilities but we only covered the basics in this article. Feel free to share your experiences with us in the comments section.

]]>
Monitor Network Traffic with vnStat on Ubuntu 20.04 https://linuxhint.com/monitor-network-traffic-with-vnstat-on-ubuntu-20-04/ Fri, 12 Mar 2021 12:20:08 +0000 https://linuxhint.com/?p=94110 vnStat is an open-source and lightweight network traffic monitor for Linux operating systems. vnStat quietly monitors the network traffic for specific interfaces and stores the monitoring data in a database. With vnStat, you can view the bandwidth usage per hour, day, month, or for a particular period.

In this guide, we will be looking at how to install vnStat and monitor network traffic on Ubuntu OS.

Note: The procedure described here has been tested on Ubuntu 20.04 LTS. The commands have been executed on Terminal which you can open through the Ctrl+Alt+T shortcut.

Installing vnStat

VnStat is available in the default Ubuntu repositories but it is not the latest version. To install vnStat latest version, follow the below-mentioned steps:

Step 1: Update repository index

First, execute the below command to update the system repository index:

$ sudo apt update

Enter the password for sudo.

Step 2: Install prerequisites

Next, you will have to install some prerequisites that can build software from source. We will need it for the compilation of vnStat. Execute this command to install the prerequisites:

$ sudo apt install build-essential gcc make libsqlite3-dev -y

Step 3: Download vnStat tar.gz package

Now from the vnStat official website, download the latest version of vnStat tar.gz package. Currently, the latest version of vnStat is 2.6, so we can download it as follows:

$ wget https://humdi.net/vnstat/vnstat-2.6.tar.gz

Step 4: Install vnStat

Once the tar.gz package is downloaded, we can install it as follows:

First, extract the tar.gz using the below command in Terminal:

$ tar -xvzf vnstat-2.6.tar.gz

Then switch to the resulting extracted directory using the below command:

$ cd vnstat-2.6

Now configure it using the command below:

$ ./configure --prefix=/usr --sysconfdir=/etc

Then, install vnStat as follows:

$ sudo make
$ sudo make install

Step 5: Verify Installation

To verify if vnStat has been successfully installed, execute the below command in Terminal:

$ vnstat -v

The following output confirms vnStat version 2.6 has been installed.

Step 6: Enable and start vnStat service

To enable and start vnStat service, first you will need to copy vnStat service file from the vnStat extracted directory to the /etc/systemd/system/ using the below command:

$ sudo cp -v vnstat-2.6/examples/systemd/vnstat.service /etc/systemd/system/

Now enable vnStat service using the below command:

$ sudo systemctl enable vnstat

Then to start vnStat service, execute the below command

$ sudo systemctl start vnstat

To verify if vnStat service is running, execute the below command:

$ sudo systemctl status vnstat

The following output confirms vnStat service is running properly without any issues.

Monitor Network Traffic with vnStat

vnStat supports various options that help you to monitor traffic in different ways. You can view some of the available options by executing the below command in Terminal:

$ vnstat --help

Or execute the following command to view the complete list of options:

$ vnstat --longhelp

vnstat help

You can also visit vnStat man page for the complete list of options.

Running the vnStat command without any option prints the bandwidth usage statistics for all the available interfaces.

$ vnstat

Here is the output of vnStat command on our system which is showing statistics of one interface as this is the only available interface on our system.

vnstat command output

You can also monitor a specific interface by using the -i option followed by the interface name.

$ vnstat -i <interface_name>

For instance, to monitor an interface ens33, the command would be:

$ vnstat -i ens33

You can also monitor bandwidth usage as per hourly, daily, monthly, and yearly usage using the -h, -d, -m, and -y options respectively. For example, to find the daily bandwidth usage, the command would be:

$ vnstat -d

vnstat daily statistics

You can also get the bandwidth usage for the top traffic days. For instance, to find the top 10 bandwidth usage days, use -t option followed by the number of days:

$ vnstat -t 10

To monitor bandwidth usage in real-time, use the -l option as follows:

$ vnstat -l

If you want to remove all the statistics for a specific interface from the database and stop monitoring it, use the below command syntax:

$ sudo vnstat --remove -i <interface_name> --force

For instance, to remove the interface ens33 from the database and stop monitoring it, the command would be:

$ sudo vnstat --remove -i ens33 --force

To add this interface again for monitoring, use the below command:

$ sudo vnstat --add -i ens33

After adding the interface, restart vnStat service:

$ sudo systemctl restart vnstat

vnStat is a handy tool to keep an eye on the bandwidth usage on your Linux OS. In this guide, you have learned how to install and use this tool on Ubuntu 20.04 LTS for monitoring the traffic on network interfaces.

]]>
How to create and run a Perl script in Ubuntu 20.04 LTS https://linuxhint.com/how-to-create-and-run-a-perl-script-in-ubuntu-20-04-lts/ Fri, 12 Mar 2021 12:07:09 +0000 https://linuxhint.com/?p=94103 Perl is abbreviated for Practical Extraction and Reporting Language that is a well-known and powerful language for String Processing and handling. It is a web scripting language that can be used along with different web frameworks and the latest technologies. Mostly the Perl used for server-side scripting but, it can also be used to front-end interface programming languages like HTML with the backend in the Database application. It is fast and robust so, it can interact with many other programming languages on different platforms.In this article, we will talk about the best steps to install Perl language and how we can create and run the Perl script through the command line on Ubuntu 20.04.

Prerequisites

You should have sudo access to run administrative commands on your system.

Installation of Perl on Ubuntu 20.04

We have implemented different steps in this article on the command line application ‘Terminal’. Before going to start the Perl installation steps in detail, open the terminal window. You can access this application by pressing ‘Ctrl+Alt+t’ or you can also open it from the application menu.

Execute the following different steps to install Perl and run a Perl script on your Ubuntu system:

Step 1: Update your system

Before going to start the installation of Perl, it is recommended to update your system by typing the following command via terminal:

$ sudo apt update

The above command will download and install all available updates for your Ubuntu 20.04 apt repository.

Step 2: Install Perl on Ubuntu 20.04

On our system, Perl is already installed. But, if you don’t have Perl installed on your system then, you can install it directly from the Ubuntu repository by typing the following command:

$ sudo apt install perl

The above command will automatically install the all required Perl packages and dependencies on your system.

Step 3: Verify the Perl Installation

Once the installation of Perl is completed, now you can verify the installation by using the following ‘grep’ command on your terminal:

$ apt list --installed | grep -i perl

The above command will find the all installed packages of Perl and list on the terminal window which you can see in the following snapshot:

Step 4: Check Installed Perl Version

If you want to know which Perl version is installed on your Ubuntu system then, by executing the following command you can check it:

$ perl -v

As you can see in the below-given screenshot that Perl version ‘v5.30.0.’ is installed our system.

Step 5: Run Your First Perl Script on Ubuntu 20.04

Now, it’s time to run your first Perl script on your system. To do this, create a simple text file in your favorite text editor and paste the following code into it:

#!/usr/bin/perl

use warnings;

print("Hi, this is test script Hello world\n");

Save the above file with named ‘helloworld.pl’. The file will be saved in your home directory by default. Run this file via the terminal by typing the below-mentioned command:

$ perl helloworld.pl

The following result will be shown on the terminal after running the above mentioned script:

Step 6: Install Perl Sql module on Ubuntu 20.04

You can install the MySQL module for Perl on your Ubuntu 20.04 system. To do this, follow the below apt command to install the Perl Mysql module:

$ sudo apt install libdbd-mysql-perl -y

The above mentioned command will install the necessary mysql Perl packages on your Ubuntu system.

Conclusion

In the above article, we have explained the installation of Perl and how to create and run Perl script using the command line on Ubuntu 20.04. We have also discussed how to configure necessary Perl modules on your system. Please let us know about your difficulties or queries related this article.

]]>
How to Install YakYak on Ubuntu 20.04 https://linuxhint.com/how-to-install-yakyak-on-ubuntu-20-04/ Fri, 12 Mar 2021 05:32:35 +0000 https://linuxhint.com/?p=94061 Google Hangouts is a famous communication app to send messages, share content like files, pictures, and videos. The screen sharing and video call options in this application make it popular among its users. The application can be installed on all operating systems and is also available on mobile phones. To make phone calls, users might need to buy monthly packages. In this tutorial, we will set up and install the YakYak Google Hangouts client on an Ubuntu 20.04 system.

Installing Google Hangouts/YakYak

Google Hangouts cannot be installed directly on the Linux platform-based desktop, we require to use YakYak a third-party application. This open-source client allows users to download Google Hangouts in their systems.

Method 01 # Installing Google Hangouts using Snap package

The first method discussed will use the snap package for the installation of Google Hangouts.

Step 1: Installing snap package

We can install Google Hangouts using YakYak in an Ubuntu system. To do so, make sure you already have installed the snap package within your system. If you do not have the package in the system, install it before moving to the next steps. To do so, open up the terminal window by using the Ctl+Alt+T shortcut or you can simply go to the ApplicationsTerminal of the system. When opened, type this command in the terminal window of your computer system:

$ sudo apt update && sudo apt install snapd

The moment you press the enter key from the keyboard, the apt updates and installation will begin.

Install Snapd

Step 2: Installing core

After the successful configuration of snap within the system, you need to install core of the snap. Type the following mentioned command in the terminal window:

$ sudo snap install core

Confirmation of installation

Once you hit enter an output similar to the one displayed below will confirm the installation process.

Step 3: Restarting snapd services

After that, restart the snapd services by typing the following:

$ sudo systemctl restart snapd

This will restart the snapd services in your system.

Step 4: Installing YakYak

The next step is the installation of YakYask within the system. To do so, type the following command within the terminal window and press the enter key:

$ sudo snap install yakyak

The download will begin as shown in the figure below:

Confirmation of installation

Once the process of installation is completed an output will appear as shown in the following figure:

Method # 02: Download and install the YakYak deb package

The second method requires user to download the YakYak deb package. Follow all of the steps mentioned below:

Step 1: Download the deb package

Download the latest deb package for YakYak in your system from the link. Download the highlighted deb package by clicking on it.

A dialog box will appear. Click on Save File option then press the OK button.

Once the deb package is saved, you need to access the Downloads directory. Type this command in the terminal window:

$ cd Downloads

Then list all of the downloaded files in the system. For this, use the command mentioned below:

$ ls

The deb package will be listed below as shown in the figure below:

Step 2: Installation of the deb package

Now, you have to install YakYak using the command given below:

The system will ask for the password of the user, provide it, and then press the enter key to proceed.

The installation process will then be finished soon.

Accessing the application

Once the application is installed in your system, go to the Applications and type YakYak, the application can now be seen in the available options.

Double click on it. The Google Account will ask for the credentials. If you already have an account, then proceed by providing the user credentials, otherwise, you need to create an account.

Uninstalling Google Hangouts/YakYak

To uninstall YakYak from the system, type the following command in the terminal window:

$ sudo apt remove yakyak

As soon as you press the enter key, the system will ask for the password of the logged in user.

This way, users can smoothly uninstall the application from their system based on their necessity.

Conclusion

In this tutorial, we went through the method of installation of Google Hangouts on the Ubuntu 20.04 system. Users can use YakYak to install the Google Hangouts application on their Linux systems. The tutorial discussed two methods of installation of YakYak and then walked users through the uninstallation process.

]]>
How to Assign Multiple IP Addresses to Single NIC in Ubuntu 20.04 LTS https://linuxhint.com/how-to-assign-multiple-ip-addresses-to-single-nic-in-ubuntu-20-04-lts/ Fri, 12 Mar 2021 05:24:57 +0000 https://linuxhint.com/?p=94058 While working with computer systems, sometimes you might require multiple IP addresses on your physical machine. One of the solutions is to have multiple NICs installed on your system. However, it is not practical to buy a new NIC and plug it in your system when you have the option to assign multiple IP addresses to a single NIC which is referred to as IP Aliasing. The common use case of IP aliasing is the implementation of IP based virtual hosting.

In this post, we will be demonstrating you how to assign multiple IP addresses to a single NIC in Ubuntu OS. We will be demonstrating the procedure on Ubuntu 20.04 (Focal Fossa).

Assigning Multiple IP Addresses to Single NIC Temporarily

In the following section, we will see how to assign a second IP address to a NIC. The second IP address assigned by this method is temporary. Once you reboot the system, it will be removed automatically.

Here are the steps for assigning a second IP address to NIC.

1. First find the current IP address and the name of the interface in your system. To do so, issue the following command in Terminal:

$ ip addr

The following output shows our network interface is ens33 and the current IP address is 192.168.72.157/24 which is the dynamic IP address assigned by DHCP.

2. Let’s assign another IP address to the NIC. To assign an additional IP address to your NIC, issue the following command in Terminal:

$ ip adder add <ip-address> dev <interface-name>

Replace the <ip-address> with the additional IP address you want to assign to your NIC and <interface-name> with the name of your NIC. For instance, to assign the second IP address 10.1.1.5/8 to your network interface ens33, the command would be:

$ ip addr add 10.1.1.5/8 dev ens33

3. After running the above command, verify if the second IP address has been assigned to your network interface. Run the following command to do so:

$ ip addr

Here is the output of the above command which shows two IP addresses assigned to the ens33 network interface.

4. Now try to ping both IP addresses one by one. You can see both IP addresses are reachable.

Remove the Multiple IP addresses from NIC

In order to remove the additional IP addresses assigned to a NIC, run the following command:

$ sudo ip addr del <ip-address> dev <interface-name>

Replace the <ip-address> with the additional IP address you have assigned to your NIC and <interface-name> with the name of your NIC. For instance, to remove the IP address 10.1.1.5/8 assigned to our network interface ens33, the command would be:

$ sudo ip addr del 10.1.1.5/8 dev ens33

Assigning Multiple IP Addresses to Single NIC Permanently

In the previous section, we have assigned the second IP address using the “ip addr add” command which is not the permanent method. Once you reboot the system, the IP address removes automatically. In this section, we will see how to make the IP assignment permanent.

In order to assign multiple IP addresses to a single NIC permanently, you will need to configure it in the interfaces configuration file.

1. Edit the interfaces configuration file as follows:

$ sudo nano /etc/network/interfaces

Append the following lines in the file:

iface <interface-name> inet static
address <ip-address>

Replace the <interface-name> with the name of your NIC to which you want to assign the additional IP address and <ip-address> with the IP address, you want to assign. For instance, to assign the second IP address 10.1.1.5/8 to your network interface ens33, the lines would be changed to:

iface ens33 inet static

address 10.1.1.5/8

Once you have added the above lines, save, and close the file.

Now restart the networking service to apply the configuration changes you have made above:

$ sudo systemctl restart networking

Alternatively, bring down and bring up the interface to apply the changes:

$ sudo ifdown ens33
$ sudo ifup ens33

Now to verify if the additional IP address has assigned to the network interface, use the following command:

$ ip addr

As we have configured the additional IP address in the configuration file, therefore it will remain permanent even if you reboot the system.

Remove the Multiple IP addresses from NIC

You can also remove the additional IP address you have configured in the interfaces configuration file. To do so, simply edit the /etc/network/interfaces file and remove the entry for the additional IP addresses you have added. Then save and close the file and restart the networking services:

$ sudo systemctl restart networking

or bring down and bring up the interface to apply the changes

$ sudo ifdown ens33
$ sudo ifup ens33

This is how you can assign multiple IP addresses to a single NIC in Ubuntu OS. In this post, we have discussed both the temporary and permanent methods for assigning the secondary IP address to a single NIC. Following the same methods, you can allocate multiple IP addresses to a single NIC.

]]>
How to block or unblock ping requests on Ubuntu Server 20.04 LTS https://linuxhint.com/block-unblock-ping-requests-to-ubuntu-server/ Fri, 12 Mar 2021 05:21:21 +0000 https://linuxhint.com/?p=94055 Ping is a network administration utility that is used to test the availability of a system on an IP network. Ping is also used to test the quality of the network connection by monitoring the round trip time and packet losses. On the other hand, network intruders and hackers also use ping to identify network subnets to find potential hosts or to perform ICMP flood attacks. Therefore, it is a good practice to block ping requests to your servers to prevent any kind of attack.

This article is about how to block ping requests to Linux Server. We will also describe how to unblock the ping requests in case you need to use ping for system administration and troubleshooting.

Prerequisites

  • Ubuntu 20.04 LTS
  • User with sudo privileges

Note: The commands discussed here have been tested on Ubuntu 20.04 LTS.

Block/unblock ping requests to Linux Server

Ping works by sending an ICMP packet (Echo request) to the destination system and then receives a response ICMP packet (Echo reply). In Linux, the ping command continues sending ICMP packets until you stop it using Ctrl+C.

In order to block ping requests, you will need to ignore/block the ICMP echo requests that are sent to your server. There are following two ways through which you can block/unblock ICMP echo requests to the Linux server.

  • Through Kernel parameters
  • Through iptables

Let’s get started.

Block/unblock ping requests through kernel parameters

Through kernel parameters, you can block ping requests either temporarily or permanently. Kernel parameters can be modified through sysctl command, /sys/proc directory, and /etc/sysctl.conf file.

Temporary block/unblock ping requests

The sysctl command in Linux is used to read and write kernel parameters in the /proc/sys directory. Using this command, we can set up kernel parameters to block/unblock ping requests. The kernel parameter net.ipv4.icmp_echo_ignore_all controls whether the system should respond to the ICMP echo request. The default value of it is ‘0’ which means to respond to the ICMP request.

Block Ping Request

In order to block ping request, issue the following command in Terminal:

$ sudo sysctl -w net.ipv4.icmp_echo_ignore_all=1

This command sets the kernel parameter to ‘1’ which means to ignore all the ICMP requests.

Now all the ping requests to your system will be blocked and the sender will receive no response as shown in the below screenshot.

Unblock Ping Request

To unblock the ping requests, again run the same command by changing the parameter value to default ‘0’.

$ sudo sysctl -w net.ipv4.icmp_echo_ignore_all=0

Alternatively, you can block the ping requests by changing the kernel parameter value in the /proc/sys directory using the echo command. However, to use this method, you will need to run the command as root.

In order to block ping request, first switch to root account using the following command in Terminal:

$ su root

When prompted for the password, enter the password for root.

Then issue the following command in Terminal:

$ echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

To unblock the ping requests, the command would be:

$ echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all

Permanently block ping requests

Kernel parameters can also be modified through the /etc/sysctl.conf file. This file will allow you to permanently block ping requests to your server.

Block Ping Request

In order to block ping request to your system, edit /etc/sysctl.conf file:

$ sudo nano /etc/sysctl.conf

Then append the following line in the file:

net.ipv4.icmp_echo_ignore_all = 1

Save and close the file.

Then issue the following command in Terminal to apply this configuration without reboot:

$ sysctl -p

Unblock Ping Request

To unblock ping requests, edit the /etc/sysctl.conf file:

$ sudo nano /etc/sysctl.conf

Then modify the value of net.ipv4.icmp_echo_ignore_all to ‘0’:

net.ipv4.icmp_echo_ignore_all = 0

Save and close the file.

Then issue the following command in Terminal to apply this configuration without reboot:

$ sysctl -p

Block/unblock ping requests Using iptables

Iptables is a firewall utility in Linux that controls incoming and outgoing traffic based on certain rules. It comes preinstalled in the Ubuntu system. In case, it is missing from the system, you can install it using the following command in Terminal:

$ sudo apt install iptables
Block Ping Request

To block ping requests to your system, type following command in Terminal:

$ sudo iptables -A INPUT -p icmp --icmp-type 8 -j REJECT

Where the A flag is used to add a rule in iptables and icmp-type 8 is the ICMP type number used for echo request.

The above command will add a rule in the firewall that will block any incoming ping requests to your system. By adding this rule, anyone sending the ping request to your system will see the “Destination Port Unreachable” message as shown in the below screenshot.

If you do not want this message to appear, use the following command replacing REJECT with DROP:

$ sudo iptables -A INPUT -p icmp --icmp-type 8 -j DROP

Now anyone sending the ping request to your system will see the following similar output:

Unblock Ping Request

In order to unblock ping requests to your server, type the following command in Terminal:

$ sudo iptables -D INPUT -p icmp --icmp-type 8 -j REJECT

Where the D flag is used to delete a rule in iptables and icmp-type 8 is the ICMP type number used for an echo request.

In order to make these rules persistent after a system reboot, you will need iptables-persistent package. Issue the below command in Terminal to install iptables-persistent:

$ sudo apt install iptables-persistent

You will be asked to confirm whether you want to proceed with the installation or not. Hit y to proceed, after which the system will start the installation and once completed, it will be ready to use.

After adding or deleting any rule, issue the following commands in Terminal to make them survive the system reboot.

$ sudo netfilter-persistent save
$ sudo netfilter-persistent reload

In order to view all the rules added to your iptables, issue the following command in Terminal:

$ sudo iptables -L

That is all there is to it! In this article, we have discussed how to block/unblock ping requests to Linux Server either through the kernel parameters or through iptables utility. Hope this helps!

]]>
How to install and configure HAproxy on Ubuntu 20.04 LTS https://linuxhint.com/how-to-install-and-configure-haproxy-load-balancer-in-linux/ Fri, 12 Mar 2021 05:10:22 +0000 https://linuxhint.com/?p=94051 HAproxy is an open-source and lightweight package that offers high availability and load balancing for TCP and HTTP based programs. It distributes the load among the web and application servers. HAproxy is available for nearly all Linux distributions. It is a widely used load balancer that is popular for its efficiency, reliability, and low memory and CPU footprint. In this post, we will explain how to install and configure HAproxy on a Ubuntu system.

We have setup three machines. We will install HAproxy on one server and the Apache web servers on two servers. Our HAproxy server will then act as a load balancer and will distribute the load among Apache web servers.

Note: The procedure and commands mentioned in this post has been tested on Ubuntu 20.04 LTS (Focal Fossa). The same procedure is also valid for Debian and Mint distributions.

Network Details

We will be using three Ubuntu servers; all on the same network. The details of our servers are as follows:

Hostname: HAproxy, IP address: 192.168.72.157 (Frontend server)
Hostname: web-server1, IP address: 192.168.72.158 (Backend servers)
Hostname: web-server2, IP address: 192.168.72.159 (Backend servers)

Note: You must have sudo privileges on all the servers.

We will configure one machine as a load balancer and the other two as web servers. The HAproxy server will be our front-end server that will receive the requests from the users and forward them to the two web servers. The web servers will be our Backend servers that will receive those forwarded requests.

This is how our setup looks like:

Setting up web servers-Backend servers

In this section, we will setup two web servers (web-server1 and web-server2) as our backend servers.

On web-server1(192.168.72.158)

Perform the below steps in your web server. Make sure to replace the hostnames and IP addresses with the relevant IP addresses and hostnames of your web servers.

1. Configure hosts file

On web-server1, edit the /etc/hosts file:

$ sudo nano /etc/hosts

Then add the hostname entry for HAproxy server as follows:

hostname-of-HAproxy IP-address-of-HAproxy

In our scenario, it would be:

HAproxy 192.168.72.157

2. Setup Apache webserver

Now install Apache web server using the below command in Terminal. You can also visit our post on How to install the Apache web server on Linux.

$ sudo apt install apache2

Then enable and start the Apache service using the below commands in Terminal:

$ sudo systemctl enable apache2
$ sudo systemctl start apache2

Create an index file for web-server1 using the below command in Terminal:

$ echo "<H1>Hello! This is webserver1: 192.168.72.158 </H1>" | sudo tee /var/www/html/index.html

If a firewall is running on your system, you will need to allow Apache traffic through it:

$ sudo ufw allow 80/tcp

Then reload the firewall configurations:

$ ufw reload

Now try accessing the site in your web browser by typing http:// followed by either the IP address or the hostname of your web server.

http:// hostname-or-IP-address

Alternatively, you can also use the curl command to test the webpage.

$ curl <hostname-or-IP-address>

On web server-2 192.168.72.159)

Perform the below steps in your second web server. Make sure to replace the hostnames and IP addresses with the relevant IP addresses and hostnames of your web servers.

1. Configure hosts file

In web-server2, edit the /etc/hosts file:

$ sudo nano /etc/hosts

Then add the hostname entry for HAproxy server as follows:

HAproxy 192.168.72.157

2. Install Apache webserver

Now install Apache web server using the below command in Terminal.

$ sudo apt install apache2

Then enable and start the Apache service using the below commands in Terminal:

$ sudo systemctl enable apache2
$ sudo systemctl start apache2

Create an index file for web-server2 using the below command in Terminal:

$ echo "<H1>Hello! This is webserver2: 192.168.72.159 </H1>" | sudo tee /var/www/html/index.html

Allow Apache in the firewall:

$ sudo ufw allow 80/tcp

and then reload firewall configurations:

$ ufw reload

Now try accessing the site in your web browser by typing http:// followed by either the IP address or the hostname.

http:// hostname-or-IP-address

Alternatively, you can use the curl command to test the webpage.

$ curl <hostname-or-IP-address>

Now our Apache web servers are ready.

Setting up HAproxy load balancer-Frontend server

In this section, we will set up an HAproxy load balancer for our web servers. This HAproxy server will act as a frontend server and accepts incoming requests from clients.

On the HAproxy server (192.168.72.157), perform the below steps to setup load balancer.

1. Configure hosts file

Edit the /etc/hosts file using the below command in Terminal:

$ sudo nano /etc/hosts

Add the following hostname entries for both Apache web servers along with its own hostname:

192.168.72.157 HAproxy
192.168.72.158 web-server1
192.168.72.159 web-server2

Now save and close the /etc/hosts file.

Installing HAproxy load balancer

Now in this step, we will be installing the HAproxy on one of our Ubuntu server (192.168.72.157). To do so, update apt using the following command in Terminal:

$ sudo apt-get update

Then update packages using the below command:

$ sudo apt-get upgrade

Now install HAproxy using the following command in Terminal:

$ sudo sudo apt install haproxy

Once the installation of the HAproxy server is finished, you can confirm it using the below command in Terminal:

$ haproxy -v

It will show you the installed version of HAproxy on your system which verifies that the HAproxy has been successfully installed.

Configuring HAproxy as a load balancer

In the following section, we will configure HAproxy as a load balancer. To do so, edit the /etc/haproxy/haproxy.cfg file:

$ sudo nano <strong>/etc/haproxy/haproxy.cfg</strong>

Append the following lines in the haproxy.cfg file replacing the IP addresses with your own IP addresses.

The frontend web-frontend in the above configuration lines tells HAproxy to listen to incoming requests on port 80 of 192.168.72.157 and then forward them to backend servers configured under the backend web-backend. While configuring, replace the IP addresses with the relevant IP addresses of your web servers.

Configuring HAproxy Monitoring

With HAproxy monitoring, you can view a lot of information including server status, data transferred, uptime, session rate, etc. To configure HAproxy monitoring, append the following lines in the configuration file located at /etc/haproxy/haproxy.cfg:

listen stats
bind 192.168.72.157:8080
mode http
option forwardfor
option httpclose
stats enable
stats show-legends
stats refresh 5s
stats uri /stats
stats realm Haproxy\ Statistics
stats auth kbuzdar:kbuzdar            #Login User and Password for the monitoring
stats admin if TRUE
default_backend web-backend

The above configuration enables the HAproxy “stats” page using the stats directive and secures it with http basic authentication using the username and password defined by the stats auth directive.

Once you are done with the configurations, save and close the haproxy.cfg file.

Now verify the configuration file using the below command in Terminal:

$ haproxy -c -f /etc/haproxy/haproxy.cfg

The following output shows that the configurations are correct.

Now to apply the configurations, restart the HAproxy service:

$ sudo systemctl restart haproxy.service

It will stop and then start the HAproxy service.

To check the status of the HAproxy service, the command would be:

$ sudo systemctl status haproxy.service

The active (running) status in the following output shows that the HAproxy server is enabled and running fine.

Here are some other commands for managing the HAproxy server:

In order to start the HAproxy server, the command would be:

$ sudo systemctl start haproxy.service

In order to stop the HAproxy server, the command would be:

$ sudo systemctl stop haproxy.service

In case you want to temporarily disable the HAproxy server, the command would be:

$ sudo systemctl disable haproxy.service

To re-enable the HAproxy server, the command would be:

$ sudo systemctl enable haproxy.service

Test HAproxy

Before testing the HAproxy setup, make sure you have connectivity to web servers. From your HAproxy server, ping both web servers either by their IP addresses or hostnames.

$ ping hostname-or-ip-address

The following output shows that the HAproxy server can reach both web servers.

Test HA Proxy using a web browser

Now in your HAproxy server, open any web browser and type http:// followed by the HAproxy server IP address which in our case is 192.168.72.157.

http://192.168.72.157

The HAproxy server will alternatively send the request to both web servers in a round-robin method. You can test this by reloading the webpage a few times.

This is the response we received when we visited the http://192.168.72.157 for the first time:

This is the response we received when we reloaded the webpage:

You can also use the hostname in place of the HAproxy server IP address.

Test HA Proxy using curl

You can also use the curl command in Linux to test the HAproxy setup. Open the Terminal and type curl followed by the IP address or the hostname of the HAproxy server.

$ curl 192.168.72.157

or

$ curl HAproxy

Run the curl command a few times and you will see the response alternating between both web servers.

Instead of running the commands several times, you can also run the following one-line script to test the HAproxy server:

$ while true; do curl 192.168.72.157; sleep 1; done

Testing HAproxy Monitoring

To access the HAproxy monitoring page, type http:// followed by the IP address/hostname of HAproxy server and port 8080/stats:

http://192.168.72.157:8080/stats

or

http://HAproxy:8080/stats

The following authentication box will appear. Enter the username and password you have configured earlier in the configurations and then press OK.

This is the statistics report for our HAproxy server.

There you have the installation and configuration of HAproxy load balancer on the Linux system. We have just discussed the basic setup and configuration of HAproxy as a load balancer for Apache web servers. We also looked at some commands for managing the HAproxy server. In the end, we tested the load balancing through the browser and the curl command. For more information, visit HAproxy official documentation

]]>
How to change MTU size in Linux https://linuxhint.com/how-to-change-mtu-size-in-linux/ Thu, 11 Mar 2021 09:01:01 +0000 https://linuxhint.com/?p=93981 MTU (Stands for Maximum Transmission Unit) is the maximum size of the packet that can be transmitted from a network interface. All the devices including servers and switches/routers involved in communication should have the same MTU size. Large MTU size has less overhead associated with it while the smaller MTU has less delay.

The default MTU size in most of the Ethernet networks is 1500 bytes. However, you can change it as per the requirements. In this tutorial, we will explain how to change MTU size in Linux.

Prerequisites

  • Ubuntu 20.04 system
  • User with sudo privileges

Note: The commands discussed in this article have been tested on Ubuntu 20.04 LTS (Focal Fossa). The same commands are also valid for Debian distribution.

View Current MTU Size

In order to view the current MTU size of your ethernet interface, use the ifconfig command as follows:

$ ifconfig | grep mtu

The output below shows the current MTU size of interface ens33 is 1500.

Alternatively, you can also use the “ip a” command to view the current MTU size:

$ ip a | grep mtu

Temporarily changing the MTU Size – Using ifconfig command

We can use the ifconfig command to change the MTU size of a system’s network interface. However, remember that this change does survive a reboot and returns to the default value i.e. 1500.

To change the MTU size of an interface, use the following syntax:

$ ifconfig <Interface_name> mtu <mtu_size> up

For instance, to change the MTU size of an interface named ens33 to 1000 bytes, the command would be:

$ ifconfig ens33 mtu 1000 up

After running the above command, the MTU size changes instantaneously. This change even does not require a service restart.

You can verify the new MTU size by running the following command in Terminal:

$ ifconfig | grep mtu

From the above output, you can verify that MTU size has now changed to 1000 bytes. However, as mentioned before, this change will not survive a reboot. The MTU size will return to its default value of 1500 after a reboot.

Permanently changing the MTU Size

The ifconfig command instantaneously changes the MTU size but this change does not survive a system reboot. In the following section, we will see how to permanently change the MTU size.

In dynamic IP addressing, the MTU size is set by DHCP. So will need to configure the DHCP configuration file located at /etc/dhcp/dhclient.conf. For static IP address, we will make changes in the network interface configuration file located at /etc/network/interfaces.

Using /etc/dhcp/dhclient.conf file

If the DHCP server is running on your system and the network interfaces are configured to receive the IP addresses from it, then use /etc/dhcp/dhclient.conf file to change the MTU size.

Edit the nano /etc/dhcp/dhclient.conf using the following command:

$ sudo nano /etc/dhcp/dhclient.conf

Then add the following lines below the “send host-name = gethostname(); line:

default interface-mtu <mtu_size>;

supersede interface-mtu <mtu_size>;

For instance, to set the MTU size to 1400, we will add:

default interface-mtu 1400;

supersede interface-mtu 1400;

If you have multiple interfaces and you want to change the MTU size of just one interface, then enclose it in the braces as follows:

interface "interface_name" {

default interface-mtu <mtu_size>;

supersede interface-mtu <mtu_size>;

}

Once you have configured the file, save, and close it.

Now restart the networking service using the following command in Terminal:

$ sudo service networking restart

Also, bring up the interface using the following command:

$ sudo ifup <interface_name>

Make sure to replace the <interface_name> with the actual network interface on your system e.g ens33, eth0, eth1, etc.

In our case, it would be:

$ sudo ifup ens33

Now issue the following command in Terminal to verify if the MTU size has changed successfully.

$ sudo ifconfig | grep mtu

From the output, you can see the MTU size has been changed to 1400.

Using /etc/network/interfaces file

If your network interface is configured to obtain a static IP address, then you can change the MTU size by configuring the /etc/network/interfaces file.

Edit the /etc/network/interfaces file using the following command in Terminal:

$ sudo nano /etc/network/interfaces

Append the below line in the file:

post-up /sbin/ifconfig <interface-name> mtu <mtu_size>

Make sure to replace <interface-name> with the actual interface name and <mtu_size> with the MTU size you want to set on the network interface.

For instance, to change the MTU size of an interface named ens33 to 1300 bytes, the command would be:

post-up /sbin/ifconfig ens33 mtu 1300 up

Once you have configured the file, save, and close it.

Now restart the networking services using the following command in Terminal:

$ sudo service networking restart

Also, bring up the interface using the following command:

$ sudo ifup <interface_name>

Make sure to replace the <interface_name> with the actual network interface on your system e.g. ens33, eth0, eth1, etc.

In our case, it would be:

$ sudo ifup ens33

Now issue the following command in Terminal to verify if the MTU size has changed successfully.

$ ip a | grep mtu

From the output, you can see that the MTU size has been changed to 1300. This change will be kept persistent and will not be affected even after a reboot.

That is all there is to it! By following the above procedures, you can change the MTU size of a network interface either temporarily or permanently in your Linux system. Hope this helps!

]]>
How to install Zimbra on Ubuntu 18.04 LTS https://linuxhint.com/how-to-install-zimbra-on-ubuntu-18-04-lts/ Wed, 10 Mar 2021 10:25:24 +0000 https://linuxhint.com/?p=93717 Zimbra Collaboration Server is open-source collaborative software that comprises a mail server and a web client. It allows for email, calendaring, creating users and distribution lists, file sharing, chatting, managing mail server activities, etc. Zimbra Collaboration Server is supported on various platforms including Ubuntu 12.04, Ubuntu 14.04, Ubuntu 18.04, Redhat Enterprise Linux 6, Redhat Enterprise Linux 7, CentOS6, CentOS 7, etc. It is also supported on cloud platforms like VMware vCloud Director VMware vCloud Air and virtualization platform like VMware vSphere, XenServer 6, and KVM.  The subject of today’s post is how to install the Zimbra Collaboration server on Ubuntu 18.04 LTS.

Prerequisites

For running the Zimbra collaboration server, you should have:

  • Ubuntu machine 18.04 – 64bit
  • Root privileges
  • Free Disk space 30 GB (minimum)
  • RAM 8 GB (minimum)
  • CPU/Processor 2.0 GHz (minimum)

Note:

For the setup, we have used:

Zimbra: 8.8.15 GA Release

Domain: test.org

IP: 192.168.1.101

Installing Zimbra on Linux

Here are the steps to install the Zimbra Collaboration Server on Linux. Let’s get started.

Step 1: Update and upgrade existing packages

First, you will need to update and upgrade the existing packages. To do so, issue the below commands in Terminal:

$ sudo apt update
$ sudo apt upgrade

Step 2: Edit hostname and hosts file

Now, we will need to setup a hostname for Zimbra. To do so, edit /etc/hostname file using the below command in Terminal:

$ sudo nano /etc/hostname

Replace the hostname with the mail.test.org and then save and close the hostname file.

Replace mail.test.org with your own domain name.

Now edit the /etc/hosts file using the below command in Terminal:

$ sudo nano /etc/hosts

Type the following entry and then save and close the hosts file.

192.168.72.167 mail.test.org mail

Where 192.168.72.167 is the IP address of your Zimbra server, and mail.test.org is the fully qualified domain name (FQDN).

Step 3: Install DNS server

In this step, we will install dnsmasq as our DNS server. However, before installing dnsmasq, we will first need to disable systemd-resolve as it runs on port 53. The DNS server dnsmasq also runs on port 53 which can cause port conflict.

Therefore, we will disable the systemd-resolve. Use the following command to do so:

$ sudo systemctl disable systemd-resolved

Then stop the systemd-resolved using the below command:

$ sudo systemctl stop systemd-resolved

Now remove the resolv.conf symlink file:

$ sudo rm /etc/resolv.conf

Then create a new resolv.conf file using the below command:

$ sudo sh -c 'echo nameserver 8.8.8.8 >> /etc/resolv.conf'

Now to install dsmasq, issue the below command in Terminal:

$ sudo apt install dnsmasq

Install Zimbra on Ubuntu

Once the installation of dnsmasq is completed, run the below command to edit the dnsmasq configuration file:

$ sudo nano /etc/dnsmasq.conf

Add the following lines in the configuration file:

server=192.168.72.167

domain=test.org

mx-host= test.org, mail.test.org, 5

mx-host=mail.test.org, mail.test.org, 5

listen-address=127.0.0.1

Then restart the dnsmasq service using the below command in Terminal:

$ sudo systemctl restart dnsmasq

Step 4: Downloading and installing Zimbra Collaboration Tool

Now download Zimbra for Ubuntu 18.04 LTS from the following link:

https://www.zimbra.org/download/zimbra-collaboration

Or use the following wget command in Terminal to download Zimbra:

$ wget https://files.zimbra.com/downloads/8.8.15_GA/zcs-8.8.15_GA_3869.UBUNTU18_64.20190918004220.tgz

The downloaded file will be in the .tgz format. Issue the below command in Terminal to extract the downloaded file:

$ tar -xvf zcs-8.8.15_GA_3869.UBUNTU18_64.20190918004220.tgz

Navigate to the extracted folder using the cd command as follows:

$ cd zcs-8.8.15_GA_3869.UBUNTU18_64.20190918004220

Then run the installer as follows:

$ sudo ./install.sh

Once the installation is started, you will see something like this:

Install Zimbra on Ubuntu

When the following Software License agreement appear, hit y to accept. Then again hit y to use Zimbra’s package repository for installation.

When the following view appears, hit y for each of the packages except for the zimbra-imapd which is available only in the beta version.

When you are notified that the system will be modified, hit y after which the installation will be started.

Install Zimbra on Ubuntu

Once the installation is done, the following view will appear and you will be asked to configure the unconfigured items.

Here, we will configure the admin password for Zimbra which is not yet configured. You can also see the Admin Password marked as ***** under the zimbra-store section. Hit 7 on your keyboard to enter into the zimbra-store section.

Now for Admin Password configuration, hit 4. You will be prompted to set the password for admin. Type any password (with a minimum of 6 characters).

Install Zimbra on Ubuntu

Now hit a to apply the configurations and hit y again to save the configurations. When you are notified that the system will be modified, hit y.

Now you will see the following screen with the configuration completed message, hit Enter to exit.

Now the installation of Zimbra mail server has been completed.

Step 5: Access Zimbra administration page

Now you can access the Zimbra administration page. Open any web browser and type:

https://ip_adddress:7071

or

https://FQDN:7071

You will see the following default Zimbra login page. Enter admin as username and type password you have set earlier (as described in the previous section).

Install Zimbra on Ubuntu

Once you are logged in, you will see the following view showing the summary and other statistics.

Install Zimbra on Ubuntu

Zimbra is an open-source mail server that offers several features but on the other hand, it consumes a lot of resources. Therefore, it is recommended to install it in a machine that has enough memory, processor, and disk space available. Now, you have learned how to install Zimbra in Ubuntu. In some other posts, we will follow up with the configuration of Zimbra.

]]>
What is build-essential Ubuntu, how to install and use it? https://linuxhint.com/install-build-essential-ubuntu/ Mon, 08 Mar 2021 09:47:06 +0000 https://linuxhint.com/?p=93436 The build-essentials packages are meta-packages that are necessary for compiling software. They include the GNU debugger, g++/GNU compiler collection, and some more tools and libraries that are required to compile a program. For example, if you need to work on a C/C++ compiler, you need to install essential meta-packages on your system before starting the C compiler installation. When installing the build-essential packages, some other packages such as G++, dpkg-dev, GCC and make, etc. also install on your system.

Above, we have described what the build-essential packages are. In the rest of the article, we will explain how to install and use build-essentials on Ubuntu systems. All terminal commands we have executed on Ubuntu 20.04 system in this article. Let’s dive into the depths!

Installation and use of Build Essential tools on Ubuntu 20.04 system

The build-essential meta-packages can be installed directly from the Ubuntu official repository. These packages are available in the default Ubuntu 20.04 system repository. Just install meta-packages of build-essential tools through the apt package manager. Open the terminal application through the keyboard shortcut ‘Ctrl + Alt + t’.

Update apt repository

Now, you need to update the packages repository before installing the build-essential tools. Type the following command to update the apt repository index:

$ sudo apt update

Install build-essential

Install the build-essential packages by running the below-given command:

$ sudo apt install build-essential

After executing the above command, the following result will be shown on the terminal:

Check GCC version

Once the installation is finished, verify the installation of these packages by checking the GCC version on your system with the following command:

$ gcc --version

The installed version of GCC to be displayed on the terminal, which is also shown in the following screenshot:

Now, all GCC compiler libraries and tools have been installed on Ubuntu 20.04 system. However, you can run a C program for testing the installation.

Create C program

Let’s create a C program by using the nano editor as follows:

$ nano testprogram.c

Now, add the below-mentioned lines of code in this nano file:

// testprogram.c

#include <stdio.h>

int main() {
    printf("Test, Program!\n");
    return 0;
}

Compiling the C program

Save the above file and make an executable file by using the following command:

$ gcc testprogram.c -o testprogram

Run C program

Now, execute the following command to run the C program:

$ ./testprogram

The following output is shown on the terminal after running the above C program:

Conclusion

We have explained the installation of build-essential tools in this article. We have explored what is build-essential and how to install and use it on Ubuntu 20.04 system. Now, you should have the proper understanding of the build-essential and how to install it on the Ubuntu system. The above commands can also be applied to the older Ubuntu versions. To learn more about these required packages, must visit their official website for a better understanding.

]]>
How to Install Python 3.9 On Ubuntu 20.04 and 20.10 https://linuxhint.com/install-python-ubuntu/ Mon, 08 Mar 2021 09:22:01 +0000 https://linuxhint.com/?p=93419 Python, an object-oriented programming language, is well-liked among beginners and experienced developers due to its easy and user-friendly syntax. This versatile language is used as a key language in top tech companies.

With new features/modules, security updates, and improvements, the python 3.9 version has been released to make this functional language more useful and top-ranked.

Now, let’s check how to get python 3.9 on Ubuntu 20.04 device.

How to Install Python 3.9 On Ubuntu 20.04 (LTS) and 20.10:

There are two main approaches to install python 3.9 on Ubuntu 20.04. but we will go with the convenient and straight-forward approach.

Your terminal will be opened by pressing Ctrl+Alt+T. Once your terminal is opened, follow the steps listed below:

Step 1: Add repository with the command:

$ sudo add-apt-repository ppa:deadsnakes/ppa

D:\Kamran\Feb\03\Article\Pics\images\image1 final.png

Step 2: Use the update command to update your apt cache. It will help to update all packages listed on Ubuntu.

$ sudo apt update

D:\Kamran\Feb\03\Article\Pics\images\image3 final.png

Once all the packages are updated, use the below-mentioned command to install the updated version of python 3.9.

$ sudo apt install python 3.9

D:\Kamran\Feb\03\Article\Pics\images\image2 final.png

So, python 3.9 is installed on your system. You can check its version if there is any doubt by using the command:

$ python 3.9 -V

D:\Kamran\Feb\03\Article\Pics\images\image5 final.png

Now, the installation process of python 3.9 is completed.

How To Uninstall Python 3.9 On Ubuntu 20.04 (LTS) 20.10:

In addition, if you want to remove or uninstall it, the following command will be used, and it will remove a python from your system.

$ sudo apt autoremove python3.9

D:\Kamran\Feb\03\Article\Pics\images\image4 final.png

Conclusion:

In this article, we have learned how to install the Python 3.9 version on Ubuntu 20.04. Python is a high-level, object-oriented language that is simple, easy to learn, and convenient for large-scale projects.

]]>
How to Install Microsoft Teams on Ubuntu 20.04 (LTS) and 20.10 https://linuxhint.com/install-microsoft-teams-ubuntu/ Mon, 08 Mar 2021 06:13:43 +0000 https://linuxhint.com/?p=93409 Microsoft has designed its most collaborative platform yet bundled with Office 365. Since 2019, Microsoft Teams has been available for Linux users. This program is globally famous because it provides the ability to use unlimited features in a single forum.

The most notable features of Microsoft Teams include audio and video calls, chats, online meetings, file and data collaboration, extensibility features, and much more. Once Microsoft Teams is installed, it does not matter if you have a small or large enterprise, you will be able to complete the project quickly and efficiently.

This article shows you how to install Microsoft Teams on Ubuntu 20.04 (LTS) and 20.10. Microsoft Teams can be installed on Ubuntu 20.04 (LTS) and 20.10 using multiple methods, which are provided in the sections below.

Method 1: Installing Microsoft Teams Using the GUI

Step 1: Open the official site of Microsoft Teams.

There, you will see multiple downloading options. Select Linux Deb 64-bit and download the .deb package.

D:\Kamran\Feb\15\Articles\Install Microsoft teams On Ubuntu 20\images\image3 final.png

Step 2: You will find the .deb file in the Downloads folder. Double-click the file to open it.

D:\Kamran\Feb\15\Articles\Install Microsoft teams On Ubuntu 20\images\image5 final.png

Step 3: A window will appear with the installation button. Click ‘Install’ to continue.

D:\Kamran\Feb\15\Articles\Install Microsoft teams On Ubuntu 20\images\image4 final.png

Now, it should be installed on your system. You can use it by signing in.

D:\Kamran\Feb\15\Articles\Install Microsoft teams On Ubuntu 20\images\image7 final.png

Method 2: Installing Microsoft Teams Using the Terminal

Issue the following command in the terminal to download the .deb package:

$ wget –O teams.deb https://packages.microsoft.com/repos/ms-teams/pool/main/t/teams/teams_1.3.00.5153_amd64.deb

D:\Kamran\Feb\15\Articles\Install Microsoft teams On Ubuntu 20\images\image6 final.png

Now, to install it, use the command given below:

$ sudo apt install ./teams.deb

D:\Kamran\Feb\15\Articles\Install Microsoft teams On Ubuntu 20\images\image2 final.png

Uninstalling Microsoft Teams from Ubuntu 20.04 and 20.10

To uninstall teams from Ubuntu, issue the command given below:

$ sudo apt remove teams

D:\Kamran\Feb\15\Articles\Install Microsoft teams On Ubuntu 20\images\image1 final.png

Conclusion

In this article, you learned how to install Microsoft Teams using the GUI and the Terminal. Microsoft Teams is a major platform, in which many people from the same organization can work together as a team for small- and large-scale projects.

]]>
How to Install Brave Browser on Ubuntu 20.04 https://linuxhint.com/install-brave-browser-ubuntu/ Sun, 07 Mar 2021 21:29:39 +0000 https://linuxhint.com/?p=93246

Brave software developed a modern browser focused on speed, privacy, security privileges, and performance known as Brave browser, which like many other modern browsers, is based on Chromium.

Brave browser features can block online ads from the websites and show several blocked ads via ad-trackers. As the brave browser is chromium-based therefore it can add limited chromium extensions.

Its speed of loading pages is faster than any other browser. Brave browsers can differentiate between safe and unsafe sites.

Let’s move towards the installation procedure of Brave browser on Ubuntu 20.04.

Install Brave Browser on Ubuntu 20.04 (LTS) and 20.10

Brave browser can be installed through GUI. It is an easy approach to get a browser on the system.

Open the Software center on Ubuntu and type “Brave browser” in the search bar.

Select Brave browser:

Click on the Install button to start the installation process, which will take a few min. After completion of downloading and installation, it can be viewed in your applications.

Click on Brave browser to start browsing on it.

Uninstall Brave Browser on Ubuntu 20.04 (LTS) and 20.10

Suppose you want to remove Brave browser from your system, open Software center on Ubuntu, and click on Installed applications. Search Brave browser. You’ll get the Remove button there. Click on it to remove Brave browser from Ubuntu.

Conclusion

We have learned how to get Brave browser on Ubuntu 20.04 through GUI and its uninstallation method. Brave browser is an open-source, secure browser that is 3-6 times faster than any other browser. People used to prefer the brave browser because of its ad-tracker and ad-block feature.

]]>
How to Install Security Updates in Ubuntu 20.04 https://linuxhint.com/install-security-updates-ubuntu/ Sun, 07 Mar 2021 21:19:30 +0000 https://linuxhint.com/?p=93263

An essential part of using any operating system is to check for security updates from time to time. It can be difficult to keep track of security updates all the time. One of the easiest ways to keep your Ubuntu system secure is by upgrading your software packages. New versions add the latest features available, and system security is increased by updating programs frequently.

This guide shows you how to install security updates in Ubuntu 20.04, which will be performed by upgrading security packages.

There are two primary methods for upgrading the software to minimize the vulnerability of security issues:

  • Update Ubuntu via the Command-Line
  • Update Ubuntu

Method 1: Update Ubuntu via the Command-Line

Updating Ubuntu using the command line gives you more clarity and authority over the process. Open your terminal and issue the following command to update the packages:

$ sudo apt update

To get a list of packages that are due for an update, enter the following command:

$ apt list --upgradable

Now, all the packages can be updated using the following command, which will complete all updates of the packages that require updates. After you enter the command listed below, your operating system will be upgraded successfully:

$ sudo apt upgrade


There will always be some software packages in the system that depend on each other to function properly.

These packages can be updated using the “dist-upgrade” command mentioned below. Type the command in the terminal to get an update:

$ sudo apt dist-upgrade


Unused packages that are no longer needed can be removed by executing the following command:

$ sudo apt autoremove

Method 2: Update Ubuntu via the GUI

The second approach to install security updates on your system is to install the updates using the software updater application. To start updating Ubuntu using the GUI, open the Ubuntu Applications folder and search for the Software Updater:

Open the Software Updater to check for the update details:

A dialogue box will appear to ask you for permission to install the updates right now or later:


Click “Details of updates” to receive a menu of individual packages, then check the package that you want to update:

Once it is done, click on “Install Now” to start the installation:


You can look at information about the installation in greater detail by clicking details:

So, the updated version of Ubuntu and the updated packages will be installed on the system. A window may ask you to restart your system to take the changes into effect.

Conclusion

The guide showed you how to upgrade the operating system via the GUI and the command-line. By updating the software packages and operating systems, security updates will be installed that not only make the whole experience smoother and faster but also secure the system from bugs and malware.

]]>
How to Change Folder Color in Ubuntu 20.04 https://linuxhint.com/change-folder-color-ubuntu/ Sun, 07 Mar 2021 13:33:24 +0000 https://linuxhint.com/?p=93063 It can be time-consuming and frustrating for a user to search for a folder when there are many stored in one directory. Color-coded folders help you to visually differentiate folders, making it easy to identify the required folder and speeding up your computer work. This article shows you how to change folder color in Ubuntu.

How to Change Folder Color in Ubuntu 20.04

There two steps to follow in this procedure. First, open the terminal, then copy the following command to enable the repository:

$ sudo add-apt-repository ppa:costales/yaru-colors-folder-color

Use the following command for installation:

$ sudo apt install folder-color yaru-colors-folder-color

Once it has been installed, move forward to check the availability of the “Folder’s Color” option. For this, right-click on any folder, and “Folder’s Colors” can be viewed in the context menu, as shown in the image below:

As you can see, the folder color changing menu appeared. So, pick a hue from the list and change your folder color by clicking the desired hue.

How to Uninstall Folder Color in Ubuntu 20.04

To delete the folder color extension from the system, use the commands given below:

$ sudo apt-get remove folder-color

Conclusion

This tutorial showed you how to install the folder-color theme on Ubuntu. Changing the folder color helps to make folders more unique and differentiable, improving the efficiency of searching for folders. You can easily get a particular folder, even when in a hurry. The article also showed you how to perform the folder-color uninstallation procedure.

]]>
How to Create an ISO from Current Installation in Ubuntu 20.04 https://linuxhint.com/create-iso-current-installation-ubuntu/ Fri, 05 Mar 2021 11:43:31 +0000 https://linuxhint.com/?p=92858 In Ubuntu, most programs and operating systems can be installed through the ISO file. The ISO file format is a live identical image of the specific operating environment that contains all required installation files. Another name used for ISO files is a disc image. So, an ISO file is a perfect duplicate of the content of an optical disc, such as DVD and CD images. An ISO file is a package that consists of installation directories in an ISO format.

Users can create a backup of their current installation in an ISO file format. The ISO file can also be used as an external drive, or you can make a bootable USB. if you have an ISO file, then you can create the installation disc by burning the image to a CD or USB.

This article shows you how to create an ISO file from a currently installed Ubuntu 20.04 system. You can create an ISO file from the current installation of Ubuntu 20.04 using any of the following methods.

Create an ISO File Using the Brasero Utility

The Brasero utility does not come preinstalled on Ubuntu 20.04, so you will need to install this utility manually. Open the ‘Terminal’ window by pressing the ‘Ctrl+Alt+T’ shortcut keys together. Install the Brasero utility using the following command:

$ sudo apt-get install brasero

Once the installation has been completed, open the Brasero application. To open this application, click the menu icon displayed in the bottom-left corner of your desktop in Ubuntu 20.04.

Now, type ‘Brasero’ in the search bar to search the Brasero application. The Brasero application icon should appear in the search results. Click the icon to open this application.

The following Brasero application window will display on your system. Select the ‘Data project’ option from the menu on the left side of the window.

Add the files to the new data project by clicking the ‘+’ icon.

Now, select the individual backup directories and click the ‘Add’ button.

When all files are included in this project, click ‘Burn.’

Choose the desired location in which you will store the ISO file. Give a suitable name with an .iso extension to your ISO file and click ‘Create Image.’

Once the above process has been completed, you will be notified with an ‘image successfully created’ message, as follows:

Create an ISO File Using the Genisoimage Utility

You can create an ISO file from a backup of your Ubuntu 20.04 system using the Genisoimage utility. The basic syntax is given below:

$ genisoimage -o [file-name.iso] [ directory-path]

Here, we are creating an ISO file with the name ‘backup.iso’ from the backup directory /home/kbuzdar/Documents/Backup. Use the following command to do so:

$ genisoimage –o backup.iso /home/kbuzdar/Documents/Backup

The above command creates the ISO file ‘backup.iso’ in the current home directory.

Using the Systemback Utility

You can create a backup of the system’s file and all configurations using the Systemback utility. In this section, you will create a live image of your system, then convert it into an ISO file format.

First, import the signing key of GPG for PPA using the following command:

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 382003C2C8B7B4AB813E915B14E4942973C62A1B

Now, add PPA to Ubuntu 20.04 by executing the command provided below:

$ sudo add-apt-repository "deb http://ppa.launchpad.net/nemh/systemback/ubuntu xenial main"

Once the above task has been completed, update the package list and install the Systemback utility, as follows:

$ sudo apt update
$ sudo apt install systemback

Once this application has been installed, search for the app in the search bar, and click on the displaying icon to open the app, as follows:

Here, you will be prompted to enter a password for the admin user.

After that, the following window will display on your system. You can create the system’s restore points, create a copy of the system to another partition, create a live system, and more. Click the ‘Live system create’ option to create a new live system.

Specify the name of your live system and click the ‘Create New’ button, as follows:

It will take time to create a live system. Once the system has been created, you can generate the ISO file using the ‘convert into ISO’ option.

Conclusion

This article showed you three different methods for creating ISO files from your current system. First, you must create a backup of your Ubuntu 20.04 system, then create the ISO file using the above utilities.

]]>
Top 9 Best Ubuntu-Based Linux Distros https://linuxhint.com/top-9-best-ubuntu-based-linux-distros/ Tue, 02 Mar 2021 12:50:17 +0000 https://linuxhint.com/?p=92405 In recent years, Ubuntu has become the default operating system of personal and professional users alike. Due to the popularity of the Ubuntu distribution, many Ubuntu-based Linux distros are now available on the Internet, each developed to fulfill special needs. In fact, there are so many unique Ubuntu distributions that it is impossible to count an exact number.

One major reason behind the popularity of Ubuntu-based distros is that these distributions are easy to work with even for novice users. Ubuntu is also backed by a large community of open-source developers who actively work to keep Ubuntu up-to-date and bug-free.

Many of these distros will be the same in terms of features and usages, but some distros have very specific features and functions. Some are built for programming and system administration, while others are specially developed for gaming or use by children.

It would be difficult to cover every distribution in this article, as there are too many to count. So, this article covers the top nine best Ubuntu-based Linux distros out there with each being dedicated to special. This will surely help you select the Linux distro you need.

1. Linux Mint

Linux Mint is one of the oldest Ubuntu-based Linux distros out there, and it is one of the most popular distros, too. Linux Mint is used by millions of users around the world. One of the top reasons behind its popularity is the clean and easy-to-navigate user interface of Linux Mint.

Linux Mint ships in with a suite of popular apps, such as the Firefox Internet browser, the LibreOffice suite, VLC, Thunderbird, and more. This distro is well-liked by beginners, as it is very easy to use and makes the transition from Windows quite easier.

2. Pop!_OS

Pop!_OS is a free and open-source Ubuntu-based Linux distribution. This distro is specially developed for System 76 computers and laptops. This operating system is designed and developed keeping software developers, administrators, and computer science professionals in mind. Pop!_OS is a modern Linux distro with a clean user interface, which makes it very easy to use.

For gaming or multitasking, Pop!_OS could be an ideal distribution, as it supports AMD and NVIDIA GPUs out-of-the-box. GPU support means smoother workflow and faster navigation. Pop!_OS also offers keyboard shortcuts and window tiling for a better end-user experience.

3. Lubuntu

Lubuntu is a fast and lightweight Ubuntu-based Linux distro. This distro has a clean and easy-to-use interface that makes every new user feel at home. Lubuntu is backed by the LXDE/LXQT environment and ships in with a suite of widely-used applications.

This distro is ideal for machines with low-end hardware and memory, as it requires minimal resources to run smoothly. The latest release of this distro is Lubuntu 20.10, which is based on Ubuntu 20.10. For more stability and long-term support, you can go with Lubuntu 20.04 LTS, which is based on Ubuntu 20.04 LTS. Lubuntu 21.04 is scheduled to be released in April this year.

4. KDE Neon

KDE Neon is the latest release from the KDE community, and it is based on Ubuntu 20.04 LTS. This distro features the latest tools that every modern-day computer user requires. KDE Neon ships in with default settings, but it is also highly configurable.

No matter what hardware version you have, this distribution works effortlessly on every older machine, as well as any modern machine. The user interface and look of this distro will give you a breath of fresh air when you first use it. It has a beautiful, modern-looking user interface, which is very easy to use and makes you feel comfortable even at first use.

5. Zorin OS

Zorin is a fast and secure Ubuntu-based Linux distro that comes with a sleek user interface, making it easy to use for most users. Many say that Zorin is an ideal alternative to Windows, and rightly so, making it easier to port from Windows even for first-time users. The look of Zorin is also quite similar to Windows, as well as Mac OS, which makes it an ideal alternative to these operating systems.

The Zorin Appearance app lets you change the appearance of Zorin and make the UI look like Windows or Mac OS. Zorin is a reliable distro that can be used for both personal and professional use. This distro is also one of the most secure Ubuntu-based Linux distributions out there. There is also a Lite version available that you can use on older machines.

Download Here

6. Elementary OS

Elementary OS is an open-source Linux distribution based on Ubuntu LTS. This is a fast and reliable distro focused on providing a great end-user experience and tight system security.

The recent Elementary update, Elementary OS 5.1 Hera, comes with a lot of changes. The new update features a completely redesigned login and lock screen, new ways to sideload and install apps, improvements to core apps, desktop tweaks, and system settings updates. Elementary also has an AppCenter, where you can get free and paid apps.

Elementary supports a multitasking view, picture-in-picture mode, and do not disturb mode. Parental controls are provided to control screen time, monitor Internet use, and manage apps.

Download Here

7. Ubuntu Budgie

Ubuntu Budgie is an integration of the Budgie Desktop Environment and Ubuntu. Budgie is a community-developed distribution that works with any computer. Porting from Mac OS X to Ubuntu Budgie is now much smoother, thanks to similar functions and features.

Budgie has a very beautiful user interface that is easy to navigate. The look is quite elegant, and the distro works effortlessly on old and new computers alike. The latest 20.04 LTS release of Ubuntu Budgie comes with support through April 2023.

Download Here

8. Feren OS

Feren OS is a free and open-source Ubuntu-based operating system. It is a stable, powerful, and secure Linux distro, ideal for any type of user. The desktop of Feren OS is quite unique in its own way, but at the same time, it is still very easy to use.

Feren OS is powered by KDE Plasma Desktop, which makes it one of the most lightweight and responsive Linux distros out there. This distro ships in with all the necessary apps pre-installed, and if need be, you can install whichever apps you want from its app store.

Download Here

9. Nitrux

Nitrux is a Linux distribution that is entirely based on Ubuntu. It is powered by the KDE Plasma Desktop 5 environment, and to top it off, Nitrux even includes the NX Desktop and Firewall.

Some necessary apps, like the office suite, media player, and Internet browser, come pre-installed out-of-the-box. The overall end-user experience is very good with this distro, thanks to the easy-to-use UI.

Download Here

Conclusion

So, this concludes our list of the best Ubuntu-based Linux distros that you can use in 2021. There are others, including Kubuntu, Xubuntu, and LXLE, that you can try out, as well. Feel free to let us know if you have any queries or suggestions at @linuxhint and @SwapTirthakar. ]]> How To Use IRSSI for Internet Relay Chat on Ubuntu 20.04 https://linuxhint.com/use-irssi-for-internet-relay-chat-ubuntu/ Tue, 02 Mar 2021 03:00:38 +0000 https://linuxhint.com/?p=92272 Even if you’re entirely new to Linux, the terminal, and IRC in general, you are not a stranger to messaging systems. They allow users to communicate with each other as individuals or groups, share images, documents, and other files.

This tutorial will discuss using your Linux terminal to join other users and communicate with them in real-time. Using IRSSI as the IRC client, you will have the power to communicate in real-time with other users.

NOTE: This guide is a quick guide. It does not dive deep into what IRC networks are or how they work.

For information on how IRC works, check our tutorials on similar topics.

Introduction to IRSSI

IRSSI is a free and open-source, terminal-based, cross-platform IRC client. IRSSI is a popular IRC client because it’s simple to install and use on all the systems.

It also supports scripts that you can install to the existing application to add or expand functionality.

Installing IRSSI on Ubuntu 20.04

By default, the IRSSI client does not come pre-installed on Ubuntu; you will need to install it manually. However, it is available in the official repositories.

Start by updating the repos and system using the command:

sudo apt-get update && sudo apt-get upgrade -y

Once you have your system up to date, install IRSSI using the command:

sudo apt-get install irssi -y

How to Use IRSSI

To start using the IRSSI client, enter the command:

irssi

This command should launch the IRSSI client, and you can start typing commands to connect to networks and join IRC channels.

Connecting to an IRC network

By default, IRSSI configuration comes with predefined servers that you can join. To view the available servers, use the /network command as:

/network list

Once you have the network you wish to connect to, you can use the /connect command followed by the server’s name to connect. For example, to connect to Freenode, type:

/connect freenode

If the network you wish to connect to is not on the default list, you can pass the URL of the server to connect to it directly as:

/connect chat.myfreenode.net

To disconnect from a network, use the command /disconnect followed by the name of the network as:

/disconnect freenode

You can also pass the URL of the network to disconnect.

/disconnect chat.myfreenode.net

Joining IRC Channels

Joining IRC channels is very easy using IRSSI. Check out our WeeChat tutorial to learn what channels are:

To join a channel, use the /join command followed by the channel name.

For example, join the official Ubuntu IRC channel:

/join #ubuntu

Once you have connected to a specific channel, you can view the topics, users, and their roles in the room. You can also send messages to all users in that channel.

To leave a channel, use the /part command:

/part #ubuntu

Send Private Messages

Once you have connected to a network, you can send a private message to a specific user instead of all channel users. Use the /msg command followed by the user’s nickname as:

/msg linuxhint “Hello, check our tutorials to learn more

You can use TAB to perform auto-completion for users’ nicknames.

NOTE: Messages are not encrypted or regarded as a secure form of communication.

How to Work with Nicknames

Working with Nicknames in IRSSI is very easy; all you have to do is use the /nick command to configure a new nickname.

For example:

/nick newnickname

Nicknames in an IRC network must be unique. If the nickname you wish to use is already in use, IRSSI will display a message indicating the nickname is not available.

If you change your nickname when connected to a channel, all users will receive a nickname change notification.

To view information about a specific nickname, use the /whois command as:

/whois linuxhint

Managing Windows and Buffers

When working with IRSSI, every channel and private conversation is ordered in specific windows. You can switch between windows using the /win command followed by the window’s number:

For example:

/win 3

To view all the available windows, use the command:

/win list

NOTE: You can also use the ALT + num of the window to navigate from one window to another.

IRSSI Configuration Commands

IRSSI provides a set of commands we can use to manage the IRC connections, each command preceded by a forward slash:

These commands include:

  • /msg – used to send a private message to a specific user in the channel.
  • /query – opens a private conversation window with a specific user
  • /ban – bans a user in a channel
  • /clear – removes a channel buffer
  • /exit – closes the IRSSI client
  • /window – manages windows settings
  • /kick – kicks out a user from the current channel.
  • /kickban – Kicks out and bans a user from the current channel.
  • /unban – unbans a user.
  • /topic – sets the topic for the specific channel.

Those are some of the commands supported by the IRSSI client. Check out the documentation below to learn more on how to configure the client to your needs.

https://irssi.org/documentation/

Conclusion

In this quick guide, we discussed how to use the IRSSI client for quick and efficient IRC communications. To learn more about how to configure the client further, check out the documentation.

]]>
How to Enable Automatic Login on Ubuntu 20.04? https://linuxhint.com/enable-automatic-login-on-ubuntu-20-04/ Sat, 27 Feb 2021 12:31:05 +0000 https://linuxhint.com/?p=91750 For Ubuntu’s latest versions, users can enable automatic login for the ease of users. If enabled, then users do not need to type the password whenever they try logging in. If you are the only user of your system, then it is a very useful method for easy access to relevant files.

In this article, we will analyze the methods of enabling the automatic login on the Ubuntu 20.04 system.

Method 01: Enabling Automatic Login Using GUI

To enable the automatic login using the graphical user interface, go to the Applications of the system. Then, search Settings in the search bar, it will appear in the available options. Click on it.

Once the Settings modal is opened, scroll down to the Users option available in the sidebar.

Once you have clicked on the Users option, you will see the right pane. The toggle button is right next to the Automatic Login option. It has to be turned on to enable the automatic login.

If you see an Unlock to Change Settings option on the same pane, this means that the change settings option is locked.

To unlock it, click on the Unlock button first.

The system will ask for Authentication. Provide the password in the relevant field to unlock the change settings.

Once the Authentication is completed, you will see that the Automatic Login option is now enabled, and the toggle button is set to ON.

Method 02: Enabling Automatic Login Using the Command line

To enable the automatic login using the command line of the system, open up the terminal window using the Ctl+Alt+T shortcut. Alternatively, you can go to the Applications and then search Terminal. Once done, you need to edit the /etc/gdm3/custom.conf file using the appended command below:

$ cd /etc/gdm3

Then access the custom.conf using the nano editor (or any other based on your choice). Use the following command below:

$ sudo nano custom.conf

The custom.conf file will open up, and you need to access the highlighted section of the file. By default, the following part of the code is commented out, just like the ones shown below:

#AutomaticLoginEnable=True
#AutomaticLogin = userName

You need to uncomment these lines just like the one displayed below:

Use the Ctl+O shortcut to save and close the editor. Once done, use the reboot option to reboot the system and reflect the changes.

$ sudo reboot

Automatic Login Enable Option not working?

For Ubuntu 20.04 system, if NVIDIA proprietary driver is installed, then this option of enabling user automatic log in can result in an infinite login loop, which is a gdm3 bug. However, there’s no need to worry about this particular bug since a solution exists. In this section, we will cover the method to resolve this problem.

Open the bootable menu of the Ubuntu system. Then access the Recovery Menu of the system. Scroll down to the root option using the arrow keys from the keyboard.

To edit grub options, run the following command:

$ sudo nano /etc/default/grub

The text editor will open up the file, just like the one displayed below. Scroll down to the line that has the “quiet splash” option.

Users need to remove the “splash” keyword from the Linux cmdline. The file will then look like this:

Press Ctl+O to save the changes.

You need to refresh the grub options using the command below:

$ sudo update-grub

Then you need to reboot your computer system. This way your issue will be resolved.

Conclusion

In this article, we went through the method of enabling the Automatic Login Option on the Ubuntu 20.04 system. We also explored the method if the automatic login enables option is not working, how to troubleshoot this problem, and get it fixed.

]]>
Best Messaging and Communications Apps for Ubuntu https://linuxhint.com/best-messaging-apps-ubuntu/ Wed, 24 Feb 2021 05:28:13 +0000 https://linuxhint.com/?p=91193 The popularity of Linux has been able to replace Windows at many workplaces, and the same scenario was also reported for personal users. Hence many popular apps from various platforms such as Android and Windows are being integrated into Linux and its distros.

Business emails/chats are also being replaced by instant messaging and communication apps as they provide more options to share files, photos, and videos, making the whole process easier. It would be great to use messaging apps on the Linux desktop that we use on our mobile devices. According to your mood, apps like these give you the flexibility to use the messaging app wherever you want.

This pandemic also taught us the importance of messaging and communication apps because these apps made it possible for many businesses to run smoothly in the time of crisis. So, in this article, we’re going to have a look at the best messaging and communication apps for Ubuntu.

1. Telegram

Telegram is one of my favorite instant messaging and communication apps out there. It is an open-source app that can be used on a mobile device as well as desktop. Cloud-based technology makes it easy to access from anywhere and several devices at once.

It is a cross-platform application that works on Windows, Mac, Linux, and Android operating systems. The best thing about this messenger is that there is no size limit to share files and messages. Hence you can share as much as messages, images, and videos you want no matter what file size is.

On top of all this, it comes with end-to-end encryption, which helps you keep all your messages secure. Recently they have released a patch that helps users switching to Telegram can bring their chat history, including media files, to Telegram from their older messaging apps like WhatsApp.

Telegram

2. Skype

Skype is one of the oldest messaging and communication apps for desktops out there, but it is still one of the best for video conferencing. Right from college lectures to business meets, everything is being done on Skype for almost a decade, and its worth has soared up even more in a recent pandemic situation.

Linux and its distros like Ubuntu have their own dedicated Skype client, even before Microsoft has officially released it. Skype integrates well with Ubuntu and makes it very easy to use for a new user.

As I mentioned above, it allows you to make audio and video calls, send text messages and share media files.

Skype

3. Slack

Slack is a powerful messaging app specially developed for business use as it offers a lot of options and configurations. It is one of the best out there but comes with a price tag.

It lets you chat and have a conversation with your colleagues in real-time, just what every business needs for smooth functioning. It comes with a modern user interface which makes it very easy to use, even for a newbie.

Many business users love slack as it offers the features and options that no other messaging app has on offer to date. It recently came up with a bunch of updates that include interface changes and the Compose button that lets you write messages in a large editor, making it more comfortable for you. So, it’s one of the best in business.

Slack

4. Wire

The wire is another modern desktop messaging platform ideal for business use. It provides quite a competition to Slack in terms of features offered. These messaging apps are voice, video, conference calls, file sharing, and external collaboration. Everything is secured by end-to-end encryption.

It is an open-source application; hence you don’t need to be worried about transparency. Of course, it comes with a price tag and has two versions on offer pro and enterprise version, with both having their own set of features and offerings.

Wire

5. Viber

Viber is a cross-platform VOIP and instant messaging app managed by Rakuten, a Japanese multinational company. It is a feature-rich communication app that is ideal for personal as well as professional use. Like other top messaging apps, you can send texts, images, videos, files, and you can even send voice and video messages.

You can also make voice and video calls. Apart from that, you can share stickers and GIFs, and also, you can make your own stickers. Viber also offers group chats and calls, which makes it ideal for business meets. You can also send disappearing messages which self-destruct themselves after a particular time, which adds extra privacy.

Viber

6. Signal

This messaging app has made a buzz recently as a privacy-friendly alternative to the popular app WhatsApp. Increased reliance on the internet as a medium of communication has raised serious personal privacy issues. Hence you need a reliable medium to connect with your friends, family, and work colleagues without worrying about privacy.

Well, the signal is the app for you. It is an open-source app that is available for mobile phones as well as desktop platforms. Talking about features, you can choose unique backgrounds for individual chats, an incognito keyboard on some devices, and message details with a timestamp.

Like any other messaging apps, you can also send text, voice messages, photos, videos, GIFs, and all this is for completely free.

Signal

7. Wickr

Wickr is a cross-platform instant messaging app specially built for enterprise use. It is a highly secure messaging and communication platform with end-to-end encryption and some very advanced security features.

Individual, group messaging, voice and video conferencing, and file sharing are bundled in this app. As I said earlier, it is developed for enterprise use, but it can also be useful for individuals for personal use.

Wickr

So, these are the best messaging and communication apps for Linux and its distros like Ubuntu. All the apps listed above are ideal for business as well as personal use. Let us know if you have used any of the above applications and your experience with them. Share your thoughts with us at @linuxhint and @SwapTirthakar. ]]> Ubuntu 20.04, WSL2, VSCode, and Drupal 8 – Fixing the “Gotchas” https://linuxhint.com/fixwsl-drupal-setup-problems/ Mon, 22 Feb 2021 15:45:37 +0000 https://linuxhint.com/?p=90924

Microsoft has finally delivered a fantastic solution for developing Linux applications on Windows.  The Windows Subsystem for Linux, WSL2, is fairly easy to install and get up and running, especially if you are already familiar with Linux.  Even if you are not, there are many very good articles about getting a basic installation up and running.

Developing Linux PHP applications using VSCode on Windows 10 is about as stable and seamless an experience one can get. Still, several “gotchas” I ran into were not described in any of the articles I found about setting up LAMP on Ubuntu and WSL2.

I had limited experience with Linux and depended heavily on articles written by those who came before me.  While they got me most of the way there, I ran into several problems getting Drupal 8 running without errors and debugging working in VSCode.  The solutions were found in the comments sections of questions posted on the internet. This took many hours of searching, and  I hope to save people by presenting the solutions I found in this one article.

My environment is  Windows 10 20H2, Ubuntu 20.04, PHP 7.3, MariaDB 10.4.17, Drupal 8.9.13, Xdebug 3.02, Windows Terminal, VSCode with Remote – WSL and PHP Debug by Felix Becker packages.  I am running WSL from Powershell within Windows Terminal.

Before we get started, here are a few recommendations that may save you time.

Installing and using apt-fast instead of apt can really speed up installs and updates.  Where I live, the internet is low bandwidth and slow, and apt-fast is a lot faster than apt.

You can “backup and restore” your Linux distribution using WSL Export and Import. As with any system, it is advisable always to maintain a current backup.

Mariadb Installs Fine, but Cannot Restart or Get Status

Mariadb installation went fine.  No errors or warnings.  When I tried to check the status, I got an error regarding the system.

$>systemctl status mysql

System has not been booted with systemd as init system (PID 1). Can't operate.

The reason for this error is that Microsoft does not support systemd in WSL.  Fortunately, Arkane Systems created a package system-genie to enable systemd .  I suggest reading their web page thoroughly before trying the following instructions, which were taken from that page. There are slightly different instructions for distributions other than Ubuntu.

First, you need to Install the .Net 5.0 runtime

$>sudo apt-fast update

$>sudo sudo apt-fast install -y apt-transport-https

$>sudo apt-fast update

$>sudo apt-fast install -y dotnet-sdk-5.0

Next we need to Configure the wsl-transdebian Repository

$>sudo apt-fast install apt-transport-https

$>wget -O /etc/apt/trusted.gpg.d/wsl-transdebian.gpg https://arkane-systems.github.io/wsl-transdebian/apt/wsl-transdebian.gpg

$>chmod a+r /etc/apt/trusted.gpg.d/wsl-transdebian.gpg

$>cat &lt;&lt; EOF &gt; /etc/apt/sources.list.d/wsl-transdebian.list

$>deb https://arkane-systems.github.io/wsl-transdebian/apt/ bullseye main

$>deb-src https://arkane-systems.github.io/wsl-transdebian/apt/ bullseye main

$>apt-fast update

Now we can install the system-genie package.

sudo apt-fast install -y systemd-genie

Exit your Linux shell then shut down WSL from Power shell

PS C:\Users\UsrName>wsl --shutdown

Restart WSL with a genie from the Powershell prompt.

PS C:\Users\UsrName>wsl genie --s

You will see “Waiting for systemd….!!!!!!!!!!!!!!!”.  It takes 180 seconds to load fully.  Just wait for it to finish.  When it is done, your new shell window should look like this:

Waiting for systemd....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Timed out waiting for systemd to enter running state.

This may indicate a systemd configuration error.

Attempting to continue.

Confirm genie installed and systemd is working:

systemctl status mariadb

You should get the status output for mariadb.  Note that systemctl status mysql also works.

Arkane Systems recommends shutting down your WSL genie session with wsl –shutdown.  This will free up all memory used by WSL in Windows.

Drupal installs But No CSS Gets Loaded

After running the basic install for Drupal 8, the pages had no formatting.  Viewing Page Source showed that no CSS files were being loaded. It took me two days to figure this one out, but the short story is Drupal assumes apache2 is using the /tmp directory, but it is not.  By default, apache2 is configured to use a private tmp directory.  Strangely enough calling, sys_get_temp_dir( ) from php return /tmp, yet that is not what apache2 is using.  When Drupal creates its optimized css and js files, it first tries writing them to the /tmp folder, then moves them to the destination folder, typically sites/default/files/css and /js. But apache2 is not using /tmp, so this process fails, and none of the css or js files. Unchecking Aggregate CSS and Javascript files will bypass this, but then all of the individual css and js files get loaded, so this is not a solution.

You can confirm this problem /tmp not being accessible with the following simple php file. It creates a tmpfile and displays the file name.  Initially, the file name will be blank because the call to tmpfile() returns NULL.  I put the following code in test.php and called it from my site, localhost/mysite/test.php

<?php

echo "<html>\n";

echo "<head>\n";

echo "<title>My Second PHP Example</title>\n";

echo "</head>\n";

echo "<body>\n";

echo "<p>If you view the page source \r\n you will find a newline in this string.</>";

 

  echo "<p>testing</p> " ;


  $tmpDir = sys_get_temp_dir( );


  echo "<p>TMP direcory = '$tmpDir'</p> " ;


  $file = tmpfile();

  $path = stream_get_meta_data($file)['uri'];


  echo "<p>Path of tmp file = '$path'</p> " ;

 

echo "</body>\n";

echo "</html>\n";

?>

 

This resulted in "Path of tmp file ="

I found a solution to this in the comments of Stackoverflow question by user One In a Million Apps.  This solution changes the apache2 configuration from PrivateTmp=true to PrivateTmp=false. Note that changing apache2 to use a private tmp directory was done for security reasons, and most apps can be configured to use a different tmp folder.  I tried that with Drupal but could not get it to work. This is my first attempt at running Drupal on Linux, and I wanted things to “just work” on my laptop with little concern for security.

First, look for the file containing PrivateTmp using this from the /lib directory:

%>sudo find / -mount -type f -exec grep -e "PrivateTmp" '{}' ';' -print

This gave me a long list of matches.  Look for the one containing the file apache2.service.  In my case it was found at /usr/lib/systemd/system/apache2.service.  copy this file to the /etc. directory. Edit /etc/apache2.services and change PrivateTmp=true to PrivateTmp=false, save and restart the apache2 service.

systemctl restart apache2

Re-run the test.php page again, and you should get the tmp file named displayed, confirming access to the /tmp folder.

Clear all the Drupal caches and reload the pages.  They should now display correctly. I do not know why, but the Drupal Clear Cache function does not always work for me.  Manually deleting all files in sites/default/files/css js, then using PhpMyAdmin to empty the cache tables always works.

Setting up VSCode Debugging

Configure Xdebug

First, install the Remote – WSL, and PHP Debug by Felix Becker packages to VSCode.

I then installed Xdebug

sudo apt-fast php7.3-xdebug

This installed version 3.02 of Xdebug.

I tried configuring it by following the many examples on the internet.  Nothing worked.  Turns out most of the examples are for Xdebug 2.x, and those configuration settings no longer work with 3.x

I finally got it working with the following php.ini settings.

I had to add the following to both /etc/php/7.3/apache2/php.ini and /etc/php/7.3/cli/php.ini on my system.

You can find the location of your xdebug.so by moving to the /lib directory file then running

find -name xdebug.so
[xdebug]

zend_extension = ./lib/php/20180731/xdebug.so

xdebug.start_with_request = trigger

xdebug.mode = debug

xdebug.discover_client_host = 1

xdebug.log = /tmp/xdebug_remote.log

xdebug.client_port = 9003

Configure VSCode

Remote debugging in VSCode uses a launch.json file stored in the root of your project directory in .vscode/launch.json.

You can create the launch.json file through the VSCode UI, but I find it easier to create it manually.  Move to the root of your website and create a .vscode directory. Create a launch.json file and load it in VSCode.

$>mkdir .vscode

$>cd .vscode

$>touch launch.json

$>code launch.json

Put the following json in the file and save it.

{

    // Use IntelliSense to learn about possible attributes.

    // Hover to view descriptions of existing attributes.

    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

    "version": "0.2.0",

    "configurations": [

        {

            "name": "Listen for XDebug",

            "type": "php",

            "request": "launch",

            "port": 9003,

            "stopOnEntry": true,

            "log": true,

            "pathMappings":

            {

                "/var/www/html": "${workspaceRoot}"            

            }

        },

        {

            "name": "Launch currently open script",

            "type": "php",

            "request": "launch",

            "program": "${file}",

            "cwd": "${fileDirname}",

            "port": 9003

        }

    ]

}

Note under pathMappings, where I have “/var/www/html”, you should put the full path to the root of your website.

Close VSCode. In your WSL Linux prompt move back to the root of your web site and load the project in VSCode.  Assuming you are still in the .vscode directory,

$>cd ..

$>code .

This should load the project in VSCode, and you should see the full directory tree of your project on the left.  Open your start page, such as index.php, and add a breakpoint.  Press F5 to start debugging.  Go to a web browser and load the site. Switch back to VSCode, and you should see it stopped at your breakpoint.

Code Does Not Run With zsh Shell

By default, WSL is set up to work with the Bash shell, and it sees the path to the VSCode executable in the PATH.  I switched to zsh, and VSCode would no longer run.  The fix was to put an alias in .zshrc

$>cd ~

$>code .zshrc

Add the following alias, which points to the full path to the code executable folder, as seen by Ubuntu in WSL.  Replace YourUserName with your actual Windows user name.

alias code="/mnt/c/Users/YourUserName/AppData/Local/Programs/Microsoft\ VS\ Code/bin/code"

You now need to reload the zsh configuration with

$>source .zshrc

Code should now load from the zsh shell.

That’s it!!  These steps finally got Drupal and VSCode debugging working correctly for me.  It took me two days to figure this all out. I am a noob! Hopefully, this works for you and saves you some time.

Just a reminder of my environment.  Windows 10 20H2, Ubuntu 20.04, PHP 7.3, MariaDB 10.4.17, Drupal 8.9.13, Xdebug 3.02, Windows Terminal, VSCode with Remote – WSL and PHP Debug by Felix Becker packages.

Happy Coding!

]]>
How to reset the root password on Ubuntu 20.04 if forgotten? https://linuxhint.com/reset-root-password-on-ubuntu-20-04/ Fri, 19 Feb 2021 03:18:33 +0000 https://linuxhint.com/?p=90195
You have forgotten your root password, and now you have no idea how to retrieve your Ubuntu 20.04 LTS Operating System? In this post, we will guide you on how to reset your root password on Ubuntu 20.04 LTS System from the GRUB menu. The Grand Unified Bootloader or GNU GRUB menu is a boot loader and software or program that loads and transfers control to the Operating System like Linux-  it runs when a computer starts. So, let’s begin with the step-by-step guide of resetting the password of the root.

Step 1: Reboot your Ubuntu 20.04 LTS Operating System and load the GRUB menu by holding the Shift Key on Keyboard

The first step is to start your computer machine and keep pressing the shift button on your keyboard until the GRUB menu appears, as shown in the picture below:

Step 2: Press ‘e’ to edit the commands

Now, select the boot Operating system, which is Ubuntu in our case, and press the ‘e’ key on your keyboard to edit some commands. By doing so, we can load the root shell Command prompt. Pressing the ‘e’ key on your keyboard allows you to have an edit screen, as shown in the picture below:

Step 3: Edit the clause of the second last line from ‘ro quiet splash $vt_handoff’ to ‘rw init=/bin/bash’

After entering into the editing mode of commands, scroll down until the last, find a line that starts with the word ‘linux’ and change the last clause of this line that reads ‘ro quiet splash $vt_handoff’ to this clause, ‘rw init=/bin/bash’, as shown in the pictures below:

Before

ro quiet splash $vt_handoff

After

rw init=/bin/bash

Step 4: Press F10 or Ctrl-x to save the edits and boot

Once you have edited the line for loading the root shell command prompt, Press F10 or CTRL+X to save and boot the system. After the reboot, a shell command prompt screen of the root will appear, as shown in the picture below:

Step 5: Type the command ‘mount | grep -w /’ to confirm the read and write access rights

In the root shell command prompt screen, type the command given below for confirmation of the read and write privileges.

# mount | grep -w /

Step 6: Type the ‘passwd’ command and provide the new password for the root

Once read and write access rights are confirmed, type the ‘passwd’ command and enter or set the new password for the root.

# passwd

You can see that the password is updated successfully.

Step 7: Type the command ‘exec /sbin/init’ to reboot your Ubuntu 20.04 LTS Operating System

After successfully updating the password of the root, the last step is to just reboot your system by typing the command given below:

# exec /sbin/init

After running the above command, your computer will reboot and load the welcome screen of the Ubuntu 20.04 LTS system.

Conclusion

The article contains a step-by-step and easy-to-understand guide on how to reset your forgotten root password on the Ubuntu 20.04 LTS system.

]]>