January, 2008

Paris – Where Open Source means Business

Aah, la douce France…

Yesterday I spent one day in Paris at The Linux Solutions, Open Source &
Free Software Exhibition for Business, Administrations and Communities
. It
was an interesting fair, but not as much as the ones I’ve gotten used to in
Germany (and the Netherlands). It was like half a FOSDEM and half a LinuxWorld.

Funny thing happened though. I met Frank-Thomas Drews from Xandros, Inc. again. The first time we met
was by accident on the bus in Nürnberg.
Apparently, we both know Thomas Uhl, and both like
him as a business partner. Who knows, maybe we get to do some business with Xandros in the future. That’d be great!

After the fair, I went for a drink with an old friend of mine, Céline
Jérusalem. I was really wonderful to meet her again after more than
three years. Céline and I followed the same Athens
course in Trondheim, back in 2003.

And it cannot be said enough: France has a won-der-ful food culture. Even in
some small, random food stand in the underground, they serve freshly baked
croissants with chocolate. Hmmm….

Posted in Business, Open Source Adventures   No Comments »

[sysadmin] cupsquota.sh

Sometimes I want to know how many pages some user printed on some printer on
the network from some host on the network. This script tells me just that.


#!/bin/sh

# script to calculate some statistics from a cups page_log
#
# takes two (optional) arguments: a cups page_log and a username
#
# page_log is expected to be in the following format:
#
# samsung sven 279 [23/Nov/2007:18:44:01 +0100] 1 1 - localhost
# samsung sven 280 [23/Nov/2007:20:09:55 +0100] 1 1 - localhost
# HP loes 281 [25/Nov/2007:16:21:18 +0100] 1 1 - localhost
# HP loes 281 [25/Nov/2007:16:21:25 +0100] 2 1 - localhost
# HP loes 281 [25/Nov/2007:16:21:30 +0100] 3 1 - localhost
# HP loes 281 [25/Nov/2007:16:21:34 +0100] 4 1 - localhost
# HP loes 281 [25/Nov/2007:16:21:41 +0100] 5 1 - localhost
# HP loes 281 [25/Nov/2007:16:21:46 +0100] 6 1 - localhost
# HP loes 281 [25/Nov/2007:16:21:49 +0100] 7 1 - localhost
# samsung loes 282 [25/Nov/2007:23:43:22 +0100] 1 1 - localhost
# samsung sven 283 [28/Nov/2007:18:15:30 +0100] 1 1 - localhost
# samsung sven 283 [28/Nov/2007:18:15:32 +0100] 2 1 - localhost
# samsung sven 284 [28/Nov/2007:18:17:42 +0100] 1 1 - localhost
# samsung sven 284 [28/Nov/2007:18:17:46 +0100] 2 1 - localhost
# samsung loes 285 [30/Nov/2007:09:02:14 +0100] 1 1 - localhost
# samsung sven 286 [30/Nov/2007:14:29:33 +0100] 1 1 - localhost
# samsung sven 286 [30/Nov/2007:14:29:36 +0100] 2 1 - localhost
# samsung loes 287 [30/Nov/2007:18:24:37 +0100] 1 1 - localhost

if [ $# -eq 0 ]
then
USERNAME=${USER}
PAGELOG=/var/log/cups/page_log
elif [ $# -eq 1 ]
then
if [ -f $1 ]
then
USERNAME=${USER}
PAGELOG=$1
else
USERNAME=$1
PAGELOG=/var/log/cups/page_log
fi
elif [ $# -eq 2 ]
then
if [ -f $1 ]
then
PAGELOG=$1
USERNAME=$2
else
PAGELOG=$2
USERNAME=$1
fi
else
echo "Usage:"
echo "$0 [] [ ]"
exit 1
fi

/usr/bin/awk -v username=${USERNAME} '
BEGIN {
pagecount = 0
pagenum = 0
if (!username) {
username = ENVIRON["USER"]
}
}

$2 ~ username {
if ( $6 !~ "total" ) { # HACK :-(
if ( $6 == 1 ) {
pagecount += pagenum
}
pagenum = $6
}
}

END {
printf "%s has printed %d pages in total\n", username, pagecount
}
' ${PAGELOG}

It’s an awk
program with a bourne shell wrapper to calculate the total amount of pages a
user has printed on a host using cups.

Posted in scripting   No Comments »

[office] scantopdf

Another addition to my [office] collection of scripts. And again one which
deals with a scanner. scantopdf scans an A4 paper from any SANE device and
stores it as a PDf with a given filename.


#!/bin/sh

# scans an A4 image and saves it as a pdf file with given filename

colourmode="Gray"
depth=8
resolution=300

while getopts cd:r: option
do
case $option in
c) colourmode="Color";;
d) depth=${OPTARG};;
r) resolution=${OPTARG};;
?) printf "Usage: %s [-c] [-d depth] [-r resolution] filename.pdf\n" $0
exit 2;;
esac
done

shift $(($OPTIND - 1))

/usr/bin/scanimage --mode=${colourmode} --depth=${depth} \
--resolution ${resolution} -x 215 -y 297 \
| /usr/bin/pnmtops -noshowpage -equalpixels -dpi=${resolution} \
| /usr/bin/ps2pdf -sPAPERSIZE=a4 - "$*"

Posted in scripting   1 Comment »

[office] copymachine

At the office, we have a scanner attached to a desktop (elisa), published as a
:net device by SANE. Additionally,
a network printer (gutenberg) is attached to the network. This script allows
anyone on the network to combine both as a (basic) copymachine.


#!/bin/sh

colourmode="Gray"
depth=8
resolution=300
printername="samsung"
copies=1

while getopts cd:r:P:n: option
do
case $option in
c) colourmode="Color";;
d) depth=$OPTARG;;
r) resolution=$OPTARG;;
P) printername="$OPTARG";;
n) copies="$OPTARG";;
?) printf "Usage: %s [-c] [-d depth] [-r resolution] [-P printername] [-n copies]\n" $0
exit 2;;
esac
done

/usr/bin/scanimage --mode $colourmode --depth $depth \
--resolution $resolution -x 215 -y 297 \
| /usr/bin/pnmtops -noshowpage -equalpixels -dpi=$resolution \
| /usr/bin/lpr -P $printername -# $copies

Remember it’s statically configured for A4 papersize (215mm x 297mm).

Posted in scripting   No Comments »

[office] dvitopdf.sh

At our office we tend to document almost
everything with LaTeX. This script
is one which has saved us a lot of time already with creating high quality PDF
documents.

Basically, it’s just an alias to simplify creating prepress quality A4 PDFs of
a DVI file, typically created with LaTeX and hyperref with the dvipdfm driver.


# creates a pdf from a given dvi file on an a4 page
# all parameters are passed to dvipdft
/usr/bin/dvipdft -p a4 -D "/bin/cat %i | /usr/bin/gs -q -dCompatibilityLevel=1.2 -dUseFlateCompression=true -dSAFER -sDEVICE=pdfwrite -sOutputFile=%o -sPAPERSIZE=a4 -dPDFSETTINGS=/prepress - -c quit" $@

It’s the “prepress” setting at the end which guarantees the quality of the
output.

Posted in scripting   No Comments »

Scripting category

As I spend a lot (too much?) time in front of my computer, I tend to let my
machine take care of boring and repetitive tasks. Or sometimes I just find
some nice shortcuts for doing interesting tasks.

Either way, from time to time I find myself scripting in various languages
like Python, Perl, Bourne or other Shells, Awk, etc…. Whenever I want to
backup such a script online, I’ll post it here.

Obviously, dear reader, you can use them too. In fact, you are encouraged to
do so, but then please let me know where improvements can be made. Thank you.
:-)

END

Posted in scripting   No Comments »

Islamabad -> Nürnberg -> home

Last week I came back from a three weeks stay at our office in Islamabad. I landed
6:40am in Frankfurt, and instead of going home, I took the train to the Open Source
meets Business
conference in the wonderful city of Nürnberg. Pretty
tiring…

Anyway, I had a great conference. First of all, I met Bertrand
Maugain
again. Bertrand is a good friend of mine and was a fellow student
when we were both studying at the NTNU in
Trondheim, Norway
. Then, of course, I discussed a collaboration framework
for expanding our customer base in Germany
with Thomas Uhl. Then, I
finally met Dr. Karl-Heinz Strassemeyer and Nico Gulden from LiSoG (Linux Solutions Group) in real
life with whom I discussed our possibly
upcoming membership of the group. And of course I bumped into Klaus Behrla
(director of communication at LPI) and Reiner
Brandt (President of LPI-Central Europe and OSC),
as I always do on conferences lately. :-)

Of course, I should also mention that rapid-i
won the Open Source Business award
and that Bryan
Cheung, CEO
of Liferay, is a very
nice guy. :-)

After these two days, I finally got home (after a train delay in Belgium of course). No time to rest
now though, because next week I’ll be in Paris for The Linux Solutions, Open
Source & Free Software Exhibition for Business, Administrations and
Communities
. Let’s hope it will be as much fun!

END

Posted in Business   No Comments »

(Im)Moral?

Two days ago, I was at the kick-off party of seenDesign, a customer/partner of us, when somebody asked me how we came to the idea
to start a business in Pakistan. When I told
him that we had had some previous dealings with Pakistan as UN volunteers
after the 2005
Kashmir Earthquake
, he said: “So you went there for a very moral reason
and ended up starting something immoral”.

That kind of pissed me off. What’s so immoral about starting a company? What’s
immoral about giving up your job, having no income
for over 13 months while investing € 200.000 somewhere else? What’s so
bad about paying 15 people in a third world country more money each month than
you can spare for yourself?

The difference with ordinary third world development programmes might be that
a business eventually wants to make money, but believe me when I say that
morality and ethics are far more important than that. Even in most of today’s
businesses. And now we’re at it, let’s not forget to mention that money is
necessary for creating sustainability and the fact that NGO’s are not so
different form ordinary companies after all…

When thinking about it, I guess going to Scotland to do “volunteer” work,
paid by European tax money (so one can feel good after doing something
“good”) is far more immoral then.

END

Posted in Business   No Comments »

It happened…

It finally happened. I have a weblog. My own, my precious.

Let’s see what happens. :-)
END

Posted in Life, the Universe, and Everything   No Comments »