Archive
Tag "Tutorials"

How to cre­ate dig­i­tal music files from your CD — here's one method. Assumes Win­dows XP systems.

Read More

Want to try AVG but just can­not get rid of Norton's per­sis­tent antivirus that itself behaves like a worm? Here are some instruc­tions that have worked.

So you want to use Grisoft's AVG Free as your antivirus, but had Nor­ton antivirus installed before, which is now prov­ing more per­sis­tent than a flat­u­lent release in a bath, with Symantec's whole con­vo­luted she­bang only com­pound­ing your woes? Well below is a sim­ple sureshot way to get rid of Nor­ton for good.

  1. First, from Start –> Cpanel –> Add/Remove pro­grams, remove every trace of Nor­ton and its asso­ci­ated pro­grams, which means scan through the list of installed pro­grams for any item that says "Nor­ton" or "Syman­tec" or "Live­Up­date" — for exam­ple "Syman­tec Live­Up­date" or "Nor­ton AntiVirus 2003".
  2. When you are absolutely sure that these ver­mins are gone, it is VITAL that you reboot the com­puter. When you are back into XP, delete the fol­low­ing fold­ers man­u­ally — if they don't exist that's fine:
    	c:\Program Files\Symantec AntiVirus
    	c:\Program Files\Norton
    	c:\Program Files\Symantec
    	c:\Program Files\Common Files\Symantec Shared
    	

    Do a SHIFT DELETE if pos­si­ble, the fold­ers don't go into your Recy­cle Bin in that case, so they are gone from your com­puter for sure.

  3. After the above, I usu­ally clean the Win­dows Reg­istry for any entries that are lying around stray. Get a Reg­istry Cleaner like HoverDesk's RegSeeker (zipped down­load) and use the "Clean the Reg­istry" option.
  4. Once that is done and you have SELECTED ALL and deleted the stray items, reboot again. To be sure.
  5. Nor­ton should be gone when your machine is back up. If not, Syman­tec has a brute force util­ity called RNAV2003 — get it here, which ought to do the rest of the scav­eng­ing, but it shouldn't come to that.
Read More

Inad­ver­tently hit by the Net­sky fam­ily, and been hav­ing trou­bles get­ting rid of it? Check this step by step removal pro­ce­dure out.

Sud­denly get­ting *.pif attach­ments in your emails or a bunch of very per­sonal and real­is­tic sound­ing mails from peo­ple you don't even know? That's because the Net­sky fam­ily has gone prime­time and spawned a mil­lion and one vari­ants: I-Worm.Netsky.A, I-Worm.Netsky.B, I-Worm.Netsky.C, I-Worm.Netsky.D, and now even I-Worm.Netsky.E. Many peo­ple have tried updat­ing their anti virus def­i­n­i­tions for their respec­tive tools, but Net­sky is clever (it stores info in the Win­dows reg­istry, and deletes some vital keys as well!)

Pls print these instruc­tions as you will even­tu­ally have to close Out­look as well as the browser that you will presently use for downloads.

I use Grisoft's won­der­ful AVG tool, which is great if you had it BEFORE the Net­sky virus (but then I also use a com­bi­na­tion of Spam Assas­sin and Cla­mav)

IMPORTANT NOTE: DISABLING AND ENABLING SYSTEM RESTORE

Win­dows Me/XP uses the Sys­tem Restore fea­ture (enabled by default) to restore the files on your com­puter in case they become dam­aged. If a virus, worm, or Tro­jan infects a com­puter, Sys­tem Restore may back up the virus, worm, or Tro­jan on the com­puter as well.

Win­dows pre­vents out­side pro­grams, includ­ing antivirus pro­grams, from mod­i­fy­ing Sys­tem Restore. There­fore, antivirus pro­grams or tools can­not remove threats in the Sys­tem Restore folder. As a result, Sys­tem Restore has the poten­tial of restor­ing an infected file onto your com­puter, even after you have cleaned the infected files from all the other loca­tions. Also, a virus scan may detect a threat in the Sys­tem Restore folder even though you have removed the threat. SO it's best to dis­able it and then re-enable it after the dele­tion process.

HOW TO DISABLE SYSTEM RESTORE

  • Click Start > Set­tings > Con­trol Panel.
  • Double-click the Sys­tem icon.
  • Click on the Sys­tem Restore tab and dis­able the Sys­tem Restore:
    System Restore disable in Windows XP Control panel
  • Click Yes, when you are prompted to restart Windows.

Now that you know how to dis­able and enable Sys­tem Restore, let's get cracking.

OPTION 1: THE MCAFEE WAY (STINGER)

McAfee has made a very nifty tool called Stinger avail­able which auto­mat­i­cally scans your com­puter for 39 viruses and deletes them. It's pretty sim­ple to use, just down­load and execute.

  • Down­load Stinger.
  • Dis­able Sys­tem Restore as described above. This will take your sys­tem into a reboot.
  • When the com­puter is back again, wun Stinger from your desk­top by double-clicking it. Wait, get some cof­fee, etc etc. This takes time.
  • Reboot.
  • Optional but rec­om­mended if the first run above found some virii: Run Stinger again to make sure your PC is clean.
  • Reboot.
  • Re-enable Sys­tem Restore from the Con­trol Panel > Sys­tem > Sys­tem Restore (checkbox).

On my machine with 120GB hard disk, 57% used, 1 GB RAM, this tool took about an hour to scan through all files. Which is prob­a­bly a wor­thy price to pay
for the con­ve­nience of automa­tion. Worth a shot for sure.

If and only if this doesn't work, try the next and some­what more con­vo­luted tool from Symantec.

OPTION 2: THE SYMANTEC WAY

Roll up your sleeves as this is can get a bit involv­ing for peo­ple who don't know MS-DOS prompts or some Win­dows sys­tem func­tion­al­ity (although there are screen­shots to boot below when­ever possible)

  • Down­load the FxNetsky.exe file. Save the file to a con­ve­nient loca­tion, e.g.,
    c:\netsky_remove
  • Down­load the file chktrust.exe. IMPORTANT: Save this file as the same loca­tion as above:
    c:\netsky_remove
  • Now close all pro­grams, includ­ing the browser from which you down­loaded the above appli­ca­tions. Then, START –> RUN, and type
    cmd

    This will start the MS DOS PROMPT. Here, type:

    cd c:/netsky_remove
    chktrust -i FxNetsky.exe

    Press Enter after typ­ing each com­mand. If the dig­i­tal sig­na­ture is valid, you will see the following:

    "Do you want to install and run "FxNetsky.exe"
    signed on 3/1/2004 10:33 PM and distributed by:
    Symantec Corporation?"
  • If you are on a net­work or if you have a full-time con­nec­tion to the Inter­net, dis­con­nect the com­puter from the net­work and the Internet.
  • Dis­able Sys­tem Restore.
  • Double-click the FxNetsky.exe in your c:\netsky_remove folder to start the removal tool.
  • Click Start to begin the process, and then allow the tool to run. Sit back and enjoy the ride. This takes time.
  • When the tool has fin­ished run­ning, you will see a mes­sage indi­cat­ing whether W32.Netsky@mm infected the com­puter. In the case of a removal of the worm, the pro­gram dis­plays the fol­low­ing results:
    Total number of scanned files
    Number of deleted files
    Number of repaired files
    Number of terminated viral processes
    Number of fixed registry entries
  • Reboot the computer.
  • If virii were found, then run the removal tool again to ensure that the sys­tem is clean.
  • If you had dis­abled Sys­tem Restore, then re-enable it.

Let me know if this doesn't work as desired!

Read More

Don't you just adore the sim­plic­ity of PHP? It is a cake walk to cre­ate thumb­nails in PHP, with­out any plu­g­ins like imagemag­ick or NetPBM, and it is super fast too. Here's the sim­ple code.

Read More

A cross-browser script to catch key­board events in Javascript with some links for fur­ther research if you are interested.

Read More

You have two dates (either in your code or in your data­base columns). How do you cal­cu­late the dif­fer­ence between them — in years, months, weeks etc?
This is one of the most com­mon ques­tions on FAQ sites, and the logic in gen­eral is quite simple.

Read More

Enter lat­i­tude and lon­gi­tude of two places, and find out the dis­tance between them. Some handy PHP code.

Read More

Here is some sam­ple code that allows you to cre­ate a thumb­nail auto­mat­i­cally (assum­ing ImageMag­ick is already installed and func­tional) (based on the imag­ick PEAR module).

Code for dynamic thumb­nails using PHP

<?php

// Specify your file details
$current_file = 'image.jpg';
$max_width = '150';

// Get the current info on the file
$current_size = getimagesize($current_file);
$current_img_width = $current_size[0];
$current_img_height = $current_size[1];
$image_base = explode('.', $current_file);

// This part gets the new thumbnail name
$image_basename = $image_base[0];
$image_ext = $image_base[1];
$thumb_name = $image_basename.'-th.'.$image_ext;

// Determine if the image actually needs to be resized
// and if it does, get the new height for it
if ($current_img_width > $max_width)
{
  $too_big_diff_ratio = $current_img_width/$max_width;
  $new_img_width = $max_width;
  $new_img_height = round($current_img_height/$too_big_diff_ratio);
  // Convert the file
  $make_magick = system("convert -geometry $new_img_width x $new_img_height $current_file $thumb_name", $retval);
  // Did it work?
  if (!($retval)) {
    echo 'Thumbnail created: <img src="' .$thumb_name .'">';
  }
  else {
    echo 'Error: Please try again.';
  }
}
else
{
  echo 'No need to resize.';
}

?>

Read More

There is a PHP mod­ule for Imagemag­ick, called imag­ick, sort of like the one for GD.

Fol­low­ing is some sim­ple code that has worked for me:

if(!extension_loaded('imagick')) { dl('imagick.so'); }
$handle = imagick_create();
imagick_set_attribute($handle,array("quality"=&gt;1,"magick"=&gt;"png"));
imagick_set_attribute($handle,"size","98x20");
imagick_read($handle,"xc:#cccccc");
imagick_annotate($handle,array(
"primitive"     =>  "text 10,14 hello",
"pointsize"     =>  16,
"antialias"     =>  1,
"stroke"        =>  "#000000",
"font"          =>  "arial.ttf"
));
$handle = imagick_copy_rotate ($handle, 270);
header("Content-type: image/png");
imagick_dump($handle,"png");
Read More

It is actu­ally quite sim­ple to get it work­ing, but not ade­quately doc­u­mented on the PHP web­site. Get straight­for­ward, bul­let point instruc­tions here (installs PHP as a mod­ule which is in fact faster than run­ning it as CGI).

Read More