Installer vmware-server på debian

Installer en ren debian


apt-get install x-window-system
apt-get install libdb2              (only needed for mui)

Download and install vmware-server, you can use only vmware server if you want to connect to it with vmware console and login with the unix root and rootpass.

However you can install the mui which gives you a webgraphical overview, mui needs libdb2 to create ssl certificates. Mui answers on port https://host:8333 and requires username and password as well, root uid will work here as well.

Both tarballs should be downloaded, unpacked and run install script.
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Stuff for dynamic webpages

http://blogus.xilinus.com/pages/javawin

Udgivet i Links, Old Base | Skriv en kommentar

Nyttige PHP-funktioner

number_format() -- Format a number with grouped thousands
Eksempel:
<?php echo number_format(pow(256, 2), null, ",", "."); ?>
Viser:
65.536

(Flere vil bliver tilføjet)
Udgivet i Knowledge Base, Old Base, PHP | Skriv en kommentar

UUID / GUID generator

http://kruithof.xs4all.nl/uuid/uuidgen

Udgivet i Links | Skriv en kommentar

UUID / GUID generator

http://kruithof.xs4all.nl/uuid/uuidgen

Udgivet i Knowledge Base | Skriv en kommentar

Adding chroot ssh access and mounting directory multiple places

in fstab:
/home/ifka              /home/jail/home/ifka ext2       bind            0 1

or command line:
mount -o bind /home/ifka /home/jail/home/ifka

And about the jail:
http://olivier.sessink.nl/jailkit/
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Recovering md RAID after a crash

ifka ~ # cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 ide/host0/bus1/target0/lun0/part1[1]
      39061952 blocks [2/1] [_U]

unused devices: <none>
ifka ~ # mdadm /dev/md0 --manage --add /dev/hda1
mdadm: hot added /dev/hda1
ifka ~ # watch cat /proc/mdstat

Wait for rebuild to complete.
Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Booting order on Ultrasparc

ok setenv boot-device disk0:0 disk2:0
boot-device =         disk0:0 disk2:0
Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Byt værdier om i et array i php

<?

# Array mangeler, copyright (c) 2006 Mikkel C.M.Christensen

function moveup($array,$num)
{
        if ($num == 0)
        {
                print "Cant do that";
                return $array;
        } else
        {
                $temp=$array[$num-1];
                $array[$num-1]=$array[$num];
                $array[$num]=$temp;
                return $array;
        }
}

function movedown($array,$num)
{
        if ($num == sizeof($array)-1)
        {
                print "Cant do that either";
                return $array;
        } else
        {
                $temp=$array[$num+1];
                $array[$num+1]=$array[$num];
                $array[$num]=$temp;
                return $array;
        }
}

?>
Udgivet i Knowledge Base, Old Base, PHP | Skriv en kommentar

Adding inline images to HTML Files

<?
print "<img src='data:image/gif;base64,".base64_encode(file_get_contents("file.gif"))."'>";
?>

Works in Firefox
Udgivet i Knowledge Base, Old Base, PHP, Programmering | Skriv en kommentar