This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- The problem is to have wide jupyter notebook cells | |
2- jupyter lab is not worth to replace jupyter notebook | |
3- Create this file: | |
~/.jupyter/custom/custom.css | |
4- Add this content: | |
.container {width:100% !important; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- Migrate a git repo by first mirroring original (ORI) repo: | |
git clone --mirror <url to ORI repo> temp-dir | |
2- Cd to the mirror repo and check local tags and branches: | |
git tag | |
git branch -a | |
3- Remove the link with the original repo: | |
git remote rm origin | |
4- Link the local repo to the new repo: | |
git remote add origin <url to NEW repo> | |
5- Push all branches and tags to the new repo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- The problem is to run a python script remotely using ssh | |
2- For a long time (days) and avoiding using $ screen | |
3- Preventing it to be killed when logging off: $ nohup | |
4- And redirecting stdout/stderr to a file: "&> file.txt" | |
5- Using python unbuffering to force writes: "python -u" | |
$ nohup python -u script_to_run.py &> std_out_err.txt & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- The problem is to find a previous executed command | |
$ history | grep <command_to_be_found> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- The problem is to copy all files with 3D in their file name | |
2- From and to specific directories, going recursively, with: | |
3- -m == --prune-empty-dirs (skip empty directories) | |
4- -a == --archive -r (do recursion preserving folder structure) | |
5- -z == --compress (do compression) | |
6- -v == --verbose (do verbose) | |
7- It is very important to set the /path/from and /path/to properly, | |
8- e.g. source path is /dir1/dir2/dir3/dir4 and the intention is to | |
9- preserve dir3/ forward in the backup so the destination path is | |
10- /dirA/dirB/dir3/, note that there is no slash at the end of dir4(/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------------- | |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- To run an sh script file using current shell, | |
2- where other sh scripts may have been sourced, | |
3- Add a dot and space before running it: | |
$ . <file_to_run.sh> | |
4- To run it creating a new shell use dot slash: | |
$ ./<file_to_run.sh> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- Install jupyter and its extensions: | |
$ conda install -c conda-forge jupyter | |
$ conda install -c conda-forge jupyter_contrib_nbextensions | |
2- Should be installed on every conda environment | |
3- Not sure about the install command below, maybe | |
4- should only be done for the base environment or | |
5- not be done at all: | |
$ jupyter contrib nbextension install --user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On: /etc/crontab | |
SHELL=/bin/bash | |
@reboot deepstation /home/deepstation/start_jupyter.sh | |
@reboot deepstation /home/deepstation/start_tensorboard.sh | |
On: /home/deepstation/start_jupyter.sh | |
#!/bin/bash | |
source /home/deepstation/anaconda3/etc/profile.d/conda.sh | |
conda activate base | |
nohup jupyter notebook --port 9114 --ip * &> /home/deepstation/jupyter_notebook_base.log & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- Install glances from its script to have latest version | |
2- (Ubuntu package is an old version), run with sudo -E -H | |
3- for root access preserving user environment and home dir | |
$ curl -L https://bit.ly/glances | sudo -E -H /bin/bash | |
4- Maybe py3nvml should also be installed for GPU monitoring: | |
$ sudo -E -H pip install py3nvml | |
5- Create dir: /etc/glances if it does not exist and edit: | |
6- /etc/glances/glances.conf; to allow some file systems and |