Skip to content

Instantly share code, notes, and snippets.

View ahmadmayahi's full-sized avatar

Ahmad Mayahi ahmadmayahi

View GitHub Profile
@ahmadmayahi
ahmadmayahi / docker-ee.sh
Created March 21, 2019 13:25
Installing Docker EE on Ubuntu dist.
DOCKER_EE_URL="Put your Docker EE url here"
DOCKER_EE_VERSION=18.09
sudo apt-get remove docker docker-engine docker-ce docker.io
sudo apt-get update -y
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL "${DOCKER_EE_URL}/ubuntu/gpg" | sudo apt-key add -
@ahmadmayahi
ahmadmayahi / iptables.sh
Last active June 23, 2017 13:24
iptables best practice for ubuntu 14+ - only 22, 80 and 443 ports
#This iptables snippet enables port 22, 80 and 443 only.
#WARNING: YOU HAVE TO EXECUTE THE 1ST COMMAND TO AVOID SELF BLOCKING, IF YOU DON'T TYPE THIS COMMAND THEN YOI'LL BE BLOCKED FROM ACCESSING YOUR SERVER.
#Accept active connecion (void self blocking)
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
#Accept loopback connections
iptables -A INPUT -i lo -j ACCEPT
#Allow port 22 (ssh)