Scripting

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
Misc

Howto combine two columns into one in mysql

This is how you can combine (or concatenate or merge) data from two table columns into one column using a mysql SQL query. SELECT CONCAT(firstname,lastname) AS ‘name’ FROM tablename The result would be “firstname lastname” If you would like to insert this data into a new column INSERT INTO tablename (full_name) SELECT CONCAT(firstname,lastname) AS ‘name’ […]

Read More
Web

Howto decompose a SWF Adobe Flash file

This post describes howto decompose a SWF Flash-file using linux and a program named swfextract. The post came to life because I had to do some changes to one of my flash presentations but I had deleted all the source files. After searching the Internet i doscovered swfextract. SWF Tools is a collection of SWF […]

Read More
Linux

Configure mutt for Zimbra and IMAP

This post describes how to configure the command line e-mail client mutt to use your Zimbra IMAP mailbox. Open the text file .muttrc, located in your home directory. If it does not exist, create it. Add or replace the following lines with your own user ID: set spoolfile=imaps://mail.example.com/Inbox set folder=imaps://mail.example.com/ set imap_user=username@example.com If you would […]

Read More