A chronological documentation test project, nothing serious, really!

24 Jun 2009 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 (Flash) manipulation and creation utilities like pdf2swf, jpeg2swf, png2swf, gif2swf, font2swf, wav2swf, swfcombine, swfdump, swfstrings, swfbbox and swfc. But I’m only going to use swfextract in this post.

If you don’t have it installed on your system, download it and install the deb-package

# wget
# dpkg -i swftools_0.8.1-2.1_i386.deb

The swftools package depends on several packages like libgif4 libt1-5 and they should be installed before swftools

# aptitude install libgif4 libt1-5

I was interested in extracting the image files in my Flash presentation and did the following to determine what was in the presentation file

# swfextract flashfile.swf
Objects in file flashfile.swf:
 [-i] 5 Shapes: ID(s) 1, 3, 5, 7, 9
 [-j] 4 JPEGs: ID(s) 2, 6, 8, 10
 [-f] 1 Frame: ID(s) 0

As we see above there are 4 JPEG-files I’m interested in extracting and their IDs.

I did the following to extract the image files

# swfextract -i 2 -j 2,6,8,10 flashfile.swf

Result files


If you don’t use the -i switch you will end up with only one output.jpg file.

You are now ready to recreate the Flash presentation using the extracted image files.

SWF Tools

Tags: , , , , , ,

Posted by

23 Jun 2009 HowTo use lftp as a sftp client

lftp is a file transfer program that allows sophisticated ftp, http and other connections to other hosts. If site is specified then lftp will connect to that site otherwise a connection has to be established with the open command.

Basic usage

  • lftp sftp://[domain name]
  • lftp s

Use a different user name than the one you are currently using

  • lftp sftp://[user name]@[domain name]
  • lftp s

Use a different port and different user name

  • lftp sftp://[user name]@[domain name]:[port number]
  • lftp s

Recursive download/upload

lftp> mirror directory_to_download
lftp> mirror -R directory_to_upload

For more lftp options type the following command in a console window

# man lftp

Tags: ,

Posted by

17 Jun 2009 Using DynDNS to access a server with dynamic IP-addresses

This post describes how you can access your server using a host name instead of the dynamic IP addresses (from DHCP) it has assigned at the moment. I’m going to describe how to use DynDNS, but this also applies to other services like EasyDNS, and ZoneEdit. This tutorial has been tested on my Ubuntu 9.04 home server. You need to create an account at DynDNS if you are planning to to this.

First you have to install the ddclient package and in debian and Ubuntu you run the command

# aptitude install ddclient

To reconfigure ddclient

# dpkg-reconfigure ddclient

You should validate the config file /etc/ddclient.conf to make sure your settings are right.
This is the content of my config file

# Configuration file for ddclient generated by debconf
# /etc/ddclient.conf

use=if, if=eth2

You can see that I user network interface eth2 as my internet connection and my login and password is the information I registered at

Restart the ddclient daemon if you do any changes to the config file

# /etc/init.d/ddclient restart

You are now able to connect to your server using the hostname you defined in the server line in the config file, in my case

Tags: ,

Posted by

13 Jun 2009 Create a empty file using dd

How to create a empty/null file with a specified size

# dd if=/dev/zero of=destinationfile.bin bs=1024k count=100

This command creates a 100MB (1024k * 100) sized file.


Posted by

12 Jun 2009 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 -e 's/<[^>]*>//g' filename.html > newfile.html

The result file newfile.html is now without any < HTML tags >.

Tags: , , ,

Posted by