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

Various commands used to detect a connected network cable on Linux

How to detect whether a physical cable is connected to network card slot on Linux

If you’ve ever needed to know whether a physical cable is connected to a network port on your Linux system, you don’t necessarily need to be right in front of the computer or server to look and see. There are several methods we can use from the Linux command line in order to see if a cable is plugged into a network slot.

There are a few reasons why this could come in handy. For one, it shows you whether the system itself detects that there’s a cable plugged in. This could be an essential troubleshooting step if you know for a fact that the cable is properly plugged in, yet the system is not detecting it. It’s also helpful on remote systems or if you’re just too lazy to look at the back of the computer and see if the cable is plugged in.

Check out some of the examples below where we go over various commands that check whether a physical network cable is plugged in or not.

In this tutorial you will learn:

  • How to detect physical network cable connectivity with Bash commands and ethtool

Read more

Writing Fedora ISO file to bootable USB key

How to create a Fedora Linux Live bootable USB key

A great feature of many Linux distributions is that you can create a live USB (or CD/DVD) key and boot directly into it. This allows you to try out an operating system, troubleshoot an existing installation, or install Linux onto the system’s hard drive.

Fedora is one of those distributions of Linux that allows us to boot into a usable environment directly from USB. In order to do that, we just need to write the Fedora installation file (.ISO format) to the USB thumb drive.

In this guide, we’ll go over the step by step instructions to create a Fedora bootable USB key via either command line or GUI. Follow along with us to get your USB key setup through Fedora’s Media Writer tool or the ddrescue command utility.

In this tutorial you will learn:

  • How to download Fedora and Fedora Media Writer
  • How to create Fedora bootable USB with Media Writer (GUI method)
  • How to create Fedora bootable USB with ddrescue (command line method)

Read more

Installing AWS CLI on Linux

Installation of awscli the Amazon Web Services command line tool on Linux

The Amazon Web Services command line tool (AWS CLI) gives users the ability to control and manage AWS services through command line scripts. This makes everything very easy to manage with a single tool, and it can be installed on any Linux distribution.

The tool requires Python in order to run, so that’s really the only prerequisite.

Read more

Removing a password from a PDF document in Linux

How to remove protection password from pdf document

If you have a PDF document (or even a bunch of PDF documents) that are password protected, there’s a simple way to remove the password from the file in Linux. In this guide, we’ll show you how to install the qpdf tool on any Linux distro, which is a handy command line utility that can do a bunch of things to PDF documents.

The feature we’ll be covering is password removal. Keep reading to see how to remove a password from one or more PDF documents with a short and easy command.

NOTE
This article isn’t about hacking PDF documents. We are assuming you already know the password to a PDF document and simply wish to remove it. You can always add a new password to the document with the same tool. We’ll show you how.

In this tutorial you will learn:

  • How to install qpdf on major Linux distros
  • How to remove encryption from a PDF document with qpdf
  • How to password protect a PDF document

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

Connecting to FTP server on Ubuntu Linux

How to setup and use FTP Server in Ubuntu Linux

FTP stands for “File Transfer Protocol” and is a great protocol for downloading files from a remote or local server, or uploading files onto the server. Using FTP proves to be a pretty basic task after it has been setup properly. It works by having a server that is listening for connections (on port 21 by default) from clients. The clients can access a remote directory with their user account, and then download or upload files there, depending on the permissions that have been granted to them. It’s also possible to configure anonymous authorization, which means that users will not need their own account in order to connect to the FTP server.

On Ubuntu Linux, there are a multitude of different FTP server and client software packages available. You can even use default GUI and command line tools as an FTP client. A very popular and highly configurable FTP server package is vsftpd, available for many Linux systems, including Ubuntu.

In this guide, we will go over the step by step instructions to install vsftpd on Ubuntu. We’ll also see how to to configure the FTP server through various settings, then how to use command line, GNOME GUI, or FTP client software to connect to the FTP server.

WARNING
FTP will suffice for some situations, but for connections over the internet, SFTP is recommended. This is because FTP is not secure to use over an internet connection, since your credentials and data are transmitted without encryption. The ‘S’ in SFTP stands for ‘Secure’ and tunnels the FTP protocol through SSH, providing the encryption needed to establish a secure connection. To learn more about SFTP, see our guide on How to Securely Transfer Files With SFTP.

In this tutorial you will learn:

  • How to install and configure vsftpd on Ubuntu
  • How to setup an FTP user account
  • How to connect to FTP server via command line
  • How to connect to FTP server via GUI
  • How to configure anonymous FTP login
  • How to change the default FTP listening port
  • Troubleshooting “connection refused” FTP connection error

Read more

Blacklisting a kernel module on Ubuntu Linux

How to blacklist a module on Ubuntu/Debian Linux

There may be a time when you need to disable some kernel modules from being loaded during your Linux system’s boot time. In this guide, we will discuss a few different ways to blacklist a module, including its dependencies, on Ubuntu and any other Debian based distros. This will effectively permanently disable a module from loading during the boot time.

In this tutorial you will learn:

  • How to blacklist a kernel module on Ubuntu/Debian-based Linux distros

Read more

Configuring an NFS server share on Linux

How to configure NFS on Linux

Sharing files between computers and servers is an essential networking task. Thankfully, NFS (Network File System) is available for Linux systems and makes the job extremely easy. With NFS properly configured, moving files between computers is as easy as moving files around on the same machine. Since NFS functionality is built directly into the Linux kernel, it is both powerful and available on every Linux distro, although the configuration can differ slightly between them.

In this guide, we’ll show how to install and configure NFS on major Linux distros, like Ubuntu and others based on Debian, and Fedora and others based on Red Hat. The configuration will involve a server (which hosts the files) and one client machine (which connects to the server to view or upload files). Follow along with the steps below to get NFS setup on your own system.

In this tutorial you will learn:

  • How to install NFS server
  • How to configure NFS server shares
  • How to connect to NFS server from client machines

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

VirtualBox Guest Additions installation of Fedora Linux

Virtualbox Guest additions installation on Fedora Linux

If you’re running Fedora Linux inside a VirtualBox virtual machine, installing the Guest Additions software will help you get the most out of the system. VirtualBox Guest Additions will give the machine more capabilities, such as a shared clipboard with the host system, drag and drop file transfer, and automatic window resizing.

This makes copying data to and from a host system much more convenient. It also changes the VM’s resolution automatically when its window is resized, so you don’t need to change it manually. Guest Additions will work with just about any Linux distribution, but instrutions can differ because of dependencies and package managers.

In this guide, we’ll be going over the step by step instructions to get VirtualBox Guest Additions installed on Fedora Linux. With these instructions, it doesn’t matter what host system you’re using, as long as the virtual machine is running Fedora. This guide assumes that you’ve already installed Fedora in the VM correctly.

In this tutorial you will learn:

  • How to install VirtualBox Guest Addition on Fedora
VirtualBox Guest Additions installation of Fedora Linux

VirtualBox Guest Additions installation of Fedora Linux

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