Skip to content

Instantly share code, notes, and snippets.

View AbdulR3hman's full-sized avatar
🐋
Focusing

AbdulRehman AbdulR3hman

🐋
Focusing
  • New York [Prev. London, UK]
View GitHub Profile
@AbdulR3hman
AbdulR3hman / localPorts.sh
Created April 16, 2017 23:19 — forked from m5m1th/localPorts.sh
Redirect port 3080/3443 to 80/443 for local dev
#Requests from outside
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 3443
#Requests from localhost
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 3443
#!/usr/bin/env ruby
# Public: Calculates the nth Fibonacci number using either a memoized or
# non-memoized functionality
#
# Examples
#
# fib = Fibonacci.new
# fib.get_fib 10
# # => 55