File size: 2,524 Bytes
80f2dbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
tar -xvC mydirectory/ -f myarchive.tgz 
ls *.gz |xargs -n1 tar -xvC /home/daporte/PycharmProjects/4d-graphs/models -f

untar mutliple files into separate dirs:
for file in *results.tar.gz;
 do mkdir -p "/home/daporte/PycharmProjects/4d-graphs/results/trial_${file%.tar.gz*}";
 tar -xf $file -C "/home/daporte/PycharmProjects/4d-graphs/results/trial_${file%.tar.gz*}";
 done


unzip:
unzip '*.zip'
tar -xf archive.tar.bz2


list ssh keys:
ls -al ~/.ssh




To quickly kill all the stopped jobs under the bash, enter:
kill -9 `jobs -ps`


ssh setup key:
ssh-keygen 
ssh-add
eval `ssh-agent -s` / Could not open a connection to your authentication agent.



SSH jupyer notebooks:
Essentially you just run the notebook on the remote in no browser mode.
jupyter notebook --no-browser --port=8080
Then setup up an ssh tunnel from the local machine:
ssh -L 8080:localhost:8080 <REMOTE_USER>@<REMOTE_HOST>


Sizes of files:
du -sh ./*| sort -h
du -ah .| sort -h


copy and rename multiple files:
pax -rw -pe -s/2015/2016/ source/ target/

copy file to/from server:
scp /file/to/send username@remote:/where/to/put
scp username@remote:/file/to/send /where/to/put


find string in folders:
grep -r "register_long_arrays" *


find file in folder:
find /search/directory/ -name "matching file search criteria"

Linux version:
hostnamectl


Conda:

    conda config --add channels conda-forge 
    conda config --set channel_priority strict 

    conda install --file requirements.txt

    Install env in a specific dir:
    conda create --prefix speech_gen --file ~/speech_generation/requirements.txt

    install miniconda:

    mkdir -p ~/miniconda3
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
    bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
    rm -rf ~/miniconda3/miniconda.sh
    ~/miniconda3/bin/conda init bash
    ~/miniconda3/bin/conda init zsh

    install mamba:
    conda install mamba -n base -c conda-forge


    # environment.yml
    name: test-env
    dependencies:
      - python>=3.5
      - anaconda
      - pip
      - pip:
        - -r file:requirements.txt


    mamba create -n speechbrain --file environment.yml



pip venv:

    https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/


    python3 -m venv env
    source env/bin/activate

jupyter:
    nb_conda_kernels : conda kernels not showing up

    speech_gen:

    cachemanager error: upgrade librosa


CUDA:
    export CUDA_VISIBLE_DEVICES=0,1