Use a File for Additional Swap Space

The following dd command example creates a swap file with the name “swapfile” under /root directory with a size of 8192MB (8GB). To create the swap space (non-persistent): Change the permission of the swap file so that only root can access it. Make this file as a swap file using mkswap command. Enable the newly … Read more

Disk I/O Stats in linux

Sysstat

For disk I/O trending there are a few options. the sar command from sysstat. By default, it gives output like this:

# sar
Linux 2.6.32-642.11.1.el6.x86_64 (test.geekdecoder.com)    01/26/2017      _x86_64_        (2 CPU)

12:00:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:10:01 AM     all      0.03      0.00      0.03      0.09      0.00     99.85
12:20:01 AM     all      0.27      0.00      0.04      0.00      0.00     99.69
12:30:01 AM     all      0.33      0.00      0.05      0.00      0.00     99.62
12:40:01 AM     all      1.01      0.00      0.18      1.18      0.00     97.63
12:50:01 AM     all      0.15      0.00      0.04      0.00      0.00     99.80
01:00:01 AM     all      0.16      0.00      0.03      0.00      0.00     99.80
01:10:01 AM     all      0.22      0.00      0.04      0.00      0.00     99.74
01:20:01 AM     all      0.36      0.00      0.05      0.00      0.00     99.59
01:30:01 AM     all      0.23      0.00      0.04      0.00      0.00     99.74
01:40:01 AM     all      0.70      0.00      0.25      6.23      0.00     92.82
01:50:01 AM     all      0.13      0.00      0.03      0.00      0.00     99.83
02:00:01 AM     all      0.16      0.00      0.04      0.00      0.00     99.80
02:10:01 AM     all      0.21      0.00      0.04      0.00      0.00     99.75
02:20:01 AM     all      0.30      0.00      0.04      0.00      0.00     99.66
02:30:01 AM     all      0.14      0.00      0.03      0.00      0.00     99.83
02:40:01 AM     all      0.20      0.00      0.03      0.00      0.00     99.76
02:50:01 AM     all      0.32      0.00      0.05      0.00      0.00     99.63
03:00:01 AM     all      0.21      0.00      0.03      0.00      0.00     99.76
03:10:01 AM     all      0.19      0.00      0.04      0.00      0.00     99.77
03:20:01 AM     all      0.12      8.44      2.69     10.79      0.00     77.96
03:30:01 AM     all      0.13      4.52      8.36      0.30      0.00     86.69
03:40:01 AM     all      0.48      0.00      0.05      0.02      0.00     99.45
03:50:01 AM     all      0.15      0.00      0.04      0.01      0.00     99.80
04:00:01 AM     all      0.13      0.00      0.03      0.00      0.00     99.84
04:10:01 AM     all      0.48      0.00      0.06      0.04      0.00     99.43
04:20:01 AM     all      0.17      0.00      0.05      0.11      0.00     99.67
04:30:01 AM     all      0.22      0.00      0.04      0.00      0.00     99.74
04:40:01 AM     all      0.89      0.00      0.08      0.16      0.00     98.87
04:50:01 AM     all      0.55      0.00      0.07      0.05      0.00     99.34
05:00:01 AM     all      0.11      0.00      0.04      0.01      0.00     99.85
05:10:01 AM     all      0.09      0.00      0.03      0.00      0.00     99.87
05:20:01 AM     all      0.17      0.00      0.04      0.00      0.00     99.80
05:30:01 AM     all      0.27      0.00      0.05      0.08      0.00     99.60

Read more

Find all files modified within 30 days and then parsed that for base64 decodes (used to encrypt/hide coding)

If your site is hacked, the check for edited files. Find all files modified within 30 days and then parsed that for base64 decodes (used to encrypt/hide coding) Find the coding itself # cd /home/domain/public_html # find . -type f -ctime -30 -iname "*.php" -exec grep "base64_decode" {} \; Results # find . -type f … Read more

IP Lookup with CLI Linux

nstall geoiplookup on Debian, Ubuntu or Linux Mint: $ sudo apt-get install geoip-bin To install geoiplookup on Fedora: $ sudo yum install geoip To install geoiplookup on CentOS, first enable EPEL repository $ sudo yum install epel-release then use yum command: $ sudo yum install geoip The default installation of geoiplookup comes with GeoIP.dat database … Read more

Ifconfig Command Not Found In CentOS 7

CentOS 7 minimal systems, use the commands “ip addr” and “ip link” to find the details of a network interface card. To know the statistics use “ip -s link”. To view the details of the network interface cards, enter the following commands: # ip addr To view the statistics of your network interfaces, enter the … Read more

Time stamped bash history logging

Timestamped bash history logging may be a great idea for logging changes. An example would look like this: Mar 28 15:08:26 database root: root@192.168.1.1 [10882]: shutdown -r now [0] Mar 28 15:08:31 database root: root@192.168.1.1 [10882]: cd /var/log [0] This can be done by adding 2 lines to the root .bashrc file or as a … Read more

Sync Date on CentOS 6 VM servers

My VM on ESXi have all different dates. Here is how toset them the same. First, you’ll need to install NTP. For Debian or Ubuntu, that would be this command: # sudo apt-get install ntp For Redhat or CentOS, you’ll need to use this one: # yum install ntp Then you’ll want to edit the … Read more

Drown Attack

Check your Site at https://drownattack.com/#test or run the following: http (replace IP with your server ip) openssl s_client -connect 192.168.1.1:443 -ssl2 postfix or other email MTA openssl s_client -connect xxxxxxxxxxxxx.com:25 -starttls smtp -ssl2 Check your version # openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 To protect against DROWN, server operators need to ensure that their … Read more