fping

fping can be used to ping multiple IP and get report.

If you just want to show if hosts are up or not

DirectAdmin CustomBuild versions.txt is getting old

I got following email from DirectAdmin server.

New Message: CustomBuild versions.txt is getting old on s1.serverok.in

A new message or response with subject:

CustomBuild versions.txt is getting old on s1.serverok.in

has arrived for you to view.
Follow this link to view it:

http://s1.serverok.in:2222/CMD_TICKET?action=view&number=000000967&type=ticket

================================
Automated Message Generated by DirectAdmin 1.52.1

Do Not Reply.

DirectAdmin is telling you to update your server.

You need to login to SSH as user root. Then run following commands.

postfix no local interface found

When starting postfix it failed with following error

To fix, edit /etc/postfix/main.cf

Find

Replace with

See postfix

tmux

CTRL+B % Split window vertically
CTRL+B “ Split window horizontally
CTRL+B c Create new window
CTRL+B d Detach tmux session
CTRL+B $ Rename session
CTRL+B n Next window.
CTRL+B p Previous window.
CTRL+B arrow keys switch between panes.

.tmux.conf

.tmux.conf file is used to configure tmux

Here is the .tmux.conf i use

https://gist.github.com/serverok/f8f729e2c22a5ab1fa6b0d82765bcddc

If you change this file, you need to restart the terminal or run

Scroll Mode in tmux

To scroll, you need to enter scroll mode by pressing

To exit scroll mode, press q

rsync

rsync command with exclude option, full server backup to remote server.

Transfer a file

I normally use scp to do single file transfer. It may be better to it with rsync as you will be able to resume.

-P == –partial –progress

If you use non standard SSH port, then replace -e ssh with “-e ssh -p PORT_NUMBER”.

Example

See backup

smartctl

To check hard disk for errors, run

Here is an example of HDD with errors

To get detailed, result, run

hdd

gzip

Enable Gzip in Amazon Linux
How to enable gzip on Plesk Nginx

To check if a web site have gzip enabled, run

When you have no GZIP enabled, you will see error as follows

With gzip enabled, you see something like following

To enable gzip on nginx web server, i added following to server block

systemctl list-dependencies

systemctl

See see dependency for a package, run

systemctl list-dependencies

Service file location

service files are located in /usr/lib/systemd/system

List all enabled services

See all running services

Systemd unit types

Install shadowsocks on Ubuntu

Install ShadowSocks server on Debian 10
install ShadowSocks client in Ubuntu 18.04

On Server, install it with

Create config file for server

Add

Replace SERVER_IP and PASSWORD in above config. Start server with

Example

Shadowsocks client

Shadowsocks have clients for different operating systems. Some are GUI. On Ubuntu, i install CLI version, that is part of shadowsocks server. To install run

Now start the sslocal program with command

Example

Now you will be able to configure your browser to use socks proxy listing at 127.0.0.1:7070