conda

  1. If you’d prefer that conda’s base environment not be activated on startup, set the auto_activate_base parameter to false:
    1
    
    conda config --set auto_activate_base false
    

jupyter

  1. This will show you the URLs of running servers with their tokens, which you can copy and paste into your browser.

    1
    
    jupyter notebook list
    
  2. jupyter server password

  3. docker + tensorflow-gpu + jupyterlab

    1. docker run -d –gpus all -p 8888:8888 -p 6006-6009:6006-6009 –restart=always –name=tensorflow -v /home/fang:/tf/fang tensorflow/tensorflow:latest-gpu-jupyter
    2. docker exec -it tensorflow pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    3. docker exec -it tensorflow pip install jupyterlab
    4. docker exec -it tensorflow jupyter server password
    5. cd /var/lib/docker/containers/your container id
    6. docker stop tensorflow && sed -i ‘s/jupyter notebook/jupyter lab/g’ config.v2.json
    7. sudo systemctl restart docker
  4. notebook config

    1. c.ServerApp.token = ‘xfangfang’

    2. c.ServerApp.quit_button = False

    3. 1
      
      c.ServerApp.terminado_settings = {'shell_command': ['/bin/bash']}
      

docker

  1. docker run –rm –gpus all nvidia/cuda:11.0-base nvidia-smi

  2. 1
    
    docker run -d --gpus all -p 8888:8888 --restart=always --name=tensorflow -v /home/fang:/tf/fang tensorflow/tensorflow:latest-gpu-jupyter
    
  3. docker exec -it tensorflow python - c “import requests; requests.get(‘http://baidu.com’)”

  4. 1
    
    docker commit tensorflow xfangfang/tensorflow-gpu-jupyter:v0.1
    

shell

  1. Shows CPU freq

    1
    2
    3
    
    watch -n 0 "cat /proc/cpuinfo | grep -i mhz"
    # or
    cpupower -c all frequency-info
    
  2. 设置所有CPU为性能模式:

    1
    
    cpupower -c all frequency-set -g performance
    
  3. 设置所有CPU为节能模式:

    1
    
    cpupower -c all frequency-set -g powersave
    
  4. nvme smart-log /dev/nvme0

  5. cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

node

apt install npm

npm config set registry http://registry.npm.taobao.org/

npm install n -g

n lts