SOLVED: sftp Error: Connection timed out after 20 seconds of inactivity

Error: Connection timed out after 20 seconds of inactivity


I just want to share a peculiar sftp connectivity issue that we encountered recently and how we solved it.

This is the message we got when trying to connect to the server using sftp and obviously it failed to retrieve directory listing.

Status: Connecting to mydomain.com...
Response: fzSftp started, protocol_version=8
Command: keyfile "somefile.ppk"
Command: open "user@mydomain.com" 22
Error: Connection timed out after 20 seconds of inactivity
Error: Could not connect to server

We usually connect to my remote server using sftp to upload and download the work files.

All was well till yesterday, when suddenly, the connectivity to the server was not happening, the network error showed connection timed out.

We distinctly remember being able to connect till sometime back, before the above error cropped up suddenly.

We were breaking our heads as to why the connection was not happening.

Rolled back in time and evaluated the things that we did during the past hours. It was suddenly that we got a brainwave that solved the problem.

The explanation:

It occurred to us that we had just enabled the CDN for the server. You know what the CDN (Cloudflare, Cloudfront etc are CDNs) does. It obfuscates the real IP address of the domain and replaces it with a different IP address.

So, the sftp was trying to connect to one of the CDN's IP addresses, which resulted in the "Connection timed out after 20 seconds of inactivity".

To put it simply, what was happening was that the request to mydomain.com was resolving to the IP address of the CDN.

The Solution:

So, we then created a sub-domain and kept it outside the CDN and used that name instead of the domain name.

Alternately, you can also use the real IP address of your server.

Simple solution, but till you get the hang of it, it is a real blood boiler.

That, in short is how we solved the failed connection attempt "sftp Error Connection timed out after 20 seconds of inactivity" problem. SOLVED.

Maximum allowed value for a string variable content in JavaScript

What is the maximum string content that can fit inside a Javascript variable?

I had this requirement where my Ajax script would return a sizeable amount of data for processing.

It was at this moment that I wondered if the returned value would fit inside a variable. I browsed through some of the available feedback in a Google search.

Most of them opined that there is no limit on the string variable content.

How do we check the maximum value for a string variable?

So, I thought, "let us check it in real time".

As per my test, I found out that a large string with a length of 102400 was initialized without generating any JavaScript error.

I am sure, nobody would require anything more than this inside their JavaScript variable.

Here is my statement:
I tested by initializing a JavaScript variable, in the browser console, with over 100,000 characters without an error.

My test machine was an I7 with 4GB of RAM.

What is Spirituality?

Essentially, Spirituality is the individual's inclination or search to understand the Universal truth.

So, what is the Universal truth?


It is a fact that we are all in this world, to play endless games (re-births! Are they for real? We will discuss this later), to make us ready for the next stage in our evolution.

Over the course of time, we will try to find logical and rational reasons for the meaning of life on Earth.

Spirituality is a subject that we learn, like any other.

And like any subject, the students of spirituality rank from being in the kindergarten to the ones who have achieved the doctorate level.

One tends to understand inherently the ways and means of the cosmic system and consciousness over a period of time.

One trait I have seen in spiritual people is compassion for self and other fellow beings, humans, animals and others; a universal love which encompasses all the living and non living beings.

A spiritual being does not want to disturb nature. He/she enjoys being one with nature; blend in and feel the bliss.

A spiritual being likes to lead the straight path, which is the path towards realising the universal truth.

A spiritual being knows and understands that there are different roads that lead to the destination. He/she is not restricted but open to external thoughts and validations to reinforce their belief.

We have heard, accept and understand that "All roads lead to Rome".

It is believed that we have been using this metaphor since the 12th century, due to the well known fact that the well designed road network of the Roman Empire, spread out like wheel spokes.

A spiritual being need not be religiously inclined though. Because, he/she knows that religion is also one of the paths that lead to the goal.

As we reach farther in the path towards realisation, we find out that all the paths converge and lead to the same goal. When we look back, we find that there are people who follow the different paths, at the start of the journey; this includes those of the non-believers, who fight amongst themselves to establish their path as the only true one.

The methods may be different, but the result is the same.

Solved "XAMPP: Couldn't start MySQL!"


The error XAMPP: Couldn't start MySQL! seems to be an issue related to one or more corrupt log files; system running Red Hat. It was sorted out by the following steps.

Corrupt log file in MySQL


A review of the error log revealed the following 

170308 19:44:18 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ip-192-168-2-1.pid ended
170308 19:48:20 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
170308 19:48:20 [Note] Plugin 'FEDERATED' is disabled.
170308 19:48:20 InnoDB: The InnoDB memory heap is disabled
170308 19:48:20 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
170308 19:48:20 InnoDB: Compressed tables use zlib 1.2.3
170308 19:48:20 InnoDB: Initializing buffer pool, size = 512.0M
170308 19:48:20 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file /opt/lampp/var/mysql/ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 134217728 bytes!
170308 19:48:20 [ERROR] Plugin 'InnoDB' init function returned error.
170308 19:48:20 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170308 19:48:20 [ERROR] Unknown/unsupported storage engine: InnoDB
170308 19:48:20 [ERROR] Aborting

Remove the corrupt log files


Since, the log file is corrupt, we will be removing the log file and try and start the session.

sudo rm /opt/lampp/var/mysql/ib_logfile0
sudo rm /opt/lampp/var/mysql/ib_logfile1

Then, start/restart lampp using 

/opt/lampp/lampp start
[or]
/opt/lampp/lampp restart


MySQL started again!

Debugging jQuery Code for dummies

At least some of us might have learnt jQuery the hard way.

As it has been said for a long time, the best way to understand jquery or any other code is to read through code written by other people. jQuery is unique because it uses html and css flags to make things happen.

Debugging jQuery code is sometimes not easy, even with some experience. This is because, parts of html and JavaScript code are linked together by a id or a class.

Steps to debug jQuery


I will try and explain the steps by way of a html and jQuery code example below.

Find the trigger word


You see, buttons or links are created with id or class and the id and class names are then used to trigger activity.

In one part of the code, there will be something like




There are events that trigger an action. The event may be on an input field, a list box a submit button or something else; and the event may be a change in the field, a click on a field, a mouse over action, a mouse out action and other such events.


Locate the trigger word in the JavaScript/jQuery code


Elsewhere in the code, there will be something like 
$('body').on('click','.saverecord',function(){ some code here }
$('body').on('click','.editrecord',function(){ some code here }

If you analyze the above code, you will see that the trigger is a click on the class called save, which executes an anonymous function that is embedded within braces.

So, a search for the keyword "saverecord" in the code will help you locate the flow of the program.

If you do not know how a jQuery code is organized, here is a short primer which tells you the framework of a jQuery code.

The Secret to a Better Life

Is there any one thing, which if we do, we will have a better future?

I would say "Yes, there is".

BE STILL! Do nothing!

Essentially, we are all spiritual beings, who are here for a reason. We are given a chance to live life in a manner that benefits us and others.

As we see, each one of us experiences life differently, based on our past experiences, our past acts done out of anger, humility, love, greed and so on.

But, because of our limited knowledge of the universe and its workings, we are happy during good times and during bad times complain that God is being cruel to us for no fault of ours.

What we fail to realize is that whatever experiences that we are going through in our life, it is all the result of an accumulation of past activities; ours, our ancestors and our society. It has been called many names from ancient times, but for the sake of better understanding, we will call it Causal action.


The Buddha Story


You must have heard about this story about the Buddha. He used to go about the village everyday, seeking food from the residents. People used to give him food, while some desisted. But, there was one household, where the master of the house scolded him for begging for alms when he was hale and healthy. Why can't you go and do work? He rained the choicest abuses upon him. All the while, the Buddha maintained his silence. And, when the abuses stopped, he went on to the next household.

The next day, he went to the same households again and in this particular house, the master got even more angry and hurled more abuses seeing the Buddha again.

This happened every day for the next few days. The abuses became feebler as the days passed by, until one day, when this person asked the Buddha, "When I abuse you, you are not responding and talking back and not even trying to offer an answer. Are you not angry?". The answer the Buddha gave was "When you offer me something, it becomes mine, only when I take it from you. I have not accepted any of the abuses that you offered me during the past few days. They remain with you."

This is a profound incident, which should offer us some understanding of how the Universe works and how enlightened souls respond to stimuli.


The Secret of Life


There is another aspect to this which I would add here. The Buddha was shouted at by the householder, because of his past actions. At the time, the Buddha did the right thing of not responding to the householder, because that would mean that he is creating another "causal action", which would result in further responses on his life.

We are just looking at one single incident here. There may be umpteen such incidents that will happen in our entire life. When we stop reacting aggressively to all that is happening that is causing us distress in our life, we reduce the "accumulated causal action" from our debt and hence our later life would be better than it is right now.

So, there you are, with the most important secret to our life;

In short, BE STILL! DO NOT REACT AND TAKE LIFE AS IT COMES!

No, this does not mean that we do nothing. What it means is that we do all the things that we do everyday, while refraining from doing things that adversely affect others, while at the same time, not reacting to bad things that happen to us.

What has to happen, happens, will happen. We would do well not to turn the tiles again, to make it happen, again!!!

Here is a tidbit to go.

Our actions result in positive or negative impact on other beings around us. These will be recorded for and against us for the future. It is also called the spiritual bank balance, as opposed to our material bank balance. The material bank balance, we cannot carry forward to the next life. But, the spiritual bank balance, we can.

As an example, if you have made a billion in cash in your lifetime, donate half of it in the benefit of the society and nature. You would have then saved by instant transfer, for your next life.

Good luck to you all!

Btw, What is Luck anyway? Let us discuss that elsewhere.

Why is there so much suffering in the world


If God is real then why is there so much suffering?
How can there be a God who can allow all this atrocities to happen?

These are the kind of questions that arise in most minds, whether they follow any of the world's religions such as Christianity, Buddhism, Islam or other religions or atheism or neutral in their belief.

The philosophical answer to this is that it is the destructive actions of humans that caused it. Then, the reactions of humans to the ills happening to them perpetuates it.


The top executive is concerned with macro issues


The logical answer to this is that assuming there is a God, He is not coming down to help you out of a fix, in the same manner that President Obama or whoever is your head of state, is not going to come down to you and help you out of a fix.

The top person never addresses micro level problems; their focus is at the macro level.


We are responsible for our actions, nobody else


Next, whatever problems that we are in, are the result of our past actions. This is explained by the fact that we studied well in school, or excelled in a sport and are well placed in our life today. On the other hand, another set of students, wasted their time, watching movies, getting into bad habits and now are in a precarious position in their life. 

How is it that we can blame God for our actions? We get an interest from a bank only when we deposit money in the bank. We have to pay interest if we have taken a loan.


It is called Karma

Newton said, for every action, there is an equal and opposite reaction.

The same rule works for every action of ours, good or bad. Only that the results are manifold, not just in the ration of 1:1

For every good deed that you do, the benefits come to you many times over. Similarly, for all the bad deeds we have done, the punishments are going to be manifold too.


Why is the person doing bad deeds living a grand life?

The most repeated question against the existence of God is "If there is a God, then why are bad people not punished?". How do we know they are not punished? The fact remains that we are viewing life from a small key hole. We do not get the whole picture.

Let us again take the example of the bank deposit here. The deposit that we put in a bank accrues interest only after a specific time. 

All the bad deeds that we do are like an overdraft from a bank, you are allowed to draw so long as your deposits allow. And whatever you draw, you have to pay back.

Similarly, all the bad deeds that we do will begin to hurt us only after our deposit has become negative.

Man is now a symbol of destruction.

Man has forgot to live in harmony with the nature.

Man has forgot to live in tune with the system.

Man has become greedier in search of material possessions...

Once we stop or fail to reflect on our actions, suffering is invariably the end result.



Bluetooth on off Switch missing in Windows 10

  Sometimes, what happens is that you are unable to switch the Bluetooth in your PC or laptop. Even if you are a professional, it gets you f...

Most Popular

Copyrighted.com Registered & Protected DWYE-NHTO-NBNH-7FFM