Sunday, December 25, 2011

local internet filter

Content filter for children or companys with tinyproxy. (local)

Installint tiny-proxy with aptitude:
aptitude install tinyproxy

then editing the conf file:

Here i had to uncomment these two lines:
Filter "/etc/filter"
FilterDefaultDeny Yes

And restart it with:
/etc/init.d/tinyproxy restart

The file /etc/filter looks like this:

Simple file with the pages which should be free.

Tuesday, December 6, 2011

brasero writes no audio cd

Installed Debian 6.0.0 from DVD without any software.
After trying to create a audio cd with brasoro it could not
finish creating.

install the cdrtoolkit, best with aptitude:
aptitude install brasero-cdrkit

After this i could create audio cd's without problems.

Terminalmagic with screen

Very nice and usefull tool: screen
With the tool you can run severel shells in one terminal.
or if any sessions are running:
screen -r

With the folowing keys you come to the command mode:
STRG + a
Then you can use the following letters:
c -> create a new window
n -> switch to next window
p -> switch to previous window
" -> show window lis
A -> give name to window
k -> kill window

I use it most to create one ssh connection to a server and then run
severel programms there.

Wednesday, November 16, 2011

Copy file to two destinations

With this small script i can copy a file to two destinations.
It works like this:

Save script als fcp and make it executable with chmod +x fcp

# One Source more Destinations
# Start:: fcp
cp $1 $2 $4 $5
cp $1 $3 $4 $5

Working with files on a ftp account

I have to work with files on a ftp-server (renaming, deleting).
With ncftp i found no solution, but after installing lftp
this work fine:

Renaming file1 into file2 :
lftp -u "username,userpass" -e"mv /directory/filename1 /directory/filename2;exit"

Deleting filename
lftp -u "username,userpass" -e"rm /directory/filename;exit"

Sunday, October 9, 2011

if with perl

Simple if construction,
reads the name into a variable,
then looks if the name is eqal (because this eq)
then prints the first block, if not print the other block.

#!/usr/bin/perl -w
use strict;
print "Your name:\n";
my $a = ;

if ($a eq "Alpha")
print "Hello Alpha\n";
print "You not Alpha\n";

hello world in perl

for a special problem i have to teach myself a programming language.
i decieded for perl because i thought a friend use it too.
after the first lessons i hear that he work with python.
but now i stay at perl.

here the classic "hello world":

#!/usr/bin/perl -w
use strict;
print "hello world\n";

very ease, i save it as .pl file,
then change it to executable with:
chmod +x
and simple execute it.

and enjoy myself at the hello world

Blog has moved

Now with a new adress,
i think much cooler than before :-)

Monday, September 5, 2011

Network configuration with a minimal installation

I get a Server with a Debian 6.0.2 and minmal installation.
Because this he has no network connection and i have to edit all files with nano.

For a correct connection to the internet i edited the following files:

auto eth0
# The loopback network interface
iface lo inet loopback
# The primary network interface
iface eth0 inet static

In this way the local ip adress is and the gateway (in this case a router) is .
The ip-adress is in this case static, and with auth eth0 the connection is coming up automatic.

Then i add the nameserver to the

Then i edit the
route add -host eth0
route add gw

This add the route to the kernel routing table every time i boot.

Tuesday, August 23, 2011

Fill pictures to a new size

Sometimes it is usefull to fill pictures without scaling them.
For this i create a file names "white.jpg" which is the backround,
and adding with imagepagick the files over it.
The pictures then stored in /gross

for i in *.jpg ; do convert -composite white.jpg $i gross/$i ; done

Wednesday, August 10, 2011

Simple picture resize with convert (imagemagick)

Simple converting many jpg's into a smaller file.
The smaller pictures are stored in /small

for i in *.jpg ; do convert $i -resize 250x188 small/$i ; done

Short and nice: cal

Calender on the shell:

-> show this month
cal 2011
-> show every month of 2011
cal -3
-> shows the last, the current and the next month


Some words to gnome3

I think this is not the right way for the grapical
Most Linux/Unix user are advanced and do not need
the help this gui's offers.

The Gnome2 way ist the right way.

could not mount usb stick with jfs

after unmounting and removing the usb stick (16gb)
it could not be mounted again.
somesthing wrong with the sync at unmounting.
the dirty bit of jfs is not removed correct.

a simple
jfs.fsck /dev/sdb2

solved the problem.

Thursday, July 7, 2011

Simple VPN installation on debian lenny

This is an simple way to install openvpn for two computer, one is the vpn-server, the other is the client.


First i install openvpn with aptitude:
aptitude install openvpn

After this i generate a secrec key with:
openvpn --genkey --secret static.key
it should be stored in /etc/openvpn direcotry.

now i modified the /etc/openvpn/server.conf that it looks like this:
dev tun
secret /etc/openvpn/static.key
push "route"
port 1234

I decieded for an other port because security reasons.
Now i must enable ip_forwarding with:
echo 1 > /proc/sys/net/ipv4/ip_forward

The kernel routing table looks like this:
Ziel Router Genmask Flags Metric Ref Use Iface UGH 0 0 0 tun0 UH 0 0 0 tun0 UG 0 0 0 eth0 U 0 0 0 eth0

Here is the ip-adress from the client behind the vpn and the ip of the vpn-server.


Here we install openvpn with:
aptitude install openvpn

The the /etc/openvpn/openvpn.conf
remote 1234
dev tun
secret /etc/openvpn/static.key

The ip adress is the fix-internetadress of the vpn server,
this one you must know.
1234 is the port where openvpn is listening.
You must transfer the static.key on a secure way to the client pc and store it
in /etc/openvpn directory

The kernel-routing table should look like this:
Ziel Router Genmask Flags Metric Ref Use Iface 0 UH 0 0 0 tun0 U 0 0 0 eth0 UG 0 0 0 eth0

Wednesday, July 6, 2011

Convert and Reszie PSD to JPG

Nice problem:
Converting a whole directory of .psd files into jpg and resize them to a lower resolution.

Smart solution:

for x in *.psd; do convert -size 320x240 -flatten "$x" "`basename "$x" .psd`.jpg";done

What a great solution in one line!

Monday, July 4, 2011

Fast way to transfer ftp data ist mc

After installing an online shop with gftp, it doesen't work.
The permissions of the files were not kept.
So i put the files with gnome directly on the server.
But my webhoster has problems with ftp and so after transfering
some files the connection was closed.

Fast and secure way to use ftp is the midnight commander.
Logging in on a non-anonymous ftp you can use user@server

Postfix and uwimapd strange problem

At some mailboxes the user had a problem with logging in (using thunderbird).
After several try's they close thunderbird and open it again.
Then all emails appears, but some of them again and again.
So some emails were douple or triple in the mailbox.

I check the permissons, the and of postfix without result.
Then i take a look into the log files, but nothing strange happens.
Restarting postfix with /etc/init.d/postfix restart solved the problem.

Server-harddisk replacing

Interesting job to do.
On the mailserver must the harddisk be replaced.
The s.m.a.r.t. values become bad.
Now i think about how to do this with minimal downtime.

At the moment my favorite idea is to boot with the sysrescue cd
(link at bottom of page) and copy all data with partimage of fsarchiver
over the network to the fileserver.
but i dont know, if the new hard disk will be able to boot then.

Wednesday, June 15, 2011

icq login problem

problem with login on icq:
During work the connection was closed, and login was
not possible.
There where a securtyfeature changed:
You must remove the mark at "use clientlogin".

Thursday, June 9, 2011

partimage and big files

Having problems backup with partimage
a large partiton.
I decieded to compress it to reduce the file size.
But after this i have problems to restore the partition.

The solution after talking with the developer is:
Dont compress it, the program has problems with large and compressed files.
So i only backup without compressing.
If you have a compressed file and get the error:
Try to uncompress witz gzip or bzip2 the partimage file
and restore then.

Short and usefull : cal

Short but sometimes usefull:


Shows the calender of the month,

cal 2011

the calender of the year.

Monday, June 6, 2011

Force sending mail with postfix

For forcing postfix to send a mail
just type:
 postqueue -f
You can take a look with
it the queue ist
empty or not.

Monday, May 30, 2011

Force fsck

Force fsck on a jfs filesystem is the same like on ext2/3/4
Just create the forcefsck file in the root directory and reboot.
Simplest way:

touch /forcefsck

and then reboot.

After this, all local hard-disks were checked during boot.
The file is then removed.

Tuesday, May 24, 2011

5 years linux 5 years happines

Now i reach the 5 years border,
5 years linux,
5 years debian
5 years with things i will never miss again....
no thinking which driver to use
no thinking about firewall or antivirus software
no thinking about updates
no thinking about the ram because everything over 512 is fine
no thinking about how large the harddisk is. everything over 20gb is fine.
no thinking about defragmentation
no thinking about open ports

The first 3 month were realy hard. in this time the change to linux
show me how less i know about computer, network and operating systems.
But then the knowledge explode.

Now i will never go back to another operating system.

Thursday, May 12, 2011

Acid 3 test on debian

That surprises me:
Acid 3 Browser test with iceweasel 3.5.16
and ephipany 2.3.60

iceweasel: 93/100
epiphany: 100/100

Friday, May 6, 2011

Installing Debian Squeeze on encryptes lvm takes long time

Installing Debian on an encrypted lvm
takes on a dual core cpu and 80gb hard-disk
about 3 hours to delete the disk.

fsck died with error code 1 on ext3 fs

Same problem with ext3 after reset.
During booting come the message
fsck died with error code1
Have no idea what happens in this situation

Saturday, April 23, 2011

wlan with debian and medion akoya E1210

Want to install linux for a friend.
First try Ubuntu because the better hardwaresupport,
but have big problems with wlan. Wants only the password for wpa again and
again, but no connection.

Then installed debian 6.0 from dvd. At this time, wlan not found by debian.
Download the ralink firmware, put it on a usb stick and installed it with gdebi.
After reboot wlan works fine.

Thursday, April 21, 2011

fsck died with errorcode 1 on jfs fs

Server has problem with harddisk,
and filesystem go into readonly mode.
I decieded to reboot after sync.

During boot process the fsck needs several
seconds and then come the message:
"fsck died with error code 1".
Used filesystem on the server is JFS.

Nice error, till now no idea what happens.
System seems to work normal.

Some weeks ago the same problem and after this i boot
with the sysrescue cd and run fsck.jfs directly.
It found no errors on the drive.

I writing with the developer of jfs and then will write here if
i have a reason.

Tuesday, April 19, 2011

Nautilus could not download via ftp

Interesting problem:
Nautilus could not download data from the ftp.
When i connect to one, and try to get some folders the system hangs,
the system transfers some bytes and then nothing happens.

Opening a textfile on ftp, editing and saving works fine.

Copy data from local to remote works too.

What is exactly the problem, till not i dont know.

Monday, March 28, 2011

Good way to backup a system

A good way to backup a system is the sysrescue cd.
With this you can use partimage for ext2,ext3,reiserfs,jfs
testet with these filesystems and work fine.
Xfs was testet with debian etch. Here it was used together with
lilo and the restore result in a not bootable system.

For those situations, and for ext4, btrfs and reiser4 i would try
the simple dd command like this:
dd if=/dev/sda1 of=/backup/image.img
and after this
dd if=/dev/sda of=/backup/boot.img bs=512 count=63
This backup the Partiton 1 into the file image.img
and after this the bootsector (the first 63kb of the raw-device sda with a block size of 512 bytes) into boot.img.

Be careful of restoring, wrong usage of dd can delete the
whole harddisk.
Read the man page !

Tuesday, March 22, 2011

Sending Formfeed to an Lpt Printer

Nice problem, actual not solved:
Sending a LF with a textfile to a Rena printer
at parallel port.
Dont know hot to geht this ascii character into the file.

Tuesday, March 15, 2011

Iso Archives

If you need an old ISO-Image from
an Debian cd or dvd look here:

Monday, March 7, 2011

User rights on smb mount

After mounting a smb share as root,
the normal user has only reading rights on the target directory.

Problem fixed wiht the following way of mounting:

mount -t smbfs -o  username=user,password="password",uid=1000,gid=1000,file_mode=0666,dir_mode=0770  //serverip/directory/share /targetdirectory

More information here:

Thursday, March 3, 2011

Solved routing problem with vpn

Routing problem with vpn is solved.
The solution was simple and clear:
Gateway on the fileserver must be the vpn-server,
not the internet-gateway.
With the wrong entry, all data packages were sent to
the internetgateway, and he dont know what to do with it.

MySQL database restore for onlineshop

After some experiments with the onlineshop i want
to restore the sql-dump backup.
It has a size of nearly 14MB and this was too large for my webhoster.
The restore has a timeout of 30sec and this time was not
enough so the server shows an error 500.
Idea was first zipping the file, but this was no solution.

I load the programm mysqldumper from
and installed it on my homepage. Important is to create the login and password!
During installation you must know your url to the database, the database name, user and password.
This program could handle only up to 10MB for each upload, but
with an ftp program i could push the whole file into the directory.

Now i must convert the raw sql-dump into a msd file and then restore the backup.

Long way for someone without hugh sql knowledge,
but now everything is fine!

Wednesday, March 2, 2011

Set date and time with on shell

Simple use the "date" command to
change date and time.
The syntax is a little bit strange:

date <month><day><time.hour><time.minutes><year>.<time.second>

take care of the point!

Monday, February 28, 2011

Some words to create a channel on irc

Creating is very simple,
just join the channel:
/join #channelname

after this you get op status.
Then register the channel with:
/msg ChanServ register ##channelname

And give you op status:
/msg ChanServ FLAGS #channel name+O

Topic and more is at the moment not much interesting,
here is enough help on the web available:

After migration to Squeeze problem with vpn

After installing Squeeze on the server,
it is not possible to access or contact the server over the vpn.
The Squeeze server can ping the vpn server and vpn client.
Ping from vpn-server is possible too.
But no connection from the client over the vpn-server to the

Syslog has no entries, auth.log hat no entries and ping from client give no error message.
It seems that the server dont exist.

Furter Information (german) look here:

Sunday, February 27, 2011

Meetingdate for debian-ruhr at uph / essen

Hello everyone out there.
At the moment we see us at the ubuntu-ruhr meetings in the uph at the 3. thursday of a month.
I think this is not the best weekday.

Who is interested in meetings another day?

Please write in comment!

Saturday, February 26, 2011

Visit me at IRC on

My channels:

look forward to see you there!

Tuesday, February 22, 2011

Adding route for vpn

It is as simple at is seems,
adding a route on a client for a vpn far away.
Normaly all ip packages that are not for the local network
find the way over the gateway.
But were gateway and vpn server are different machines,
every pc must get a route for the vpn and gateway.

On Debian-PC adding route with this:
route add destinationip gw gatewayip

If it works show you ping!

Monday, February 21, 2011

Two mailserver with different ip ...

... but same /etc directory are no good idea.
Because i want to create a backup mailserver,
i installed lenny with the same packages like the old mailserver with postfix.

After this i copy the /etc directory, and restore it back to the new debian.
Then i modified the /etc/network/interfaces
so that the ip is different.
After this i reboot the server and restore the /home directory from the old mailserver.
After this, although the ip is different strange things in the network happens.
Old mails appears in the mailboxes etc.

I think it is because the hostname of the system is the same.
Will try to setup the server from ground with different name, ip.

Moving Mailserver not easy as i thought

Moving a Mailserver from one to another Debian is not easy as i thought.
Installed the Server with the sampe packages,
then copy the whole /etc directory.

But... login with imap is not possible.
Local login from the user works.

Thursday, February 17, 2011

Filesystem goes readonly

On a server the filesystem goes readonly
without any log entry.
I reboot with a rescue cd, and run a
fsck.jfs /dev/sda1 -f
to force the checking of the structure.
Some data were stored in lost+found.
After this the system seems to work.

One file on the home directory of the user
was reneamed to file.lock and has no entry.
After renaming back to file, everything was fine.

I have no idea why the system has this effect,
and why the backup dont work.

Lock for a reason!

The error message deep in the log is:
xExtend: estension is not contigious

Filesystem block size and database page size

Think that it is the best value to use the same pagesize like blocksize on harddisk.
So i get the blocksize with this command:
blockdev --getbsz /dev/sdx

The result on the jfs filesystem is 4kb,
so i think 4kb pagesitz would be best.

Tuesday, February 15, 2011

Decided for Superclassic

I think the Superclassic 2.5 on Squeeze is the way to go.

Next area where to experiment is the page size.
Interesting values are 4kb, 8kb, 16kb, 32kb.

My first think was to use the same size like sectors on harddisk,
so the memory-manager could handle the pages better.

But i am not sure about the effect on heavy use.
At heavy usage maybe this can lock the database.

Installing Server in 30 minutes

Nice problem: replacing lenny with debian in a production enviroment.
I decided for new installation, befor this i backup the complete /etc directory,
and /var/lib/samba .

Then booting from netinstall cd and begin installation.
At tasksel i decidet for only "standart-system" without any software.
When installation was done, i uses aptitude to install the database and administration utilities i need.

From the old /etc directory i could use the following things:

After this the server could boot into productive enviroment,
the rest i could do later.

All user could use the database and the fileserver.

Squeeze in 30 minutes.

Monday, February 14, 2011

Not sure about right firebird version

Still not sure, which firebird is right,
classic, superserver or superclassic.
Testet the database with all versions, and with one connected
user the differences are very small.

Now i testing with different buffer sizes.

At the moment all versions have nearly the same performance.
But i dont know how it would be with much user and more queries.

Saturday, February 12, 2011

Next try with firebird database

Now will try to install firebird on
debian squeeze.
Not sure which version is best.
or superclassic.

Think i try superclassic.

Look here:

Friday, February 11, 2011

Evolution lost memos

After restoring the evolution data,
all memos were lost.
First i searched in the directory-structure for the data, but
they where there.

Solution is as simple as unexpectet: rebooting the systems
bring all data back.

Increasing firebird performance

Still problem with low firebird performance.
Changing the page size to 16KB or 32KB has no effect.
Could stay at 8KB.

Now will test new firebird 2.5 superclassic,
best on squeeze.

Thursday, February 10, 2011

vpn problem is still open bug at debian

The problem with the subnet conflict from openvpn
seems to be still an open bug at debian.

so the log-entry has no effect.

Finding out mailserver from email adress

Today interesting problem,
how to find out which mailserver receives the mail for a domain.

Soluton is to ask the nameserver which ip is relevant for the domain together with the mx-record:

set type=mx

I should spend more time learning the tcp/ip utilities...

Wednesday, February 9, 2011

vpn adapter subnet conflict

openvpn.log from the vpn-server has
the following entry:

WARNING: potential TUN/TAP adapter subnet conflict between local LAN [] and remote VPN []

this is the openvpn.conf:

dev tun
secret /etc/openvpn/static.key
push "route"
port 10000
keepalive 10 120

and this says route -n

Ziel                Router             Genmask               Flags Metric Ref    Use Iface      UH    0      0        0 tun0       UG    0      0        0 eth0          U      0      0        0 eth0                    UG    0      0        0 eth0

Both, client and server seems to work.
Maybe problem is in routing.
Try to fix in near future.

socket write error

Try to backup with ncftpput and become this error message:
socket write error.
First was not clear what happens,
but using the normal ftp and try to push the file
to the server show clearly what happens:

netout: Connection reset by peer
451 Transfer incomplete. Quota exceeded. Closing data connection.

No space left on ftp-server.

Error in gnome terminal

Strange error in gnome terminal:
when editing a long command-line
the shell makes no line-feed, it begins directly at pos.1 and overwrites the line.

dont know if it is a problem of gnome-terminal, dash or that i use a ssh for login on a remote computer...

Updated rc.local

Updated rc.local for automounting
the network connections.

like this:
mount -t smbfs -o user=username,password=password //serverip/share /targetdirectory

Squeeze has fast network

Copy a hugh amount of data over the network (samba)
is much faster than with lenny.

Tuesday, February 8, 2011

Printerdriver block aptitude

Some Programms could not be installed with aptiutde.
A Program from the printer-driver,
and the file smfpd from /etc/init.d
blocked aptitude.
After removing the file, i could install ncftp.
Then i copy the file back to /etc/init.d

Encrypt in Shell

For Encrytion with the shell i must import the key:
gpg --import key.asc
and then set ist to trust:
gpg --edit-key key.ask

So no error appears when using in a script.

Same Problem with NetworkManager

with the Testing version from 17.01.2011 no network Problems,
after upgrading same NetworkManager problem like with the other pc.
At home no problems with the NetworkManager.

Pidgin dont work at the moment

Try to fix it with modifien /etc/NetworkManager/NetworkManager.conf

Updating from Testing to Stable

Update from Testing to Stable done.
aptitude dist-upgrade

Final status from aptitude:
Aktueller Status: 73 Aktualisierungen [-6].

Now try to reboot

Network printer is not nice as lenny

Installing a network printer is not so nice like in lenny.
At Lenny the network printer were shown with its ip-adress.
Now Sequeeze shows my only the printer name in the dialogue.
With severel printers of the same model.... not the best solution.

Monday, February 7, 2011

Problem with Networkmanager

Now i installed Squeeze on my Work-PC.
This PC uses a fix IP-Adress.
After installation, Internet works fine,
but Pidgin and Evolution show "no network connection".

The error is:
in the /etc/NetworkManager/NetworkManager.conf
must be this set:

After this, everything works fine.
This Problems appears on this PC the first time,
the other PC's from yesterday have no problems with network.

Filesystem JFS

All new installations i do, i use JFS as Filesystem.
I decieded for it, because it is fast, uses journal and
seems to be nearly error-free.

I am happy that the new squeeze supports jfs further.
With default installation is no way for ReiserFS.
This you must load as module on expert-installation.

Interesting, that btrfs is an option in the installer,
because so far i know it is not stable.

Installation on Desktop/TestPC is done

Finnishing installation on my Test-Desktop.
Everything works fine.

The old computer has only 512MB RAM, but
with the actuall Debian you can work very fast.
This way: No need to buy new...

Now look forward the upgrade from Testing to Stable in the company.

Sunday, February 6, 2011

Installation on Netbook is done

Installation from Debian 6.0.0 on my Netbook (Asus EEE) is done,
and it works fine!
All hardware ist supported.
Installation runs without problems.

For Security i set the powersaving features from the HDD:
hdparm -B 254 /dev/sda

Upgrading Debian Lenny to Squeeze

Now i test a Upgrade from Lenny to Squeeze with
"aptitude dist-upgrade"
It takes a very long time.
After upgrading (and some error-messages)
i reboot the System and found myself in a
After Login i must type "startx" for Graphical work.
The Windowsmaker seems to be different to the normal installed Squeeze.

I think not the best way for installing.

Upgrading Debian Testing to Squeeze

First i try to upgrade from Testing to Squeeze.
I start "aptitude dist-upgrade" and wait a little time.
Upgrade was fine. Every work after this.