1. To determine whether the rebuttal is necessary. If the scores are too low, just give up.

  2. Summarize the questions from reviewers and rank them based on the importance.

  3. Pick out the questions which call for experiments and conduct those experiments immediately.

  4. When running experiments, draft the response file. Pay attention to the format of response file (e.g., limited characters or one page of pdf, URL allowed or not).

  5. In the response file, try to cover all the questions if possible. Otherwise, igore the questions with least importance.

  6. The tone of response file cannot be rude and offensive. Be cool and confident.

  7. If the maximum number of characters is quite limited, there are many tricks to save space.

raw: dpkg

1
2
3
4
5
6
dpkg -i xxx.deb
dpkg -r xxx.deb
dpkg --purge xxx.deb
dpkg -L xxx.deb
dpkg --info xxx.deb
dpkg -reconfigure xxx

dkpg is raw method to install without solving dependencies and existing software.

mature: apt-get

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
apt-get install softname1 softname2 softname3……
apt-get remove softname1 softname2 softname3……
apt-get remove --purge softname1
apt-get autoremove
apt-get clean //clean /var/cache/apt/archives
apt-get autoclean //clean the out-of-date files in /var/cache/apt/archives

apt-get update //update software information and database command
apt-get upgrade //update the system

apt-cache search rough_name
apt-cache show exact_name

pkg-config --libs opencv
pkg-config --cflags opencv
pkg-config --modversion opencv

apt-get is built on dkpg without saving the deb file. apt-get can solve dependencies and existing software. Note that when using dkpg, dkpg can circumvent apt-get, so apt-get don’t know the software installed by dkpg.

more mature: aptitude (GUI)

1
2
aptitude install softname1
aptitude remove softname1

aptitude is also built on dkpg and more powerful than apt-get.

#!/bin/bash at the head of file indicates shell type

  1. strict format

    For if [[ $input == "hello" ]], note that the space after [[ and before ]] is very strict, since [[]] can be used for matching regular expression

  2. arguments

    • $@: stores all the arguments in a list of string
    • $*: stores all the arguments as a single string
    • $#: stores the number of arguments
    • shift: remove the first argument

When starting login or interative shells, certain files will be executed based on the following tables:

For bash:
login-y interactive-y: profile
login-y interactive-n: profile
login-n interactive-y: bashrc

For zsh:
login-y interactive-y: zshenv zprofile zshrc zlogin
login-y interactive-n: zshenv zprofile zlogin
login-n interactive-y: zshenv zshrc
login-n interactive-n: zshenv

Mount remote folder on Windows/Linux:

1
2
sudo apt-get install cifs-utils
sudo mount -t cifs -o username=XXX,password=XXX //10.70.1.82/src_dir tgt_dir

Mount sharefolder between host machine and virtualbox:

1
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) share_name tgt_dir

You may fail to log in Ubuntu due to the following reasons:

  1. /etc/environment or /etc/profile is modified to a wrong format: Just modify them back.

  2. startX is used improperly: run sudo rm -r .Xauthority*

Tips: use Ctr+Alt+F1~6 corresponding to tty 1~6 to use command line

  1. $sudo gedit /etc/default/locale

  2. modify as follows,

    1
    2
    LANG="en_US.UTF-8"
    LANGUAGE="en_US:en"
  3. $locale-gen -en_US:en

  4. log out or reboot

For user-wide: ~/.profile or ~/.bashrc
For system-wide: /etc/profile

source ~/.bashrc or source /etc/profile can make the newly added (not the removed) environment variables for the current cmd window available immediately. However, you need to re-login to make them user-wide or system-wide.

Note that after you sudo su (not using sudo privilege), the environment variables will be lost. You need to re-login. Because sudo su will erase newly exported variables.

For permanent system-wide change even after sudo su, you should modify /etc/environment, which is not recommended. Because /etc/environment cannot recognize intermediate variable such as $JAVA_HOME. Sometimes misusing /etc/environment may result in your failure in login.

Not recommend running sudo su and then modifying ~/.profile or ~/.bashrc.

  • crontab -l //list crontab

  • crontab -r //remove crontab

  • crontab -e //edit crontab

    • minute hour day-of-month month day-of-week cmd
    • each term can be a single number, e.g., 3, or a range, e.g., 3-6, or a set, e.g., 3,5,7, or interval, e.g., */10
    • for example, “ /10 * sh ~/cmd.sh” means executing cmd.sh every 10 minutes.

In windows, the function of contrab can be realized by using “task scheduler”.

Here is a website link to query linux commands.


  1. create new user with home folder

    1
    adduser XXX
  2. sudo privilege: vim /etc/sudoers and add $username ALL=(ALL) ALL at the bottom.

  3. start ssh on the server, the default port is 22

    1
    2
    sudo apt-get install openssh-server
    sudo/etc/init.d/ssh start
  4. list

    1
    2
    3
    list -a #including hidden files
    list -S #arrange by size
    list -t #arrange by time
  5. view text

    1
    2
    3
    cat
    head/tail -n 10 tmp.txt #view the first/last 10 lines
    less #more powerful than more
  6. Change the privilege

    1
    2
    chmod 777 ./
    chmod a+x ./
  7. Check disk or file size

    1
    2
    df -h 
    du ./ --max-depth 2 -h
  8. Compress or uncompress files, refer to this link.

  9. Grep + regular expression

    1
    grep [xyz]
  10. Search file

    1
    2
    3
    4
    5
    locate "keyword" #fast
    find ./ -maxdepth 1 -name "*keyword*"
    find ./ -name "*keyword*" -size +50M -size -100M
    find ./ -name "*keyword*" -mmin -10 #m:modify min:minute
    find ./ -name "*keyword*" -exec rm -r {} \;
  11. Pipe commands

    1
    2
    3
    ls -l | tr -s ' ' | cut -d ' ' -f 2 #tr to truncate space
    ls -l | sort -rnk2 #-r:reverse -n:numerical -k:k-th column
    ls -l | wc -l #count line
  12. xargs:

    1
    2
    3
    cat python/requirements.txt | xargs -L 1 sudo pip install
    find . -name "*.c" | xargs rm -rf
    find . -name '*.c' | xargs grep 'stdlib.h'
  13. alias: temporary alias command

    1
    2
    alias lnew="cd /home/niuli/caffe"
    unalias lnew
  14. export: The export command is one of the bash shell built-in commands, which means it is part of your shell.

    1
    2
    3
    4
    5
    6
    export a=linux.com
    echo $a
    export -n a #remove variable

    printname () { echo "Linuxcareer.com"; }
    export -f printname #export function

    add LD_LIBRARY_PATH

    1
    2
    echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib' >> ~/.bashrc
    source ~/.bashrc
  15. shellscript sample

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    #!/bin/bash
    read -p "Please input your first name: "
    echo -e "\nYour full name is: $firstname $lastname"
    test ! -e $filename && echo "The filename '$filename' DO NOT exist" && exit 0
    test -f $filename && filetype="regulare file"
    test -d $filename && filetype="directory"
    [ "$yn" == "Y" -o "$yn" == "y" ] && echo "OK, continue" && exit 0

    if [ "$yn" == "Y" ] || [ "$yn" == "y" ]; then
    echo "OK, continue"
    elif [ "$yn" == "N" ] || [ "$yn" == "n" ]; then
    echo "Oh, interrupt!"
    else
    echo "I don't know what your choice is"
    fi

    while [ "$yn" != "yes" -a "$yn" != "YES" ]
    do
    read -p "Please input yes/YES to stop this program: " yn
    done

    for animal in dog cat elephant
    do
    echo "There are ${animal}s.... "
    done
0%