Saturday, June 25, 2016

Install R-base 3.1.1 on Ubuntu 14.04

sudo add-apt-repository ppa:marutter/rrutter

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install r-base r-base-dev

set static ip ubuntu

1. Set IP changes in "/etc/network/interfaces"
auto eth0
iface eth0 inet static

address 136.187.xx.xx
netmask 255.255.248.0
gateway 136.187.80.1

2. Don't give your DNS configurations in /etc/resolv.conf because while we restart the server sometimes the configuration get erased.
 So use vim /etc/resolvconf/resolv.conf.d/base (while updating configs in this it doesn't get removed).

search  (domain name)
nameserver 8.8.8.8
nameserver 8.8.4.4

How to create a bootable USB stick on OS X

From Ask Ubuntu

isntall R and other packages

install.packages('ggplot2', dependencies=T)
using above can install ggplot2 package. 

Sunday, June 19, 2016

Wednesday, March 9, 2016

Flask, how to send email. Configuration

   Using gmail as flask's sendmail server

1, First configure flask as below:     

        MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USERNAME = 'email@gmail.com'
MAIL_PASSWORD = 'password'
MAIL_USE_TLS = True
MAIL_USE_SSL = False

2, Change your google account settings: 

Google blocks sign-in attempts from apps which do not use modern security standards(mentioned on their support page). You can however, turn on/off this safety feature by going into the link below:

Go to this link and select turn on :



Saturday, February 13, 2016

file size


  1. individual file size : ls -lh file
  2. free and used place on the disk : df  -h
  3. total folder size : du -hs

DNS configure


  1. all mappings are in hosts: /etc/hosts
  2. google public dns
  3. clients need to be able to connect to local nameserver

Thursday, February 11, 2016

using sublime text2 as latex editor on ubuntu


  1. install sublime text2 
  2. install package control via sublime console (ctrl + `)
    • import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
  3. install latextools : 
    • CTRL + SHIFT + P
    • install package ..
    • install latextools ...
  4. install tex : sudo apt-get install texlive latexmk

vim configure

  3 set nu
  4 set autoindent
  5 set ruler
  6 syntax on
  7 set nocompatible
  8 filetype indent plugin on
  9 set hlsearch
 10 set softtabstop=4
 11 set shiftwidth=4
 12 set expandtab
 13 set autoindent
 14 set ruler

Tuesday, February 9, 2016

档案权限与管理

install and configure ns3 on ubuntu


  1. wiki: install ns3
    • download ns3 tar
    • install pre requirements: sudo apt-get install
      gcc g++ python python-dev qt4-dev-tools libqt4-dev mercurial bzr cmake libc6-dev 
      libc6-dev-i386 g++-multilib gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison 
      libfl-dev tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 
      libgtk2.0-dev vtun lxc uncrustify doxygen graphviz imagemagick texlive 
      texlive-extra-utils texlive-latex-extra texlive-font-utils dvipng python-sphinx dia 
      python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev libboost-signals-dev 
      libboost-filesystem-dev openmpi-bin openmpi-common openmpi-doc libopenmpi-dev

install ubuntu using virtualbox in mac

  1. install virtualbox on mac 
  2. download ubuntu iso 
  3. install ubuntu on virtualbox
  4. make ubuntu window full screen : 
    • start ubuntu
    • Home+F make the virtualbox full screen
    • find devices menu on the left top, and then choose "install guest addition"
  5. finish.

Full Screen:
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install dkms
  • sudo apt-get install build-essential
  • install guest additioin on the devices menu