Posts which you will also like.

Friday, December 30, 2011

Running executable files on a remote computer



To run executable files on a remote computer first of all you have to download the Pstools suite.
You can download Pstools from here: http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx

About Pstools suite:Light bulb
Pstools is a command line tool package, that has some tools like the; psexec, pslist, psservice, psloggedon and some more tools.
PsTools let you manage local AND remote systems, that's nice because we want to do some remote stuff.
One of the relevant tool for this post is Psexec which lets us to run a program on the remote system/host.

Sysntax for Psexec: Light bulb
Psexec -i \\HOST P:\a\t\h\program
The -i option let you run it interactively.
Where the \\HOST is is the host computer name or IP address.
Then you give the path of the program and the program name to be run.

Example: 
Psexec -i \\Rajeev-PC C:\WINDOWS\System32\mspaint.exe
Psexec -i \\Rajeev-PC "C:\Program Files\Internet Explorer\iexplore.exe" “www.techyrajeev.blogspot.com


Read More ->>

Monday, November 21, 2011

Complete Data Recovery From Hard Disk Crash :A Tutorial





Hard disk crash is one of the worst nightmare of computer users.It can happen at any moment or at any time, means it is not certain when it will occur.I created this tutorial because my portable hard disk was crashed two times and when I asked the experts some advised to format it and some demanded huge sum of money for recovery.So I decided to find the solution.
Light bulbA hard disk crash can occur by any of the following reasons:
  1. Virus
  2. High voltages,Current leak
  3. Problem in usb port in which you connect your pen drive or External Hard Disk
First cause is not too severe and can be corrected very easily but other remaining two may cause the disk/Pendrive to be of almost no use.It could damage the internal circuitry of the Pendrive and in case of Hard Disk read/write head starts crashing with disks.
Problem of Virus: If Hard Disk/Pen Drive shows its size but you are unable to access it directly then It could be the problem of virus.In this case scan it from a good but updated antivirus and then follow the recovery procedure.
For the Hard Disk:If scratching sound comes from your hard disk and It is inaccessible too then do not retry again again to use the drive continuously rather stop using it and use only it for recovering the data(I will discuss how to recover the data later in this tutorial).After you have successfully recovered your data from it and saved it to another drive replace your drive if it is in its warranty period.
For the pendrives: If problem occurred due to 2nd or 3rd case then in 90% cases Pendrive is damaged completely and only way is to get it replaced by your vendor.This case happened to me more than 5 times and I replaced my pendrive each time and got a new one Smile.
Recovery: Now I will discuss how to recover your data from a crashed hard disk/Pendrive.
Windows provides great in built tools for this purpose.So first try them before going to buy any third party proprietary tools.
chkdsk: You might have used this command before via right clicking your drive –>tools--->select the first option:Error checking.
But I would recommend the command line version since your Hard Disk/Pendrive may not be visible and If it is visible It would take too long to respond when you will right click on it.
So better to switch to command line and follow the steps:
  1. Open the command prompt with administrative privilege i.e “Run as administrator”
  2. Run the chkdsk with following switches
  3. chkdsk  [driveletter:] /F /R
  4. Clock wait for the five stages to complete.
recover1Run the above step two times for proper recovery.*you can leave the option /R if you just want to fix the errors.This command works by removing the bad sectors by chaining i.e if a sector is bad then all data at that sector is copied to another position and all references to that bad sector are transferred to new sector.This scheme is known as sector sparing or forwarding.
Light bulbA typical bad-sector access might be as follows:
1.The operating system tries to read logical block 63.
2.The controller calculates the Error Correcting Code and finds that the sector is bad.
3.It reports this finding to the operating system.
4.The next time the system is rebooted, a special, command is run to tell the Hard disk controller to replace the bad sector with a spare.
5.After that, whenever the system requests logical block 63, the request is
translated into the replacement sector's address by the controller.recover blogpost
Third Party Tools: You can also use the third party tools to recover your data.
Some popular ones are:
  • Acronics Disk Director Home
  • Active File Recovery
  • Seagate File Recovery
  • iCare Data Recovery


Read More ->>

Friday, November 11, 2011

A Tutorial on Creating GUI for compiling and running a JAVA program

In this post I am trying to explain a GUI which is used for compiling and running a java program.
In this program you have to specify the java file which contains the java program.After that on clicking the button compile this simple GUI compiles the java file.If there are any error in source file then that error is displayed in the TextArea of the GUI.If source file contains no error then a success message is displayed in the TextArea.
After that we can run the program by clicking run button.Any run time exception is generated is on the TexArea otherwise the output is displayed.


Download the Jar file: JavaCompiler.jar

Read More ->>

Monday, November 7, 2011

BackTrack 5 Released !

Most favorite OS for System penetration testing and Ethical Hacking BackTrack 5 in released recently.This version has several improvement over the previous one.
This BackTrack version is based on Ubuntu Lucid LTS. Kernel 2.6.38.


As with its predecessor this BackTrack version is also freely available to download.So What are you thinking now ! ! !
Download it and start the hacking(Ethical) :)

Download the BackTrack 5 from here: BackTrack 5

Read More ->>

Saturday, October 15, 2011

Deleting a non empty directory using JAVA

Here in this post I created a java program which deletes the directories which are non empty.
In this program I have used recursion approach to delete the directory which is not empty.Program continuously searches the bottom most folder in directory tree deletes it then return back to its parent and deletes it.This process is completed when recursion reaches the root directory i.e parent folder of all child folder.Delete that parent folder and we are done.


  Download Source Code for this Application: DelDir.rar

Read More ->>

Wednesday, September 7, 2011

A Tutorial on Freqency counter program in java

This is a simple program which counts the frequency of occurrences various character in a file.
It browses for the file containing text and counts the occurrences of characters.
Image below shows the result of this program.


Download source code:FreqCounter.rar

Read More ->>

A Tutorial on Creating Digital Clock In Java Using Threads

In this example I created a live digital clock in Java using SWING and THREAD classes.There are two many methods to create this and I chose the one in which I extended the Jlabel class which shows the current time with the help of Threads.
Next I added a JLabel to the JPanel and instantiated my custom JLabel class and gave its reference to the label that was added to JPanel.

The image below shows the outcome of the code:


OUTPUT:

Download source code :LiveClock.rar

More on this at techcresendo.com
Read More ->>

Tuesday, April 5, 2011

Tricks to Make Computer Booting and Shut Down faster !!!

There are various issues for slow computer shutdown(both Hardware and Software)
Following article deals with both of them. Please note the system boot speed before and after using the tricks to appreciate the difference.

1.LIMITING SERVICES THAT LOADS : Well,we have a conception that older the installed Operating System gets slower it would be. Quite so. But the reason being that we clog it by numerous programs and utilities. For this Soluto is a excellent utility which can be downloaded for free from here or you can use a excellent utility Bootvis which can be downloaded from here . If you have problem using Bootvis click here
2. BIOS : Go to BIOS and then go to boot menu. In most modern BIOS you would find option of Quick Boot ,ENABLE it. Also put Hard Disk in the highest priority in Boot Device Priority.
3. MSCONFIG : To restrict unwanted start up programs from loading in the RUN (Win+R) type MSCONFIG then enter. There in the startup tab would be listed utilities the load on boot up. Check here in case of confusion (whether its necessary or not)
4. LAN : If you are connected to LAN and DHCP server is enabled. Then every time you boot it is tested whether or not you have a valid IP address. To wipe off this time use a static IP address by assigning values in RUN(Win+R) -> NCPA.CPL -> local area network -> Properties -> Internet Protocols TCP/IP -> Properties . Fill your static IP ,subnet,default gateway,DNS server.
5. USB/COM Ports : If you don't use USB/COM ports to connect devices .Disable the devices at Control Panel -> System -> Hardware ->Device Manager.
6. Pagefile.sys :For security reason pagefile.sys is cleared before shutdown. It stores various sensitive data . If you have a Personal Computer and it doesn't deals with sensitive data then disable this default clearing of pagefile.sys by RUN(Win+R) -> Regedit then navigate to : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
Change the value of ClearPageFileAtShutdown to 0. Close Registry and reebot.

7. Recent Documents : It stores the recent documents used. After a certain time this list gets long and has a adverse effect . Clear it time to time else go to RUN (Win+R) -> Regedit and navigate to :

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Create a DWORD value named ClearRecentDocsOnExit and give it a data value of 1

In case of any problem in applying any of the trick or for any suggestion,feel free to revert.
Read More ->>

Sunday, March 27, 2011

Playing with Google:I am feeling lucky

Here are some tweaks you can play with google I am feeling lucky option.
1.google holiday:shows the holiday logo and events in style of google
2.google bsd:show the linux version of google
3.google linux:show the linux version of google
4.google easter egg:lets you to play the easter egg game
5.google scholar:Useful for scholars
6.google suggest:this will give you suggestions in your search
7.early google:shows the earliest version of google when it was not too popular as today
8.elgoog:reverses the name of google
9.google blog search:lets your search to be blog specific
10.google heart page:shows the bouncing heart following your mouse at the screen
11.google zeitgeist:lets you to search patterns,trends,and surprises (provides very accurate search)
12.gogole moms:A page of google for mother's day
13.xx-hacker:Shows the search page suitable for hackers!
14.google mentalplex:Search smarter and faster with Google's MentalPlex
press I am feeling lucky after typing these keywords and see the result(do not type ':' with keywords).
Read More ->>

Friday, February 11, 2011

A JAVA Program:Barchart

Program to make Barchart

import javax.swing.JFrame;
import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JPanel;
class bc extends JPanel
{  
  
    String [] x={"2004","2005","2006","2007","2008"};//plot varaibles Converted this to String for convenience
    int [] y={50,60,68,79,90,100};//Data to be plotted
    Color clr;
    int Hspace,Xpos;
    int Xrect,Yrect;
    public bc()
    {
        //default constructor
    }
    public bc(int [] data,String [] caption)
    {
        y=data;
        x=caption;
    }
    public void setValues(int [] data,String [] caption)
    {
        y=data;
        x=caption;
    }
    public void set(Color c)
    {
        clr=c;
    }
    public Color get()
    {
        return clr;
    }
    public Color reset()
    {
        clr=Color.RED;
        return clr;
    }
    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        g.drawLine(40,10,40,410);
        g.drawLine(40,410,570,410);
        g.setFont(new Font("serif",Font.BOLD+Font.ITALIC,14));
        set(Color.RED);
        g.setColor(get());
        g.drawString("100%",15,20);
        g.drawString("75%",15,120);
        g.drawString("50%",15,220);
        g.drawString("25%",15,320);
        Hspace=(530/x.length);//570-40
        Xpos=45;
        for(int i=0;i
        {
            // g.drawString((new Integer(x[i])).toString(),Xpos,430);
            g.drawString(x[i],Xpos,430);
            Yrect=4*(100-y[i])+10;//Scaling factor
            g.drawRect(Xpos+10,Yrect,15,410-Yrect);
            g.setColor(Color.GREEN);
            g.fillRect(Xpos+15,Yrect+10,5,400-Yrect);
            Xpos+=Hspace;
            g.setColor(reset());
        }
      
      
      
    }
  
}
class barchartp
{
    public static void main(String args[])
    {  
        bc b=new bc();
        JFrame jr=new JFrame("Barchart program");
        jr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jr.add(b);
        jr.setSize(600,600);
        jr.setLocationRelativeTo(null);
        jr.setVisible(true);
      
  
    }
}

OUTPUT:



Read More ->>

Wednesday, January 26, 2011

A JAVA Program:Bouncing ball with color change on collision with walls

In this program a ball is created which bounces back and forth and also changes its color on collision with the walls of the container.

CODE:

import java.awt.Graphics;
import java.util.Random;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JOptionPane;
class bounceball extends JPanel
{
    private static final int win_w=640;
    private static final int win_h=480;
    private float rad=100;// radius of the ball
    private float x=rad+50;
    private float y=rad+20;//center coordinates of the ball
    private float sx=4;
    private float sy=3;       //change in the coordinates(x and y)
    private static final int update_rate=30;//refresh of screen per second
    // Now constructor
    private Random r;
    private Color clr=Color.BLUE;
    public void set(Color c)
    {
        clr=c;
    }
    public Color get()
    {
        return clr;
    }
    public bounceball()
    {
        r=new Random();
        setPreferredSize(new Dimension(win_w,win_h));//size of the panel is set to
        //the size of the window
        Thread ballthread=new Thread(){
            public void run(){
                                while(true)
                                {
                                    x+=sx;
                                    y+=sy;
                                    //here we handle collision with the window walls
                                    //checking the horizontal collision
                                    if(x-rad<0)
                                    {  
                                        sx=-sx;//reverse the direction
                                        x=rad;
                                        set(new Color(r.nextInt(256),r.nextInt(256),r.nextInt(256)));
                                      
                                    }
                                    else if(x+rad>win_w)
                                    {
                                        sx=-sx;
                                        x=win_w-rad;
                                        set(new Color(r.nextInt(256),r.nextInt(256),r.nextInt(256)));
                                    }
                                    //checking the vertical collision
                                    if(y-rad<0)
                                    {
                                        sy=-sy;
                                        y=rad;
                                        set(new Color(r.nextInt(256),r.nextInt(256),r.nextInt(256)));
                                    }
                                    else if(y+rad>win_h)
                                    {  
                                        sy=-sy;
                                        y=win_h-rad;
                                        set(new Color(r.nextInt(256),r.nextInt(256),r.nextInt(256)));
                                    }
                                    repaint();
                                    try
                                    {
                                        Thread.sleep(1000/update_rate);
                                    }
                                    catch(InterruptedException e)
                                    {
                                        JOptionPane.showMessageDialog(null,"Please don't interrupt me while sleeping !","Disturbed",JOptionPane.ERROR_MESSAGE);
                                    }
                                }
                             }
                            };
        ballthread.start();//start the thread's execution      
    }
    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        g.setColor(Color.BLACK);
        g.fillRect(0,0,win_w,win_h);
        g.setColor(get());
        g.fillOval((int)(x-rad),(int)(y-rad),(int)(2*rad),(int)(2*rad));
        g.setColor(Color.WHITE);
        String s=String.format("Position:[%3.0f,%3.0f]",x,y);
        g.drawString(s,20,40);
    }
    public static void main(String [] args)
    {
        JFrame jr=new JFrame("Bouncing ball.");
        bounceball ball=new bounceball();
        jr.add(ball);
        jr.setVisible(true);
        jr.setSize(650,500);
        jr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jr.pack();
    }
}

OUTPUT:


More on this at techcresendo.com

Read More ->>

Thursday, January 13, 2011

A java program to print a shape using wired mesh

This program uses swing and Graphics class.All coding is straight forward and can be easily understood.You may need to create main method to use this.

import javax.swing.JPanel;
import java.awt.Graphics;
public class Drawpanel4 extends JPanel
{
    public void paintComponent(Graphics g)
    {
        int width=getWidth();
        int height=getHeight();
        int stepx=width/15;
        int stepy=height/15;
        super.paintComponent(g);
        int x=0,y=0,i=0,j=0,k=0,l=0;
        while(i<15)
        {   
            g.drawLine(0,y,x,height);
            y+=stepy;
            x+=stepx;
            i++;
       
        }
        x=0;y=height;   
        while(j<15)
        {
            g.drawLine(0,y,x,0);
            y-=stepy;
            x+=stepx;
            j++;
        }
        x=width;y=0;
        while(k<15)
        {
            g.drawLine(width,y,x,height);
            y+=stepy;
            x-=stepx;
            k++;
        }
        y=height;x=width;
        while(l<15)
        {
            g.drawLine(width,y,x,0);
            x-=stepx;
            y-=stepy;
            l++;
        }
    }
}



OUTPUT:


Read More ->>

Wednesday, January 12, 2011

Program in java to show file description

This program shows the full description of a file or directory such as name ,when modified , length etc.

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Font;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
class FileDemonstration extends JFrame
{
    private JTextArea outarea;
    private JScrollPane scroll;
    public FileDemonstration()
    {
        super("Testing Class file..");
        outarea=new JTextArea();
        outarea.setFont(new Font("Serif",Font.BOLD,14));
        scroll=new JScrollPane(outarea);
        add(scroll,BorderLayout.CENTER);
        setSize(400,400);
        setVisible(true);
        analyzefiles();
    }
    private File getFileinf()
    {
        JFileChooser fc=new JFileChooser();
        fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        int result=fc.showOpenDialog(this);
        if(result==JFileChooser.CANCEL_OPTION)
            System.exit(1);
           
        File fname=fc.getSelectedFile();
        if((fname==null) || (fname.getName().equals("")))
        {
            JOptionPane.showMessageDialog(this,"Invalid Name!","Invalid Name!",JOptionPane.ERROR_MESSAGE);
            System.exit(1);
        }
        return fname;
    }
    public void analyzefiles()
    {
        File name=getFileinf();
        if(name.exists())
        {
            outarea.setText(String.format("%s %s\n %s\n %s\n %s\n %s \n %s\n%s\n %s %s\n %s %s",
            name.getName(),"exists.",(name.isFile()?" is file.":"is not a file."),
            (name.isDirectory()?"is directory":"is not a directory"),(name.isAbsolute() ? " is absolute.":"is not absolute"),
            "Last Modified:",name.lastModified(),"Length",name.length(),"Path:",name.getPath(),"Absolute Path",name.getAbsolutePath(),
            "Parent",name.getParent()));
        }
        if(name.isDirectory())
        {
            String[] dir=name.list();
            outarea.append("\n\nDirectory content\n\n");
            for(String dirname:dir)
                outarea.append(dirname+"\n");
        }
        else
            {
                JOptionPane.showMessageDialog(this,name+"does not exits.","Error",JOptionPane.ERROR_MESSAGE);
            }
    }
}
class jfile
{
    public static void main(String args[])
    {
        FileDemonstration f=new FileDemonstration();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}

output:



Read More ->>

Saturday, January 8, 2011

Demonoid Invitation codes

Entry to demonoid:
Demonoid is one of the top most ranked torrent tracker website.One can only register to this site either through invitation code or through open seasons.
Open season means the first week of the month when demonoid is open for all. Within this period we don't need the invitation code to register.Although invitation codes are free but some people tries to sell it because of its demand.
Now demonoid.com is changing its  address to demonoid.Me.



Some invitation codes are:

qc8h14wymfg3gr70sb1dai0rnjq82qncr271tz0
tcb6we3sz1mjvrhhs00m192m5amk6ei6btivlut0coy7
3giy5v5usworywionwrijgv4bpovmfn6bil
whyqv9d1lrqqhat9gayhwcw105b7v18ul5xc9p1jm3
av4w4rzpse3t2uchormaxu316cs55h5zf40o34opkcp
sujwprq4slhqc8178vsl00jtdyxtz3nccqfqvxop6
lclvuoigqclk988fngw4zf4hs4bmb8iv0agpuof
70kasx53pw0ot0hmz4o69r90w01lkqh32iru37eqh4djn
h25zfcjn76a1lls739ous58aun0hovf870nl
kezd9l0ht0hdim9g64n3ao48efi2c7tm
eiibawgpetm65r1abo38lsi0bxajui3f6q
v0187ko1g6ocstv823pqfqt704ijqdis0am1qovfiyu
efycj6bbzaqax1qq98cgwybxpanghyu9augnmiv9tkgh
helldown3Xa3mb0rbyr9y4p0vj37flqqzm6zn24j4jvkl
helldown3Xh21g8y9f7y8mubfdwaawrow49n
helldown3Xaoti0lndjcmmqul1zmur9l0bzvy7xvi7jnj
helldown3Xpvj1aojabb8hz9tl57i3pvsx2y0n8gdvwtk
helldown3X3tra2neoiyb63kxayw391z9bdla9ocsfve0
helldown2X4vi138bd8m0d7jyk7pt2691dyoqtq7vz6
helldown2X9xpayin63q69so3k9s8fgb79ihga
helldown2Xpf2gwu279mljniworo35kwsueca0v4o5p8y
helldown2Xsfpf2wy88jq6i4otq911klcgdbi7upcu690
helldown2Xn3xmy23hruspns0bjovnibxbkgge6zhaxfo

There is no guarantee that all of these codes may work because some of them my have been used already.

Read More ->>
DMCA.com Protected by Copyscape Online Plagiarism Tool