Reset MySQL Root Password

First stop the mysql service

service mysqld stop
or 
systemctl mysqld stop

Start mysql with safe mode

sudo mysqld_safe --skip-grant-tables

Log into MySQL as root:

mysql -u root

Change to the mysql database, which handles the settings for MySQL itself:

use mysql;

Update the password for the root user:

update user set password=PASSWORD("newpassword") where User='root';

Refresh the MySQL user privileges:

flush privileges;

Exit MySQL:

exit

Restart mysql back and retry to login with new password

mysql -u root -p
Scan Website Malware with malware.expert

Scan Website Malware with malware.expert

First, you need ClamAV installed on your system

Ubuntu

sudo apt-get install clamav

Centos 7

yum -y install epel-release
yum -y update
yum -y install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd

Install malware.expert scanner

wget http://cdn.malware.expert/malware.expert.scanner.sh
chmod 750 malware.expert.scanner.sh

To scan with malware.expert

bash malware.expert.scanner.sh scan /folder

To run scan in background and save into one .txt file

bash malware.expert.scanner.sh scan /folder > result.txt &

Enable Slow Log on MySQL/MariaDB

First enable the MySQL slow query log in the MySQL configuration file my.cnf

CentOS/RHEL Based

vi /etc/my.cnf

Debian/Ubuntu Based

vi /etc/mysql/my.cnf

Add the records below at the end of the **mysqld** section:

[mysqld]
slow_query_log = 1
log-slow-queries = /var/log/mysql-slow.log
long_query_time = 1

Create slow log file

# touch /var/log/mysql-slow.log
# chown mysql:mysql /var/log/mysql-slow.log

Restart MySQL service

CentOS/RHEL

service mysqld restart

Debian/Ubuntu

service mysql restart

If MariaDB installed

service mariadb restart

Tail the slow log file

tail -f /var/log/mysql-slow.log
Format and Add Disk Larger than 2TB using fdisk

Format and Add Disk Larger than 2TB using fdisk

Basically, fdisk cannot create partition more than 2 TB. The other way to create the partition is using parted command.

Step one, locate the disk using fdisk

fdisk -l

Let say we got /dev/sdc

parted /dev/sdc

On parted

(parted) mklabel gpt
(parted) mkpart primary 0GB 3TB
(parted) exit

To verify

fdisk /dev/sdc

Format disk to ext4

mkfs.ext4 /dev/sdc1

To mount the formatted disk

mount /dev/sdc1 /data1