How to use bash array in a shell script

How to use bash array in a shell script

In this tutorial we will see how to use bash arrays and perform fundamental operations on them. Bash, the Bourne Again Shell, it’s the default shell on practically all major linux distributions: it is really powerful and can be also considered as a programming language, although not as sophisticated or feature-reach as python or other “proper” languages. Furthermore, the Bash scripting is a must skill for any Linux system administration job.

Read more

Converting a binary number to decimal via Python script in Linux

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

Read more

main-image

Introductory tutorial to Git on Linux

Git is without doubt the most used version control system in the world. The software is open source, released under the GPLv2 license, and was created by Linus Torvalds, which is also the father of Linux. In this tutorial we learn
the basic concepts behind its usage, we see how to create or clone a git repository and how to perform the basic actions involved in the git workflow.

In this tutorial you will learn:

  • The basic git concepts
  • How to create a git repository
  • How to clone a git repository
  • How to add file contents to the repository index
  • How to create a commit
  • How to push changes to a remote repository
  • How to pull changes from a remote repository
main-image

Introductory tutorial to Git on Linux

Read more

Fibonacci number sequence with C++

C++ function to calculate Fibonacci number sequence

In this artcile you will learn how calculate Fibonacci sequence with using C++ function. The Fibonacci sequence starts with 0 and 1 where the the following number is always a sum of the two preceding numbers. For example, 0,1,1,2,3,5,8 and so on.

In this tutorial you will learn:

  • How to compile Fibonacci C++ program
  • How to run Fibonacci C++ program

Read more

whois script to check many domains and TLDs at once

Check domain name availability with bash and whois

If you’ve ever tried to come up with a catchy domain name, you know how annoying it can be to keep checking to see if a certain name is available. Fortunately, on Linux we can make the task a little easier on us by using the whois command. When a domain is available, the output from whois will let us know that it’s not able to find any information for that domain.

It’s easy enough then to put this functionality into a Bash script, which helps to automate checking lots of different TLDs (Top Level Domains, like .com, .net, .org, etc).

In this guide, we’ll show how to check domain name availability from the command line on Linux. Then, we’ll give you a simple Bash script that you can copy onto your own system and check for lots of domains at once. Read on to learn how.

In this tutorial you will learn:

  • How to install whois on major Linux distros
  • How to check for domain name availability with whois command
  • Bash script for checking domain name availability

Read more

Replacing all tab characters with spaces on Linux

Replace all TAB characters with spaces

If you have a lot of tab characters inside a text document or program file, they can be annoying because of how they’re represented differently in various text editors. For example, when you send your code to someone else, is it going to display the same way on their screen as it did on yours? Tabs are a bit unpredictable in this respect, and spaces are a much safer bet.

In this guide, we’ll show how to replace all the tab characters inside a file with spaces on Linux. We can use various Linux commands to do the job for us, which we’ll go over below. Depending on your situation and the file in question, some commands may be more suitable than others.

In this tutorial you will learn:

  • How to replace tab characters with spaces

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

Developing and running an Android app on a Linux system

Get Started with Android application development using Linux and Android SDK

Developers interested in the Android mobile operating system are able to use the Android SDK and various IDE software to code applications. These apps can then be made available and marketed to Android users around the world.

There are a lot of choices when it comes to programming Android applications. Your coding environment can involve a Linux system and a variety of different IDE programs to facilitate all of the software development. The trouble here is that each Linux distribution will often have a different set of requirements to run the sofware, and a separate list of steps that need to be followed.

In this guide, we’ll go through the step by step instructions to install Android Studio – which is one of the most popular Android IDEs – on a Linux system. This will work on any distribution because we’ll be using Snap package manager to manage the installation. Love it or hate it, the Snap package manager gets your system ready for Android development very quickly, by handling all the dependencies and working identically on any distribution you’re running, whether it be Ubuntu, Debian, Red Hat, CentOS, AlmaLinux, openSUSE, or any other type of Linux system.

Follow along with us below as we setup Snap package manager, install Android Studio, and then program a Hello World Android application to verify that everything is working properly.

In this tutorial you will learn:

  • How to setup Snap package manager
  • How to install Android Studio and SDK packages
  • How to create a Hello World test application
  • How to run an Android application on an emulated device

Read more

Various examples for removing duplicate lines from a text file on Linux

Removing duplicate lines from a text file using Linux command line

Removing duplicate lines from a text file can be done from the Linux command line. Such a task may be more common and necessary than you think. The most common scenario where this can be helpful is with log files. Oftentimes log files will repeat the same information over and over, which makes the file nearly impossible to sift through, sometimes rendering the logs useless.

In this guide, we’ll show various command line examples that you can use to delete duplicate lines from a text file. Try out some of the commands on your own system, and use whichever one is most convenient for your scenario.

In this tutorial you will learn:

  • How to remove duplicate lines from file when sorting
  • How to count the number of duplicate lines in a file
  • How to remove duplicate lines without sorting the file

Read more