The purpose of this tutorial is to show how to use a Bash shell script or Python programming code to validate a credit card number on a Linux system.
programming
Introduction to Ansible prompts and runtime variables
This tutorial is part of a series we dedicated to Ansible. Previously we talked about the Ansible basics, then we focused on some Ansible modules we can use to perform some very common administration tasks, and we also talked about Ansible loops. In this article, instead, we learn how to create interactive prompts we can use to ask for user input and how to pass variables at runtime.
How to hash passwords on Linux
Passwords should never be stored as plain text. Whether we are talking about a web application or an operating system, they should always be in hash form (on Linux, for example, hashed passwords are stored in the /etc/shadow
file).
How to perform administration operations with Ansible modules
In previous tutorials we introduced Ansible and we discussed Ansible loops. This time we learn the basic usage of some modules we can use inside playbooks to perform some of the most common system administration operations.
Introduction to YAML with Examples
YAML is a data serialization language. The name itself is a recursive acronym which stands for YAML Ain’t Markup Language. It is specifically designed to be human-friendly, easy to read and write, to represent settings and data structures and to work well with modern programming languages.
Bash printf syntax examples
This tutorial will explore the bash printf command with syntax examples on Linux systems. When writing bash scripts, most of us by default use the echo
command as a means to print to standard output stream.
Ansible loops examples and introduction
In a previous article we talked about Ansible, a very useful provisioning free and open source software written in Python, which we can use to automate tasks on multiple machines. We saw how to install it on some of the most used Linux distributions and the basic concepts behind its usage.
Count lines of code with cloc
It can be difficult to count the number of lines of code that comprises a certain program, since simply viewing the source code will include comments, whitespace, etc. On Linux systems, the cloc command can be used to count lines of code in one or multiple files, and even sort results by programming language.
Bash countdown timer
Using a bit of Bash scripting, it’s possible to create a countdown timer in Linux. This will allow you to countdown in seconds, minutes, or to some future date.
Extract email from text file
The Linux command line has many tools that we can use to extract information from text files. In this tutorial, we’ll use a few different methods to extract email addresses from a text file on Linux.
C++ code on how to read characters from a file
This tutorial will show you a small example of C++ code on how to read a characters from a file, as well as to count the number lines that any particular file consist of. We will be creating the script and compiling the C++ on a Linux system. All distros will work the same, provided you have the G++ compiler installed, which we will cover as well.
How to convert binary number to decimal with python
In this guide, we will show you a short script that can be used to convert a binary number to a decimal number in Python on Linux. This script uses casting which is used to convert a variable from one type to another. In this case, we use Python casting to convert a string to decimal number that is an integer.
Check out the script below to use it on your own system.
In this tutorial you will learn:
- How to convert binary number to decimal with Python