Saturday, December 29, 2007

Mouse Over Preview in Ubuntu


To get Mouse over preview of MP3 files working, Install the following pacakages,

sudo apt-get install mpg321
sudo apt-get install ubuntu-restricted-extras
sudo apt-get install pulseaudio
sudo apt-get install pulseaudio-esound-compat
sudo apt-get install libasound2-plugins

Friday, December 28, 2007

Apaceh Error - Open as .phtml file ?

I have installed the Apache server using apt-get in ubuntu. I also installed php5 library files.

But while trying to open .php files , it gives the pop-up like

"open as .phtml file ?"

On google, we can see more posts on this error. Most of them mentioned to add the following lines

in httpd.conf,


<ifmodule>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</ifmodule>


But in my system , it already added by php5 library installation.

Some of them mentioned to clear the browser cache.

Yes ! Its work for me....;-)

How to get Duplicate rows from table

Example:

SELECT number, count(*) FROM doc_master GROUP BY number HAVING count(*) > 1

Usage of SAJAX

Installing Fonts on Ubuntu

Just copy your font into your users

font folder ~/.fonts (”~” represents the path to your home dir e.g.

/home/bala/.fonts). If it doesn’t exist then create it. Then

exectue the font cache command from the terminal.

sudo fc-cache -vf

  • -v option is for verbose or it tells you exactly what the command is doing.
  • -f option forces updating of all cached font files
This updates the font cache on your system and you should be able to use the fonts right away.

Tuesday, September 11, 2007

Restore Backup on PostgreSQL

To restore the backup on postgresql the steps are:-

1) dropdb
2) createdb
3) psql or pg_restore to import data into the backup database.

If some clients are connected to the backup database during the 1st
Step (dropdb) the postmaster throws an error saying clients connected
cannot drop database.

” ERROR: database “database_name” is being accessed by other users “

Following will solve the problem of killing connections prior to dropping:

kill `ps auxww | grep ‘postgres: postgres <database>’ | grep -v ‘grep’
| perl -F”\\s+” -ane ‘print “$F[1] “;’`

Basically, this takes a process listing, finds all entries
corresponding to connections to the target database, excludes the
calling command, then isolates the pids using Perl.

Following will be Much cleaner than previous

pkill -f ‘postgres: postgres &lt;database&gt;’

Powered by ScribeFire.