Quick reset to my compute pod.


Jump to it:


Essential:

# manual / pip
$ unminimize
$ apt install python3-pip

# required for `pyenv`
$ apt install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl

# required for `lm-eval` (there
$ apt install lzma liblzma-dev libbz2-dev   

# needed to transfer files between diff. hosts
$ apt install rsync

$ apt update && apt upgrade -y

#not needed anymore, I guess? Cuz I am using pyenv for everything?
#apt-get install software-properties-common
#add-apt-repository ppa:deadsnakes/ppa

Pyenv:

export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv install 3.12  #to install
pyenv versions      #to list all available versions
pyenv global 3.12   #to use v 3.12 

git:

Update Configs:

git config --global user.name  eigenAyoub
git config --global user.email benayad7@outlook.com

SSH

  1. Generate key:
    • ssh-keygen -t ed25519 -C "benaya7@outlook.com"
  2. Start ssh-agent, then add private key to it:
    • eval "$(ssh-agent -s) (this starts the agent)
    • ssh-add ~/.ssh/id_ed25519
  3. Add public key to your remote git server.
    • cat ~/.ssh/id_ed25519.pub
    • Paste it in github/gitlab.

Set up multiple remotes

TODO


Python, copy pasta please.

# numpy is king,  always first and alone.
$ pip install numpy 
$ pip install matplotlib
$ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
$ pip install ipython
$ pip install einops # cuz you need it to learn it!
$ pip install transformers datasets  tiktoken  wandb tqdm 
# no sklearn? you zoomer.

.dotfiles:

(would you please update this frequently?)

VIM

set wrap
set number relativenumber

set mouse=a
set so=15
set ai
set si

set tabstop=4
set shiftwidth=4
set smarttab

autocmd FileType markdown setlocal spell

tmux

First git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm, then reload / source.

################################# Basics
set -g mouse on

# main key
unbind C-b
set-option -g prefix C-Space
bind-key C-Space send-prefix

# Get the colors work
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"


#shift alt, switch between keys
bind -n M-H previous-window
bind -n M-L next-window

################################## Copy Pasta
set -s set-clipboard on


# Use vim keybindings in copy mode
setw -g mode-keys vi
unbind -T copy-mode-vi MouseDragEnd1Pane

# Clear selection on single click
bind -T copy-mode-vi MouseDown1Pane send-keys -X clear-selection \; select-pane

bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel

# you know exactly what this is about.
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

################################## Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'

run '~/.tmux/plugins/tpm/tpm'

VS Code:

Add a detailed description here on how to use remote hosts over VS Code. //TODO

{
    "security.workspace.trust.untrustedFiles": "open",
    "window.zoomLevel": 1,
    "vim.insertModeKeyBindingsNonRecursive": [
        {
            "before": ["<ESC>"],
            "after": ["<ESC>"],
            "commands": [
                "workbench.action.files.save"
            ]
        }

    ],
    "keyboard.dispatch": "keyCode",
    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": ["Z", "Z"],
            "commands": [":w"]
        },
        {
            "before": ["g", "p", "d"],
            "commands": ["editor.action.peekDefinition"]
        }
    ],
    "vim.smartRelativeLine": true,
    "editor.cursorSurroundingLines": 8,
    "vim.useSystemClipboard": true,
    "glassit.alpha": 220,
    "editor.minimap.enabled": false,
}

Problems and Fixes:

Local to Remote: rsync [OPTION]... -e ssh [SRC]... [USER@]HOST:DEST

Remote to Local: rsync [OPTION]... -e ssh [USER@]HOST:SRC... [DEST]

Comments from https://discuss.pytorch.org/t/how-can-we-release-gpu-memory-cache/14530/3


What is the difference?