Skip to content

Instantly share code, notes, and snippets.

@ljchuello
Last active November 19, 2023 17:47
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 ljchuello/9620d3a5d7b667143c8de0f82565abee to your computer and use it in GitHub Desktop.
Save ljchuello/9620d3a5d7b667143c8de0f82565abee to your computer and use it in GitHub Desktop.
OnInit.sh
[Unit]
Description=Servicio de monitoreo
[Service]
ExecStart=glances -w -p 27017 -t 1
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
#!/bin/bash
# Updates the packages
DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade
# Tools
apt install curl -y
apt install wget -y
apt install unzip -y
apt install nginx -y
# Firewall
apt install ufw -y
echo "y" | ufw enable
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 27017/tcp
# .NET Core LTS
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel LTS --install-dir /usr/share/dotnet
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Glances
apt install python3
apt install python3-dev -y
apt install python3-pip -y
wget -O- https://bit.ly/glances | /bin/bash
# Glances Service
cd /etc/systemd/system/
wget -O glances-y5zgd.service "https://gist.githubusercontent.com/ljchuello/9620d3a5d7b667143c8de0f82565abee/raw/a6bd97620b0f4bcf538921a21f672b65397a052c/glances-y5zgd.service"
systemctl start glances-y5zgd
systemctl enable glances-y5zgd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment