Skip to content

Instantly share code, notes, and snippets.

@manzanit0
Last active December 4, 2019 00:04
Show Gist options
  • Save manzanit0/170e40d2c71719fa6521ea1ad0e1fcd3 to your computer and use it in GitHub Desktop.
Save manzanit0/170e40d2c71719fa6521ea1ad0e1fcd3 to your computer and use it in GitHub Desktop.
My personal ubuntu setup guide

Setting up Ubuntu from scratch

Keyboard set up - English (intl. with AltGr dead keys)

Some out of the box basics:

sudo apt install git

To have emoji render anywhere, install:

sudo apt-get install fonts-noto-color-emoji

Fish - setting up the shell

Actual shell:

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt-get update
sudo apt-get install fish

To set as default shell:

chsh -s /usr/bin/fish

In case fish hasn't been aded to /etc/shells:

echo /usr/bin/fish | sudo tee -a /etc/shells

Install Fisher package manager:

curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish

Set terminal prompt theme:

# https://github.com/rafaelrinaldi/pure

fisher add rafaelrinaldi/pure

And dont forget to set the .config/fish/config.fish

Tmux

The fonts are necessary for the theme in the .tmux.config

sudo apt install tmux
sudo apt install fonts-powerline

To get my personal .tmux.conf running, also install tpm:

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Remember to then install all tmux plugins it with ctrl + b + I.

asdf - software environments

Clone the repository, checkout the latest branch and, magic:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf
cd ~/.asdf
git checkout "$(git describe --abbrev=0 --tags)"

Add asdf to shell:

echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc

The following packages are good-to-have for most plugins:

sudo apt install \
  automake autoconf libreadline-dev \
  libncurses-dev libssl-dev libyaml-dev \
  libxslt-dev libffi-dev libtool unixodbc-dev \
  unzip curl

Elixir/Erlang

Erlang dependencies:

apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop

Install Erlang's latest version:

asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang ref:master # Install latest version from master
asdf install erlang 22.1.3 # As of now, latest has v23, which we don't want.

Install Elixir:

N.B: Check compatibility versions!

asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.9.2 # Can also mark version as v1.9.2-otp-22

Javascriptses

Install node.js plugin and import the Node.js release team's OpenPGP keys to main keyring:

asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring

# Now just simply install the version and set it globally
asdf install nodejs 12.12.0
asdf global nodejs 12.12.0

AWS

Make sure you have pip3, or look around here how to set it up.

pip3 install awscli --upgrade --user

To set up the profiles:

mkdir ~/.aws
touch ~/aws/credentials

And set up the credentials there in the format

[profile some-name]
aws_access_key_id = ...
aws_secret_access_key = ...

Docker

Original Post

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 bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce

Check that it's running: sudo systemctl status docker

To execute docker without sudo:

sudo usermod -aG docker ${USER}
su - ${USER}

Postgres

Running postgres within docker

Check Mac

Installing postgres and psql

sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

Day-to-day soft

Insomnia REST Client

# Add to sources
echo "deb https://dl.bintray.com/getinsomnia/Insomnia /" \
    | sudo tee -a /etc/apt/sources.list.d/insomnia.list

# Add public key used to verify code signature
wget --quiet -O - https://insomnia.rest/keys/debian-public.key.asc \
    | sudo apt-key add -

# Refresh repository sources and install Insomnia
sudo apt-get update
sudo apt-get install insomnia

VS Code

Ref

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code
Adding extensions
code --install-extension <extension-name>

Most used extensions:

emmanuelbeziat.vscode-great-icons
formulahendry.terminal
gerane.Theme-FlatlandMonokai
humao.rest-client
mjmcloug.vscode-elixir
saratravi.elixir-formatter
techer.open-in-browser
vscodevim.vim

Spotify

curl -sS https://download.spotify.com/debian/pubkey.gpg | sudo apt-key add - 
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list

sudo apt-get update && sudo apt-get install spotify-client

DBeaver

wget -O - https://dbeaver.io/debs/dbeaver.gpg.key | sudo apt-key add -
echo "deb https://dbeaver.io/debs/dbeaver-ce /" | sudo tee /etc/apt/sources.list.d/dbeaver.list
sudo apt update
sudo apt -y  install dbeaver-ce

Snaps

sudo snap install telegram-desktop
sudo snap install slack --classic
sudo snap install intellij-idea-community --classic

Other

To install Zoom, check here

Setting up nvim

Beware, the package from apt doesn't contain the latest version, so it's prefered installing from the repository rather than sudo apt install neovim.

To install from repository:

wget --quiet https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage --output-document nvim

chmod +x nvim
sudo chown root:root nvim
sudo mv nvim /usr/bin

cd ~
mkdir -p .config/nvim

vim-plug

Install vim-plug:

curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Copy the contents of your vim setup:

cp ~/.vimrc ~/.config/nvim/init.vim

deoplete and the Python modules

If you don't have pip, first install:

sudo apt install python3-pip
sudo apt install python-pip

Then install the python modules for Neovim:

pip install --user neovim
pip3 install --user neovim

Lastly, launch nvim and run :PlugInstall and :UpdateRemotePlugins to finish the setup\

To set up nvim as the default editor in fish, run: set -Ux EDITOR nvim

AG - Silver searcher

In the current set up for nvim, I use AG for searching. Make sure to install it:

sudo apt-get install silversearcher-ag

Some other packages

npm i -g ngrok

# Setting up fancy differ
npm install -g diff-so-fancy
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment