Archive for March, 2007

How-to: Ubuntu Static IP

March 19th, 2007 No comments

Here is how to setup a static address on Ubuntu – presumably the same for Debian.

Categories: Uncategorized Tags:

Regex Sample

March 15th, 2007 No comments


The following example demonstrates how the REG_NOTBOL flag can be used with the regexec subroutine to find all substrings in a line that match a pattern supplied by a user. (For simplicity, very little error-checking is done in this example.)

/* this call to regexec finds the first match on the line */
error = regexec(&re,&buffer[0],1,&pm,0);
while (error == 0) {   /* while matches found */
	/* This call to regexec finds the next match */
	error = regexec(&re,pm.rm_ep,1,&pm,REG_NOTBOL);
Categories: Uncategorized Tags:

Open Source and Outsourcing

March 10th, 2007 No comments

A couple of interesting links from the Register:

Open source: Management fears

Small businesses not outsourcing

Categories: Uncategorized Tags:

Chkconfig for Ubuntu

March 8th, 2007 1 comment
$ apt-get install libnewt0.52 
$ ln -s /usr/lib/ /usr/lib/ 
$ wget 
$ dpkg --force-all -i chkconfig_1.2.24d-1_i386.deb
Categories: Uncategorized Tags:

Ubuntu Asterisk from Scratch

March 8th, 2007 No comments

Stolen from fizgig (I skipped a couple of steps re kernel headers):

HOWTO: Compile Asterisk from scratch

I took notes on what I did so I could do it later. Maybe someone else might find them useful. They might not be the most ideal – I’m not an expert but please feel free to comment and I’ll update this message.

0. Edit the /etc/apt/sources.list file to remove the # signs before the lines that begin with # deb http to activate them and then do apt-get update.

1. Install Packages:
apt-get install sendmail zlib1g-dev libssl-dev ncurses-dev libnewt-dev gcc-3.4 subversion openssh-server build-essential linux-source-2.6.12 (or whatever kernel you have)

2. Prepare Linux kernel source
cd /usr/src
tar xvjf linux-source*
(Extracts the files from the zip file)
rm linux-source-2.6.12.tar.bz2 (Don’t need the zip anymore)
ln -s linux-source-2.6.12 linux (makes /usr/src/linux point to /usr/src/linux-source-2.6.12)
cd linux
cp /boot/config-2.6.whatever .config
(copies the config file that was used to compile your kernel into the /usr/src/linux dir)
make menuconfig then exit and save config
uname -r
(examine what comes after 2.6.12 For example, I had 2.6.12-9-386)
vi /usr/src/linux/Makefile
Go to the EXTRAVERSION line and make it like so:
make modules_prepare
ln -s /usr/src/linux /lib/modules/`uname -r`/build

3. Get Asterisk Packages
cd /usr/src
svn checkout asterisk-1.2
svn checkout zaptel-1.2
svn checkout libpri-1.2
svn checkout asterisk-sounds-1.0

4. Compile Stuff
cd /usr/src/libpri-1.2
make clean
make install
-=Zaptel Modules=- (If you’re going to use zaptel hardware to connect to PSTN)
cd /usr/src/zaptel-1.2
Change anything in /usr/src/zaptel/zconfig.h if you need to (I didn’t need to)
make clean
make linux26
make zttool
make install
cd /usr/src/asterisk-1.2
make clean
make mpg123

note: This doesn’t work for me as of 2-20-07. I had to go into the mpg123 directory myself and type:


make CC=gcc LDFLAGS= OBJECTS=’decode_i386.o dct64_i386.o decode_i586.o audio_oss.o term.o’ CFLAGS=’-DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DLINUX -DREAD_MMAP -DOSS -DTERM_CONTROL -Wall -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math’ mpg123-make

make install
make samples
(if you want sample config files put into /etc/asterisk)
cd /usr/src/asterisk-sounds-1.0
make install

5. Edit udev
vi /etc/udev/udev.rules

Stick the paragraph below somewhere

# Section for zaptel device
KERNEL=”zapctl”, NAME=”zap/ctl”
KERNEL=”zaptimer”, NAME=”zap/timer”
KERNEL=”zapchannel”, NAME=”zap/channel”
KERNEL=”zappseudo”, NAME=”zap/pseudo”
KERNEL=”zap[0-9]*”, NAME=”zap/%n”

6. That’s the installation part. Go ahead and reboot. Then, if you have some zaptel piece of hardware installed, try lsmod | grep zap and see if the two modules are already installed.

7. Configure it!


edit: removed extra steps to manually compile mpg123 that weren’t necessary.
edit2: removed tar extraction step since svn brings the files over untarred. (duh)
edit3: Added some explanation notes.
edit4: Added mpg123 compile note 2-20-07

come on guys, it’s all ball bearings nowadays

Categories: Uncategorized Tags:

Linux on MacMini

March 8th, 2007 1 comment

CentOS 4.4 installation went smoothly but the system wouldn’t boot (got stuck in Grub).

Rather than debug this, I simply switched to Ubuntu Server 6.10 where all worked well. Also tried Ubuntu Desktop 6.10 which worked well, including wireless. Only significant issue with the desktop edition was that it failed to reboot cleanly – required power-cycle.

Categories: Uncategorized Tags:

Simple instructions to get Linux on your Intel iMac

March 7th, 2007 No comments

This article assumes basic knowledge surrounding Linux, terminal and the underlying Unix operating system. Those without basic knowledge will find this article hard to follow.

Info for the blessing the EFI part are taken from EFI Howto

  1. Download from the Intel site: EFI Sample Implementation
  2. Unzip the file to /efi
  3. do ‘sudo bless –folder /efi –file /efi/Binary/BIOS32/Bin/GraphicsConsole.efi –setBoot’
  4. Download the following files : e.efi, elilo.conf, vmlinuz, initrd from Bootfiles/Kernel/Initrd
  5. If you have a 20″ iMac change in elilo.conf “video=imacfb:i17” to “video=imacfb:i20”
  6. Copy the downloaded files to a FAT-formated USB memory stick/HDD into the root dir.
  7. Reboot with your memory stick connected.
  8. You’ll get the familiar chime and gray screen, wait about 10 seconds then hit the spacebar.
  9. Select Boot Maintenance Manager.
  10. Select Boot From File.
  11. Select your USB memory stick/HDD.
  12. Select e.efi

To get back to OSX do steps 9,10. Then select your OSX HDD shown as “NO FILE SYSTEM INFO”.

Use /System/Library/CoreServices/boot.efi to boot OSX.

Alternatively, it is possible to set up Dual Booting with separate partitions. That allows you to choose between Mac OS X and Linux using the built-in boot volume chooser (hold down Option while booting).

This post was copied from and more info here

Categories: Uncategorized Tags:

SipX Installation

March 5th, 2007 No comments

How to install sipX on a CentOS 4.4 Xen DomU

Setup yum repo:

wget -P /etc/yum.repos.d/

Download the xen DomU kernel and related glibc files from Xensource

rpm -Uvh glibc-common-2.3.4-2.25.xs0.4.4.57rpm -Uvh glibc-2.3.4-2.25.xs0.4.4.57   

rpm -ivh kernel-xenU-2.6.9-42.0.3.EL.xs0.4.0.263.i686.rpm

Due to some conflicts, install sipx-w3c-libwww first

yum install sipx-w3c-libwwwyum install sipxpbx

Create and install certificate:


Check config and start:

service sipxpbx configtestservice sipxpbx start

And you’re done

Also check out the the sipfoundry wiki

Categories: Uncategorized Tags:

Xen Dom0 Installation

March 5th, 2007 No comments

Just a quick note:

  1. Xensource has all the RPMs needed to install Dom0/DomU on CentOS 4.4, including special glibc.
  2. Ubuntu LTS does not. And all recipes so far fail to produce satisfactory results.

Conclusion: at least for Dom0, use CentOS, not Ubuntu. This may change over the next few months, but for the time being CentOS is the way to go.

Categories: Uncategorized Tags:

CIFS note

March 4th, 2007 No comments

When using CIFS in Ubuntu (and probably elsewhere), make sure smbfs is installed otherwise you can waste all sorts of time tracking down helpful dmesg error messages like “cifs error -22”.

Categories: Uncategorized Tags: