Configuration Cheatsheet

  • Docker
    • Nvidia Image: TensorRT, PyTorch
      • docker pull nvcr.io/nvidia/tensorrt:20.03-py3
      • docker pull nvcr.io/nvidia/pytorch:20.03-py3
    • Commands:
      • remove image: docker rmi $name
      • prune: docker system prune
    • Permission Error:
      • fixing by sudo chmod 666 /var/run/docker.sock
    • No enough space:
      • moving to a different disk by
        sudo cp -r /var/lib/docker $TARGET_PATH
        echo '{
        "graph": "$TARGET_PATH"
        }' | sudo tee -a /etc/docker/daemon.json
        sudo systemctl daemon-reload
        sudo systemctl restart docker
        sudo chmod 666 /var/run/docker.sock
        
  • Jupyter
  • Windows
    • Terminal: Termius (education account w. github student)
    • Windows Subsystem for Linux:
      • install:
        • run: Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform in powershell w. admin
        • run: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux in powershell w. admin
        • get Ubuntu from microsoft store & RUN the app (Ubuntu refers to the recommended version, should be 20.04)
        • run: wsl --set-default-version 2
        • Now, the ubuntu’s bash.exe is available:
          • windows file system is mounted at /mnt/
      • anyconnect not working in WSL:
        • use anyconnect within the windows store. reference
    • Windows Terminal:
      • Configuration is saved at here
    • Multi-Monitor:
      • Enable multi task bar (search taskbar)
      • Make the larger one major monitor and neven group icons (search display)
      • Only show the icon of searching (right click at taskbar->search)
      • Hide cortana and task buttons by right click at taskbar.
    • Win-PE creator:
  • Sublime:
    • install package control w install package control;
    • theme: default (or ayu)
    • sftp: for windows: convert ssh to ppk with puttygen in https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.
      • setting: "ssh_key_file": "C:/Users/Liyuan Liu - LL/.ssh/id_rsa.ppk"
    • remote editing alternative: https://github.com/textmate/rmate
    • sidebarenhancement
  • Tmux
    • oh my tmux
    • tmux 1.8 config:
      • https://github.com/mandre/dotfiles/blob/master/.tmux-1.8.conf
    • save and restore tmux section:
    • save pane content by commands
      • command to use in tmux: tmux capture-pane -pS -1000000 > file.out
  • bash commands
    • generate
      • basic: ssh-keygen
      • advanced: ssh-keygen -t idrsa -b 4096 -C "llychinalz@gmail.com"
    • authorize server login w. ssh
      • recommended:ssh-copy-id -i idrsa $remote_username@$server_ip_address -p $port
    • add ssh key:
      eval `ssh-agent`
      ssh-add idrsa
      
  • linux
    • check linux version: uname -m && cat /etc/*release
    • check cuda version:cat /usr/local/cuda/version.txt
    • output gpu utils to one line:nvidia-smi --query-gpu=memory.used --format=csv,noheader | xargs | sed -e 's/ /,/g'
    • reboot to bios: sudo systemctl reboot --firmware-setup
    • autojump install
      sudo apt-get install autojump
      echo ". /usr/share/autojump/autojump.sh" | tee -a ~/.zshrc
      
    • zsh
      • oh-my-zsh sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
      • zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
      • zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
      • plug-in permissions compaudit | xargs chmod g-w,o-w
      • on WSL, the git plut-in may be too slow, turn off by git config --global oh-my-zsh.hide-status 1
    • driver
  • NAS
  • Nvidia Geforce GPU
  • PyTorch
    • solution for Error: mkl-service + Intel(R) MKL: MKL_THREADING_LAYER=INTEL...:
      • python: os.environ['MKL_THREADING_LAYER'] = 'GNU'
      • command: MKL_THREADING_LAYER=GNU python my_script.py
      • env: export MKL_THREADING_LAYER=GNU
    • distributed data parallel halts without error message:
      • env: export NCCL_P2P_DISABLE=1
  • RStudio
    • docker run -d --name rstudio -v $HOME:/home/rstudio -e PASSWORD=$PASSWORD -p 8787:8787 rocker/tidyverse
  • Markdown editor
    • Joplin + Typora
  • Printer
    • docker repo source
    • stop cups service for DSM
      synoservice --hard-disable cupsd
      synoservice --hard-disable cups-lpd
      synoservicectl --stop cupsd
      synoservicectl --stop cups-lpd
      synoservicecfg --hard-disable cupsd
      synoservicecfg --hard-disable cups-lpd
      
    • command to start:
      docker run -d --name="airprint" --net="host" --privileged="true" \
          -e "CUPS_USER_ADMIN"=$USER -e "CUPS_USER_PASSWORD"=$PASS \
          -v $PATH_TO_AIRPRINT_CONFIG:/config \
          -v /dev/bus/usb:/dev/bus/usb \
          yaurora/cups-google-airprint
      
    • Login and install Canon DFRII driver:
      docker exec -it airprint /bin/bash
      wget http://gdlp01.c-wss.com/gds/6/0100009236/06/linux-UFRII-drv-v510-usen-09.tar.gz
      tar -xzf linux-UFRII-drv-v510-usen-09.tar.gz
      cd linux-UFRII-drv-v510-usen
      ./install.sh
      
    • Network address for windows:
      http://$IP/printers/Canon_D530_D560
      
Avatar
Liyuan Liu
Senior Researcher @ MSR

Understand the underlying mechanism of pretraining heuristics.

Related