Ubuntu from scratch
It’s been a while since I last formatted and wasted a whole day doing this. So. I just documented everything for future uses. :)
Git
1 2 3 4
| $ sudo apt install git $ git config --global user.email "ignacio.delaparra@gmail.com" $ git config --global user.name "Gabriel De La Parra" $ git config --global credential.helper 'cache --timeout=14400'
|
Create SSH Key for git
1 2 3 4
| $ ssh-keygen -t rsa -b 4096 -C "ignacio.delaparra@gmail.com" $ ssh-add ~/.ssh/id_rsa $ sudo apt install xclip $ xclip -sel clip < ~/.ssh/id_rsa.pub
|
Vim
Pip
1
| $ sudo apt install python3-pip
|
VSCode
Plugins
Markdown
- hnw.vscode-auto-open-markdown-preview
- yzhang.markdown-all-in-one
- telesoho.vscode-markdown-paste-image (requires
sudo apt install xclip
)
- mdickin.markdown-shortcuts
- evilz.vscode-reveal
Git
Python
Jupyter
Bash autocomplete ignore case
1 2
| $ if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi echo 'set completion-ignore-case On' >> ~/.inputrc
|
1 2
| $ sudo apt install zsh $ sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
- Add to .zshrc:
1 2 3 4 5 6 7 8 9
| ZSH_THEME="agnoster" plugins=(git python django heroku node pip virtualenv zsh-autosuggestions) alias py="python3" alias pip="pip3" alias gcm="git commit -m" alias pm="python3 manage.py" workon default
|
Hack Font
Terminator
1
| $ sudo apt install terminator
|
1
| $ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
|
- Add to .zshrc: (included before)
1
| plugins=(zsh-autosuggestions)
|
1
| $ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
- Add to .zshrc:
1 2 3
| export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
Virtual Environments
1 2 3 4
| sudo pip install virtualenv sudo pip install virtualenvwrapper mkvirtualenv default
|
- Add to .zshrc:
1 2 3 4 5
| export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/Devel export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 source /usr/local/bin/virtualenvwrapper_lazy.sh
|
Cheat Sheet
- Run:
workon
- A list of environments, empty, is printed.
- Run:
mkvirtualenv temp
- A new environment,
temp
is created and activated.
- Run:
workon
- This time, the
temp
environment is included.
- Run:
deactivate
to exit the environment.