Skip to content

Instantly share code, notes, and snippets.

@viniciusgati
Last active May 25, 2021 19:09
Show Gist options
  • Save viniciusgati/2d8b964ff511116cfb0dc8c9a546deca to your computer and use it in GitHub Desktop.
Save viniciusgati/2d8b964ff511116cfb0dc8c9a546deca to your computer and use it in GitHub Desktop.
echo -e "[mongodb-org-4.4]\nname=MongoDB Repository\nbaseurl=https://repo.mongodb.org/yum/redhat/" > /etc/yum.repos.d/mongodb-org-4.4.repo
echo "$releasever" > /etc/yum.repos.d/mongodb-org-4.4.repo
echo -e "/mongodb-org/4.4/x86_64/\ngpgcheck=1\nenabled=1\ngpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc" > /etc/yum.repos.d/mongodb-org-4.4.repo
sudo yum update
sudo yum -y install \
gmp-devel \
libbsd-devel \
libedit-devel \
libevent-devel \
libxml2-devel \
libyaml-devel \
llvm-static \
openssl-devel \
libcanberra-gtk-module \
readline-devel
sudo yum -y install java-11-openjdk-devel
sudo yum -y install patch autoconf gcc-c++ patch libffi-devel automake libtool bison sqlite-devel ImageMagick-devel nodejs git gitg
sudo yum -y install gcc-c++ patch readline readline-devel zlib zlib-devel \
libyaml-devel libffi-devel openssl-devel make \
bzip2 autoconf automake libtool bison sqlite-devel
sudo yum install -y mongodb-org
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
source ~/.bashrc
asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
# Imports Node.js release team's OpenPGP keys to main keyring
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install nodejs 12.18.2
asdf global nodejs 12.18.2
npm install -g @ionic/cli
git config --global user.name Vinicius Gati
git config --global user.email viniciusgati@gmail.com
git config --global alias.c commit
git config --global alias.st status
git config --global alias.ck checkout
git config --global alias.l log
# ----------------------------- PÓS-INSTALAÇÃO ----------------------------- #
## Finalização, atualização e limpeza##
sudo yum update && sudo yum dist-upgrade -y
sudo yum autoclean
sudo yum autoremove -y
# ---------------------------------------------------------------------- #
# entrar no mongodb com comando mongo
# db.createUser({user: "admin", pwd: "senha", roles: [{role: "userAdminAnyDatabase", db: "admin"}, {role: "readWriteAnyDatabase", db: "admin"}]})
# se precisar colocar alguma role so para informacao o comando eh
# db.grantRolesToUser('yourNewUsername',[{ role: "root", db: "admin" }])
# alterar no /etc/mongod.conf
# bindIp: 0.0.0.0
# security:
# authorization: enabled
# sudo systemctl restart mongod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment