Wednesday, December 7, 2016

Reboot to windows form linux-Only for once

Follow the below steps to boot to windows when you are in Linux.

1. check the entries in grub.cfg
[sudiptakumar_laha@symc Desktop]$ sudo grep '^menuentry' /boot/grub2/grub.cfg
menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-e138508e-48ed-4b19-9bcc-446bbfa2da86' {
menuentry 'CentOS Linux (0-rescue-a962980d35964ca6aa2a4d23e8f02266) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-a962980d35964ca6aa2a4d23e8f02266-advanced-e138508e-48ed-4b19-9bcc-446bbfa2da86' {
menuentry "Windows 7" {


2. Here we see windows 7 is the 3nd meny entry and the index is 2 starting from 0. Hence sent grup-reboot 2

[sudiptakumar_laha@symc Desktop]$ sudo grub2-reboot 2


3. Now reboot your computer.

[sudiptakumar_laha@symc Desktop]$ sudo reboot

Sunday, July 17, 2016

Elasticsearch -Part 1

Brief of elasticsearch

Elastic search organizes your data  a makes it available for online searching.

Similar products:

  1. Apache Lucene

Installation prerequisites:

Installation instructions:

  • Create a directory /elaticsearch  and copy elasticsearch-2.3.4.tar.gz  inside the directory.
  • cd /elasticsearch
  • Extract the elasticserach contents tar -xvf elasticsearch-2.3.4.tar.gz

Starting elastic search

  • Go to the bin directory of the elaticsearch folderextracted folder  and execute the below command.
  • /elasticsearch

Verify elastic search install




Sunday, September 28, 2014

Coding and Chatting- How they affect each other.

Today I choose to write this article based on my experience in past few years. Social networking sites are popular and people like to spend most of their time meeting new people and talking to them. One of the main thing people like to do is chatting, one of the easiest way to communicate with new and old friends. But the thing I am interested is how it affects the software professionals who write code.

Chatting may refer to any kind of communication over the Internet that offers a real-time transmission of text messages from sender to receiver. Its a wonderful technology to communicate with people. Most of us use a lot of jargon and short form of words to make it happen. There is nothing wrong in it, but we generally get habituated with this short form of worlds (like Please -Pls etc).  This short form of words become annoying for a software professional when they write such words in software code. I personally have done the same mistake while writing log messages in professional code. As we are habituated with such words, they get a place in our logs messages/documentations. Also being familiar with such words, it become difficult to review such code errors.

The conclusion is we stop using social networks. I am joking- That cant be true. But we need to be extra careful while writing code and should omit those newly created words. Being a software professional we may avoid using short forms of words while chatting and make our mind familiar with the correct words.


Sunday, July 3, 2011

Win Vista PE+usb not recognized+ VMWARE

Hi,

This is a solution i tried to make ghost copies with winPE in VMWare.
Problem-
It recognizes on the hard drive and not the USB devices. So I was unable to make the save the image from the ghost copy.

Solution-
Make a copy of the vmdk file in the wmware folder and name it as xxxx_1.vmdk. In the vmware setting add a new Hard Drive with the new vmdk file(xxxx_1.vmdk). Boot the image with windows PE. Now it will show up 2 hard drives. So the image of the one hard drive can be saved to the other one. Once done shutdown the VM. Rename the two vmdk files. Boot the operating system with the new vmdk. Then the image can be transfered using FTP(or copying).

Hope this may be helpful.

Saturday, June 25, 2011

Updating/Refreshing a dojo Tree

A dojo tree can be reloaded or refreshed with the below code.

<html>
<head>
<link rel="stylesheet" type="text/css" href="dojo-release-1.6.0/dojo/resources/dojo.css" />
<link rel="stylesheet" type="text/css" href="dojo-release-1.6.0/dijit/themes/tundra/tundra.css" />
<script src="dojo-release-1.6.0/dojo/dojo.js" language="javascript"></script>
<script language="javascript" type="text/javascript">
dojo.require("dojo.parser");
dojo.require("dijit.form.Button");
dojo.require("dijit.Tree");
dojo.require("dijit.tree.ForestStoreModel");
dojo.require("dojo.data.ItemFileWriteStore");
var treeModel;
</script>
<script>
function reload(){
if(dijit.byId("treeOne")){
// Destroy the widget
dijit.byId("treeOne").destroyRecursive();
}
var store = new dojo.data.ItemFileWriteStore({
url: "./json/files.json"
});

treeModel = new dijit.tree.ForestStoreModel({
store: store,
query: {
"type": "Folder"
},
rootId: "server",
rootLabel: "ROOT",
childrenAttrs: ["children"],
});
document.getElementById("treespan").innerHTML="<div id='treeOne'></div>"
new dijit.Tree({
model: treeModel,
},
"treeOne");
}
</script>
</head>
<body class="tundra">
<button dojoType="dijit.form.Button" type="button" onClick="reload()" >Load Tree</button>
<span id="treespan"></span>
</body>
</html>



Back Track a dojo Tree

If we have a tree node of dojo tree we can back track the tree using the below code.

Once we get a tree node of the dojo tree(for Right click/click), we can find out the root node of the tree .
We get the values of the nodes from the datastore that was used to create the tree.


var tn =dijit.getEnclosingWidget(e.target);

while(parent.indent >0){
// get the value from the nodes from the data store
console.debug(store.getValue(parent.item, 'name'));
parent=parent.getParent();
}



Tuesday, September 14, 2010

Running JBOSS Programmatically from java

Please find below code to run JBOSS Programmatically from JAVA. Please include jboss jars in your classpath.

I tested the following code for JBOSS-6.0.0.M2


package com.sudipta.jboss.conf;

import org.jboss.Main;

public class JbossOperation {
public static Main ob;
static Class jbossMain;
static{
try {
jbossMain=Class.forName("org.jboss.Main");
ob = (Main)jbossMain.newInstance();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}

}

/**
* START JBOSS SERVER
* @return true if started successfully
*/
public static boolean startServer(){
boolean status=true;

String str[]={"-c","default"};
try {
ob.boot(str);

} catch (Exception e) {
e.printStackTrace();
return false;
}
return status;
}

/**
* STOP JBOSS SERVER
* @return true if started successfully
*/
public static boolean stopServer(){
boolean status=true;
try {
ob.shutdown();
} catch (Throwable e) {
e.printStackTrace();
}

return status;
}

/**
* Main method
* @param args
*/
public static void main(String args[]){
System.out.println("---------------------Strating the server------------------");
startServer();
System.out.println("---------------------Stoping the server------------------");
stopServer();
System.out.println("---------------------SERVER STOPPED------------------");
}
}



About Me