David Portes commited on
Commit
80f2dbf
1 Parent(s): 0288ea1
Files changed (1) hide show
  1. Unix_commands +118 -0
Unix_commands ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ tar -xvC mydirectory/ -f myarchive.tgz
2
+ ls *.gz |xargs -n1 tar -xvC /home/daporte/PycharmProjects/4d-graphs/models -f
3
+
4
+ untar mutliple files into separate dirs:
5
+ for file in *results.tar.gz;
6
+ do mkdir -p "/home/daporte/PycharmProjects/4d-graphs/results/trial_${file%.tar.gz*}";
7
+ tar -xf $file -C "/home/daporte/PycharmProjects/4d-graphs/results/trial_${file%.tar.gz*}";
8
+ done
9
+
10
+
11
+ unzip:
12
+ unzip '*.zip'
13
+ tar -xf archive.tar.bz2
14
+
15
+
16
+ list ssh keys:
17
+ ls -al ~/.ssh
18
+
19
+
20
+
21
+
22
+ To quickly kill all the stopped jobs under the bash, enter:
23
+ kill -9 `jobs -ps`
24
+
25
+
26
+ ssh setup key:
27
+ ssh-keygen
28
+ ssh-add
29
+ eval `ssh-agent -s` / Could not open a connection to your authentication agent.
30
+
31
+
32
+
33
+ SSH jupyer notebooks:
34
+ Essentially you just run the notebook on the remote in no browser mode.
35
+ jupyter notebook --no-browser --port=8080
36
+ Then setup up an ssh tunnel from the local machine:
37
+ ssh -L 8080:localhost:8080 <REMOTE_USER>@<REMOTE_HOST>
38
+
39
+
40
+ Sizes of files:
41
+ du -sh ./*| sort -h
42
+ du -ah .| sort -h
43
+
44
+
45
+ copy and rename multiple files:
46
+ pax -rw -pe -s/2015/2016/ source/ target/
47
+
48
+ copy file to/from server:
49
+ scp /file/to/send username@remote:/where/to/put
50
+ scp username@remote:/file/to/send /where/to/put
51
+
52
+
53
+ find string in folders:
54
+ grep -r "register_long_arrays" *
55
+
56
+
57
+ find file in folder:
58
+ find /search/directory/ -name "matching file search criteria"
59
+
60
+ Linux version:
61
+ hostnamectl
62
+
63
+
64
+ Conda:
65
+
66
+ conda config --add channels conda-forge
67
+ conda config --set channel_priority strict
68
+
69
+ conda install --file requirements.txt
70
+
71
+ Install env in a specific dir:
72
+ conda create --prefix speech_gen --file ~/speech_generation/requirements.txt
73
+
74
+ install miniconda:
75
+
76
+ mkdir -p ~/miniconda3
77
+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
78
+ bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
79
+ rm -rf ~/miniconda3/miniconda.sh
80
+ ~/miniconda3/bin/conda init bash
81
+ ~/miniconda3/bin/conda init zsh
82
+
83
+ install mamba:
84
+ conda install mamba -n base -c conda-forge
85
+
86
+
87
+ # environment.yml
88
+ name: test-env
89
+ dependencies:
90
+ - python>=3.5
91
+ - anaconda
92
+ - pip
93
+ - pip:
94
+ - -r file:requirements.txt
95
+
96
+
97
+ mamba create -n speechbrain --file environment.yml
98
+
99
+
100
+
101
+ pip venv:
102
+
103
+ https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
104
+
105
+
106
+ python3 -m venv env
107
+ source env/bin/activate
108
+
109
+ jupyter:
110
+ nb_conda_kernels : conda kernels not showing up
111
+
112
+ speech_gen:
113
+
114
+ cachemanager error: upgrade librosa
115
+
116
+
117
+ CUDA:
118
+ export CUDA_VISIBLE_DEVICES=0,1