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
### To simply clone as git submodule do: | |
git submodule add <clone_repo_url> | |
git commit -am "new submodule added" | |
### To migrate git repo into submodule | |
git clone <old_repo_url> | |
git remote add <new_repo_name> <new_repo_url> | |
git push <new_repo_name> master |
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 make changes in <another_branch> until satisfied | |
2. having several branches with different versions that maybe entitled | |
3. to be the master branch, and then selecting <another_branch> | |
4. to be the master branch: | |
git checkout <another_branch> | |
<make changes as needed> | |
git merge -s ours master | |
git checkout master | |
git merge <another_branch> | |
git push origin master |
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 rename a git branch named <current_branch_name> | |
2. that already exists to a new name <new_branch_name>: | |
git checkout <current_branch_name> | |
git branch -m <new_branch_name> | |
git push origin -u <new_branch_name> | |
git push origin --delete <current_branch_name> |
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. Sometimes a git submodule may lose its head during commit | |
2. It appears as: HEAD detached ... | |
3. This may be because the commit done as submodule creates | |
4. a "virtual" branch (hopefully will be fixed in the future) | |
5. One way to fix it is to do: | |
cd <submodule dir> | |
git add <changed files in submodule> | |
git commit -m <message> | |
git status # showing HEAD detached | |
git branch tmp |
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. On server side do: | |
$ jupyter notebook --port 9999 --ip=* --no-browser | |
2. On client side do: | |
$ ssh -NL 9999:localhost:9999 user@server | |
3. Then open browser and access: | |
htpp://localhost:9999 | |
4. Put the token that appear on the server side |
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. For example: | |
conda create --name tf | |
conda activate tf | |
conda install -c conda-forge tensorflow | |
2. It is good to have the conda tab in jupyter notebook: | |
conda install nb_conda | |
3. It is also good to update conda env. kernels automatically: | |
conda install nb_conda_kernels | |
4. You should have ipython kernel in the environment: | |
conda install ipykernel |
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 with a file created by someone | |
2. (docker or nimbix internal configuration or ...) | |
3. in profile.d that sets PATH without appending to it | |
4. removing the previous content of PATH that can be set | |
5. by /etc/environment (a global system wide way of setting | |
6. environment variables such as PATH) the fix tests if the | |
7. bug file exists in a bash script to then replace its | |
8. content with a sed replacing substring "PATH=" by "PATH+=\:". | |
9. The result is: | |
if [ -f "/etc/profile.d/00-container-environment.sh" ]; then |
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 add a new entry to the PATH | |
2. environment variable for all users system wide | |
3. for both logged-in (interactive) and non-logged-in | |
4. (non-interactive) shells using the /etc/environment | |
5. (the /etc/profile.d scripts are only applied to logged-in shells) | |
6. which is not a bash script rather a list of one variable set | |
7. (without appending) per line and I want to replace the already | |
8. existing PATH in the last line (there is only one line) | |
9. by removing the last character (a double quote) with a | |
10. colon (:) and then appending the new entry to PATH |
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
# The problem is to get rid off many buggy file systems when doing | |
# "df -h" because of this "snaps" from Ubuntu, it is just better to | |
# remove all snaps and then it will clean the list of disk usage: | |
sudo rm -rf /var/cache/snapd/ | |
sudo apt autoremove --purge snapd gnome-software-plugin-snap | |
rm -rf ~/snap |
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
# Sometimes it is better to use wget to download a file from a link, | |
# e.g. when an .exe file (such as XMetersSetup to install XMeters on | |
# windows --- a nice tool to monitor CPU/memory in the taskbar) is | |
# blocked by clicking on it using the web browser, and then wget | |
# itself may be blocked by proxy, wget command has several arguments | |
# to set the proxy using an already set environment variable, via: | |
wget -e use_proxy=yes -e https_proxy=$https_proxy https://entropy6.com/xmeters/downloads/XMetersSetup.exe |