Monday, May 21, 2012

To set default session timeout / automatically logout inactive SSH sessions in Linux

Solution 1:
Edit the /etc/ssh/sshd_config file to set the parameter as follows:
# vi /etc/ssh/sshd_config
ClientAliveInterval 3600
ClientAliveCountMax 0
# service sshd reload          or,  
# service sshd restart
Solution 2:
The /etc/bashrc file is used to apply the timeout system wide but if you need it to be user specific then modify the ~/.bashrc file instead and add as below:
# echo "TMOUT=3600 >> /etc/bashrc
# echo "readonly TMOUT" >> /etc/bashrc
# echo "export TMOUT" >> /etc/bashrc
Log off, start a new session and wait for One Hour. Your session should terminate.

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.