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
[user] | |
name = Andre Maximo | |
email = [email protected] | |
[credential] | |
helper = cache --timeout=3600 | |
[core] | |
editor = emacs -nw | |
[filter "lfs"] | |
required = true | |
clean = git-lfs clean -- %f |
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 properly use github, it is important to add SSH and GPG keys | |
- to respectively connect (allowing git push/pull/clone) to github and | |
- sign commits (allowing git commit -S) adding a "verified" tag to it | |
- Using SSH key to connect sometimes requires to go thru port 443 instead of | |
- port 22 when accessing github: | |
- Edit ssh config to use port 443 https when accessing github via ssh | |
- and also to use ssh key (must be the same added in github): |
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
#!/usr/bin/bash | |
echo 'clearing dmesg...'; | |
sudo dmesg -c && clear; | |
DEVICE=$(rfkill list all | grep -o 'hci*.'); | |
sudo hciconfig ${DEVICE} down; | |
sudo rmmod btusb; | |
sudo service bluetooth disable; | |
sudo modprobe btusb; |
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
# Good run x times function to have readily available in cmd line to | |
# just do: $ runx 10 cmd args <- run 10 times cmd with args | |
function runx() { | |
for ((n=0;n<$1;n++)) | |
do ${*:2} | |
done | |
} | |
# The py_envs can help add a python path before running python or jupyter | |
# It is used as $ py_envs jupyter notebook |
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. Image viewer: https://feh.finalrewind.org/ |
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
Python virtual environments (venv) are good to: | |
1. Use a specific version of Python; | |
2. Do pip install rightly (without sudo); | |
3. Be able to use other Python versions as jupyter notebook run kernel. | |
It is the recommended way of organizing packages versions in Python 3.3+. | |
To create/activate/deactivate a venv: | |
python3.8 -m venv ~/python3.8-venv |
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
Install clangd to have IDE support in emacs: | |
https://clangd.llvm.org/ | |
Add following snippet to ~/.emacs: | |
(require 'eglot) | |
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd")) | |
(add-hook 'c-mode-hook 'eglot-ensure) | |
(add-hook 'c++-mode-hook 'eglot-ensure) | |
Create file ~/.clangd with: |
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
0. A better option than below guidelines is to install OpenCV in Python via: | |
pip install opencv-python | |
sudo apt update | |
sudo apt install libgl1 | |
1. Remove opencv installed by apt (probably not the most recent version) | |
2. Clean-up and update apt (so dependencies can be installed) | |
3. Install dependencies | |
4. Set gcc/g++ to maximum allowed version (8 for cuda-10.2) |
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
.ssh/config: | |
Host * | |
(...) | |
AddKeysToAgent yes | |
(...) | |
eval `ssh-agent` | |
ssh-copy-id -i ~/.ssh/id_rsa.pub node: | |
ssh node |
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
# Fresh install Docker + avoid VPN conflict | |
sudo rm -rf /etc/docker/* | |
sudo apt-get remove --purge *docker* | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
sudo apt update | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" | |
sudo apt update |
NewerOlder