Sunday, 29 July 2012

Virus in Notepad


Shut down your friend computer:
Type in notepad:

@echo off
msg * I don't like you
shutdown -c "Error! You are too silly!" -s


Save it as "<filename>.bat". and run it

Friday, 6 January 2012

GRANT,REVOKE previleges for the USER in Oracle -xe

Creating Use AND PROVIDING PREVILEGES:


SQL>connect system/<passward>


SQL>CREATE USER <user name> IDENTIFIED BY <USER_passward>;


SQL>ALTER USER <user name> ACCOUNT UNLOCK;


SQL>GRANT CONNECT TO <user name>;


SQL>GRANT RESOURCE TO <user name>;


SQL>GRANT CREATE VIEW TO <user name>;


SQL>GRANT CREATE TRIGGER TO <user name>;


                                  OR


SQL>GRANT DBA TO <user name>;

Install ORACLE 10G Express Edition in LINUX OS

 To install Oracle-xe:


mount the software in download folder >> right click and open with Gdebi package installer


>>close the window >>Open New terminal and type the following:


sudo /etc/init.d/oracle-xe <space> configure <enter>


provide passward for system.


Now oracle-xe is installed.

Tuesday, 19 July 2011

LOCK THE FOLDER

Note :If you are familiar with DOS commands,then only try this.

1. Gather all the files that you wish to hide in a folder anywhere in your PC (make it in C:\hidden – RECOMMENDED).

2. Now, add those files in a RAR archive (e.g. secret.rar). This file should also be in the same directory (C:\hidden).

3. Now, look for a simple JPEG picture file (e.g. logo.jpg). Copy/Paste that file also in C:\hidden.

4. Now, open Command Prompt (Go to Run and type ‘cmd‘). Make your workingdirectory C:\hidden.

5. Now type: “COPY /b logo.jpg + secret.rar output.jpg” (without quotes) – Now, logo.jpg is the picture you want to show, secret.rar is the file to be hidden, and output.jpg is the file which contains both.

6. Now, after you have done this, you will see a file output.jpg in C:\hidden. Open it(double-click) and it will show the picture you wanted to show. Now try opening the same file with WinRAR, it will show the hidden archive .

Monday, 18 July 2011

PROGRAM TO OBTAIN ADDRESSES OF PRINTER PORTS

//PROGRAM TO OBTAIN ADDRESSES OF PRINTER PORTS 
#include <stdio.h>
#include <dos.h>

void main(void)
{
      unsigned int far *ptraddr;  /* Pointer to location of Port Addresses */
      unsigned int address;  /* Address of Port */
      int i;

      ptraddr=(unsigned int far *)0x00000408;

      for (i = 0; i < 3; i++)
      {
               address = *ptraddr;
               if (address == 0)
               printf ("No port found for LPT%d \n", i+1);
               else
               printf("Address assigned to LPT%d is %Xh\n", i+1,address);
              *ptraddr++;
       }
}

Note :Execute this code on your own risk.

Thursday, 10 March 2011

* COBOL PROG to PERFORM ARITHMETIC OPERATIONS USING CONDITION-NAME CONDITION

       IDENTIFICATION DIVISION
       PROGRAM-ID. ARITHMETIC OPERATIONS.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       77 OPR PIC X.
       88 ADDITION VALUE "+".
       88 SUBTRACTION VALUE "-".
       88 MULT VALUE "*".
       88 DIVI VALUE "/".
       88 EXT VALUE "E".
       88 VALID-VALUES VALUES ARE "+" "-" "*" "/" "E".
       77 A PIC S999V99.
       77 B PIC S999V99.
       77 RESULT PIC -9999.99.
       PROCEDURE DIVISION.
       INP-PARA.
            DISPLAY "ENTER TWO NUMBERS".
            ACCEPT A.
            ACCEPT B.
       MENU-PARA.                                                                                                                                                         PPPPP
            DISPLAY "MENU".
            DISPLAY "ADDITION(+)".
            DISPLAY "SUBTRACTION(-)".
            DISPLAY "MULTIPLICATION(*)".
            DISPLAY "DIVISION(/)".
            DISPLAY "EXIT(E)".
            DISPLAY "ENTER THE OPERATOR".
            ACCEPT OPR.

            IF ADDITION
            COMPUTE RESULT = A + B.
            IF SUBTRACTION
            COMPUTE RESULT = A - B.
            IF MULT
            COMPUTE RESULT = A * B.
            IF EXT GO TO ERR-PARA.
            IF DIVI
            IF B = 0
            DISPLAY "DIVISION BY ZERO" GO TO ERR-PARA
            ELSE
            COMPUTE RESULT = A / B.
            IF NOT VALID-VALUES
            DISPLAY "WRONG CHOICE" GO TO MENU-PARA.
            IF RESULT = 0
               DISPLAY 0.
            DISPLAY "RESULT= ", RESULT GO TO MENU-PARA.
       ERR-PARA.
       STOP-RUN.
.

*COBOL program to generate series which are divisible by 5 but not by 4


       IDENTIFICATION DIVISION.
       PROGRAM-ID. NUM.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       77 N PIC 9(3).
       77 I PIC 9(3) VALUE 10.
       77 R PIC 9(3).
       77 Q PIC 9(3).
       PROCEDURE DIVISION.
       READ-PARA.
           DISPLAY "Enter the limit"
           ACCEPT N.
           IF N < 10
           DISPLAY "NO NUMBER DIVISIBLE BY 5 "
           GO TO EXIT-PARA.
           DISPLAY "EVEN NUMBERS DIVISIBLE BY 5".
       COMPUTE-PARA.
           IF I > N GO TO EXIT-PARA.
           DIVIDE I BY 4 GIVING Q REMAINDER R
           IF R NOT = 0
           DISPLAY I.
           ADD 10 TO I
           GO TO COMPUTE-PARA.
       EXIT-PARA.
       STOP-RUN.

Get CSV Values in SQL

Query: DECLARE @CSVValue NVARCHAR(50)='100,101,102'                   DECLARE @eachValue NUMERIC(9,0)   while len(@CSVValue) ...