Pages

Monday 16 December 2013

Recover files on pendrive that has been changed to shortcuts

Getting back to the topic, to recover your data (which is converted to shortcuts), just follow these simple steps:
  • Connect your pen/flash/external drive to your computer.
  • Go to My Computers and check what drive it is assigned for example F: or G: drive. Lets assume its G: (replace it with correct letter as applicable in your case).
  • Click on “Start” –>”Run”–> type cmd and hit OK. This will start command prompt.
  • Enter the following command and hit “Enter”.
    attrib -H -R -S /S /D G:\*.*
  • Now check the pendrive for the files.
    If the above command doesn't work then use a third-party tools that you can find on the internet. One cool tool i found is Piriform's  Recuva.

    Recuva recovers files deleted from your Windows computer, Recycle Bin, digital camera card, Memory Sticks, or MP3 player. And notably it's free of cost. Post your comments if you found any helpful or better tools.

Sunday 13 January 2013

How to Install Smarty on Windows

Installing Smarty on Windows

This document assumes that you have configured PHP5, Apache Webserver already.
  1. Download Smarty
  2. Unzip the content of Smarty zip file to smarty folder. So it appears as  C:/server/smarty
  3. Create two folders templates_c  and cache inside it. So it appears as C:/server/smarty/templates_c and C:/server/smarty/cache
  4. Browse to PHP Installation Directory and edit php.ini's include_path and add the location of the libs folder. Example: include_path = ".;C:/server/smarty/libs/;"
  5. Restart IIS/Apache
  6. Create a new folder in htdocs (root) folder and rename it to smarty. C:\server\htdocs\smarty
  7. Create two folders configs and templates inside it. C:\server\htdocs\smarty\configs and C:\server\htdocs\smarty \templates
  8. Smarty configuration is done. Create two scripts index.php and index.tpl to test Smarty template engine.
  9. Place index.php inside C:\server\htdocs\smarty and index.tpl inside C:\server\htdocs\smarty \templates
  10. Open the web browser and type in the URL http://localhost/smarty.

index.php

<?php

// load Smarty library

require('Smarty.class.php');

$smarty = new Smarty;

$smarty->template_dir = ‘C:\server\htdocs\smarty \templates’;

$smarty->conf ig_dir = ‘C:\server\htdocs\smarty\configs’;

$smarty->cache_dir = ‘C:/server/smarty/cache’;

$smarty->compile_dir = ' C:/server/smarty/templates_c’;

$smarty->assign('name','Lucky!!');

$smarty->display('index.tpl');

?>

index.tpl

<html>

<body>

Hello, {$name}

<body>

<html>