Friday, November 13, 2015

Simple PHP logging

In case you need to log something in a concrete PHP script you can do something as follows:

$queryString=$_SERVER['QUERY_STRING'];


$userIP = $_SERVER['REMOTE_ADDR'];


$myfile = fopen("my_log.txt", "a") or die("Unable to open file!");
$txt = $queryString;
fwrite($myfile, "\n".date("Y-m-d h:i:sa")." - ".$queryString." - ".$userIP);
fclose($myfile);


Like that we can log from what IP visits are coming and the query string coming in the request.

Sunday, November 1, 2015

Change keyword configuration spanish Linux / Cambiar configuracion teclado Linux



sudo setxkbmap -layout 'es,es' -model pc105


References: