Configure local network Redhat package repository over HTTP with Apache

Objective

The objective is to configure network Redhat package repository accessible via HTTP protocol. This guide uses Apache webserver as a means to provide HTTP access to the local package repository.

Operating System and Software Versions

  • Operating System: – Red Hat Enterprise Linux Server 7.3 (Maipo)
  • Software: – Apache/2.4.6 (Red Hat Enterprise Linux)

Requirements

Privileged access to your RHEL server system will be required.

Difficulty

EASY

Conventions

Read more

Detecting which system manager is running on Linux System

Objective

There are multiple system managers which can by possibly running on your Linux system. The current most common system managers are SysV (init), Systemd and Upstart. You may find this short guide to be of use to you, if you are unsure which, system manager is running on your Linux system.

Requirements

Privileged access to your Linux system is required.

Difficulty

EASY

Conventions

Read more

Python Packages and Modules

Introduction

Whenever you need some additional functionality in Python, you turn to the import keyword to pull in extras from Python modules. You’ve used common ones like the math module plenty of times.

Now, you will learn how to create your own Python modules and packages to compartmentalize your code. Modules are sort of like classes in that they make your code modular. While classes make code modular within a program and serve as the blueprints for objects, modules make all of your code modular across all programs and are utilities to be used just as they are.

Through the use of modules, you can create your own toolbox with all sorts of parts and pieces that you commonly use. Modules can include anything from variables and constants to functions and even classes. Because of this versatility, you can set yourself up to have everything that you need at the beginning of any project.

Read more

Enigmail Setup Wizard

Encrypt Your Email With GPG, Thunderbird, and Enigmail

Introduction

Encrypting everything online is becoming more important by the day. Email is no different. For Linux users, the process is actually very simple with three common open source tools; Mozilla Thunderbird, Enigmail, and GNU PGP(GPG.) Through the use of these three tools, you can send and receive encrypted messages easily, and protect yourself and the people you’re communicating with from attackers and privacy invasions.

Gathering The Pieces

Install GPG

The first thing that you will need in order to begin encrypting your emails is GPG. Since GPG is part of the GNU Project and is a common tool for generating encryption keys, it’s likely to be in any distro’s repositories. Use your package manager to install it.

Read more

Test And Recover Your Passwords By Cracking Them With Hashcat

Introduction

Hashcat is a robust password cracking tool that can help you recover lost passwords, audit password security, benchmark, or just figure out what data is stored in a hash.

There are a number of great password cracking utilities out there, but Hashcat is known for being efficient, powerful, and full featured. Hashcat makes use of GPUs to accelerate hash cracking. GPUs are much better and handling cryptographic work than CPUs are, and they can be utilized in much greater numbers than CPUs. Hashcat also supports a very wide range of popular hashes, to ensure that it can handle deciphering nearly any password.

Please note that misuse of this program can be illegal. Only test on systems that you own or have written permission to test on. Don’t share or post hashes or results publicly. Hashcat should be used for password recovery and professional security audits.

Read more

Manage Vim Plugins With Pathogen

Introduction

There’s no denying that Vim is awesome on its own. It provides users with unprecedented configuration potential and quick, powerful commands. That said, Vim can get even better with the use of plugins.

There are hundreds of plugins that can seriously amp-up your Vim installation. Many of them are tailored for specific uses, like programming in a certain language or even writing. Others are more general and enhance Vim’s existing capabilities. Whichever it is that you need, you’re going to have to manage those packages.

There are a number of Vim package managers, but Pathogen is the most universal and simple to use and install. Pathogen works by pulling all of the Vim plugins in a certain directory into your Vim installation and activating them with a single line in your .vimrc file.

Read more

How to Securely Transfer Files With SFTP

Introduction

Transferring files between computers can be a pain. FTP is somewhat clunky and old, and using online services isn’t direct and is less than ideal for handling sensitive files. Git works well for code and text, but isn’t the best for binary files and requires a repository to be configured. So, what’s a good solution for sending files directly between computers? SFTP.

SFTP is a secure file transfer protocol that makes use of SSH to send files between computers. It is encrypted and direct. It allows you to use an existing service to send files, thereby reducing your attack surface, and it eliminates the need to rely on potentially vulnerable passwords for file transfers.

Before you go any further, you need to set up SSH keys for the machines you want to work with. If you don’t know how, check out our guide on setting up SSH key based authentication.

Read more

Record and Replay Terminal Session with Asciinema on Linux

Introduction

Asciinema is a lightweight and very efficient alternative to a Script terminal session recorder. It allows you to record, replay and share your JSON formatted terminal session recordings.
The main advantage in comparison to desktop recorders such as Recordmydesktop, Simplescreenrecorder, Vokoscreen or Kazam is that Asciinema records all standard terminal input, output and error as a
plain ASCII text with ANSI escape code .

As a result, JSON format file is minuscule in size even for a longer terminal session. Furthermore, JSON format gives the user the ability to share the Asciinema JSON output file via simple file
transfer, on the public website as part of embedded HTML code or share it on Asciinema.org using asciinema account. Lastly, in case that you have made some mistake during your terminal session, your
recorded terminal session can be retrospectively edited using any text editor, that is if you know your way around ANSI escape code syntax.

Difficulty

EASY

Conventions

Read more

How to perform a faster data compression with pbzip2

Introduction

What if you would be able to perform a data compression four times faster, with the same compression ratio as you normally do. Pbzip2 command line utility can easily accomplish this as it gives you an option to select number CPU and amount of RAM to be used during the compression process.

Regular tar and bzip2 compression

We all know the regular command to perform tar and bzip2 directory compression. The below command will tar and compress our sandbox directory FOOBAR. We are also prefixing the below command to get exact time for how long will it take to output compressed file FOOBAR.tar.Bbz2 from 242MB FOOBAR directory:

# time tar cjf FOOBAR1.tar.bz2 FOOBAR/

real    0m20.030s
user    0m19.828s
sys     0m0.304s

From the above time output we can see that it took about 20 seconds to create following compressed file:

# ls -lh FOOBAR1.tar.bz2 
-rw-r--r-- 1 root root 54M Mar 10 20:25 FOOBAR1.tar.bz2

Read more