Configuring Gmail as a Sendmail relay on Linux

Configuring Gmail as a Sendmail email relay

Sendmail is email routing software that can allow Linux systems to send an email from the command line. This allows you to send email from your bash scripts, hosted website, or from command line using the mail command. Another example where you can utilize this setting is for notification purposes such as failed backups, etc.

In this guide, we’ll go over the step by step instructions to configure Gmail as a relay for the sendmail client on Linux. Note that Sendmail is just one of many utilities which can be configured to rely on a Gmail account. Others that are capable of this include postfix, exim, ssmpt, etc. The instructions here should work for any mainstream Linux distribution.

In this tutorial you will learn:

  • Gmail configuration prerequisites
  • How to install Sendmail and mail utilities on Linux
  • How to configure Gmail as a relay for Sendmail
  • How to test the config by sending an email from command line

Read more

Viewing an Excel formatted xlsx file in LibreOffice Calc

Converting xlsx Excel format files to CSV on Linux

Files with the xlsx extension have been formatted for Microsoft Excel. These documents contain columns and rows of data, just like those found in Google Sheets or LibreOffice Calc. This data can be stored as CSV (comma separated values), making it easily readable by various applications or even plain text editors. Due to their proprietary nature, Excel spreadsheets can be difficult to open on Linux systems, making CSV files a much more cross compatible format.

In this guide, we’ll show you a few different methods to convert Excel spreadsheets into comma separated files. This can be done from the command line, or you can open the spreadsheets with LibreOffice and resave them in the desired format, as you’ll see below.

In this tutorial you will learn:

  • How to convert xlsx files to csv via command line with ssconvert
  • How to convert xlsx files to csv via command line or GUI with LibreOffice

Read more

VSZ and RSS columns in the ps command output

ps output – Difference between VSZ vs RSS memory usage

The ps command on Linux systems is a default command line utility that can give us insight into the processes that are currently running. It can give us a lot of helpful information about these processes, including their PID (process ID), TTY, the user running a command or application, and more.

There are two columns in the output of the ps command that don’t get talked about a lot. These are the VSZ (Virtual Memory Size) and RSS (Resident Set Size) columns. Both columns give us information about how much memory a process is using. In this guide, we’ll go over their meanings and how to interpret the data they show us in the ps command on Linux.

In this tutorial you will learn:

  • How to interpret VSZ and RSS numbers in the ps command output

Read more

Checking the current runlevel on a Linux system

How to check a current runlevel of your Linux system

Before systemd came into existence, most major Linux distributions ran a Sys-V style init system. Sys-V used seven different “runlevels” to determine which processes to start on the system. For example, runlevel 3 was typically reserved for the command line and its related programs, whereas runlevel 5 would launch a GUI and all the processes required for it. Results may vary, depending on the distro in question.

These days, the vast majority of Linux distros have adopted systemd as their init system. Some distros still use Sys-V, where the implementation of runlevels as described above still exists. On systemd systems, the concept of runlevels is still alive, but they have been adapted into systemd “targets.”

Remnants of Sys-V still exist on some systems, where commands like runlevel still work. But some modern systemd distros have eradicated this support completely. In this guide, we’ll show you how to check the current runlevel on Linux.

In this tutorial you will learn:

  • How to check the current runlevel

Read more

Executing remote commands via SSH

Executing commands remotely with ssh and output redirection

The SSH command can be used to remotely login to a server running an sshd daemon. This allows Linux administrators to perform variety of administrative jobs. However, SSH is more powerful than just providing a user with remote shell access, as it can also be used to automate remote command executions, like running simple backups and downloading the backup file locally.

In this guide, we’ll go over a few different command line examples to show how you can execute commands on a remote system via SSH, as well as direct the output back to your local machine.

In this tutorial you will learn:

  • Examples for remote command execution via SSH

Read more

Configuring SSH login without password between two systems

SSH login without password

If you ever get tired of typing in your SSH password, we’ve got good news. It’s possible to configure public key authentication on Linux systems, which allows you to connect to a server through SSH, without using a password.

The best part is, using key authentication is actually more secure than typing in a password each time. This is in addition to being far more convenient. It also allows you to automate certain tasks, such as rsync scripts or other Bash scripts that utilize SSH, SCP, etc.

The process for setting up key authentication involves generating RSA keys on one system, then copying the key to a remote host. This works on any Linux distribution and is a short and easy process. Follow along with the instructions below as we take you through the step by step guide to configure passwordless SSH on Linux.

In this tutorial you will learn:

  • Generate RSA keys and transfer to remote system
  • How to login with SSH without a password

Read more

How to work with dnf package groups

How to work with dnf package groups

Dnf is the default high-level package manager in the Red Hat family of distributions, which includes Fedora, Red Hat Enterprise Linux and all its clones. It is the successor of Yum, and indeed using the yum command in recent versions of the distributions mentioned above, is just another way to call dnf. Dnf has a lot of nice features
and plugins which help us install, update and remove software packaged in the “.rpm” format. In this tutorial we explore dnf package groups and learn how to handle them.

In this tutorial you will learn:

  • What is a package group
  • How to get information about a package group
  • How to list all available package groups
  • How to install, upgrade and remove a package group
How to work with dnf package groups

How to work with dnf package groups

Read more

ansible-logo

Ansible tutorial for beginners on Linux

A system administrator, in the vast majority of cases, has to take care of more than one server, so he often has to perform repetitive tasks on all of them. In these cases automation is a must. Ansible is an open source software owned by Red Hat; it is written in the Python programming lanaguage, and it is a provisioning and configuration management software which help us in the aforementioned cases. In this tutorial we will see how to install it and the basic concepts behind its usage.

In this tutorial you will learn:

  • How to install Ansible on the most used Linux distributions
  • How to configure Ansible
  • What is the Ansible inventory
  • What are the Ansible modules
  • How to run a module from the command line
  • How to create and run a playbook
ansible-logo

Read more

Searching for two different file name patterns in a compressed archive on Linux

Search the contents of compressed gzip archive file on Linux

Archives compressed with gzip have the .tar.gz or .tgz file extension. It’s easy enough to extract the contents from these files, but what if you only need a certain file? There’s not much sense in extracting hundreds or thousands of files from an archive if you’re only looking for a few files.

Fortunately, we can utilize the Linux command line and even GUI archive managers to search the contents of gzip compressed archives. Once we identify the file we want, it’s possible to extract the file by itself, rather than extracting every single file.

In this guide, we’ll show how to search one or multiple gzip archives for a particular file from both command line and GUI.

In this tutorial you will learn:

  • How to search the contents of a compressed gzip archive via command line
  • How to search the contents of a compressed gzip archive via GUI
  • How to search the contents of multiple gzip archives
  • How to extract a particular file from a gzip archive

Read more

Listing the biggest directories on Linux

List all directories and sort by size

When it comes to tidying up your hard drive on Linux, either to free up space or to become more organized, it’s helpful to identify which directories are consuming the most storage space.

In this guide, we’ll show you how to list all directories and sort them by their total size on Linux, through command line examples, a Bash script, and GUI methods.

In this tutorial you will learn:

  • How to list directories by size with du command examples
  • How to list directories by size with a Bash script
  • How to check directory sizes with Disk Usage Analyzer GUI utility

Read more

maim

Introduction to Ranger file manager

Ranger is a free and open source file manager written in Python. It is designed to work from the command line and its keybindings are inspired by the Vim text editor. The application has a lot of features and, working together with other utilities, can display previews for a vast range of files. In this tutorial we learn how to use it, and explore some of its functionality.

In this tutorial you will learn:

  • How to install Ranger on the most used Linux distributions
  • How to launch Ranger and copy its configuration files locally
  • Ranger basic movements and keybindings
  • How to visualize hidden files
  • How to get preview of various types of documents
  • How to create, access and remove bookmarks
  • How to select files and perform actions on them
maim

Read more

Connecting to a running Docker container via SSH on Linux

How to connect to Docker container via ssh

After installing Docker on Fedora, AlmaLinux, Manjaro, or some other distro, it’s time to install more containers. Once you have a Docker container up and running on a Linux system, one of the things you’ll likely need to do is run commands inside the container. This allows you to use the container similarly to how you would a physical machine, except that Docker has done most of the setup legwork for us already.

There are already two commands available that allow us to run commands on a Docker container. The first one is docker exec, and the second command, which allows us to attach to a running container, is docker attach. These commands usually suffice, but you may find yourself in a scenario where you’d prefer to use SSH to connect to the Docker container and manage it.

Not all Docker containers are provisioned to run SSH. Normally, Docker containers are very lightweight and only programmed to do one thing. However, some Docker containers will allow SSH, and this can make management of the container much easier. In this guide, we’ll see how to connect to a Docker container via SSH from the host system on Linux command line.

In this tutorial you will learn:

  • How to connect to a running Docker container via SSH

Read more