How to recover deleted files on formatted drive?

Here I'll show you how to use the File Scavenger program that allows you to recover permanently lost files on your harddrive. The application size is small but it's very effective in restoring deleted information. It scans your harddrive and detects if there are ones that could be restored.
Update: for more in depth restoration techniques please take a look at:
Advanced hard drive partition and geometry recovery

In my case I've had to restore a 60Gb hdd that was 2 times formatted using NTFS quick and full windows installation format and simultaneously after the formats were installed 2 versions of windows XP.
I've tried lots of recovery software on this drive to see what results they could bring out and I think that this program deserves a special attention.
As an end result I've managed to rescue 35Gb of music and photos from the hard drive.




Usage:

First off ensure that you've got spare hard disk with size similar to the damaged/deleted/formatted one.
Example: If you want to restore 40Gb of information ensure another drive with 40Gb free space.
Get a license because otherwise you could recover only the starting chunks from the deleted files.

Start the File Scavenger. On the Search mode select Long Search and press the Search button. On the warning message press: No. Display deleted files. Then you'll have to wait for some time until the program finishes rescuing.
In the input box Recover using the Browse... button select the free harddrive already prepared for the information storage. You'll have to wait this process to finish. When ready you'll have your information back and all you'll have to do is to sort it, because the file names will be renamed.

Happy successful restoring. Cheers!
by Nevyan Neykov



Free website click heatmap - DIY

What are the click heat maps?
Heat maps are places on your website where users mostly click or hover their mouse. They are also known as website hot spots.

Why do you need to know your website hotspots?

Once knowing their location you can reorder your important information, optimize your adverts to increase their CTR(click-through-rate) etc...

Remember that this type of click tracking is different from the simple web counters. Click heatmaps map the exact x,y clicks and mouse hover positions. That makes such statistics really great for those who look for usability improvements.

Of course there are free services such as Creazyegg.com and Clickdensity.com but the offered JavaScript actually slows down the user experience. So the following is a guide how to build your own heatmap tracking. I've combined 2 techniques so the AJAX script could work across multiple domains. Here are their respected versions urls:


for the heatmap:
http://blog.corunet.com/english/the-definitive-heatmap

for the cross-domain AJAX:
http://blog.cbciweb.com/articles/tag/asynchronousjavascriptacrossdomains

INSTRUCTIONS:
1. Create an empty readable and writeable file: clickcount.txt on your webserver.
2. Place the following javascript code in your website just above the ending tag:

var xOffset,yOffset;
var tempX = 0;
var tempY = 0;


//detect browser
var IE = document.all?true:false
if (!IE) {
document.captureEvents(Event.MOUSEMOVE)
}
//find the position of the first item on screen and store offsets
//find the first item on screen (after body)
var firstElement=document.getElementsByTagName('body')[0].childNodes[1];
//find the offset coordinates
xOffset=findPosX(firstElement);
yOffset=findPosY(firstElement);
if (IE){ // In IE there's a default margin in the page body. If margin's not defined, use defaults
var marginLeftExplorer  = parseInt(document.getElementsByTagName('body')[0].style.marginLeft);
var marginTopExplorer   = parseInt(document.getElementsByTagName('body')[0].style.marginTop);
/*assume default 10px/15px margin in explorer*/
if (isNaN(marginLeftExplorer)) {marginLeftExplorer=10;}
if (isNaN(marginTopExplorer)) {marginTopExplorer=15;}
xOffset=xOffset+marginLeftExplorer;
yOffset=yOffset+marginTopExplorer;
}
/*attach a handler to the onmousedown event that calls a function to store the values*/
document.onmousedown = getMouseXY;




/*Functions*/
/*Find positions*/
function findPosX(obj){
var curleft = 0;
if (obj.offsetParent){
while (obj.offsetParent){
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}else if (obj.x){
curleft += obj.x;
}
return curleft;
}


function findPosY(obj){
var curtop = 0;
if (obj.offsetParent){
while (obj.offsetParent){
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}else if (obj.y){
curtop += obj.y;
}
return curtop;
}
function getMouseXY(e) {
if (IE) {
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
} else {
tempX = e.pageX
tempY = e.pageY
}
tempX-=xOffset;
tempY-=yOffset;
var url='http://yourwebsite.com/empty.php?x='+tempX+'&y='+tempY; /* Type your website URL here*/


ajad_send(url);


return true;
}


var ajad_ndx_script = 0;


function ajad_do (u) {
// Create new JS element
var js = document.createElement('SCRIPT');
js.type = 'text/javascript';
ajad_ndx_script++;
js.id = 'ajad-' + ajad_ndx_script;
js.src = u;


// Append JS element (therefore executing the 'AJAX' call)
document.body.appendChild(js);


return true;
}


function ajad_get (r) {
// Create URL
var u = r;




// Do AJAD
return ajad_do(u);
}


function ajad_send(url) {
// referrer
// r = window.location;


var r = url;
// send it
ajad_get(r);


// remove the last script node.
document.body.removeChild(document.getElementById('ajad-' + ajad_ndx_script));
ajad_ndx_script--;
}


3. Create empty.php file and fill it with:
<?
$q=$REQUEST_URI;
include_once("functions.php");
save_file($q, "clickcount.txt");
?>


4. Statistics
Allow at least 2 days for the clicks to accumulate. If you open clickcount.txt in your browser you'll see the x,y coordinates of the user clicks.
In order to visualize the gathered data create file click_count.php with the following contents:

<?
Header("Content-Type: image/png" );
$width=1024;
$height=4300;
$im=ImageCreate($width,$height);
$red = ImageColorAllocate ( $im, 255, 0, 0 );
$white = ImageColorAllocate ( $im , 255, 255, 255 );
$black = ImageColorAllocate ( $im ,0, 0, 0 );
$blue = ImageColorAllocate ( $im , 0 , 0 , 255 );
$gray = ImageColorAllocate ( $im , 0xC0, 0xC0 , 0xC0 );
ImageFill ( $im , 0 , 0 , $black );
$file="clickcount.txt";
$fp = fopen ( $file, 'r' ) or die("error opening file");
$file=fread($fp,filesize($file));
$splitted  = explode ("\n", $file);

for ($i=0;$i<count($splitted); $i++){
if (! is_string($splitted[$i]))  return false;
$arr_query=NULL;
$url=parse_url($splitted[$i]);
$url=$url['query'];
parse_str($url,$vars);
$x = $vars['x'];
$y = $vars['y'];
imagesetpixel($im,$x,$y,$white);
}
Imagepng ($im);
imagedestroy($im);
?>

website heat map

Here is a sample generated heatmap screenshot: Click to see the whole image.
heat map

I know that the above mentioned code could be optimized so your suggestions are always welcome! by Nevyan Neykov



Keep your printer clean and running - I

Everyone has experiences problems with their printers. Here are some solutions to common printer problems:

Paper jam
Reasons:
Dust in the rollers
Leftovers from previous printing blocking the paper leading mechanism
Incorrect choice of paper size and type
Worn out leading paper rollers

How to remove jammed paper
When removing paper always pull along the path of the incoming paper. Do it easily - if you pull the other way that could damage the printer.

Printer takes several sheets at once.
This could happen because of dust or worn out parts. Other possibility is that the paper could be damped. Check out if the printer is clean and the paper is dry and in good condition.


Part of the printed fades out.
Fade out printing or horizontal lines that appear in the page might come from:
1. Low ink value in the cassette/toner. If that's the reason - replace it with new one.
2. Blocked nozzles - if the nozzles are blocked they wouldn’t emit ink properly. Cleaning up the printer's head could fix that problem.

How:
Use cotton ball & spirit and softly rub the head surface in order to dilute the parched ink. Next clean up the ink with dry cotton ball and start the manufacturer’s page cleaning software. Be careful not to leave any cotton ball parts in this process.

3. The head leading block hasn't been steadily connected to the printing head. Turn off the printer and adjust the head position.
4. Dust from the printing paper could be an obstacle to the electric circuits. If the printer had been used for a long time the electrical contacts of the printing head could interact with the dust. Wipe the contacts with spirit and wait to dry.
5. When using a toner and experience spots or fading - you could carefully fine clean the toner’s roller: watch out for a dried dust or ink.
6. In case of recharging and using non-quality consummative it is possible that they could clog the printer's head. You could fix that by blowing pressured air and spirit in the head's nozzle. The other way for cleaning is to leave the printer's head for a day in pure distilled water.

Page could not be printed
Usually this happens in case of loss of communication between the printer and computer. If you still couldn't print with good cable interface connections apparently you have problems with the drivers.
The easiest way to fix this problem is to reinstall the correct drivers. First go to Control Panel->Printers and remove all the Printers out there. Then go to Control Panel->System->Hardware->Device manager - search and remove all the printers & printer drivers that you can find. Next use the CD from the manufacturer or download and install the newest available printer drivers.
If the reinstalling doesn’t help then the problem could be in your Operational System (OS).

Summary:
1. Periodically clean up the printer: Turn off the printer, open the front cover and blow out the containing dust and dirt.
2. Pay attention to the ink tonners & cassettes. Their nozzles are fragile and easily damaged, that's why you shouldn't force them when doing a change. Also don't touch the copper contacts on the back of the patron/cassette. Your perspiration could cause improper working of the cassette.
3. Avoid placing the printer at floor's bottom. The dust level there is too much and could cause you future problems.
by Nevyan Neykov



Track website referals - howto

What are the website referrals?
Referrals are links from search engine queries or websites which had passed the user to your website.

Why you need referral tracking?
Simply this way you'll know what are your most visited keywords and key phrases which will allow you to optimize your website content further.

Here is a simple working example on how one can easily track its website referrals and keywords. Just put this JavaScript code in your webpage:
<script type="text/javascript">
var q = parent.document.referrer;
document.write("<img  height=\"1\" width=\"1\" src=\"decode.php?q=" + q +"\">");
</script>


Here is the analyzing decode.php code:
<?
if (empty($q)) {$q = getenv("HTTP_REFERER");}

/* filter some bad characters */
if (!empty($q)) {
$q = str_replace("+", "", $q); $q = str_replace("-", "", $q);
$q = str_replace(":", "", $q); $q = str_replace("!", "", $q);
$q = str_replace("?", "", $q); $q = str_replace(".", "", $q);
$q = str_replace(",", "", $q); $q = str_replace("'", "", $q);
$q = str_replace("\"", "", $q); $q = str_replace("\n", " ", $q);
$q = str_replace("\r", " ", $q); $q = preg_replace("(\s+)", " ", $q);
$q = preg_replace("/([0-9])/e", "", $q);
if (get_magic_quotes_gpc() == 1) {$q=addslashes($q);}
$q = strtolower($q); $q=trim($q);
if (iconv('UTF-8', 'UTF-8', $q) == $q) { $q=iconv("utf-8", "cp1251", $q); }
$q = htmlentities($q, ENT_QUOTES);
$q = html_entity_decode($q);

if (strstr($q,"put_your_domain_name_here")) {}
else {
//save_file($q, "referals.txt");//uncomment this if you want to save in file
//save_file($q); //uncomment this if you want to save in mysql database
}
?>

Use this function if you want to save the referrals in file. Fist create file referers.txt on your server and set it with 0777 rights (read,write,execute):
<?
function save_file($message, $filename) {
trim($message);
if ($message!=""){
$message="\n".$message;
$fp = fopen($filename, "a") or die("error opening");
$write = fputs($fp, $message);
fclose($fp);
}
}
?>

Use the following function if you want to save the referrals in a Mysql database. First create the table referers:
CREATE TABLE referers ( count int(4) NOT NULL default '0', srch_word varchar(100) default NULL ) TYPE=MyISAM; 

<?
function save_file($message)
{
include_once("mysql_oop.php");
$db1= new mysqldb;
$db1->setsql("SELECT srch_word FROM referers WHERE srch_word='$q'");
$db1->selectquery(); $numberrows=$db1->getnumberrows();

//if we have already that referrer -> update its count
if ($numberrows > 0) {
$db1->setsql("UPDATE referers SET count=count+1 WHERE srch_word='$q'"); $db1->selectquery();
}

//if it's new referrer -> record it
else
{
$db1->setsql("INSERT INTO referers(srch_word) VALUES('$q')"); $db1->selectquery();
}
}

?>


Additionally here is the object oriented MySql framework: mysql_oop.php
<?
class mysqldb {
//set up the object
var $dbhost;
var $db;
var $dbuser;
var $dbpassword;
var $sql;
var $result;
var $numberrows;
var $dbopenstatus;
var $dbconnection;
var $insert_id;

function get_insert_id(){
$this->insert_id=mysql_insert_id();
return $this->insert_id;
}

function setdbuser($req_dbuser){$this->dbuser = $req_dbuser;}
function setdbpassword($req_dbpassword){$this->dbpassword = $req_dbpassword;}
function sethost($req_dbhost){$this->dbhost = $req_dbhost;}
function getdb(){return $this->db;}
function setdb($req_db){$this->db = $req_db;}
function getsql(){return $this->sql;}
function setsql($req_sql){$this->sql = $req_sql;}
function getnumberrows(){return $this->numberrows;}
function setnumberrows($req_numberrows){$this->numberrows=$req_numberrows;}
function setdbconnection($req_dbconnection){$this->dbconnection = $req_dbconnection;}

function mysqldb(){
global $HOST,$DB,$WEBUSER,$WEBPASSWORD;
global $TRUE,$FALSE;

//set here your server settings: user,host,password,database_name
// example: $DB="your_database_name";
// $HOST="your_hostname";

//$this->sethost($HOST); //uncomment if you must specify mysql database host
$this->setdb($DB);
//$this->setdbuser($WEBUSER); //uncomment if you must specify mysql user
//$this->setdbpassword($WEBPASSWORD); //uncomment if you must specify mysql password
$this->setdbconnection($FALSE);
}

function opendbconnection(){
global $TRUE,$FALSE;
$this->dbconnection=mysql_connect("$this->dbhost","$this->dbuser","$this->dbpassword");

if ($this->dbconnection)//if we have connected select and return true
{
mysql_select_db($this->db) or die("Unable to select database");
$this->setdbconnection($TRUE);
return true;
}

else {$this->setdbconnection($FALSE); return false;}
}

function closedbconnection(){
if($this->dbconnection=$TRUE){mysql_close($this->dbconnection);}
}

function selectquery(){
global $TRUE,$FALSE;
if($this->dbconnection==$FALSE) {$this->opendbconnection();}//open connection if still not opened

$this->qry=@mysql_query($this->sql); if(!$this->qry){$this->numberrows="0"; return false;}//query error

else{//querry passed

$this->numberrows=@mysql_numrows($this->qry);
//if we have any result fill result array
if($this->numberrows>=0) { for($x=0;$x<$this->numberrows;$x++) {$this->result[$x]=@mysql_fetch_row($this->qry);} return true;}

else{$this->numberrows="0"; return false;}//if we don't have results give error

}//end query passed

}

}

?>
That's it! Just wait some time to track some referrers. You can look at your referrals either by querying the MySQL table referers or looking in your browser the file referals.txt If you have any comments/suggestions please write them down.
by Nevyan Neykov



Skin care - how to fight acne II

omega 3 capsuleIf you are deeply interested in fighting acne here is a more advanced information that I’ve gathered recently.


The hormones
One of the main factors causing acne is the excess hormones in our body. When our hormones are out of balance they send signals to the respectful glands to produce additional amounts of oil in order to restore the balance.

During teenage times the androgen hormone levels are spiking. This causes an excess sebum oil production which at the end of its pathway clogs our hair follicles and thus contributes to the creation of acne.

Why getting sufficient essential fatty acids(EFA) is important
Recent studies show that consuming essential oils in right proportions normalizes the levels of EFA's in our sebaceous glands. Same EFA's control the production of androgen hormones thus achieving a normal hormonal balance in our body.

Some facts about EFA
When our body has deficit of essential fatty acids, we will have:
- a weaken immune system
- more inflammation
- poor skin
- skin eruptions that won’t heal easily
- increased sebum production
- increased sebaceous glands size

Benefits: These oils came straight from fish & vegetable oils, nuts and seeds as well as an additional supplements.

Balancing EFA’s
Prior trying to manually balance your hormone levels I would recommend you having hormonal tests. According to results you'll see what needs to be adjusted.
The three fatty acids you need to balance out are the Omega-3, Omega-6 and Omega-9. Most people have an excess of Omega-6, so they need to concentrate on getting more Omega-3 EFAs to their diet. On the flip side if your ratio of Omega-3 is more than Omega-6, concentrate on supplementing with Omega-6 oils.

Use of flax seed oil
flax seedsIt’s less potent than the fish oil, so when one wants quicker results he/she could try first fish oil and Spirulina and then steadily settle down with flax oil. The problem with the flax seed oil is that the flax seed must be grounded before digestion and also the body needs an enzyme called delta-6 desaturase (D6D) to transform the flax seed's Linoleic acid into GLA.


spirulinaSpirulina is the most potent form of GLA because it is derived from marine or freshwater algae. Fish consuming such algae become more potent also. Spirulina, taken together with fish oil eliminates the need of D6 for your body in order to work fine. It's very high in protein and can also enhance your muscular strength and athletic endurance. Studies conclude that spirulina is effective in increasing isometric muscle strength, especially in trained athletes as well as enhancing isometric muscle endurance in trained and untrained participants alike.
A mix of protein, amino acids, and vitamin B12, spirulina is an excellent dietary supplement for vegetarians, due to the fact that 60 to 70% of the plant’s structure is composed of protein. It can also benefit you with an immune-enhancing effect.

Nature of the D6D enzyme
This enzyme is dependant on so many factors like: minerals as magnesium, zinc, calcium, vitamins B6, B12, E, biotin and is important to remember that D6D potency declines as we age. The delta-6-desaturase enzyme is also inhibited by stress, disease, increased insulin levels, trans-fatty acids (like those found in margarine), saturated fats and alcohol. When D6 is not so strong the digestion of flax seed gets compromised. The solution is to try the direct supply of gamma linoleum acid(GLA) from foods such as: spirulina, borage, night primrose and others.
Fixing the inhibition problem
We can further inhibit enzyme D5D that converts the GLA to the bad Aarachidonic acid which causes inflammation on our body and converts the hardly gained GammaLinoleic acid back to Aarachidonic acid. The solution is to eat sesame seeds. They inhibit the production of this D5D enzyme so more GammaLinoleic acid stays for the body.

GLA is then broken down either to arachidonic acid (AA) or another substance called dihomogamma-liolenic acid (DGLA). Dihomo-gamma-linolenic acid (DGLA) is the actual precursor in the production of prostaglandins - it is beneficial and reduces the inflammation in our bodies which is our goal. By consuming enough magnesium, zinc, vitamins: C, B3, B6 GLA will convert to DGLA and not to AA.

The anti-inflamatory Prostaglandins
Prostaglandins are hormones made from fatty acids (with the help of enzymes) that act as chemical messengers. They act as regulatory molecules and are responsible for the cell's inflammatory and anti-inflammatory responses. Derived from Omega-3 and Omega-6 oils they help to regulate every function in our cells and organs. They also keep our androgen hormones in control so that excess sebum won't be produced resulting in acne. Normally, enzymes in your body break Omega-3 acids down to Eicosapentaenoic Acid(EPA) and Docosahexaenoic Acid(DHA). These two fatty acids then change into prostaglandins.

When Omega-3 fatty acids are not enough

image of salmonThey consist of the following tree fatty acids: alpha linoleic acid(ALA), eicosapentaenoic acid(EPA) and docosahexaenoic acid(DHA).
ALA created in the chloroplasts of green plants from the linoleic acid(LA) is important because it serves as a building material for EPA. DHA on the other side is an integral part of eye and brain tissue. It is found in marine algae (spirulina), plankton, fish and mammals.
However, eating plenty of essential Omega-3 and Omega-6 fatty acids (EFA) is not enough to produce EPA and DHA. It is critical for acne and more importantly for your health that you get enough EPA and DHA in your cells and organs that they can convert and produce the required prostaglandins. Then it is necessary for you to take a fish oil supplement that contains both the EPA and DHA fatty acids.
In order to be fully digested they must be taken after eating otherwise they'll quickly burn as energy fuel and you won't fully benefit them.

Notes on salicylic acid
The anti-inflammatory mechanism of the salicylic acid is due to decreased prostaglandin synthesis and possibly by inhibiting the synthesis and/or activity of other mediators of the inflammation response. The type of inflammation that results in symptoms of redness and swelling is actually the acne.

Omega sources reference list
omega sourcesOmega-3: Avocados, Sesame seeds, Pumpkin seeds, Walnuts, Dark leaf green vegetables (spinach, mustard greens, kale), Wheat germ oil, Salmon, Sardines, Albacore tuna

Omega-6: Flax seed oil, Flax seeds, Grape seed oil, Pistachio nuts, Olives, Olive oil, Sunflower seeds, Evening primrose oil, Pumpkin seeds, Black currant oil

Omega-9: Olive oil, Avocados, Cashews, Almonds, Olives, Sesame oil, Pecans, Pistachio nuts by Nevyan Neykov