Linux Resources
- Home
- Linux Resources
This article covers how to install the Lighttpd server on a Linux Mint 20 system. In fact, Lighttpd is an open-source web server that focused on simplicity and high performance with small and low memory consumption but still remaining standard-compliance, security, and flexibility.
How to Install Lighttpd on your Linux system ?
1. Update all available repositories, and install Lighttpd using the apt command below:
$ sudo apt update
$ sudo apt install lighttpd
2. Once all installation is completed, start the Lighttpd service and add it to the system boot:
$ systemctl start lighttpd
$ systemctl enable lighttpd
3. The Lighttpd service is up and running, check it using the following command:
$ systemctl status lighttpd
4. Next, add the HTTP, HTTPS, and SSH services to the ufw firewall:
$ sudo ufw allow ssh
$ sudo ufw allow http
$ sudo ufw allow https
5. Enable the ufw firewall service using the command:
$ sudo ufw enable
Type 'y' to enable the ufw firewall.
This article covers how to install the Playary music and movie streaming application on Linux Mint 20. In fact, this application can act as a good alternative to YouTube therefore, after installing it on your system, you can conveniently enjoy your movie and music streaming experience.
This article covers how to use the lsblk command in Linux. In fact, lsblk prints all block devices (except RAM disks) in a tree-like format by default. Use lsblk --help to get a list of all available columns.
The lsblk command in Linux lists block devices.
Following is Lsblk's syntax:
$ lsblk [options] [device...]
Lsblk can be used to retrieve a vast range of information about all the block devices attached to the system.
How to make lsblk display info about device owner, group, and mode ?
This can be achieved using the -m command line option:
$ lsblk -m
This article covers how to list all the available commands and aliases that we can run on Linux. In fact, The compgen is bash built-in command and it will show all available commands, aliases, and functions for you. This command works under Linux, macOS, *BSD and Unix-like system when Bash shell is installed.
This article covers all you need to know about the w command in Linux. In fact, The w command is a built-in tool that allows administrators to view information about users that are currently logged in. This includes their username, where they are logged in from, and what they are currently doing.
w Command in Linux Syntax
The Linux w command is a system utility that displays information about currently logged-in users. It uses the following syntax:
$ w [options] [username]
Where:
The w command uses the following options:
This article covers how to use the if else statement in Python. In fact, An if else Python statement evaluates whether an expression is true or false. If a condition is true, the "if" statement executes. Otherwise, the "else" statement executes. Python if else statements help coders control the flow of their programs.
Python Conditions and If statements
Python supports the usual logical conditions from mathematics:
Python Nested if statements
We can have a if...elif...else statement inside another if...elif...else statement. This is called nesting in computer programming.
Any number of these statements can be nested inside one another. Indentation is the only way to figure out the level of nesting. They can get confusing, so they must be avoided unless necessary.
Python Nested if Example
'''In this program, we input a number
check if the number is positive or
negative or zero and display
an appropriate message
This time we use nested if statement'''
num = float(input("Enter a number: "))
if num >= 0:
if num == 0:
print("Zero")
else:
print("Positive number")
else:
print("Negative number")
Output 1 will give:
Enter a number: 5
Positive number
Output 2 will give:
Enter a number: -1
Negative number
Output 3 will give:
Enter a number: 0
Zero