Månedsarkiv: februar 2006

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 … Læs resten

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) … Læs resten

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

Logrotate på Gentoo

Først, insttaller logrotate: # emerge logrotate Derefter, rediger /etc/logrotate.conf så den passer til dine behov. Lettere kan det ikke blive 🙂

Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Proftpd passive mode behind firewalls

(By BT) I could not get my Proftpd working in passive mode, whilst it was behind a firewall. The solution seemed to be, to tell the server that it was behind a specific firewall (the MasqueradeAddress directive), that it should … Læs resten

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Why i dont code C , Kernighan and Ritchie style

Page 14. “The C Programming Language” By Brian W. Kernighan and Dennis M. Ritchie 1978 a simple program to read characters from STDIN: #define EOF -1 main() { int c; c = getchar(); while (c != EOF) { putchar(c); c … Læs resten

Udgivet i Knowledge Base | Skriv en kommentar