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