×


Blog


Methods to check the status of laptop battery on Ubuntu 20.04 LTS ?

This article will guide you on different methods to view detailed information on your battery using both the #command line and UI.

To check your #battery health you'll want to open the app, click on the relevant battery item in the sidebar, and double-check that you're faced with the Details tab.

1. Use upower command to check battery status from command line:

Type the following command:

$ upower -i /org/freedesktop/UPower/devices/battery_BAT0

2. Displaying #Linux Laptop Battery Status Using the apci #terminal command

The acpi command may not be installed by default so use apt-get command or yum command to install the same:

$ sudo yum install acpitool

3. Use /proc/acpi/ directory to get laptop battery info (deprecated method)

You can browse the same data by visiting /proc/acpi/ directory:

$ cd /proc/acpi/

$ ls -l


Steps to restart network services in Linux ?

This article will guide you on how to start, stop, and restart the #network service on different Linux distribution like Ubuntu, #Debian, Linux Mint, and CentOS 8. Moreover, you can troubleshoot the network #error through the #NetworkManager tool on #CentOS 8.

Please don't stop services if you have a remote ssh connection that may create a problem.

Restarting networking on a desktop machine will cause dbus and a bunch of #service to stop and never be started again, usually leading to the whole system being unusable.

To restart a Linux service:

1. Linux provides fine-grained control over system services through #systemd, using the systemctl command.

2. To verify whether a service is active or not, run this command: sudo systemctl status apache2.

3. To stop and restart the service in Linux, use the command: sudo systemctl restart SERVICE_NAME.


Steps to install XAMPP Server on Linux Mint 20 ?

This article will guide you on steps to install #XAMPP on Linux Mint 20. You will also learn the method of uninstalling XAMPP web server whenever you feel like it.

The #htdocs folder can be found in /opt/lampp/ . You can navigate to your root folder from the file manager (nautilus by default), by clicking on Other locations from the sidebar, then #Computer . From there you can find the opt folder that contains the lampp folder.

To install xampp in MX #Linux:

1. Click XAMPP for Linux. It's in the middle of the page.

2. Allow the download to complete.

3. Open #Terminal.

4. Change over to the "Downloads" directory.

5. Make the downloaded file executable.

6. Enter the installation #command.

7. Enter your password when prompted.

8. Follow the installation prompts.


Steps to create and run a Perl script in Ubuntu 20.04 LTS ?

This article will guide you on steps to #install 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.

Perl is a programming language that can be used to perform tasks that would be difficult or cumbersome on the command line. Perl is included by default with most GNU / #Linux #distributions. Usually, one invokes Perl by using a text editor to write a file and then passing it to the perl #program.

Perl has a wide range of command-line options or switches that you can use. The options are also called switches because they can turn on or turn off different behaviors. For example, the -e option lets you specify a line of code directly on the command line instead of creating a script file.

To install Perl in Linux:

1. SSH to your server.

2. Change your directory to /opt by running the below command. cd /opt.

3. Download the zipped source code available for Unix/Linux.

4. After download the zip file runs the below commands to extract and install Perl.


Methods to safely shutdown Ubuntu 20.04 LTS ?

This article will guide you on how to easily shut down your #Ubuntu 20.04 system. Here you will learn different methods will eventually cause your Ubuntu 20.04 #system to shut down.

There's nothing different in running sudo #reboot in a instance versus on your own server. This action shouldn't cause any problems. I believe the author was worried if the disk is persistent or not. Yes you can shutdown/start/reboot the instance and your data will persist.

If your system fails to boot for whatever reason, it may be useful to boot it into recovery mode. This mode just loads some basic services and drops you into command line mode. You are then logged in as root (the superuser) and can repair your system using command line tools.

To remove all #files from a directory in #Linux:

1. Open the terminal #application.

2. To delete everything in a #directory run: rm /path/to/dir/*

3. To remove all sub-directories and files: rm -r /path/to/dir/*


Steps to install Apache web server on Ubuntu 20.04 LTS ?

This article will guide you on steps to #install and configure #Apache on #Linux server.

Apache is one of the most popular web servers that allows you to run a secure website without too much of a headache.

#HTTPD is a program that is (essentially) a program known as Apache Web server. The only difference I can think of is that on Ubuntu/Debian the binary is called apache2 instead of httpd which is generally what it is referred to as on RedHat/CentOS. Functionally they are both 100% the same thing.

Apache server root will be located in /etc/httpd. The path to the apache #program will be /usr/sbin/httpd. In the document root three directories are created: cgi-bin, html and icons.

By default, Apache web server is instructed to listen for incoming connection and bind on port 80. If you opt for the TLS configuration, the server will listen for secure connections on port 443.

To start Apache server on Debian / Ubuntu Linux Specific Commands to Start/Stop/Restart Apache:

1. Restart Apache 2 web server, enter: # /etc/init.d/apache2 restart. $ sudo /etc/init.d/apache2 restart.

2. To stop Apache 2 web server, enter: # /etc/init.d/apache2 stop.

3. To start Apache 2 web server, enter: # /etc/init.d/apache2 start.