m4s0n501
TrickyLinux | Linux Tricks And Tutorials
Finding block size

How to check/find the block size in linux

A block is a fixed length uniformly sized unit of data storage. The length of the block may vary from 512bytes, 4kb, 8kb and so on. There are multiple ways of finding block size in Linux. Below are the example of finding block size: Calculate the block size using blockdev # blockdev –getbsz /dev/sda1 Finding

allow ping to single IP

Allow Ping for Single IP In Linux

To protect the server from attack or harm server admin may disable the Ping request from outer world but allow a single IP for himself to check sever connectivity. This tutorial will guide you to allow ping packets for one IP only This whole process of allowing single IP is based on Iptables and there

Stop

Disable Ping Response in Linux

Ping response can be disabled on the server due to many reasons such as server security, to avoid the network congestion., etc. Ping can disabled temporary and permanent in Linux.   Disable Ping response Temporary: To disable the ping response temporary run the following command on the server as root # echo “1″ > /proc/sys/net/ipv4/icmp_echo_ignore_all

firewall installation

How To Install APF and BFD

APF is a policy based iptables firewall system designed for ease of use and configuration. This article covers the steps to install APF (Advanced Policy Firewall).   Steps to Install APF: 1. Change to the temp directory. cd /tmp/   2. Download the apf packages on your server. wget http://www.rfxn.com/downloads/apf-current.tar.gz   3. Extract the packages

open

How to allow the port in CSF Firewall

Some applications runs on a specific ports which need to be opened with the server firewall. This can be very useful but sometime its very hazardous because hackers can use these ports to gain the access of the server.   Steps to Open Ports in CSF: 1. Open the csf configuration file using any text

firewall installation

How To install CSF and LFD

Firewall plays an important role in the protection of the server. Firewall protects the servers against harmful stuff. Firewall controls the incoming and outgoing traffic by analyzing the packet and determine whether they are allowed through or not based on set of rules. In Linux we uses IPTABLES to manage the firewall rules. But its

change ssh port

Change the default SSH port 22

The Secure Shell (ssh) protocol by default uses the port 22. Attackers mostly uses the port 22 in the automated attack and changing the default will prevent your server from these automated attack. There are many ways of making your server secure and changing the default ssh port is the little server hardening. Steps to

insert

How to insert text/string at the beginning of the line

Using sed command we can insert the text at any matching pattren of the file. Using sed we can inset at any point of the file.   Insertion with sed at the beginning of the line   If you want to insert the text during the execution of the command use -i option. Sed -i

insert

How to insert string/text at the end of the line.

Some time we need to insert some text or symbols or string at the end of every line in a file. This can be done using two methods “awk” and “sed” command. Below are the examples:   Insertion with sed at the end of the line If you want to insert the text during the

upgrade

How to upgrade Plesk 10 to plesk 11 in CentOs 6.

Before starting upgrade process please check Plesk 11 system requirement. Please note that most of the time upgrade process fails because of EPEL repository. To complete upgrade process without any error disables the EPEL repository by doing: cd /etc/yum.repos.d mv epel.repo epel.repo_back mv epel-testing.repo epel-testing.repo.back Once you are done with the above steps, start the