Bash script to backup using lftp

Can use below script to gzip a folder, and upload to a FTP site. We can use a cron task to schedule it.

Fn=myvps-backup-$(date +%Y%m%d).tar.gz
tar cf - websites | gzip -9 - > $Fn lftp -u user@name,password << EOF
set ssl:check-hostname no
set ssl:verify-certificate false
cd /public_ftp
put $Fn

Whitepaper on Designing an efficient Virtual Queue Management System

Recently I wrote a research paper on the said topic, and here are the links I published:

  1. Original, updated version @ GitHub –
  2. Medium –

Additionally, a small excerpt in a Malayalam online news paper –

PHP PortPing script – check host connectivity

Here is a script in PHP I wrote to check if a remote host and port are open for you to connect. Do not mistake this as an equivalent to ping command because ping uses ICMP and I used TCP using PHP’s famous fsockopen() function, and a small piece of AJAX.


You can get the latest source code from my GitHub code share page –


function ping($host, $port) {
         $startTime = time();
         if ($fs = fsockopen($host, $port, $errCode, $errStr, 1)) {
             $timeTaken = (time()-$startTime)/1000;
         echo "Reply from $host:$port time={$timeTaken}ms";
         } else {   
             echo "Request timed out.";
         echo "<br>";


var count = 0;
             var intervalID = setInterval(function PortPing() {
                 var xhttp = new XMLHttpRequest();
                 xhttp.onreadystatechange = function() {
                     if (this.readyState == 4 && this.status == 200) {
                         document.getElementById("console").innerHTML += this.responseText;
       "GET", "PortPing.php?source=self&host=<?=$host?>&port=<?=$port?>", true);
                 if (++count > <?=$t-1?>) {

How to setup AWS SES / Simple Email Service

This is a tutorial on how to setup AWS SES / Simple Email Service.

Step 1 – Login to your AWS Console, then choose Services –> Customer Engagement –> Simple Email Service


Step 2 – Verify a New Domain

Choose “Domains” from left navigation panel, then click –> Verify a New Domain button


Step 2.2 – Enter Domain name


Also click checkbox Generate DKIM settings, though optional, I will be using this.

You will be displayed with a list of DNS settings in the next screen.


Once you completed the Step 3, click close.

Step 3 – Edit DNS records

You will have to login to your domain control panel and add these.

I will be using cPanel for this exercise. Steps are almost same with any domain/hosting control panel.


Step 4 – Wait for the domain to get verified. Click refresh icon on the right-top whenever you are impatient.


You have nothing to do here. Just wait for some 2-5-10 minutes.


Step 4.1 – Verify Email Address

You cannot even send a test mail, unless you have a email id verified.

Choose ‘Email Addresses’ from the left-navigation panel and click “Verify a New Email Address” button.


Make sure you enter an already existing email id.


A verification mail will be sent to your inbox.

There will be a URL you are expected to click, and you are verified.


Once verified, you should be able to see the verification status updated in AWS console too.


Step 5 – Send test mail.

Go back to Domains –> “Send a Test Mail” button.