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

Tuesday, November 17, 2015

install linux


  1. 分区:主(一般最多四个)、延伸、逻辑
  2. /boot 必须在最前面
  3. 不同分区的大小,以及如何分区,依据系统的功能制定
  4. 一般需要etx4, swap类型的分区,当然也可以添加

file system


  1. find file system type : df -T
  2. linux & windows both support : vfat file system 

Saturday, November 14, 2015

Python Plan


  1. develop some small projects
  2. develop games 2D
  3. develop games 3D
  4. develop games interesting (how to create a game structure)

Friday, November 13, 2015

Linux study plan

basic stage (精通使用、内核基本了解):

  1. 鸟哥的书,共两册。 使用、了解linux,打好基础!
  2. UCore. 初步了解linux系统的程序开发过程以及开发工具的使用,以及较好的了解UCore系统
  3. 其他的比较好的介绍linux的书

master stage (内核深入了解、精通开发):

  1. 更多的通过实践来了解

Wednesday, November 11, 2015

Windows visual studio 2013 install MS_MPI and run mpi program


  1. install MSMPI : msmpi.  We need install both msmpisdk.msi (to get include\ & lib\) and MSMpiSetup.exe (to get bin\mpiexec.exe) 
  2. set environment variables : 
    • MSMPI_BIN=C:\Program Files\Microsoft MPI\Bin\
    • MSMPI_INC=C:\Program Files (x86)\Microsoft SDKs\MPI\Include\
    • MSMPI_LIB32=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x86\
    • MSMPI_LIB64=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64\
  3. create a new C++ empty project :
  4. change linker's system configuration to CONSOLE(SUBSYSTEM:CONSOLE)
  5. add linker additional lib directories (x86 or x64) this machine is x86:
  6. add linker input additional dependencies , Type msmpi.lib to the list 
  7. add location of mpi header file 
  8.  Add a C++ file to write your first MPI program and write the following codes as a test: 
    #include<iostream>
    #include<mpi.h>
    using namespace std;
    
    int main(int argc, char** argv){
    
        int mynode, totalnodes;
    
        MPI_Init(&argc, &argv); 
        MPI_Comm_size(MPI_COMM_WORLD, &totalnodes);
        MPI_Comm_rank(MPI_COMM_WORLD, &mynode);
        
        cout << "Hello world from process " << mynode;
        cout << " of " << totalnodes << endl;
    
        MPI_Finalize();
        return 0;
    }
  9. build the program and if there is no error , then test it by running mpiexec:                        "mpiexec -n 4 mpi_hello.exe"
  10. use msmpi ; use msmpi 2 : 主要参考