Posts

Showing posts from September, 2018

Setting up page title on meteor project

In config.js file(Placed inside lib folder), place this,setTitle function. this.setTitle = function(title) {   var base;   base = ': Biomeds';   window.scrollTo(0,0);   if (title) {     return document.title = title + ' | ' + base;   } else {     return base;   } }; Now in a normal route definition add this section onAfterAction: function() {       return setTitle('Login');     } eg: Router.route('/', { // layoutTemplate: 'left_panel', path: '/', onBeforeAction: function() { this.render("login"); }, onAfterAction: function() {       return setTitle('Login');     } });

start, stop and restart Nginx (with proper installation guide for Nginx server)

Image
Step 1: Install Nginx Nginx is available in Ubuntu's default repositories, so the installation is rather straight forward. Since this is our first interaction with the  apt  packaging system in this session, we will update our local package index so that we have access to the most recent package listings. Afterwards, we can install  nginx : sudo apt-get update sudo apt-get install nginx After accepting the procedure,  apt-get  will install Nginx and any required dependencies to your server. Step 2: Adjust the Firewall Before we can test Nginx, we need to reconfigure our firewall software to allow access to the service. Nginx registers itself as a service with  ufw , our firewall, upon installation. This makes it rather easy to allow Nginx access. We can list the applications configurations that  ufw  knows how to work with by typing: sudo ufw app list You should get a listing of the application profiles: Output Available applications: Nginx Full Ng

Change Date.now() to readable date format (eg: sep 8,2018 or 2 hrs ago)

Change Date.now() to readable date format (eg: sep 8,2018) var dateInDateNowFormat = date.now(); moment(dateInDateNowFormat).format('MMM DD, YYYY'); Change date To sec , Minutes, hrs , weeks and months. eg(3 min ago, 2 weeks ago)     calculate_time_difference(a){     var dt = new Date(a);    var millis =    new Date().getTime() - dt.getTime() ;       var minutes = Math.floor(millis / 60000);   var seconds = ((millis % 60000) / 1000).toFixed(0);    var hours = (millis / (1000 * 60 * 60)).toFixed(1);  var days = (millis / (1000 * 60 * 60 * 24)).toFixed(1);    if(minutes<1 && seconds<10){     return 'now';   }else if(minutes <1 && seconds<59 ){     return seconds + 's';    } else if(minutes>= 1 && minutes<=59) {     return minutes + 'm';   }else if(minutes>=60 && hours<24){         if(Math.floor(hours)==1 || minutes==60){         return Math.floor(hours) + 'h';

Keep Server running even after closing the SSH login window in digital ocean.

Keep Server running even after closing the SSH login window in digital ocean. Run server on one window and open a new window to run screen simultaneously. sudo apt-get install screen Once it is installed type 'screen' to start screen. screen Hit enter, and you’ll be at a normal prompt. To disconnect (but leave the session running) Hit Ctrl + A and then Ctrl + D in immediate succession. You will see the message [detached] Now you can close the server window and check the ip, to see if its still running. Some extra commands To reconnect to an already running session screen -r To reconnect to an existing session, or create a new one if none exists screen -D -r To create a new window inside of a running screen session Hit Ctrl + A and then C in immediate succession. You will see a new prompt. To switch from one screen window to another Hit Ctrl + A and then Ctrl + A in immediate succession. To list open screen windows Hit Ctrl + A and then W

Lists of commands and remove services in orthanc services - Ubuntu 16 using terminal

listing and killing running services. to list all running services at same pot using terminal netstat -tulpn | grep 80 sudo netstat -nl -p tcp  | head to Kill a service sudo kill -16601   //port number killall mongod  //kill mongod or mongo nginx -s stop   //stop nginx services and free port