×


Blog


Install Iptables on CentOS 7 Server - Step by Step Process ?

This article covers how to disable FirewallD and install and iptables on CentOS 7 server. The iptables service stores configuration in /etc/sysconfig/iptables and /etc/sysconfig/ip6tables , while firewalld stores it in various XML files in /usr/lib/firewalld/ and /etc/firewalld/ . 

Note that the /etc/sysconfig/iptables file does not exist as firewalld is installed by default on Red Hat Enterprise Linux.

FirewallD is a complete firewall solution that can be controlled with a command-line utility called firewall-cmd. If you are more comfortable with the Iptables command line syntax, then you can disable FirewallD and go back to the classic iptables setup.


To Install and Use Iptables Linux Firewall:

1. Connect to your server via SSH.

2. Execute the following command one by one: 

$ sudo apt-get update 
$ sudo apt-get install iptables

3. Check the status of your current iptables configuration by running:

$ sudo iptables -L -v


Location of iptables rules on CentOS ?

CentOS 7 uses FirewallD by default. If you would like to manage iptables/ip6tables rules directly without using FirewallD, you may use the old good iptables-services service which will load the iptables/ip6tables rules saved in /etc/sysconfig/iptables and /etc/sysconfig/ip6tables when it is started during boot time.


Configure Firewall with FirewallD on CentOS 7

This article covers how to configure and manage the FirewallD service on your CentOS system. A Linux firewall used to protect your workstation or server from unwanted traffic. You can set up rules to either block traffic or allow through. You can add or delete or update firewall rules without restarting the firewall daemon or service. The firewall-cmd act as a frontend for the nftables. In CentOS 8 nftables replaces iptables as the default Linux network packet filtering framework. 


To Start and enable firewalld, run the commands:

$ sudo systemctl start firewalld
$ sudo systemctl enable firewalld

To Stop and disable firewalld, run the commands:

$ sudo systemctl stop firewalld
$ sudo systemctl disable firewalld

To Check the firewalld status, run the command:

$ sudo firewall-cmd --state

To Command to reload a firewalld configuration when you make change to rules, run the command:

$ sudo firewall-cmd --reload

To Get the status of the firewalld service, run the command:

$ sudo systemctl status firewalld


Install MySQL on Debian 9 Stretch - Step by Step Process ?

This article covers how to install mysql 8.0 and Secure MySQL on Debian 9 server. MySQL, the world's most popular open-source relational database management system is not available in the default Debian's repositories. MariaDB is the default database system in Debian 10. 

The MySQL APT repository provides a simple and convenient way to install and update MySQL products with the latest software packages using Apt. The MySQL APT repository provides MySQL packages for the following Linux distros: Debian.


How to Uninstall MySQL from Debian?

To remove MySQL, Run the following commands:

$ sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
$ sudo apt-get autoremove -y
$ sudo apt-get autoclean
rm -rf /etc/mysql
sudo find / -iname 'mysql*' -exec rm -rf {} \;


How to secure MySQL ?

MySQL comes with a command we can use to perform a few security-related updates on our new install. Let's run it now:

$ mysql_secure_installation

This will ask you for the MySQL root password that you set during installation. Type it in and press ENTER. Then answer a series of yes or no prompts. 


Install MariaDB on CentOS 7 Server - Step by Step Process ?

This article covers how to install and Secure MariaDB on a CentOS 7 server. MariaDB is a fork of MySQL managed by the original MySQL developers. It's designed as a replacement for MySQL, uses some commands that reference mysql, and is the default package on CentOS 7.


To Install MariaDB 5.5 on CentOS 7:

1. Install the MariaDB package using the yum package manager: 

$ sudo yum install mariadb-server

2. Once the installation is complete, start the MariaDB service and enable it to start on boot using the following commands: 

$ sudo systemctl start mariadb 
$ sudo systemctl enable mariadb


To install MariaDB on CentOS 8:

1. Open the terminal application. Another option is to log in using the ssh command:

 ssh user@centos-8-server-ip

2. Install the MariaDB on CentOS 8 by running the command:

$ sudo yum install mariadb-server

3. Secure the MariaDB server in CentOS 8 by running the command:

$ sudo mysql_secure_installation

4. Finally test MariaDB installation by running the command:

$ mysql -u root -p


MariaDB vs MySQL:

Even though MariaDB is a fork of MySQL, these two database management systems are still quite different: 

MariaDB is fully GPL licensed while MySQL takes a dual-license approach.

MariaDB supports a lot of different storage engines. 

In many scenarios, MariaDB offers improved performance.


Install Scribus on Linux Mint 20 - Step by Step Process ?

This article covers the installation method of Scribus on a Linux system. Scribus is used to create PDF files, e-books, newsletter, magazines and posters etc. It can also be used to edit the existing PDF file.

Scribus is available in the default package repositories of Ubuntu, Linux Mint, Debian and Arch Linux. So, to install it run the following command:

$ sudo apt upade && sudo apt install -y scribus    // Ubuntu, Linux Mint & Debian
$ sudo pacman -S scribus   // Arch Linux & Manjaro Linux


Python Get Current Directory

This article covers how to use the 'os. getcwd()' method to easily get the python current working directory. When you run a Python script, the current working directory is set to the directory from which the script is executed.

The os python module provides a portable way to interact with the operating system. The module is part of the standard Python library and includes methods for finding and changing the current working directory.

Basically, In Python, you can get and change (set) the current working directory with os.getcwd() and os.chdir().

os module is included in the standard library, so no additional installation is required.

To Get the current working directory: os.getcwd()

To Change the current working directory: os.chdir()


How to Get the current working directory: os.getcwd() ?

1. os.getcwd() returns the absolute path of the working directory where Python is currently running as a string str.

2. getcwd stands for "get current working directory", and the Unix command pwd stands for "print working directory".