Reset MySQL Root Password

Very often, once we didn’t log on to MySQL database for some time, I guess most of us will forgot the root password. Can we reset the root password? Obviously… Nothing is Impossible :P

Follow the steps below to reset MySQL’s Root Password;

  • Stop MySQL Service
  • Start MySQL Service in Safe Mode: /usr/local/bin/mysqld_safe –skip-grant-tables&
  • Connect to MySQL /usr/local/bin/mysql
  • mysql> use mysql;
  • mysql> UPDATE user set password=password(‘newpassword’) where user=’root’ and host=’localhost’;
  • mysql> flush privileges;
  • mysql> quit;
  • Stop MySQL Service Again
  • Start MySQL Service in normal mode

Log in to MySQL with your newly created password.

How to do DNS Setup On your Machine

Most of us know, without DNS Setup on your machine or PC, you can’t browse on the website at all, DNS setup is a must, cause what DNS does is translate the Domain Name to IP Address in order to reach the server.

What DNS Server to use? We will use OpenDNS server for DNS Setup.

DNS Setup on Windows Vista

On your Windows Vista, follow the step below;

  • Click on “Windows Start Button”, then select “Control Panel”.
  • Click on “Network and Internet”
  • Click on “Network Center”
  • Click on “Personalize”, next to your network
  • Click on “Properties” button.
  • Another window will pop up – click on “Properties” button, again
  • Vista will ask for your permission to make changes. Click “Continue” button.
    Make sure you have administrative rights on your system before making changes.
  • Select “Internet Protocol Version 4 (TCP/IPv4)”, then click on “Properties” button.
  • Click the radio button “Use the following DNS server addresses” and type in OpenDNS addresses in the “Preferred DNS server” and “Alternate DNS server” fields.
  • Preferred DNS server address for Open DNS is: 208.67.222.222
    Alternate DNS server address for Open DNS is: 208.67.220.220

  • Click on “OK” button.
  • Restart your computer.
  • DNS Setup on Apple Mac OS X

    On Apple Mac, follow the steps below for DNS Setup;

  • Click on the Apple icon on top left menu
  • Select System Preferences
  • Click on Network
  • On DNS Server, type: 208.67.222.222, 208.67.220.220
  • Click on Apply. That’s all
  • DNS Setup is pretty easy, happy browsing!

SSH Client on Blackberry

Is there any SSH client for Blackberry phone? Definitely yes, I am using BBSSH as SSH client on Blackberry. BBSSH is free and it runs on latest Blackberry OS, I do remote SSH to server to do some health check. BBSSH supports both SSH1 and SSH2.

BBSSH Features

Some of the features on BBSSH

  • Adding Multiple Connection – You can add multiple connection on BBSSH and the connection will be saved for convenience access.
  • Multiple Session at one time – You can access to multiple server at the same time, and you are also able to switch over to other session from time to time.
  • Support shortcut keys like Ctrl + D – You can invoke normal Ctrl + D key with Sym + D as a shortcut to log out or Sym + Up to scroll back history and etc.

Connection Error

When I first setup a new connection, I was having difficulty to connect to the server, getting error message like “Notice: APN is not specified”. You need to enable APN at Options > Advance Options >TCP/IP > and check APN Settings Enabled. You can leave the authentication username and password empty.

Connect on Custom SSH port

There is no option to configure custom SSH port. You can set the hostname as yourhostname.com:customport, for example example.com:8383

I hope you enjoy SSH on Blackberry with BBSSH as much as I do!

Chinese Simplified PinYin Input Doesn’t Work on Blackberry OS 5.0.0.x

Recently I have upgraded to Blackberry OS version 5.0. Everything works except for Chinese Pin Yin input where it supposes can be swap between English and Chinese. Chinese Simplified PinYin input is installed and I am able to read Chinese Characters but the language switching options cannot be seen at Options > Language and Text Input.

My model is Blackberry Bold 9000, running on latest OS v5.0.0.454 (Platform 5.2.0.41). Suspect that Application Center is crash with Chinese PinYin Input. If you have the similar problem, try to make it works by following the steps below with Blackberry Desktop Manager.

  • First, remove Application Center from your Blackberry.
  • After Application Center has been removed, install East Asian Characters and Font Support > Simplified Chinese Characters and Font Support
  • Try to do Alt + Enter, you should able to switch between English and Chinese Simplified Pin Yin

Please do share if you have others workaround.

Configure Smarthost SMTP Authentication on Postfix

My machine at home cannot send email using port 25, end up I got to do smart host SMTP authentication on Port 587 means your machine will connect to your public mail server, and from your public mail server deliver the email to recipient. Let’s do some simple Smarthost SMTP authenication on Postfix. The example is Postfix on Linux Ubuntu server.

Create Authentication Password File For Postfix

Create a password file which require authentication on your mail server.


shell> vi /etc/postfix/smarthosts.conf

#mailserver username password
mail.example.com test 123123

Save the file and perform some simple permission settings.


shell> cd /etc/postfix
shell> chown root:root smarthosts.conf
shell> chmod 0600 smarthosts.conf
shell> postmap hash:$P

Now you have done with SMTP server authentication configuration file.

Configure Smart Relay on Postfix

Fire up Postfix’s main.cf config file


vi /etc/postfix/main.cf

Paste the config below on the bottom of the configuration


relayhost = mail.example.com:587
# smtp_sasl_auth_enable = yes
smtp_auth_enable = yes
# smtp_sasl_password_maps = hash:/etc/postfix/smarthosts.conf
smtp_password_maps = hash:/etc/postfix/smarthosts.conf

relayhost is the your server address and with port 587, in case your ISP is blocking port 25. You can use either plain password authentication or SASL authentication, depend on what type of authentication does your server support.

Save it and reload Postfix Service


shell> /etc/init.d/postfix reload

Perform the testing on your newly configured SMTP Smart Host Authentication


shell> echo 'Hello World' > /tmp/hello
shell> mail -s 'Hello World' test@example.com < /tmp/hello
shell> rm -f /tmp/hello

Check on the mail server log on delivery status.


shell> tail -F /var/log/mail.log
Mar 25 22:42:43 dummyserver postfix/pickup[6747]: 755A441202: uid=0 from=
Mar 25 22:42:43 dummyserver postfix/cleanup[6772]: 755A441202: message-id=<20100325144243.755A441202@dummyserver.WAG160N>
Mar 25 22:42:43 dummyserver postfix/qmgr[6748]: 755A441202: from=, size=305, nrcpt=1 (queue active)
Mar 25 22:42:54 dummyserver postfix/smtp[6775]: 755A441202: to=, relay=mail.example.com[203.222.222.222]:587, delay=11, delays=0.12/0.01/10/0.99, dsn=2.0.0, status=sent (250 OK id=1NuoGu-000PGq-6l)
Mar 25 22:42:54 dummyserver postfix/qmgr[6748]: 755A441202: removed

If the status is sent, it means your smart host is working well.