wororo.

freshStart

2017/09/16

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' #4 horas

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
  • Add to github via web.

Vim

1
$ sudo apt install 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

  • codezombiech.gitignore

Python

  • donjayamanne.python

Jupyter

  • N/A yet.

Bash autocomplete ignore case

1
2
$ if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi
echo 'set completion-ignore-case On' >> ~/.inputrc

Oh-my-ZSH

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
  • Cambiar font por Hack.

zsh-autosuggestions

1
$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
  • Add to .zshrc: (included before)
1
plugins=(zsh-autosuggestions)

Node via nvm

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"
1
$ nvm install stable

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

  1. Run: workon
  2. A list of environments, empty, is printed.
  3. Run: mkvirtualenv temp
  4. A new environment, temp is created and activated.
  5. Run: workon
  6. This time, the temp environment is included.
  7. Run: deactivate to exit the environment.
CATALOG
  1. 1. Ubuntu from scratch
  2. 2. Git
    1. 2.1. Create SSH Key for git
  3. 3. Vim
  4. 4. Pip
  5. 5. VSCode
    1. 5.1. Plugins
      1. 5.1.1. Markdown
      2. 5.1.2. Git
      3. 5.1.3. Python
      4. 5.1.4. Jupyter
  6. 6. Bash autocomplete ignore case
  7. 7. Oh-my-ZSH
    1. 7.1. Hack Font
    2. 7.2. Terminator
    3. 7.3. zsh-autosuggestions
  8. 8. Node via nvm
  9. 9. Virtual Environments
    1. 9.1. Cheat Sheet