woocommerce-rest-api

How to work with the Woocommerce REST API with Python

WordPress is probably the most used CMS in the world (it is estimated that almost 40% of all websites are built using the platform): it is very easy to install and use, and allows even non-developers to create website in few minutes.
Wordpress has a very large plugin ecosystem; one of the most famous is Woocommerce, which allows us to turn a website into an online store in few steps. The plugin makes use of the WordPress REST API infrastructure; in this tutorial we will see how to interact with the Woocommerce API using the Python programming language, showing how to list, create, update and delete products and categories.

In this tutorial you will learn:

  • How to generate Woocommerce REST API credentials and enable pretty permalinks
  • How to interact with the Woocommerce REST API using Python and the woocommerce package
  • How to get information about the existing Woocommerce categories, create, update and delete them
  • How to get information about the existing Woocommerce products
  • How to create simple and a variable products with variations
  • How to update and delete a product

woocommerce-rest-api

Read more

How to read and change the value of kernel parameters using sysctl

How to read and change the value of kernel parameters using sysctl

Sysctl is a utility installed by default in all modern Linux distributions. It is used both to read and write the value of kernel parameters at runtime; the available parameters are those listed under the /proc pseudo-filesystem, and specifically under the /proc/sys directory. In this article we learn how to use this utility, how to make changes persist a reboot, and how to load settings from a file “manually”.

In this tutorial you will learn:

  • How to read the value of kernel parameters
  • How to modify the value of kernel parameters at runtime
  • How to make changes persist a reboot
  • How to load settings from a file manually

Read more

How to compare files using diff

How to compare files using diff

The diff utility is, in the vast majority of cases, installed by default in every Linux distribution out there. The program is used to calculate and display the differences between the contents of two files. It is mainly used when working with source code two compare the same versions of two files and highlight the differences between them. In this article we will learn the various modes in which diff can work and how to create a diff file which can later be applied as a patch with the patch utility.

In this tutorial you will learn:

  • How to use diff
  • How to display the output of diff on two columns when using diff in normal mode
  • How to read the diff output in normal, context and unified mode
  • How to create a diff file and apply it as a patch with the patch utility

Read more

How to use bridged networking with libvirt and KVM

How to use bridged networking with libvirt and KVM

Libvirt is a free and open source software which provides API to manage various aspects of virtual machines. On Linux it is commonly used in conjunction with KVM and Qemu. Among other things, libvirt is used to create and manage virtual networks. The default network created when libvirt is used is called “default” and uses NAT (Network Address Translation) and packet forwarding to connect the emulated systems with the “outside” world (both the host system and the internet). In this tutorial we will see how to create a different setup using Bridged networking.

In this tutorial you will learn:

  • How to create a virtual bridge
  • How to add a physical interface to a bridge
  • How to make the bridge configuration persistent
  • How to modify firmware rules to allow traffic to the virtual machine
  • How to create a new virtual network and use it in a virtual machine
How to use bridged networking with libvirt and KVM

How to use bridged networking with libvirt and KVM

Read more

How to run the Raspberry Pi Os in a virtual machine with Qemu and Kvm

How to run the Raspberry Pi Os in a virtual machine with Qemu and Kvm

Although many operating system are available for the Raspberry Pi, the official one is the Raspberry Pi Os. The operating system is made to run for the arm architecture, and can be easily installed on the SD card which will be used as the main Raspberry Pi storage device. Sometimes we may want to perform some tests or try some applications without having a physical Raspberry Pi machine; in this tutorial we will see how we can create a virtual machine with the Raspberry Pi Os system using Qemu and Kvm (Kernel Virtual Machine).

In this tutorial you will learn:

  • How to install qemu and kvm
  • How to download and check the integrity of the latest Raspberry Pi Os version (Buster)
  • How to run the Raspberry Pi Os in a virtual machine

Read more

How to install Debian on an existing LUKS container

How to install Debian on an existing LUKS container

LUKS (Linux Unified Key Setup) is the de-facto standard encryption method used on Linux-based systems. While the Debian installer is perfectly capable of creating a LUKS container, it lacks the ability to recognize and therefore re-use an already existing one. In this article we see how we can workaround this problem using the “DVD1” installer, and running it in “advanced” mode.

In this tutorial you will learn:

  • How to install Debian in “advanced-mode”
  • How to load the installer additional modules needed to unlock an existing LUKS device
  • How to perform the installation on an existing LUKS container
  • How to add an entry in the crypttab file of the newly installed system and regenerate its initramfs

Read more

How to check disk space with df and du on Linux

How to check disk space with df and du on Linux

Df and du are two very useful utilities which are normally installed by default in all Linux distributions. We can use the first one to obtain an overview of the used and available space on mounted filesystems; the second, instead, is very useful to obtain a detailed report about the space used by files and directories. In this article we take a look at their usage, and we see what are the most common used options which can be used to modify their behavior.

In this tutorial you will learn:

  • How the df utility works
  • How to show the output of df in human-readable form
  • How to include the filesystem type in the output of df
  • How to include or exclude filesystems from the output of df
  • How the du utility works
  • How to obtain a human-friendly output with du
  • How to obtain a summary of the used space
  • How to exclude files from the output of du
  • How to obtain a “grand total” of the space in use by multiple directories

Read more

LFTP tutorial on Linux with examples

LFTP tutorial on Linux with examples

There is certainly no shortage of ftp client on Linux: some come with a graphical user interface such as Filezilla, others are command line applications which can be used even when display servers, such as Xorg or Wayland are not available. In this article we talk about one of the most used and feature-rich CLI ftp client: lftp.

In this tutorial you will learn:

  • How to install lftp on the most used Linux distributions
  • How to connect and authenticate to a remote host
  • How to create, remove, edit and list bookmarks
  • Some of the most used lftp commands
  • How to run commands non-interactively
  • How to download torrent files with lftp

Read more

How to rip an audio CD from the command line using cdparanoia

How to rip an audio CD from the command line using cdparanoia

Nowadays we are surrounded by devices able to read digital audio, and there are many services such as Spotify which allow to stream content legally. However if you like to buy music on physical support (compact disc), you may want to extract the audio tracks so they can be used on your smartphone or favorite device, or just for backup purposes. There are man tools on Linux which can be used to accomplish such task, but in the vast majority of cases they are just frontend to cdparanoia. In this tutorial we will learn how to use this tool.

In this tutorial you will learn:

  • How to install cdparanoia on the most used Linux distributions
  • How to retrieve drive information
  • How to rip all the audio tracks from a compact disc
  • How to rip specific tracks and/or a specific segment of a track
  • How to pipe the output of cdparanoia to tools like flac or lame to compress the audio tracks
How to rip an audio CD from the command line using cdparanoia

How to rip an audio CD from the command line using cdparanoia

Read more

main

Introduction to database normalization: the first three normal forms

The goal of a relational database normalization is to achieve and improve data integrity and avoid data redundancy so to avoid possible insertion, updation or deletion anomalies. A relational database is normalized by applying a series of rules called normal forms. In this article we will discuss the first three normal forms.

In this tutorial you will learn:

  • What is the first normal form
  • What is the second normal form
  • What is the third normal form
main

Read more

How to download online videos from the command line using Youtube-dl

How to download online videos from the Linux command line using Youtube-dl

Nowadays a lot of video sharing platforms exist online. Some are really popular, like Youtube , and others are a little more “obscure”. Different types of content can be found on these platforms, but is not always possible to download them via the native web interface. In this tutorial we will see how to use a small command line utility: youtube-dl. This command line utility is able to download said videos for us using a very simple syntax. The following tutorial aims to demonstrate the capabilities of the program, however it should be used only where appropriate, in order to respect copyright laws.

In this tutorial you will learn:

  • How to install youtube-dl
  • How to download videos using youtube-dl
  • How to list the available formats for a video
  • How to download a specific format
  • How to stream a video directly to a media player
  • How to save downloaded files using template patterns
  • How to specify options into the youtube-dl configuration file
How to download online videos from the command line using Youtube-dl

How to download online videos from the command line using Youtube-dl

Read more

main

How to listen to music from the console using the cmus player on Linux

Cmus is a fantastic ncurses-based music player written in C. It can be used on all Unix-based operating systems, and so also on Linux. It has a series of very nice features like gapless playback, and supports a variety of file formats; among the others: Ogg Vorbis, MP3, FLAC, Opus, Musepack, WavPack, WAV, AAC, and MP4. It also support adding features via extensions. In this tutorial we will learn its basic usage.

In this tutorial you will learn:

  • How to install cmus on the most used Linux distributions
  • How to add songs to the library
  • How to reproduce a song, and the various reproduction modes
  • How to add and remove songs from the queue
  • How to create,rename,delete,import and export a playlist
  • How to add and remove songs from a playlist

Read more