Skip to content

Instantly share code, notes, and snippets.

@suzzukin
Created February 16, 2022 21:19
Show Gist options
  • Save suzzukin/484c83e9f6a81409310b56143ee420f7 to your computer and use it in GitHub Desktop.
Save suzzukin/484c83e9f6a81409310b56143ee420f7 to your computer and use it in GitHub Desktop.
linx
#!/bin/bash
sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^roundcube"|tr '\n' ' ')
sudo apt-get update && apt-get upgrade -y
sudo apt-get install curl wget net-tools ethtool transmission build-essential python-pip python3-pip bash-completion -y
sudo apt-get install apt-transport-https libssl-dev libffi-dev python3-dev openvpn redsocks bridge-utils -y
sudo apt-get install python3-pip python3-dev
sudo apt-get install python3-venv -y
sudo apt-get install gcc make -y
sudo apt-get purge ufw* -y
sudo apt-get autoremove y
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --sport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -j ACCEPT
sudo iptables -A OUTPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 4000 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 1503 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 8000:8099 -j ACCEPT
sudo iptables -I INPUT 1 -i lo -j ACCEPT
sudo apt-get install iptables-persistent -y
iptables-save >/etc/iptables/rules.v4
python3 -m pip install --upgrade pip
pip3 install --upgrade setuptools
echo "Basic Python fw donw"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment