Skip to content

Instantly share code, notes, and snippets.

@czocher
Created March 25, 2017 13:42
Show Gist options
  • Save czocher/f413d0574eb4caa50870aa19c6d550cc to your computer and use it in GitHub Desktop.
Save czocher/f413d0574eb4caa50870aa19c6d550cc to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install guake and nano
sudo apt-get install -y guake nano
sudo apt-get install -y iptables-persistent
# Download the wallpaper
sudo wget http://i.imgur.com/qIb3xjS.png -O /home/turniej/.wallpaper.jpg
sudo chmod 777 /home/turniej/.wallpaper.jpg
# Configure the firewall
# Allow loopback
sudo iptables -I INPUT 1 -i lo -j ACCEPT
# Allow DNS
sudo iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
# Now, allow connection to the judge
sudo iptables -A OUTPUT -p tcp -d 82.139.137.168 -j ACCEPT
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# Drop everything
sudo iptables -P INPUT DROP
sudo iptables -P OUTPUT DROP
sudo dpkg-reconfigure iptables-persistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment