how to start a simple (temporary) webserver in current directory (with php support)

Sunday, 10. November 2013

With python 2.4 and later you can use the SimpleHTTPServer module like this

python -m SimpleHTTPServer [port]

This will start a HTTP server on port 8000 (if no port is specified) serving the files and directories which are in the current working dir.

for Python 3 use


python -m http.server [port]


If you need the web server to parse php files you should use the php webserver instead of the python webserver:

php -S 

Dsniff / Arpspoof HowTo

Saturday, 2. November 2013


This is a direct copy of

Thank you for this neat howto!



  • dsniff
  • arpspoof
  • the IP of your gateway
  • Linux machine (BSD would work too)
  • Enable IP forwarding (VERY IMPORTANT)

dsniff/arpspoof website

NOTE: On Debian/Ubuntu systems, both tools are packaged under ‘dsniff’.

Get your gateway’s IP

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 br0   U     0      0        0 virbr0         UG    0      0        0 br0

In this case, it would be

Enable IP forwarding


# echo 1 > /proc/sys/net/ipv4/ip_forward

To make it permanent, add this line to /etc/sysctl.confnet.ipv4.ip_forward = 1

NOTE: If you don’t do this, no one will be able to use the network as your machine will refuse to forward packets to the gateway. You have been warned!


This will make the clients on the network believe that your computer is the gateway. So make sure you enabled forwarding.

# arspoof


This tool will sniff the traffic for unencrypted login and passwords. When it finds one, it will print it to stdout.

# dsniff -i br0 -mc


Make sure you’re authorized to do this, because in many countries, that could be seen as hacking and/or spying. Laws differ in every country, but the results are often jail.

Share Internet Connection from GNU/Linux Systems

Saturday, 2. November 2013

this is a direct copy of  Thank you for this neat howto!


Now, here we have,

A computer connected to the Internet via the eth0 port (if you have a mobile broadband it would be ppp0).

We want to share the connection via the eth1 port of the same computer.

What we need,

We need basic networking utilities that is, in most cases, comes pre-installed in your GNU/Linux distribution (iptablesifconfig to be precise).

Yes, we do need some Lan Cables (Crossover cable) to share the connection via the eth1 port of the above mentioned computer.

So, let us begin. Connect your computer to the Internet. If u have a dhcp connection you may use dhclient or dhcpcd. Just do, as root, ‘dhclient eth0′, without the quotes. For connecting to mobile broadband you may use wvdial.

Flush iptables rules:

# iptables -F
# iptables -t nat -F
# iptables -t mangle -F
# iptables -X
# iptables -t nat -X
# iptables -t mangle -X

Enable kernel routing mode:

# echo 1 > /proc/sys/net/ipv4/ip_forward

Also, you can make ip forward permanent by editing /etc/sysctl.conf and set net.ipv4.ip_forward = 1

Setup eth1:

# ifconfig eth1 netmask
# ifconfig eth1 up

( you may consider using a different ip address)

Set iptables rules for port forwarding:

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

That’s it. Now connect one end of the cable to the eth1 port of your server. Connect the other end to any computer or device such as a router or a switch.

Client side configuration example:

Ip address:
DNS server address: Same as the server (you may also use Google DNS or any other DNS of your preference)

# ifconfig eth0 netmask
# ifconfig eth0 up
# route add default gw eth0
# echo "nameserver" > /etc/resolv.conf

Happy surfing.



KDE SC – KMix – Change Volume Percentage Step and add Audio Feedback

Sunday, 31. March 2013

While hovering over the KMix systray-icon using the mousewheel will increase (or decrease) the volume by min. 12% .. so the sound volume becomes “just too loud” or “just too soft”

The following change in the KMix config file will change that behaviour. The mouse wheel (or volume buttons) will increase the volume by approximately 4% instead of 12% after the change.

  1. Stop KMix  (right-click on the kmix icon in the systray and select “exit”)
  2. Edit the config file ( nano ~/.kde/share/config/kmixrc )
  3. Add the following line to the [Global] section:   VolumePercentageStep=1.2
  4. Set the value for VolumeFeedback to true
  5. Save the config file
  6. Start KMix
  7. Enjoy your fine granied KMix control with audible feedback! 

thx to eric hameleers for the percentage step – tip 🙂


EDIT:   (audiofeedback)

or.. you can just enable the audio feedback in the GUI 🙂







Easy Setup NGINX Webserver

Sunday, 17. March 2013

 Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.


Set Up / Install

sudo apt-get install nginx

Create a New Directory under /var/www/html

sudo mkdir -p /var/www/html/


Create a New INDEX.html under /var/www/html

sudo nano /var/www/html/

Create the default index.html page

<h1>This is your first virtual host</h1>


Create the New Virtual Host File

 sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/


Set Up the Virtual Hosts

sudo nano /etc/nginx/sites-available/

Make changes in the NGINX.conf file

Server {
listen 80;

root /var/www/;
index index.html index.htm;

Create a symbolic link between the sites-available directory and the sites-enabled directory

sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Restart NGINX

sudo service nginx restart


Wednesday, 21. November 2012

based on meego, sailfish is the first real open source mobile operating system that also runs android apps thanks to myriads alien dalvik.  the Qt swipe UI allows to swipe away apps and push them to the multitasking homescreen where the app will act as interactive widget. an application drawer lives underneath the homescreen and can be accessed via swipe up. as seen in meego, the lock screen shows notifications and allows quick-access to the camera, phone, profiles and more with a swipe down. swiping away an app half way allows a glance at the homescreen and whats going on there without leaving the app.  

jolla plans to launch the first sailfish phones in the second quarter of 2013.



Presenting Jolla

Jolla Sailfish OS Keynote at Slush Event in Helsinki

Hands On – UI Preview



Detailed UI Preview

clone devices with dd

Thursday, 8. November 2012

1. Open Konsole
2. Make sure NO partitions are mounted from the source hard drive.
3. Backup the whole drive.

# dd if=/dev/sda conv=sync,noerror bs=64K | gzip -c > sda.img.gz

  4, Backup MasterBootRecord

#  dd if=/dev/sda of=mbr-backup count=1 bs=512

“dd” is the command to make a bit-by-bit copy of “if=/dev/sda” as the “Input File” to “of=sda.img.gz” as the “Output File”. Everything from the partition will go into an “Output File” named “sda.img.gz”. “conv=sync,noerror” tells dd that if it can’t read a block due to a read error, then it should at least write something to its output of the correct length. Even if your hard disk exhibits no errors, remember that dd will read every single block, including any blocks which the OS avoids using because it has marked them as bad. “bs=64K” is the block size of 64×1024 Bytes. Using this large of block size speeds up the copying process. The output of dd is then piped through gzip to compress it.


  •  To restore your system:
 #  gunzip -c sda.img.gz | dd of=/dev/sda conv=sync,noerror bs=64K    
  • To restore Masterbootrecord
# dd if=mbr-backup of=/dev/sda

other useful things:


  • Store extra information about the drive geometry necessary in order to interpret the partition table stored within the image. The most important of which is the cylinder size.
# fdisk -l /dev/hda >
  •  backup just one partition
#  dd if=/dev/sda2 of=sda2.img



One of the disadvantages of the dd method over software specifically designed for the job such as clonezilla is that dd will store the entire partition, including blocks not currently used to store files, whereas the likes of clonezilla understand the filesystem and don’t store these unallocated blocks. The overhead isn’t too bad as long as you compress the image and the unallocated blocks have low entropy. In general this will not be the case because the emtpy blocks contain random junk from deleted files. To rectify this, it’s best to blank all unused blocks before making the image. After doing that, the unallocated blocks will contain mostly zeros and will therefore compress down to almost nothing.

Mount the partition, then create a file of zeros which fills the entire disk, then delete it again.

# dd if=/dev/zero of=/tmp/ bs=8M; rm

also read (dd with progressbar)

very special thx to


Thunderbird “firetray”

Wednesday, 6. June 2012

since KMAIL failed me over and over again in the last months (years?) especially when it comes to IMAP in disconnected mode i finally managed to take the small step to thunderbird. no problems here so far..  BUT there is no systemtray integration 🙁


lucky me .. there are addons..  thx mozilla and devs !



 it works great in KDE (but you would probably change the icon to something simple an white) 


typeX-press Filebrowser “standalone”

Wednesday, 9. May 2012

In the last few days i found some time to work on the typeX-press Filebrowser again.

I made a standalone version of the filebrowser. It still has the full usermanagment and all the other features except the file editing feature. I fixed o lot of bugs and added some useful features like “download folder as zip” or a little image gallery (work in progress)

Filebrowser – Features:

  • Folderlist
  • Breadcrumb Navigation 
  • DragAndDrop Files (move, copy) 
  • Create Folder
  • Rename Folder/File 
  • Delete Folder/File 
  • File Uploader (Ajax, Resize Images Before Upload)
  • Sort Columns (by Name, Size, Date) 
  • Show proper Filesize/Filetime information
  • Download folder as .zip file (subdirectories included)
  • Fancybox jquery image slideshow
  • Imagepreview on mouseover
  • resizeable UI elements
  • Image Gallery (Fancybox, Rotate Images,…) 
  • Usermanager (add/delete/rename)
  • Configuration Panel (configure tp-filebrowser and tp-uploader)

> download 

 ( latest version: 1.1  )




relinux & (k)ubuntu 12.04 – custom username/hostname and other obstacles

Thursday, 12. April 2012

it seems that relinux needs a major rework to function properly on 12.04 ( afaik the team knows about this and is already working)


for relinux “iso” to work i had to write the following lines into a terminal first:

sudo bash
rm -rf $WORKDIR
mkdir -p $WORKDIR/ISOTMP/casper
mkdir -p $WORKDIR/ISOTMP/preseed
mkdir -p $WORKDIR/dummysys/dev
mkdir -p $WORKDIR/dummysys/etc
mkdir -p $WORKDIR/dummysys/proc
mkdir -p $WORKDIR/dummysys/tmp
mkdir -p $WORKDIR/dummysys/sys
mkdir -p $WORKDIR/dummysys/mnt
mkdir -p $WORKDIR/dummysys/media/cdrom
mkdir -p $WORKDIR/dummysys/var
chmod ug+rwx,o+rwt $WORKDIR/dummysys/tmp


because of a recent change in CASPER it tries to determine username and hostname in a really bad way that leads to errors .. (it takes the livecd lable for username AND hostname or something like that)

 i therefore had to hardcode USERNAME and HOST in 

/usr/share/initramfs-tools/scripts/casper (lines 692-693)


today i encountered a new problem :  

vesamenu.c32: Not a COM32R image

in order to solve this problem i had to overwrite the file “vesamenu.32”  located in /syslinux/  on the usb thumbdrive with the original file located in  /usr/lib/syslinux/  on my “relinux” system.