IPTables - Port Forwarding

Today I found myself needing to route all my server's incoming web packets to a docker container that was acting as a reverse proxy. This is done by simply running the following commands to add rules to the NAT. If you want to forward different ports, just change the numbers 80 and 443.

sudo iptables -t nat -A PREROUTING -d $HOST_PRIVATE_IP/32 -p tcp --dport 80 -j DNAT --to-destination $PROXY_IP
sudo iptables -t nat -A PREROUTING -d $HOST_PRIVATE_IP/32 -p tcp --dport 443 -j DNAT --to-destination $PROXY_IP
sudo iptables -A FORWARD -p tcp -d $PROXY_IP --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A FORWARD -p tcp -d $PROXY_IP --dport 443 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
The variable HOST_PRIVATE_IP is named as such because in this case it was an AWS instance, and one needs to use the private IP rather than the public IP in such a case.


VLC - Remove Bottom Green Bar

If you find that you have a horizontal bar at the bottom of your videos during playback as shown below, there here is how to fix it.

    Select Tools -> Preferences to open up the preferences menu.
    Navigate to the "Video" section and change "Output" to "X11 video output".

Ubuntu 14.04 - Install Pidgin Indicator

    Run the following command to install the necessary packages.
    sudo apt-get install pidgin-indicator -y
    Open up pidgin and use the context menu to navigate to Tools->Plug-ins
    Select Ubuntu Indicator
    Close pidgin by navigating to Buddies -> Quit
    Start pidgin and you should see the icon in the tray at the top right where you can make selections from.