Web

mysql alternative to PHP substr_count function

The substr_count function in PHP counts the number of substring occurrences. This post describes how to create a mysql stored function to behave just like PHP’s substr_count function. This function can be created from your mysql console delimiter || DROP FUNCTION IF EXISTS substrCount|| CREATE FUNCTION substrCount(s VARCHAR(255), ss VARCHAR(255)) RETURNS TINYINT(3) UNSIGNED LANGUAGE SQL […]

Read More
Linux

Create a Debian Lenny installation USB stick

This is a short post that describes how to prepare your USB memory stick for a base installation of Debian Lenny. This will most likely also work on Debian based distributions like Ubuntu. Download the latest Debian boot.img.gz file # wget http://people.debian.org/~joeyh/d-i/images/daily/hd-media/boot.img.gz Download the latest Debian netinst ISO image # wget http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/i386/iso-cd/debian-testing-i386-netinst.iso Connect the USB […]

Read More
Linux

iptables connection tracking table full

I’ve recently experienced that my workstation (Ubuntu Jaunty Jackalope, 9.04, x86_64) “hangs” periodically when my internet browser, Mozilla Firefox, has a lot of active tabs. In my case I had > 100 active tabs in more than 20 windows. I know I should have closed some of them but that is not an option right […]

Read More