Search This Blog

Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Sunday, December 25, 2011

PostgreSql change password command line


Awww yeah... If we can't remember your postgres db password, we can reset it.

Ubuntu
First we have to switch to postgres user


su - postgres


now we can execute the psql command


psql -d dbname -U postgres; (this allows you to get it o the db)


alter user postgres with password 'newpassword'; (now you can modify the password)

Tuesday, September 13, 2011

iptables firewall commands


#to allow access to server with iptables
iptables -A INPUT -s 192.111.111.111 -j ACCEPT
service iptables save

#tp remove access to server with iptables
iptables -A INPUT -s 192.111.111.111 -j DROP
service iptables save


//to list properties of iptables and show allowed ip is added
iptables -L