Thursday, February 24, 2011

php : how to generate random code

This small function generate random code:

maybe used in generating  random password whatever i like :

$nc => is the total length of string required.

function randcode($nc, $a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') {
    $l=strlen($a)-1; $r='';
    while($nc-->0) $r.=$a{mt_rand(0,$l)};
    return $r;
}

Proxmox installation display out of range

Reference:  https://forum.proxmox.com/threads/proxmox-ve-screen-out-of-range.131297/