Skip to content

Instantly share code, notes, and snippets.

@thibaut-d
Last active January 5, 2022 16:05
Show Gist options
  • Save thibaut-d/55052d4d9261cc062cb0164810e92b71 to your computer and use it in GitHub Desktop.
Save thibaut-d/55052d4d9261cc062cb0164810e92b71 to your computer and use it in GitHub Desktop.
Memo

Memo

Download a directory with scp

scp -r thibaut@172.29.4.12:/home/thibaut/project backups/project

Run in background

nohup python myscript.py &

sudo apt-get update
sudo apt-get install screen
screen python myscript.py
ctrl+a then ctrl+d to detach

Git

revert last commit

git reset --soft HEAD~1

Resources management

monitor GPU usage

nvidia-smi    

monitor CPU and RAM usage

htop

check why a process has been killed

sudo dmesg

conda

Add conda to path

export PATH="/home/thibaut/anaconda3/bin:$PATH"
conda init

SSH

Generate a key

 ssh-keygen -t rsa -b 4096 -N '' -C "me@gmail.com" -f ~/.ssh/id_rsa

Correct SSH key permissions

chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 644 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment