Linux Commands Reference

We publish these commands for our developer’s for reference purposes. They are publicly visible as it might be helpful for other users as well:


#stop all containers:
docker stop $(docker ps -a -q)

# Restart docker service
sudo systemctl restart docker.service

#stop all containers by force
docker kill $(docker ps -q)

#remove all containers
docker rm $(docker ps -a -q)

#remove all docker images
docker rmi $(docker images -q)

#purge the rest
docker system prune --all --force --volumes

Error response: Could not kill running container runc did not terminate successfully: container_linux.go:392: init process caused “permission denied”

This can happen if apparmor prevents stopping the docker container.
One solution is to uninstall apparmor and restarting the docker service:

sudo apt-get purge --auto-remove apparmor
sudo service docker restart
docker system prune --all --volumes

sudo systemctl restart docker
sudo systemctl daemon-reload

Error starting userland proxy: listen tcp bind: address already in use

Find PID and kill it:

sudo netstat -nlpt |grep 3306

sudo kill [pid]



Number of open connections per ip
netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

Show all connected ip addresses to a certain port
netstat -an |grep 443
netstat -an |grep 80

Count connections per IP
netstat -an | grep 80 | wc -l
netstat -an | grep 443 | wc -l

Firewall iptables

Firewall Block IP Adress
sudo iptables -A INPUT -s [IP ADDRESS] -j DROP

Allow access from a specific IP address
sudo iptables -A INPUT -s -p tcp –destination-port 3306 -j ACCEPT

Firewall Rules

  • sudo ufw default deny incoming
  • sudo ufw default allow outgoing
  • sudo ufw allow ssh
  • sudo ufw allow 1000
  • sudo ufw allow http
  • sudo ufw allow 443
  • sudo ufw allow from to any port 3306 (Local IP address)
  • sudo ufw allow from to any port 3306 (Amazon DBS)
  • sudo ufw deny from


Change MySQL password authentication module tomysql_native_password.

Needed for upgrading from 7.X to mysql 8.x

ALTER USER ‘user’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password1’;