Install PHP5 on OpenBSD 4.2

PHP needs expat; this is included in the base set xbase42. If you didn’t install it at install-time you can get it with

cd / ftp http://ftp.belnet.be/mirror/ftp.openbsd.org/4.2/i386/xbase42.tgz tar xzvpf xbase42.tgz

Magpierss with UTF8

MagpieRSS is an RSS parser in PHP. If you’re parsing UTF-8 streams and the output looks crippled then you might want to try this (add this to your file that calls the Magpie-code ) :

define(‘MAGPIE_OUTPUT_ENCODING’, ‘UTF-8’); define(‘MAGPIE_INPUT_ENCODING’, ‘UTF-8’); define(‘MAGPIE_DETECT_ENCODING’, false);

Adjust X11 resolution on the fly

Modern X11 drivers support resolution changing on the fly (as in, you don’t need to restart your X11 server). You can check if your driver supports this when you see this

(==) RandR enabled (II) Initializing built-in extension RANDR

Changing the resolution is very easy:

xrandr –size 1024×768

Entering xrandr without any options shows all the available resolutions.

Snort 3.0 Architecture Serie

If you care at all about Snort you must read Snort 3.0 Architecture Series by Marty Roesch.

start Ubuntu in text mode only

A short command on how to change Ubuntu so that it will only start in text mode, no X11 (graphical) mode. The following removes the graphical greeter from the runlevels :

sudo update-rc.d -f gdm remove

Write a disk full with files with random or zero data

I wanted to test a hard-drive that halted when its internal temperature raised above its safety level. hdparm is one option but the script below creates different files with a certain given size.

#!/bin/bash COUNTER=0 while [ true ]; do dd if=/dev/zero of=file$COUNTER bs=$1 count=1024 let COUNTER=COUNTER+1 done

You can replace /dev/zero with /dev/random if you want random data. Call the script with one argument, the file size.

Set the default height and width of a gnome-terminal

Launch it with gnome-terminal –geometry 135×30 (edit the menu or create a new launcher).

Adjust the launchsettings in ~/.xbindkeysrc

“gnome-terminal –geometry 135×30”   m:0x10 + c:116

Show comment box / comments on a WordPress Page

Just include this in your theme / template for the WP-pages : <?php comments_template(); ?>

If you’re not happy with the default then just edit the file comment.php

WordPress, printing ParentChild menus

Worpress allows you to print parent menu’s with different child-menus. Implementation is easy, just add this to your themes.

In the file that creates the header of your page, normally header.php, add this code:

<?php $args = array( ‘title_li’ => ”, ‘sort_column’=>’menu_order’, ‘depth’ => 1 ); wp_list_pages($args); ?>

Then in the file that creates your child menu (normally this should be sidebar.php) add this code:

<?php if($post->post_parent) { $children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″); } else { $childrenRead more.

L.ROOT-SERVERS.NET changing to 199.7.83.42 on 2007-11-01

Een bericht op de RIPE mailinglist dns-wg leert ons dat vanaf 1 November 2007 er een nieuw IPv4 adres, 199.7.83.42, is voor L.ROOT-SERVERS.NET. Het oude adres, 198.32.64.12, zal nog een zes maanden actief blijven om de overgang mogelijk te maken.

Iedereen die dns-servers onder zijn controle heeft past best z’n hints files aan. Vanaf één november zijn de nieuwe hints files beschikbaar vanop

ftp://rs.internic.net/domain/db.cache ftp://rs.internic.net/domain/named.cache ftp://rs.internic.net/domain/named.root ftp://ftp.internic.net/domain/db.cache ftp://ftp.internic.net/domain/named.cache ftp://ftp.internic.net/domain/named.root