Tuesday 18 November 2014

Firefox 31+ crashes in centos 6.4/6+

After updating firefox on Centos 6.4 it started showing the following error and would not start firefox.
$ firefox\n
/usr/lib64/firefox/firefox: symbol lookup error: /usr/lib64/firefox/libxul.so: undefined symbol: gdk_window_get_visual

The issue was resolved after installing
$ sudo yum list gdk-pixbuf2

Still if you get the following error:
/usr/lib64/firefox/firefox: symbol lookup error: /usr/lib64/libgdk-x11-2.0.so.0: undefined symbol: _XGetRequest

Then update gtk and libX11, in my case gtk was already updated to the latest version so, just updated the libX11 and it worked
$ sudo yum update libX11

Tuesday 11 November 2014

Thursday 23 October 2014

Eclipse keyboard shortcuts

1. Convert all letters to capitalcase -
 Ctrl + Shift + X 
2. Convert all letters to lowercase -
 Ctrl + Shift + Y 

Friday 17 October 2014

The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Get rid of any servletcontainer-specific libraries such as jsp-api.jar in your /WEB-INF/lib folder. This exception indicates that you've put servletcontainer-specific libraries of a container which supports only Servlet 2.4 / JSP 2.0 or older in there (the getJspApplicationContext() method was introduced in Servlet 2.5 / JSP 2.1). This is a major mistake. Those libraries don't belong in the webapp's classpath.

Perhaps you did this to overcome project compilation errors, which is indeed a pretty common beginner's mistake. This should have been solved differently, you should refer the target runtime in your project, not copy some libraries of an arbitraty servletcontainer make/version into your project. It would make your project incompatible with servletcontainers of a different make and/or version.

Monday 6 October 2014

Logging not working in spring mvc webapp project

Add the log4j.properties or the log4j.xml to a folder named classes inside web-inf folder

Tuesday 29 July 2014

Using Mahout Mapreduce

hadoop jar /home/Jijo/Mahout/mahout-distribution-0.9/mahout-core-0.9-job.jar org.apache.mahout.cf.taste.hadoop.item.RecommenderJob -Dmapred.input.dir=/jijo/mahout/links-simple-sorted.txt -Dmapred.output.dir=/jijo/mahout/output --numRecommendations 5 –b true -s SIMILARITY_TANIMOTOCOEFFICIENT

Thursday 17 July 2014

How to decompile a java class file in linux/centos

Navigate to the class file that has to be decompiled
javap -c classname
No need to include the extension .class

This command outputs the contents on stdout. Use the following to write it to a file
javap -c classname > classname.java

Friday 16 May 2014

How to remotely lock screen in CentOS

To lock
ssh -X user@node "export DISPLAY=:0; gnome-screensaver; gnome-screensaver-command -l;"
to unlock
ssh -X user@node "export DISPLAY=:0; gnome-screensaver; gnome-screensaver-command -d;"

Tuesday 13 May 2014

How to release yum lock

To find out what's locking up yum, try running:

ps aux | grep yum
Note the PID number of the process and run this to kill the process:
kill insert_PID_number
For eg:
$ ps aux | grep yum
root     23861  0.7  0.1 567568 26084 ?        S    10:34   0:01 /usr/bin/python 
/usr/share/PackageKit/helpers/yum/yumBackend.py simulate-install-files 
/tmp/wync_redhat64_v2.0.97.rpm
$ kill 23861

Wednesday 29 January 2014

Thursday 2 January 2014

Changing ownership in hdfs

To change the owner ie chown you need to run it as hdfs user
It changed the owner to myuser when i copied it from another location but this command saved the day.

sudo -u hdfs hadoop fs -chown -R hbase:hbase /hbase/Table_Name