Check rootkit with rkhunter

rkhunter is a software used to check your server for rootkits. The official site is

http://rkhunter.sourceforge.net/

On Ubuntu, install with

Before you scan, update rkhunter with

To check your system for rootkit, run

Apache AH00144: couldn’t grab the accept mutex

On Ubuntu 18.04 server, apache crashed. On checking apache error log, found following

To fix the error, edit file

Find

Replace with

Restart Apache

See Apache

Install PHPShield in Cpanel Server

phpSHIELD is an encoder that encode PHP scripts so no one can read your source code.

https://www.phpshield.com/

They actually resell SourceGuardian Encoder, so you can install Sourceguardian loaders.

Cpanel Servers come with sourceguardian loader, to install follow the instructions here.

Install SourceGuardian in Cpanel Server

To install sourceguardian PHP loaders in Cpanel server, run

How to Block a Country in CSF firewall

To block all traffic from a country in CSF Firewall edit file /etc/csf/csf.conf

Find the line

In this line, you can add 2 Letter country code. For example to block China and Russia, add

Now you need to restart firewall with command

error: ‘x264_bit_depth’ undeclared (first use in this function)

When installing ffmpeg, i get error

This is due to incompatability with ffmpeg and x264.

What you can do is try another version of x264. You will be able to download older version of x264 from

ftp://ftp.videolan.org/pub/x264/snapshots

On 2018-08-14, it failed with latest stable snapshot. So i tried 14 days old stable snapshot

This worked with ffmpeg.

Solution here is to try latet version first, if it did not work, try older version, say try 1 month old version, if that did not work, go back 2 months, see if that works.

Now install ffmpeg with

List all recent logins to Linux server

last command list all recent logins to your linux server.

Linux Last Command

To list only last 5 logins, run

As you can see, last shows IP of the user, by default it show hostname of the remote server. In above example, it show “admin.serverok.i”, this is turncated. To see full hostname, run

if you don’t want IP converted to hostname, run

Last stores login data in file /var/log/wtmp. Old files will be rotated, so to see old logins you need to specify the location of the file using -f argument.

Example

File name may be differnt in your server, check /var/log folder for actual file names.

Reset Prestashop admin password

On Prestashop 1.7, open file

Find the value of “cookie_key”.

prestashop reset admin password

Now run following SQL

Example

This set password for admin user [email protected] to “ok123pass”.

See Prestashop

Extract Backup of one database from mysqldump all databases

When you backup MySQL Server with command

You get a MySQL backup file containing all databases.

If you want to generate MySQL backup for single database from this file, you can run

See mysqldump