Thursday, May 17, 2012

How to install Hindi ttf fonts in Linux?

·         Login as root user.
·         Download the font from the website.
·         Copy the downloaded font in to the /usr/share/fonts/TTF directory.
·         If TTF directory is not found then create a new directory TTF in /usr/share/fonts directory.
·         Then paste the downloaded font in the TTF directory.
·         Now issue the following command-
# fc-cache -f /usr/share/fonts/TTF
·         Check font path by “chkfontpath” command.
·         Logout from the current Linux session.
·         Login again.


For particular user you can install Hindi font as below:

·         Make a directory named ‘.fonts’ in user’s home directory
# cd /home/ravi
# mkdir .fonts
·         Now copy the font you install to this directory.
·         Run the below command:
#chkfontpath -a /home/ravi/.fonts

Now your font is ready to use in any Linux application.

Thursday, April 5, 2012

MySQL- Lost / forgotten root password reset on Linux


Step 1: Stop MySQL daemon if it is currently running

Locate the .pid file that contains the server's process ID

Common locations are /var/lib/mysql/, /var/run/mysqld/ and /usr/local/mysql/data/.

Generally, the file name has an extension of .pid and begins with either mysqld or your system's host name.

or 

Check running process

# ps -ef | grep mysql     

Kills the daemon, if it is running.

# pkill mysqld  

or

# kill -9 /path/to/pid

Step 2: Run MySQL safe daemon with skipping grant tables

 # mysqld_safe --skip-grant-tables &

Step 3: Login to MySQL as root with no password

# mysql -u root mysql

Step 4:  Run UPDATE query to reset the root password

mysql> UPDATE user SET password=PASSWORD("NewPassword") WHERE user="root";

mysql> FLUSH PRIVILEGES;

Step 5:  Stop MySQL safe daemon

Note: This time only run kill (pkill) “mysqld_safe” instead of “mysqld”
               
# pkill mysqld_safe

Step 6:  Start MySQL daemon

# service mysqld start

Step 7: Root password is reset and ready to use

 # mysql -u root -p mysql