RITESH'S BLOG

Just another TECHNICAL BLOG….

  • Categories

  • Archives

How to Test the Working of your Antivirus – EICAR Test

Posted by RITESH JAIN on May 7, 2010

Have you ever wondered how to test your Antivirus software to ensure it’s proper working? Well here is a quick and easy way to test your antivirus. The process is called EICAR test which will work on any antivirus and was developed by European Institute of Computer Antivirus Research. This process can be used by people, companies and antivirus programmers to test the proper functioning of the antivirus/antimalware software without having to deal with the real computer virus which can cause damage to the computer. Here is a step-by-step procedure to test your antivirus.

Read the rest of this entry »

Posted in technology | 1 Comment »

Batch code for html to text conversion

Posted by RITESH JAIN on February 18, 2010

Hi friend here i am wirting code for converting html to text ….

This is a batch that cleanly converts Web documents into plain text files. You might have to convert the HTML file into DOS format by loading into EDIT then saving (or using other means) before converting if the source document is in UNIX format. This does not interpret codes like <br> or <p>, it goes only by the line breaks in the source. If it’s one of those documents where everything’s on one line, this won’t work very well. The WORDWRAP batch can help if the file comes out with long lines.

QBasic must be on the path, it is supplied with MSDOS versions 5 and above. To use, simply enter:

   html2 infile.htm outfile.txt

If you want to preserve embedded http/ftp hyperlinks then use:

   html2 infile.htm outfile.txt /link

(substitute the actual file names, they don’t have to be .htm and .txt)

HTML2.BAT removes all HTML tags that begin with a letter, ! or / then it converts &lt; &gt; < > &nbsp; &quot; & &amp; and &middot; codes to their proper characters, hopefully resulting in readable text or working batch code. It gets a little flaky when mixing &#.. codes and other & codes when right next to each other, but I think I can live with that.

This code has been HTML-converted for proper display. To recover the code, copy/paste from the browser screen or get the UTILBATS collection.

:: HTML2.BAT – HTML to text converter (c)2009,2010 RITESH JAIN
:: Syntax:  html2 infile.htm outfile.ext [/link]
::  /link option leaves hypertext urls in text
@echo off
if %2.==. goto done
if not exist %1 echo Input file not found
if not exist %1 goto done
echo.>%2
if not exist %2 echo Cannot create output file
if not exist %2 goto done
del %2
echo Working…
:: create temporary qbasic program…
echo> proc$.bas :on error goto closeout
echo>>proc$.bas open “%1” for input as #1
echo>>proc$.bas open “%2” for output as #2
::======== main loop – get input line ======
echo>>proc$.bas floop:line input #1,a$
::======== html code stripper ==============
echo>>proc$.bas q=1
echo>>proc$.bas qloop:p=instr(q,a$,”<“):if p=0 goto qend
echo>>proc$.bas q=p+1:if mid$(a$,q,1)=”/” goto qconv
echo>>proc$.bas if mid$(a$,q,1)=”!” goto qconv
echo>>proc$.bas if ucase$(mid$(a$,q,1))=lcase$(mid$(a$,q,1)) goto qloop
echo>>proc$.bas qconv:if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas p=instr(q,a$,”>”):if p=0 goto qend
echo>>proc$.bas le=len(a$):if p=le then c$=”” else c$=right$(a$,le-p)
if not %3.==/link. if not %3.==/LINK. goto nolink
echo>>proc$.bas d$=mid$(a$,q,p-q):e$=lcase$(d$):r1=0
echo>>proc$.bas r=instr(e$,”http://&#8221;):if r=0 then r=instr(e$,”ftp://&#8221;)
echo>>proc$.bas if not(r=0) then r1=instr(r,e$,chr$(34))
echo>>proc$.bas if not(r1=0) then c$=”(“+mid$(d$,r,r1-r)+”) “+c$
:nolink
echo>>proc$.bas a$=b$+c$:q=q-1:goto qloop
echo>>proc$.bas qend:
::======== convert “&lt;” to “<” =========
echo>>proc$.bas a:p=instr(lcase$(a$),”&lt;”):if p=0 goto b
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-3:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+”<“+c$:goto a
::======== convert “&gt;” to “>” =========
echo>>proc$.bas b:p=instr(lcase$(a$),”&gt;”):if p=0 goto c
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-3:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+”>”+c$:goto b
::======== convert “<” to “<” =========
echo>>proc$.bas c:p=instr(lcase$(a$),”<“):if p=0 goto d
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-4:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+”<“+c$:goto c
::======== convert “>” to “>” =========
echo>>proc$.bas d:p=instr(lcase$(a$),”>”):if p=0 goto e
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-4:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+”>”+c$:goto d
::======== convert “&nbsp;” to ” ” =========
echo>>proc$.bas e:p=instr(lcase$(a$),”&nbsp;”):if p=0 goto f
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-5:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+” “+c$:goto e
::======== convert “&quot;” to ” ===========
echo>>proc$.bas f:p=instr(lcase$(a$),”&quot;”):if p=0 goto g
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-5:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+chr$(34)+c$:goto f
::======== convert “&” to “&” =========
echo>>proc$.bas g:p=instr(lcase$(a$),”&”):if p=0 goto h
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-4:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+”&”+c$:goto g
::======== convert “&amp;” to “&” =========
echo>>proc$.bas h:p=instr(lcase$(a$),”&amp;”):if p=0 goto i
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-4:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+”&”+c$:goto h
::======== convert “&middot;” to “·” =========
echo>>proc$.bas i:p=instr(lcase$(a$),”&middot;”):if p=0 goto wrline
echo>>proc$.bas if p=1 then b$=”” else b$=left$(a$,p-1)
echo>>proc$.bas le=len(a$)-7:if p=le then c$=”” else c$=right$(a$,le-p)
echo>>proc$.bas a$=b$+”·”+c$:goto i
::======== write line and loop ============
echo>>proc$.bas wrline:print #2,a$:goto floop
::======== done – close up ================
echo>>proc$.bas closeout:close #1:close #2:system
:: run the qbasic program…
qbasic /run proc$.bas
del proc$.bas
if exist %2 echo %2 text file created
if not exist %2 echo Something didn’t work…
:done

have some commment on it …..

Posted in technology | Tagged: | 1 Comment »

Apple IPAD Latest LAunch

Posted by RITESH JAIN on January 29, 2010

The best way to experience the web, email, photos, and video.  Hands down.

All of the built-in apps on iPad were designed from the ground up to take advantage of the large Multi-Touch screen. And they work in any orientation. So you can do things with these apps that you can’t do on any other device.


Safari

The large Multi-Touch screen on iPad lets you see web pages as they were meant to be seen — one page at a time. With vibrant color and sharp text. So whether you’re looking at a page in portrait or landscape, you can see everything at a size that’s actually readable. And with iPad, navigating the web has never been easier or more intuitive. Because you use the most natural pointing device there is: your finger. Scroll through a page just by flicking your finger up or down on the screen. Or pinch to zoom in or out on a photo. There’s also a thumbnail view that shows all your open pages in a grid, to let you quickly move from one page to the next.

Mail

See and touch your email in ways you never could before. In landscape, you get a split-screen view showing both an opened email and the messages in your inbox. To see the opened email by itself, turn iPad to portrait, and the email automatically rotates and fills the screen. No matter which orientation you use, you can scroll through your mail, compose a new email using the large, onscreen keyboard, or delete messages with nothing more than a tap and a flick. If someone emails you a photo, you can see it right in the message. You can also save the photos in an email directly to the built-in Photos app. And iPad works with all the most popular email providers, including MobileMe, Yahoo! Mail, Gmail, Hotmail, and AOL.

Photos

With its crisp, vibrant display and unique software features, iPad is an extraordinary way to enjoy and share your photos. For example, the Photos app displays the photos in an album as though they were in a stack. Just tap the stack, and the whole album opens up. From there, you can flip through your pictures, zoom in or out, or watch a slideshow. You can even use your iPad as a beautiful digital photo frame while it’s is docked or charging. And there are lots of ways to import photos: You can sync them from your computer, download them from an email, or import them directly from your camera using the optional Camera Connection Kit.

Video

The large, high-resolution screen makes iPad perfect for watching any kind of video: from HD movies and TV shows to podcasts and music videos. Switch between widescreen and full screen with a double-tap. Because iPad is essentially one big screen, with no distracting keypad or buttons, you feel completely immersed in whatever you’re watching.

YouTube

The YouTube app organizes videos so they’re easy to see and navigate. To watch one, just tap it. When you’re watching in landscape, the video automatically plays in full screen. And with its high-resolution display, iPad makes the latest HD YouTube videos look positively amazing.

iPod

With the iPod app, all your music is literally at your fingertips. Browse by album, song, artist, or genre with a simple flick. To play a song, just tap it. iPad even displays album art at full size. Listen to your music with the powerful built-in speaker or with wired or Bluetooth wireless headphones.

iTunes

A tap of the iTunes store icon lets you browse and buy music, TV shows, and podcasts — or buy and rent movies — wirelessly, right from your iPad. Choose from thousands of movies and TV shows (in both standard and high definition), along with thousands of podcasts and millions of songs. Preview songs before you buy them. Or just sync iPad with the content you already have in your iTunes library on your Mac or PC.

App Store

iPad runs almost 140,000 apps from the App Store. Everything from games to business apps and more. And new apps designed specially for iPad are highlighted, so you can easily find the ones that take full advantage of its features. Just tap the App Store icon on the screen to browse, buy, and download apps wirelessly, right to the iPad.

iBooks

The iBooks app is a great new way to read and buy books.* Download the free app from the App Store and buy everything from classics to best sellers from the built-in iBookstore. Once you’ve bought a book, it’s displayed on your Bookshelf. Just tap it to start reading. The high-resolution, LED-backlit screen displays everything in sharp, rich color, so it’s easy to read, even in low light.

Maps

See more of the world with high-resolution satellite and street view images. Even see topography with the new terrain view. You can also search for a nearby business type (“Restaurant,” for example), then tap the business to see the route and directions from your current location.

Notes

With its expansive display and large, onscreen keyboard, iPad makes jotting down notes easy. In landscape view, you see not only a note-taking page but a list of all your notes. iPad even circles the current note in red, so you can see where you are at a glance.

Calendar

iPad makes it easy to stay on schedule by displaying day, week, month, or list views of your calendar. You can see an overview of a whole month or the details of a single day. iPad even shows multiple calendars at once, so you can manage work and family schedules at the same time.

Contacts

The Contacts app on iPad makes finding names, numbers, and other important information quicker and easier than ever before. A new view lets you see both your complete contacts list and a single contact simultaneously. Need directions? Tap an address inside a contact and iPad automatically opens Maps.

Home Screen

The Home Screen gives you one-tap access to everything on iPad. You can customize your Home Screen by adding your favorite apps and websites or using your own photos as the background. And you can move apps around to arrange them in any order you want.

Spotlight Search

Spotlight Search allows you to search across iPad and all of its built-in apps, including Mail, Contacts, Calendar, iPod, and Notes. It even searches apps you’ve downloaded from the App Store. So no matter what you’re looking for, it’s never more than a few taps away.

Posted in Uncategorized | Leave a Comment »

MD5

Posted by RITESH JAIN on January 28, 2010

What is MD5 Hash and How to Use it?

In this post I will explain you about one of my favorite and interesting cryptographic algorithm called MD5 (Message-Digest algorithm 5). This algorithm is mainly used to perform file integrity checks under most circumstances. Here I will not jump into the technical aspects of this algorithm, rather will tell you about how to make use of this algorithm in your daily life. Before I tell you about how to use MD5, I would like to share one of my recent experience which made me start using MD5 algorithm.

Recently I made some significant changes and updates to my website and as obvious I generated a complete backup of the site on my server. I downloaded this backup onto my PC and deleted the original one on the server. But after a few days something went wrong and I wanted to restore the backup that I downloaded. When I tried to restore the backup I was shocked! The backup file that I used to restore was corrupted. That means, the backup file that I downloaded onto my PC wasn’t exactly the one that was on my server. The reason is that there occured some data loss during the download process. Yes, this data loss can happen often when a file is downloaded from the Internet. The file can be corrupted due to any of the following reasons.

  • Data loss during the download process, due to instability in the Internet connection/server
  • The file can be tampered due to virus infections or
  • Due to Hacker attacks

So whenever you download any valuable data from the Internet it is completely necessary that you check the integrity of the downloaded file. That is you need to ensure that the downloaded file is exactly the same as that of the original one. In this scenario the MD5 hash can become handy. All you have to do is generate MD5 hash (or MD5 check-sum) for the intended file on your server. After you download the file onto your PC, again generate MD5 hash for the downloaded file. Compare these two hashes and if it matches then it means that the file is downloaded perfectly without any data loss.

A MD5 hash is nothing but a 32 digit hexadicimal number which can be something as follows

e4d909c290d0fb1ca068ffaddf22cbd0

This hash is unique for every file irrespective of it’s size and type. That means two .exe files with the same size will not have the same MD5 hash even though they are of same type and size. So MD5 hash can be used to uniquely identify a file.

How to use MD5 Hash to check the Integrity of Files?

Suppose you have a file called backup.tar on your server. Before you download, you need to generate MD5 hash for this file on your server. To do so use the following command.

For UNIX:

md5sum backup.tar

When you hit ENTER you’ll see something as follows

e4d909c290d0fb1ca068ffaddf22cbd0

This is the MD5 hash for the file backup.tar. After you download this file onto your PC, you can cross check it’s integrity by again re-generating MD5 hash for the downloaded file. If both the hash matches then it means that the file is perfect. Otherwise it means that the file is corrupt. To generate the MD5 hash for the downloaded file on your Windows PC use the following freeware tool

MD5 Summer (Click on the link to download)

I hope you like this post. For further doubts and clarifications please pass your comments. Cheers!

Posted in technology, Uncategorized | Leave a Comment »