el bOn

In this world without frontiers, who needs Gates and Windows

Saturday, December 01, 2012

NO-IP on Centos 6

Hi all, we're about to learn how to set NO-IP on our Centos 6, first of all you'll need a no-ip account, so go to http://www.no-ip.com/ , create an account and then...
1.- Go to your account settings.

2.- Click on "Add a host".

3.- In the next form: "Hostname information" you'll need to fill in these mandatory fields:
    hostname: your desired hostname i.e.
        midominio + no-ip.org
    Ip adress: in this field you need to put your public IP, if you don't know what is your public IP, go to  this site http://www.whatismyip.com/

4.- This step is VERY IMPORTANT:
    Ir order to get access to your server from the public side, you'll need to open the necessary ports on your modem, go to your access point settings and edit the firewall rules or give access to your server machine on the correct ports, I mean if you're running a web server, then you'll need to address the port 80 of your modem to your ip server:
On the above example I gave access on the porst 22 and 80, because I'm using SSH and HTTPD.

5.- Now go for a beer.


6.- The rest is easy, you only need to do this on you terminal as root:
 cd /usr/loca/src
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
tar xzf no-ip-duc-linux.tar.gz
cd no-ip-2.1.9
make
make install

7.- Eventually the binary will ask you for your no-ip user, no-ip passwd  and the minutes to refresh, the default for this last question is 30 minutes, so set your refresh time to 10 minutes if you want to.

8.- The result of the previous step will be a conf file, now you need to start the process, so go to your terminal and type:
./noip2

9.-  You can check if the process is running by doing:
ps -ef | grep noip2

10.- It is almost done, be patient only 1 more step, in order to get noip working everytime you reboot the server you'll need to add this line to your "rc.local" file:


whereis noip2
/usr/local/bin/noip2
echo '/usr/local/bin/noip2' >> /etc/rc.local

11.- Go for another beer and enjoy your new free public domain.

12.- Additional notes:
Some other options with noip2
noip2 Execute the binary
noip2 -S Shows the current status
noip2 -C to configure the client
noip2 -K This instruction kills the current process




Tuesday, February 07, 2012

Recover mysql password

Hi my name is Bernardo, and today i am going to teach you, how to recover your mysql password.
This is funny, cause i've just reset my password, LOL, i forgot my mysql password, but thats another story, lets get to work

1.- The first step is: Stop the server
This can be done by typing in the console this instruction:

service mysqld stop

2.- The second step: Start mysql in safe mode
This is important, cause in this way we are able to change the password, with this we are leaving the mysql console open to any connection without a passwd, remember to put the "&" after the line, cause this leaves the process in second plane.

mysqld_safe --skip-grant-tables --skip-networking&

3.- The third step: Conect to mysql server
At this moment(after typing the below instruction), mysql should'nt ask for a password, and you'll have full access to the mysql server
mysql -u root

4.- The fourth step: Change the password

You need to modify the table "User" and set the new value, in this case, your new password, if you look at the line, we are only typing a query for an update, where the user is "root"
UPDATE user SET password=PASSWORD('new_pass') WHERE user='root';
5.-The fifth step: Just restart the service
If every step before was ok, we only need to restart mysql service, by typing this instruction
service mysqld restart

So, thats it, easy, dont you think!!!
If you have any question, you can leave a coment, See you guys!!!