# Linux Web Development Setup for 2023

# Setup your Development Machine

```plaintext
> sudo apt-get update

> sudo apt-get install terminator

> sudo apt-get install neovim

> sudo apt-get update
```

# Setup File Searching

```plaintext
> sudo apt-get install rg
```

# Git Setup

```plaintext
> sudo apt install git

> git config --global push.default simple

> git config --global user.email "<your-email>"

> git config --global user.name "<your-name>"

> git config --global alias.lg "log --color --graph --
pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
```

# Oh-my-ZSH Setup

```plaintext
> sudo apt install zsh curl

> zsh --version

> chsh -s $(which zsh)

> sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```

# Neovim Development Setup

```plaintext
> mkdir ~/.config

> git clone https://gitlab.com/jethro.riosa/neovim-setup.git ~/.config/nvim

> ~/.config/nvim/zsh_script.sh

> source ~/.zshrc

> git clone https://github.com/k-takata/minpac.git ~/.config/nvim/pack/minpac/opt/minpac
```

*   Open terminator.
    
*   In your terminator, type vim, this will show your vim editor.
    
*   Press `Shift + Colon` and type `PackUpdate` to install packages.
    

```plaintext
> vim ~/.zshrc
```

*   Change the value of ZSH value.
    

```plaintext
export ZSH="PATH/.oh-my-zsh"
```

*   save your `~/.zshrc` file and the type `source ~/.zshrc` in your terminator.
    

# ASDF troubleshooting

```plaintext
> git clone https://github.com/asdf-vm/asdf.git ~/.asdf

> git clone https://github.com/olivierverdier/zsh-git-prompt.git

> source ~/.zshrc
```

# Install Elixir

```plaintext
> asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git

> asdf install elixir latest

> asdf global elixir latest
```

# Install Erlang

```plaintext
> asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git

> asdf install erlang latest

> asdf global erlang latest
```

# Install Node

```plaintext
> asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

> asdf install nodejs latest

> asdf global nodejs latest
```

# Install Phoenix

```plaintext
> mix local.hex

> elixir -v

> mix archive.install hex phx_new
```

# Install PostgreSQL

```plaintext
> psql -v

> sudo apt-get install postgresql

> sudo apt-get update

> psql --version
```

*   `psql -v` will help to check if there is an already installed version on your system. If it doesn't show anything or an error, we can proceed to the next step.
    

```plaintext
> sudo -u postgres psql postgres

> \password postgres

> sudo -u postgres createuser --superuser $USER
```

*   The first command creates a new Postgres account.
    
*   The second command opens up the psql console and asks for you to enter a password for the account created ( which is Postgres). From there you can just enter `postgres`
    
*   The third command makes your newly created account to be a `superuser` and add specific privileges.
    

# Install Inotify for File Watching

```plaintext
sudo apt-get install inotify-tools
```

# Create a new Phoenix Project

```plaintext
> mix phx.new hello_world

> cd hello_world

> mix ecto.create

> mix phx.server
```
