Bash shortcuts

Enable color prompt

Edit .bashrc, add following

SendGrid API key

Configure postfix to relay mails using SendGrid

To use postfix to send email using sendgrid, you first you need to install postfix on your server. Edit


Delete the line. Go to end of the file and add following

Create API Key in SendGrid

Next you need to create an API key in sendgrid. To do this, go to Settings > API Key.

SendGrid API key

Click “Create API Key” button.

Sendgrid create api key

For this test, i just give the new API key Full Access. On next page you will get API key. Copy it and keep it safe as you won’t be seeing it again.

sendgrid api key created

Now you have the API key, that you can use with postfix.

Add API Key to postfix

Edit file


Here is what i have

[email protected]:~# cat /etc/postfix/sasl_passwd
[]:587 apikey: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
[email protected]:~#

Now run

To test email, run


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

A new message or response with subject:

CustomBuild versions.txt is getting old on

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

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/


Replace with

See postfix


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 file is used to configure tmux

Here is the .tmux.conf i use

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 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”.


See backup