Skip to content

Development Environment Configuration

dscabral edited this page Aug 16, 2021 · 3 revisions

Development Environment Configuration

Golang

The installation process is quite simple. The first step it's to choice the go version that you wanna install. Just access the official site, and choice the desired version ( https://golang.org/dl/go1.16.5.linux-amd64.tar.gz). The recommendation it's always download the most updated version.

To download on linux, execute the command below on terminal:

# select the version that you would like to install
VERSAO_GO=1.16.5
cd ~
curl -O "[https://golang.org/dl/go${VERSAO_GO}.linux-amd64.tar.gz](https://golang.org/dl/go1.16.5.linux-amd64.tar.gz)"

Now unpack the files with the follow command:

tar xvf "go${VERSAO_GO}.linux-amd64.tar.gz"

Next, move the files to the bin directory of your linux user:

sudo mv go /usr/local

Now test your go installation:

go version

In case of Error, try to export the go path with the command below:

PATH=$PATH:/usr/local/go/bin

Development IDE

IntelliJ IDEA

Visual Studio Code

You can install using the follow link:

https://code.visualstudio.com/download

Confirm that the VS Code was successful installed executing the command:

code .

Install the

For VS Code, you need to install some extensions. Install Luke Hoban. with the command below:

code --install-extension ms-vscode.go

When open a Go file for the first time on VS Code, it will indicate witch analysis tools are missing. Click on the button to install. You can check the complete list of tools here.

Go Debugger

A good option to debug your programs in Go is Delve. It can be installed by using the go get command:

go get -u github.com/go-delve/delve/cmd/dlv

Database tools

GIT Client

Or can use the command line, and in case of doing bullshit, just use the link below:

https://ohshitgit.com/

API Client

Bash

It's a script to help you to see your branch directly on your bash

  1. Step

    1. Put this script at the end of your bashrc (~/.bashrc)
    force_color_prompt=yes
    color_prompt=yes
    parse_git_branch() {
        git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
    }
    if [ "$color_prompt" = yes ]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
    else
        PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
    fi
    unset color_prompt force_color_prompt
  2. Step

    Execute this command:

    source ~/.bashrc

Starship

The minimal, blazing-fast, and infinitely customizable prompt for any shell!

https://starship.rs/demo.webm

https://starship.rs/

Yakuake

Yakuake is a top-down terminal for KDE in the style of Guake for GNOME, Tilda or the terminal used in Quake

https://www.youtube.com/watch?v=FPT1nJP8ogw&ab_channel=StefanoBiancorosso

sudo apt install yakuake

Docker

Official link for installation:

https://docs.docker.com/engine/install/ubuntu/

Config the repositories

  1. Update and install the packages:

    sudo apt-get update
    
    sudo apt-get install \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg \
        lsb-release
  2. Add the official docker GPG key:

    curl -fsSL [https://download.docker.com/linux/ubuntu/gpg](https://download.docker.com/linux/ubuntu/gpg) | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  3. Add a stable Docker repository:

    echo \
      "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine

  1. Update and install the docker packages:

    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io
  2. Check the Docker installation with the hello-world image:

    sudo docker run hello-world

Follow the post install tutorial, to use Docker without sudo command (Linux postinstall)

Troubleshooting

If in the end of installation you get the message below:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

Try to start the Docker service:

systemctl start docker

or

sudo service docker start

Docker compose

  1. Run this command to download the current stable release of Docker Compose:

    sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

To install a different version of Compose, substitute 1.29.2 with the version of Compose you want to use.

  1. Apply executable permissions to the binary:

    sudo chmod +x /usr/local/bin/docker-compose

Note: If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.

For example:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  1. Test the installation.

    docker-compose --version
    docker-compose version 1.29.2, build 1110ad01

Clone this wiki locally