There is a timezone configuration on PostgreSQL server. If you want to change the default globally, you can edit the postgresql.conf. On Ubuntu, it is located at
It’s quite common to check the available versions of a Python package before installing it. The yolk3k package is a very convenient command line tool for querying PyPI and Python packages. yolk3k is a fork of the original yolk and it adds Python 3 support while maintaining Python 2 support.
I was working on a Meteor project which is connected to a mongoDB hosted on MongoLab. Since it is a sandbox plan, the oplog of the mongoDB instance is not available and in that case the Meteor will keep polling the mongoDB in around every 10 seconds. This causes a very high consumption on CPU and network bandwidth.
If you are running, Meteor 0.7.0 or above and your mongoDB has oplog enabled. You won’t experienced the problem.
Since the oplog is not available so the only workaround which i could think of is to unsubscribe the dataset. Here is a main.js which is executed when the app is loaded and when the user is idle for than 3 mins. Stop the subscription and that will stop polling the mongoDB. Continue reading Meteor – High Network IO as it keeps polling MongoDB→
Update @ 2016-05-21: Please consider using the idleCat plugin instead of this brute force checking approach. Thanks for the suggestion from Smuuf. =D
–
Nowadays, websites are becoming more advanced with many different features. Sometimes it would be beneficial if we could switch off them on the client browser when the user is idle for a period of time in order to reduce the web server loading.
Here is a Javascript example which would pop up an alert box if the mouse doesn’t move for 3 mins.
$(document).ready(function () {
// Set timer to check if user is idle
var idleTimer;
$(this).mousemove(function(e){
// clear prior timeout, if any
window.clearTimeout(idleTimer);
// create new timeout (3 mins)
idleTimer = window.setTimeout(isIdle, 180000);
});
function isIdle() {
alert("3 mins have passed without moving the mouse.");
}
});