Partclone ncurses progress interface

How to use partclone to create a “smart” partition backup

Objective

Learning how to use the partclone utility to backup a partition

Requirements

  • Root permissions
  • Partition to backup must be unmounted

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

If you ever used Clonezilla to create a backup of your operating system, you have already experienced the power of the partclone. Unlike other tools like dd, partclone knows how to interact with specific filesystems, therefore it can create much smaller backups, cloning only the used space in the partition. In this tutorial we will learn how to use partclone from command line.

Read more

ubuntu-grub-menu

How to boot Ubuntu 18.04 into emergency and rescue mode

Objective

Learning about systemd emergency and rescue targets and how to boot the system into them

Requirements

  • No special requirements

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

Systemd has nowadays become the de facto standard init system for all the major Linux distributions.

Superseding SysV and upstart, it also replaced the classical way of defining system runlevels, using system targets, a special type of unit.

In this tutorial we will see how to boot an Ubuntu 18.04 system into the emergency and rescue systemd targets, and what kind of environment they provide to the users.

Read more

docker_logo

How to create a docker-based LAMP stack using docker-compose on Ubuntu 18.04 Bionic Beaver Linux

Objective

Following this tutorial you will be able to create a LAMP environment using the Docker technology.

Requirements

  • Root permissions
  • Basic knowledge of Docker

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Other Versions of this Tutorial

Ubuntu 20.04 (Focal Fossa)

Introduction

docker_logo
Docker is an open source project aimed at providing software inside containers. You can think of a container as a sort of “package”, an isolated environment which shares the kernel with the host machine and contains everything the application needs. All containers are built using images (the central images repository for them being Dockerhub).

In this tutorial, we will see how to create a LAMP stack based on dockerized components: following the “one service per container” philosophy, we will assemble the environment using docker-compose, a tool to orchestrate container compositions.

Read more

cockpit_logo

How to install cockpit on Ubuntu 18.04 Bionic Beaver

Objective

Learn how to install and take advantage of cockpit on an Ubuntu 18.04 machine

Requirements

  • Root permissions

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

cockpit_logo

Introduction

Cockpit is a web-based system administration service, which let us manage machines in a nice and easy way. Its aim is to simplify daily administration tasks, including resources, network and users monitoring and management.

Originally available for the Rhel distributions family, it was possible to install it on Ubuntu 16.04 by using an external ppa. With Ubuntu 18.04 it has been included in the official repositories, therefore its installation has become even simpler and safer.

Read more

joomla-logo

How to install Joomla on Ubuntu 18.04 Bionic Beaver Linux

Objective

The objective of this tutorial is to obtain a working Joomla installation based on a Lamp environment built on Ubuntu 18.04 Bionic Beaver.

Requirements

  • Root permissions

Difficulty

MEDIUM

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

joomla-logo
Joomla is one of the most famous CMS (Content Management System): it is an open source project, released under the GPL license and, according to its developers, it powers over 2 Million websites, and it is translated in 74 languages. In this tutorial we will walk through the Joomla installation in a LAMP environment, built on Ubuntu 18.04 Bionic Beaver.

Read more

How to enable all SysRq functions on Linux

Objective

Learn how to enable the SysRq functions, and how to use invoke them by using command keys.

Requirements

  • Root permissions
  • Linux Kernel compiled with the “CONFIG_MAGIC_SYSRQ” option enabled

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

The SysRq key combination can be used to send commands directly to the Linux kernel in some specific circumstances: the kernel will respond to commands sent with command keys immediately, unless it is completely locked. Various command keys achieve specific tasks, and they can be combined to restore the system to a safe state, or to obtain a clean reboot when nothing else works: this is what we can obtain with the reisub sequence.

In this tutorial we will see how to enable all SysRq functions using a standard installation of Ubuntu 18.04 - Bionic Beaver as a base.

Read more

firewalld - firewall-cmd

Introduction to firewalld and firewall-cmd command on Linux

Objective

Learn the basic concepts behind firewalld and how to interact with it using the firewall-cmd utility

Requirements

  • Root permissions

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

firewalld - firewall-cmdSince version 7 of Rhel and CentOS and version 18 of Fedora, firewalld is the default firewall system. One of its more distinctive traits is its modularity: it works on the concept of connection zones. In this tutorial we will learn more about it, and how to interact with it using the firewall-cmd utility.

A firewall based on zones

Firewalld is a zone-based firewall: each zone can be configured to accept or deny some services or ports, and therefore with a different level of security. Zones can be associated with one or more network interfaces. Usually firewalld comes with a set of preconfigured zones: to list this zones, and more generally to interact with the firewall, we will use the firewall-cmd utility. I am running on a Fedora 27 system, let’s check what the available zones are:

$ firewall-cmd --get-zones
FedoraServer FedoraWorkstation block dmz drop external home internal public trusted work

Read more

How to schedule tasks using at command on Linux

Learning how schedule and manage tasks using the at program

Requirements

  • Root permissions to start the atd daemon
  • Having the at program installed

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

During the administration of a system, being able to schedule a task for a later execution it’s one crucial ability: to perform a backup of a database for example, or perhaps to run a maintenance script. Less known than cron or anacron, the at program let us do this in a pretty easy way: in this tutorial we will learn how to use it and how it is different from the programs mentioned above.

Read more

Tutorial on how to write basic udev rules in Linux

Objective

Understanding the base concepts behind udev, and learn how to write simple rules

Requirements

  • Root permissions

Difficulty

MEDIUM

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

In a GNU/Linux system, while devices low level support is handled at the kernel level, the management of events related to them is managed in userspace by udev, and more precisely by the udevd daemon. Learning how to write rules to be applied on the occurring of those events can be really useful to modify the behavior of the system and adapt it to our needs.

Read more

qrcode

How to organize your passwords using pass password manager

Objective

Learn to organize your passwords using the “pass” password manager on linux

Requirements

  • Root permissions needed to install required packages

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

If you have the good habit to never use the same password for more than one purpose, you have probably already felt the need for a password manager. There are many alternatives to choose from on linux, both proprietary (if you dare) and open source. If you, like me, think that simplicity it’s the way to go, you may be interested in knowing however to use the pass utility.

Read more

How to use argparse to parse python scripts parameters

Objective

Learn to use the argparse module to easily parse python scripts parameters

Requirements

  • Basic knowledge of python and object oriented concepts

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

In a previous article we have seen how to parse command line arguments using getopts in the context of bash scripts (you can find the article here). Now we will see how to accomplish the same task, in a more powerful way, when writing a python script.

Read more

How to use special permissions: the setuid, setgid and sticky bits

Objective

Getting to know how special permissions works, how to identify and set them.

Requirements

  • Knowledge of the standard unix/linux permissions system

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

Normally, on a unix-like operating system, the ownership of files and directories is based on the default uid (user-id) and gid (group-id) of the user who created them. The same thing happens when a process is launched: it runs with the effective user-id and group-id of the user who started it, and with the corresponding privileges. This behavior can be modified by using special permissions.

Read more