Skip to content

Instantly share code, notes, and snippets.

@ricsdeol
Last active December 15, 2021 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricsdeol/e4d3f613cc12bec4beaad148744113fa to your computer and use it in GitHub Desktop.
Save ricsdeol/e4d3f613cc12bec4beaad148744113fa to your computer and use it in GitHub Desktop.
Clean Ruby and some databases Environment

Install some dependences

// improve battery perform
sudo add-apt-repository ppa:linrunner/tlp


sudo sh -c 'echo "deb [arch=amd64]  https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

sudo apt-get install  apt-transport-https ca-certificates curl software-properties-common

// add docker repository
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 \
   $(lsb_release -cs) \
   stable"
   
sudo apt-get install postgresql-client postgresql-server-dev-14 gawk autoconf automake bison libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libyaml-dev pkg-config sqlite3 libgmp-dev libreadline-dev libssl-dev build-essential zlib1g-dev liblzma-dev patch git git-extras vim docker-ce chrome-gnome-shell tlp htop terminator

Add default gems for all ruby versions: gedit ~/.default-gems

paste:

solargraph
ruby-debug-ide
pry
bundler
rubocop

Install ruby and node by www.asdf-vm.com/

echo "gem: --no-document" > ~/.gemrc

git clone https://github.com/asdf-vm/asdf.git ~/.asdf
// config asdf on bash/zsh https://asdf-vm.com/#/core-manage-asdf-vm?id=install


asdf plugin add ruby
asdf install ruby latest:2
asdf global ruby latest:2

asdf plugin-add nodejs
bash -c '${ASDF_DATA_DIR:=$HOME/.asdf}/plugins/nodejs/bin/import-release-team-keyring'
asdf install nodejs latest:14
asdf global nodejs latest:14

npm update -g npm
npm install -g yarn

asdf reshim

Install vs code: sudo snap install vscode

Install docker and databases containers: https://docs.docker.com/install/linux/docker-ce/ubuntu/

sudo usermod -aG docker $USER

// Best docker Gui management, http://localhost:9000 user and password: admin admin
docker run --name portainer -d --restart=always -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce --admin-password='$2y$05$YUJPauVkLX7/4nlNmpcA1.Zp06fm5J9Itz2EKFxRPQNrwWP7lMsW2'

docker run --name redis  -p 6379:6379 -d redis:alpine

docker run --name pg14 -v pg14_data:/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres:14-alpine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment