sudo service nginx restart # or sudo systemctl restart nginx
Linux
Test nginx config file using docker
docker run --rm -t -a stdout --name nginx -v $PWD/config/:/etc/nginx/:ro nginx:latest nginx -c /etc/nginx/nginx.conf -t
Try ‘apt –fix-broken install’ with no packages
This is an annoyed issue, but after several tries, here is my approach for the fix:
sudo dpkg --configure --force-overwrite -a # or sudo apt -o Dpkg::Options::="--force-overwrite" --fix-broken install
Install Mongodb on Ubuntu
Command line to install mongoDB on Ubuntu
sudo apt-get install gnupg wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list sudo apt-get update sudo apt-get install -y mongodb-org sudo systemctl start mongod sudo systemctl enable mongod
Cannot store MySQL workbench password on Ubuntu
If you’re facing this issue especially if using Kubuntu or Lubuntu: The name org.freedesktop.secrets was not provided by any .service files
You can fix it by installing this software:
sudo apt install gnome-keyring
How to install kubectl k8s command line using terminal
sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2 curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubectl
Block port 8080 on Linux using iptables
iptables -A INPUT -p tcp --destination-port 8080 -j DROP iptables-save
Nginx reverse proxy for Java Springboot 8080
server { listen 80; server_name boot.example.com; location / { proxy_pass http://localhost:8080; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; } }
Swap size vs RAM Linux
RAM Size / Swap Size (Without Hibernation) / Swap size (With Hibernation)
256MB 256MB 512MB
512MB 512MB 1GB
1GB 1GB 2GB
2GB 1GB 3GB
3GB 2GB 5GB
4GB 2GB 6GB
6GB 2GB 8GB
8GB 3GB 11GB
12GB 3GB 15GB
16GB 4GB 20GB
24GB 5GB 29GB
32GB 6GB 38GB
64GB 8GB 72GB
128GB 11GB 139GB
Use VPSSIM to setup a new server, simply!
Vietnamese Version
curl http://get.vpssim.vn -o vpssim && sh vpssim
EngLish Version
curl http://get.vpssim.com -o vpssim && sh vpssim