Thursday, December 22, 2011

Memory aid on redirecting ports

sysctl -w net.ipv4.ip_forward=1

iptables -t nat -A PREROUTING -d < DEST > -p tcp -m tcp --dport <original destport> -j DNAT --to-destination <new machine>:<new port>

iptables -t nat -A POSTROUTING -d <new machine> -p tcp -m tcp -j SNAT --to-source <this box ip>

iptables -A FORWARD -d <new machine> -j ACCEPT

Thursday, December 15, 2011

Change the admin user password in drupal

UPDATE users SET pass = md5('The password!') where uid=1;