Web

Logon to Norsk Tipping using Ubuntu 9.10

This post is a short howto how I managed to use my Ubuntu 9.10 (Karmic Koala) to log on to the web pages of Norsk Tipping using a USB CardMan 3121 buypass card reader and Firefox web browser. First of all you need to install Java to login to Norsk Tipping webpages. # aptitude install […]

Read More
Web

Create a temporary “Site Down” notice in Apache

This post describes how to make a “Site down for maintenance” notice using Apache .htaccess and the mod_rewrite module. I assume you know how to enable the Apache htaccess directive and the mod_rewrite module. First you need to create a .htaccess file in your root level of your website. Next you add the following lines […]

Read More
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
Scripting

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
Web

Replace specific HTML tags using sed and regular expression

In this post I would like to replace all <embed> HTML tags in a HTML file with a <strong> tag. # sed -e ‘s/<embed[^>]*>/<strong>/g’ filename.html > newfile.html And if you would like to remove the <embed> tag altogether # sed -e ‘s/<embed[^>]*>//g’ filename.html > newfile.html To remove all HTML tags in a file # sed […]

Read More