domingo, agosto 29, 2004

LX Cross Reference Kernel Linux

http://lxr.linux.no/source/

Link



NC Adicionar um dia de expiração

var expdate = new Date();
expdate.setDate(expdate.getDate() + 1);


NC Proteger página com senha e Javascript (corrigido)

Dentro do HEAD

script
function setCookie(name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}

function deleteCookie(name, path, domain) {
if (getCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}

function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}

function password () {
if (getCookie("ointernetinho") == 2004 || getCookie("ointernetinho") == "2004") { return; }
var wrong = "http://www.blogger.com/";
var password = "neto";
var name = null;
name = prompt("Insira a senha","********");
if (name == null) { location.href = wrong; return; }
if (name!= password) { location.href = wrong; return; }
if (getCookie("ointernetinho") == 2004 || getCookie("ointernetinho") == "2004") {
deleteCookie("ointernetinho", "", "");
}
var expdate = new Date();
expdate.setDate(expdate.getDate() + 1);
setCookie("ointernetinho", "2004", expdate, "", "", "");
}
script

script
password();
script

LX Entedendo o /proc statm

The statm file contains more detailed information about the process memory usage.

size total program size
resident size of in memory portions
shared number of the pages that are shared
trs number of pages that are 'code'
drs number of pages of data/stack
lrs number of pages of library
dt number of dirty pages

VmSize: 804 kB
VmLck: 0 kB
VmRSS: 344 kB
VmData: 68 kB
VmStk: 20 kB
VmExe: 12 kB
VmLib: 660 kB

Size (also VSZ or VmSize): The total amount of virtual system memory a process uses.

Total locked

Resident (also VmRSS or RSS): The amount of physical system memory a process uses up. This is more accurate for measuring how much system memory a process needs.

VmData is the heap

VmStk is the stack

VmExe is the statically linked stuff

VmLib is shared libraries

-------------------------------------------------------------------------------

VmSize
Virtual memory usage of entire process
= VmLib + VmExe + VmData + VmStk

VmRSS
Resident Set currently in physical memory including Code, Data, Stack

VmData
Virtual memory usage of Heap

VmStk
Virtual memory usage of Stack. Doest change much.

VmExe
Virtual memory usage by executable and statically linked libraries 'man top' says this is broken ?

VmLib
Virtual memory usage by dlls loaded



This page is powered by Blogger. Isn't yours?