Saturday, April 26, 2014

Fatal error: ini_set(): To prevent data corruption, you are not allowed to turn on the mongo.native_long setting on 32-bit platforms in Unknown on line 0

It is a mongo client - RockMongo error.

To remove the error, open file index.php in the directory rockmongo and comment the line
ini_set("mongo.native_long", 1);
Make it two forward slashes at the starting of the line to comment it out.
// ini_set("mongo.native_long", 1);
Now try again.

The default username and password is admin

You may find some deprecated error here but you can use the RockMongo without fatal error.

Tuesday, April 15, 2014

Install nodejs or node.js on CentOS / RHEL / fedora

To install node.js ( nodejs ) on CentOS / RHEL / fedora, Run following commands.

# sudo yum install nodejs

Install Packages using npm on CentOS / RHEL / fedora
First install npm on centos / RHEL / fedora
# sudo yum install npm
Now install packages using npm
Install mongodb :
# npm install mongodb
Install express :
# npm install express

Install nodejs or node.js on ubuntu

To install node.js ( nodejs ) on ubuntu, Run following commands.

# sudo add-apt-repository ppa:chris-lea/node.js

# sudo apt-get update

# sudo apt-get install nodejs

# sudo apt-get install software-properties-common

Install Packages using npm on Ubuntu
First install npm on ubuntu
# sudo apt-get install npm
Now install packages using npm
Install mongodb :
# npm install mongodb
Install express :
# npm install express

XAMPP - Fatal error: Class 'ZipArchive' not found

Run following command to download file zip.so
# /opt/lampp/bin/pecl install zip
It will install zip functionality, now enable the extension zip.so

To Enable this, uncomment following line (remove the semi colon (;) )
extension="zip.so"
in the file /opt/lampp/etc/php.ini

Restart xampp.

phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

CentOS - If you are getting this error while executing phantomjs on terminal

phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
 
To remove this error.

# sudo yum install fontconfig
If you are still facing the error, Run
# sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
Note :
If you are using ubuntu or debian, use apt-get install to install this package.

phantomjs: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory

CentOS - If you are getting this error while executing phantomjs on terminal

phantomjs: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory
 
To remove this error.

# sudo yum install freetype
If you are still facing the error, Run
# sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
Note :
If you are using ubuntu or debian, use apt-get install to install this package.

Install phantomjs on Linux

Install phantomjs on Ubuntu / Debian

Download phantomjs package from here

If you have 32 bit Linux distribution, download 32 bit file package or if you are using 64 bit Linux distribution, download the 64 bit package.

Extract the zip file and open the directory. Now you will find the phantomjs file inside bin directory.

Copy the file and paste into /usr/bin, /usr/local/bin & /usr/local/share.

Create a file hello.js and put following code into it.


console.log('Hello, world!');
phantom.exit();
Now run the phantomjs from the terminal.
# phantomjs /path/of/hello.js or # /usr/bin/phantomjs /path/of/hello.js

Install phantomjs on CentOS / RHEL

Download phantomjs package from here

If you have 32 bit Linux distribution, download 32 bit file package or if you are using 64 bit Linux distribution, download the 64 bit package.

Extract the zip file and open the directory. Now you will find the phantomjs file inside bin directory.

Copy the file and paste into /usr/bin, /usr/local/bin & /usr/local/share.

Create a file hello.js and put following code into it.
console.log('Hello, world!'); phantom.exit();
Now run the phantomjs from the terminal.
# phantomjs /path/of/hello.js or # /usr/bin/phantomjs /path/of/hello.js
If you get the error
phantomjs: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory

 
To remove this error.

# sudo yum install freetype

Now run hello.js again but if you get another error
phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

 
To remove this error.

# sudo yum install fontconfig
 If you are still facing the error, Run
# sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
Now run again, it should work.

# phantomjs hello.js Hello, world!
Note : 
Execute or Run phantomjs on browser
you can't directly reference a phantomjs script in your browser, but you can communicate with a PhantomJS instance using HTTP GET/POST with Web Server module

Monday, April 14, 2014

ERROR:dbus.proxies:Introspect error on :1.303:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken

Open file /etc/dbus-1/system.d/org.freedesktop.PackageKit.conf
Find the line
<allow send_interface=org.freedesktop.PackageKit"/>
Add following line after above line
<allow send_interface="org.freedesktop.PackageKit.Transaction"/>

Open file /etc/dbus-1/system.conf
Find both lines
<allow send_requested_reply="true" send_type="method_return"/>
<allow send_requested_reply="true" send_type="error"/>

and replace top line with following line
<allow send_requested_reply="true"/>
Now delete the bottom line.

XAMPP Error- (20014)Internal error: Error retrieving pid file logs/httpd.pid Remove it before continuing if it is corrupted.

If you are getting above error, Remove file httpd.pid from /opt/logs/httpd.pid
Restart XAMPP.

Open video in Linux terminal in ASCII mode

If you want to open the video in Linux terminal, follow the steps.

They are not viewable but if you are Linux Geek, only you can understand the experience.

If you are using ubuntu / debian / mint, Install following package first.
# sudo apt-get install mplayer
Now play the video using terminal
# mplayer -vo caca "/path/of/the/video/.avi"

If you are using CentOS / RHEL / fedora, Install following package first.
# sudo yum install mplayer
Now play the song using terminal
# mplayer -vo caca "/path/of/the/video/.avi"

Play songs using Linux Terminal


If you want to play the songs using Linux command line, follow this.

If you are using ubuntu / debian / mint, Install following package first.
# sudo apt-get install mpg321
Now play the song using terminal
# mpg321 "/path/of/the/song.mp3"

If you are using CentOS / RHEL / fedora, Install following package first.
# sudo yum install mpg123
Now play the song using terminal
# mpg123 "/path/of/the/song.mp3"

ubuntu - E: Could not perform immediate configuration on 'util-linux'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)

If you are facing this error on your ubuntu or debian system. Run following commands.
# sudo apt-get upgrade -y

# sudo apt-get install upstart-job

# sudo apt-get dist-upgrade -y

Ubuntu - E: Package has No installation candidate

If you are facing this error on ubuntu, Run following command.
# sudo apt-get update

Postfix - master dead but pid file exists

Stop and start postfix. Do not restart, use individual commands for stop & start.

If you are still facing the problem
Remove /var/spool/postfix/pid/master.pid and /var/lock/subsys/postfix
Stop and start postfix

If you are still facing the problem, Check what is running on port 25
# netstat -lnp | grep :25
Kill the process and start postfix again.

ubuntu - Compiler error - msgfmt command not found

Install following package
# sudo apt-get install gettext
or

use '-i' while installing package from source code.
make -i install

ubuntu - configure: error: zlib.h was not found or is not usable. Please install zlib

Install these packages, libgcrypt11-dev and zlib1g-dev
# apt-get install libgcrypt11-dev

# apt-get install zlib1g-dev

Starting httpd: [date] [warn] _default_ VirtualHost overlap on port 80, the first has precedence

To remove this error, uncomment following line in /etc/httpd/conf/httpd.conf

NameVirtualHost *:80
Now restart httpd
# service httpd restart

Apache - Browser throwing sql query and php code

Apache - Browser showing mysql queries and php code

Open php.ini file
Find "short_open_tag = Off" and make it enabled
short_open_tag = On
Restart Apache. If you are using xampp, restart lampp after making changes in php.ini


If you are using xampp and you are still facing this problem.
Uncomment following line in the file /opt/lampp/etc/httpd.conf
Include etc/extra/httpd-xampp.conf
This line should not be commented.

If you are using centos / RHEL / fedora and you are still facing the problem
Run following command in the terminal.
# yum install php php-mysql -y

ubuntu - could not perform immediate configuration on 'python-minimal'

If you are facing this error, Run the following command in the terminal
# sudo apt-get -f install -o APT::Immediate-Configure=false

CentOS / RHEL / fedora - Apache error - include() unable to allocate memory for pool

Add line in httpd.conf
php_flag apc.cache_by_default Off

Add line in php.ini
apc.enabled = 0

Restart httpd

# service httpd restart

HP laptop / notebook - show wired and wireless connections simultaneously


Wireless connections are disappeared after connecting to LAN

Press F10 before booting and open the BIOS mode

System Configuration > Built in settings

Disable the option LAN/Wireless switch
The option should not be enabled.

Save the changes and exit.

Now you can see wired and wireless connections together.

Fatal error: Call to undefined method PMA_Config::load() in /usr/share/phpmyadmin/libraries/Config.class.php

 Solution :

Restart apache and mysql both.

If you are using XAMPP - Restart it.
# /opt/lampp/lampp restart
It will restart apache and mysql both.

If you are using apache2 - restart it using
# service apache2 restart
If you are using apache2 - restart it using
# service mysql restart
If you are using httpd - restart it using
# service httpd restart
If you are using mysqld - restart it using
# service mysqld restart

See the Mail Queue and Delete all pending mails on Linux server

List the Pending mails and delete them on Linux Mail Server

If you want to see all the pending mails on your Linux server, Run following command:
# mailq
If you want to delete all these pending mails, Run
# postsuper -d ALL