Forfatterarkiv: mike

halt.c linux

Dont ask, its a result from a reverse engineering of has shutdown -h halt.c #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main(void) { int fh; fh=open(“/dev/initctl”, O_WRONLY); write(fh, “i\31\t\3\1\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0”, 384); close(fh); } —-endfile cc halt.c -o myhalt ./myhalt and everything … Læs resten

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

Hvorfor nej til EU

Nitrit i øko pølser http://nyhederne.tv2.dk/article.php?id=1924680&forside

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

Automatic DNS check of apache virtualhosts

#!/usr/bin/perl $space=65; $myip=”212.242.77.75″; # Domains with this ip gets “working” stamp open(fh, “/usr/local/apache2/conf/httpd.conf”); while ($dat=<fh>) { if ($dat=~ /servername/i) { $dat =~ s/ //g;chop($dat); if ( lc ( substr($dat,0,10)) eq “servername”) { $domain=substr($dat,10,length($dat)); print $domain; $res = `host -t a … Læs resten

Udgivet i Apache, Knowledge Base, Networking, Old Base | Skriv en kommentar

Nyttige PHP funktioner

5 function eng2dan($ls,$string) 6 { 7 $da_mon_long=array(“Januar”,”Februar”,”Marts”,”April”,”Maj”,”Juni”,”Juli”,”August”,”September”,”Oktober”,”November”,”December”); 8 $da_mon_short=array(“Jan”,”Feb”,”Mar”,”Apr”,”Maj”,”Jun”,”Jul”,”Aug”,”Sep”,”Okt”,”Nov”,”Dec”); 9 10 $da_day_long=array(“Mandag”,”Tirsdag”,”Onsdag”,”Torsdag”,”Fredag”,”Lørdag”,”Søndag”); 11 $da_day_short=array(“Man”,”Tir”,”Ons”,”Tor”,”Fre”,”Lør”,”Søn”); 12 13 for ($i=0; $i<7; $i++) { $eng_days[]=date(“D”,(24*60*60)*(4+$i)); } 14 for ($i=0; $i<12; $i++) { $eng_month[]=date(“M”,(24*60*60*31)*($i)); } 15 16 if ($ls == “long”) 17 { return … Læs resten

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

Boundling NIC’s in FreeBSD

ckh #!/bin/sh ckh # Configure NICs as up and load kernel module ckh ifconfig vr0 up ckh ifconfig vr1 up ckh kldload ng_ether.ko ckh # Plumb notes together ckh ngctl mkpeer vr0: one2many upper one ckh ngctl connect vr0: vr0:upper … Læs resten

Udgivet i FreeBSD, Knowledge Base, Networking, Old Base | Skriv en kommentar

Transperent windows in xorg and other fancy stuff

First you need a recent xorg, (6.8.x) the one in gentoo portage will work. configure X as you would otherwise do adding following to you config file: Section “Extensions” Option “Composite” “Enable” Option “RENDER” “Enable” EndSection If you have either … Læs resten

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

FreeBSD Trafic Shaping

http://www.bsdnews.org/02/dummynet.php

Udgivet i Uncategorized | Skriv en kommentar

FreeBSD Trafic Shaping

http://www.bsdnews.org/02/dummynet.php

Udgivet i FreeBSD, Knowledge Base, Links, Old Base | Skriv en kommentar

Software raid in freebsd

you can if you want add: device ccd but it shouldnt be necesary: ccdconfig ccd1 32 0 /dev/ad0 /dev/ad1 Unites ad0 and ad1 in a harddisk named ccd1 which has twice the size Save config: ccdconfig -g > /etc/ccd.conf echo … Læs resten

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

Enabling 3d Support in Fedora Core 2

Remove any NVIDIA Drivers before proceding. Hent ATI Drivers til XFree86 4.30 http://www.ati.com/support/drivers/linux/radeon-linux.html Hent Fedora Core 2 Patch http://www.fedoraforum.org/forum/attachment.php?attachmentid=3340 Derefter aabner du en terminal som root og henter kernesovs. # yum install kernel-sourcecode Installer ATI Drivere # rpm -Uvh –replacefiles … Læs resten

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