June 30, 2008
filed at around evening time by DrScofield in: from the grid, hacking
technorati tags:
QR code for this entry · average time to read 0:28 minutes

daTwitch and nebadon, both infamous opensim developers did an interesting experiment over the weekend: they patched mono and rebuild it with the --with-large-heap configuration option and then load tested OpenSim — result: you get way more bang for your buck!

so, i’ve updated the mono-build script to include that patch and also use the large heap configuration option. admittedly, they did use mono from its SVN trunk, so i’m not sure how much the script will help, but, have a go and let me know how it works out.

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
May 18, 2008
filed at around evening time by DrScofield in: hacking, linux
technorati tags:
QR code for this entry · average time to read 1:16 minutes

since time immemorial (well, almost) i own a private epson 1260 scanner. a couple of weeks ago i — foolishly, as it turns out now — offered to my in-laws to copy all lake district articles out of our country walking collections. foolishly, because i realized that country walking must have their offices on one of those lonesome, remote fells: there are lots and lots and lots and lots of lake district articles and routes in country walking.

i started off with the gscan2pdf tool — really slow to start up, at that speed summer would be over before i had everything scanned in and converted to PDF. not good.

next try: kooka, KDE 3.5’s own scan tool — faster, but non-intuitive, you apparently have to rename and save each individual file. winter time before i’d be done.

i noticed, once again, that the epson 1260 does have a scan button (and a print and a mail and a web button) — if only that were working under linux. last time i checked for a tool (gazillion years ago), there was nothing, zilch, nix available to utilize that button. googling for plustek and scan button (the scan chipset inside the epson 1260 is a plustek chipset) this time did turn up something: scanbuttond! and even better: it’s available as a ubuntu package in hardy heron:

% apt-get install scanbuttond

installed the beast. following the instructions on the gentoo wiki gave me a working one-button-scan process! i modified the scan script slightly to deposit the fresh scan in my $HOME/tmp/scans/ directory.

converting a bunch of JPG images into a single PDF is also quite easy: you imagemagick’s convert command:1

% convert *.jpeg allinone.pdf

voila!


  1. if you haven’t installed that yet, it’s a simple

    % apt-get install imagemagick
    

    away. 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
May 15, 2008
filed mid-afternoon by DrScofield in: from the grid, hacking, void
technorati tags:
QR code for this entry · average time to read 2:22 minutes

our lab “owns” an island on the LindenLab grid and we’ve created a “lab” avatar who is the estate owner. as the island is paid for by the lab, we need to have monthly account statements on file for the bean counters. so far, i had to remember to log in to the lab avatar’s account page, copy the account statement and mail it our friendly lady in accounting taking care of these things (yes, we are a small lab)…

…the only problem with that is that i tend to forget these things and our friendly accounting lady has to be rather patient and usually ends up sending reminder notes.

so, after another one of these notes and as it was becoming rather embarrassing that i kept forgetting, i decided to tackle it once and for all and write a python script to do this automatically. the very excellent mechanize python package turned out to be an invaluable tool.

here’s the script in all its glory:

it reads the avatar name, password and so forth from a configuration file:

[lindenlab]
url = http://www.secondlife.com
firstname = Foo
lastname = Bar
password = secret

[mail]
subject = %Y-%m LindenLab monthly account statement for Foo Bar
to = accounting@foo.bar.com
cc = me@foo.bar.com
from = me@foo.bar.com

adapt the config file to your taste and invoke as follows:

sl-account-statement --config config.cfg

voila!

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
May 8, 2008
filed in the early afternoon by DrScofield in: from the grid, hacking
technorati tags:
QR code for this entry · average time to read 2:34 minutes

mucking around with trying to get mono to run on hardy heron (and my custom compiled kernel1) i ended up with a mutilated mono installation. just following my previous recipe didn’t work out too well for the mono document browser…duh…:-(

so, i took sean’s shell script and gave that a spin. that worked mostly — i had to adapt it to mono 1.9.1 for the mono-doc stuff and also install additional mono packages. here’s the revised edition (click here for a downloadable version):

#!/bin/sh

BUILDDIR=/usr/src/local/mono/1.9.1

# This is needed to pick up our built mono for commands
export PATH=/usr/local/bin:$PATH 

apt-get install -y build-essential bison gawk
apt-get install -y libglib2.0-dev
apt-get install -y libpng12-dev libx11-dev libfontconfig1-dev
apt-get install -y libfreetype6-dev libjpeg62-dev libtiff4-dev
apt-get install -y libungif4-dev libexif-dev libcairo2-dev
apt-get install -y libpango1.0-dev libgtk2.0-dev libglade2-dev
apt-get install -y libgnome2-dev libgnomecanvas2-dev libgnomeui-dev
apt-get install -y libgnomeprint2.2-dev libgnomeprintui2.2-dev
apt-get install -y libpanel-applet2-dev libgtksourceview-dev
apt-get install -y libgtkhtml3.14-dev
apt-get install -y intltool

apt-get remove 'mono-*' libgdiplus

mkdir -p $BUILDDIR
cd $BUILDDIR

wget -c http://go-mono.com/sources/libgdiplus/libgdiplus-1.9.tar.bz2
tar xvf libgdiplus-1.9.tar.bz2
cd libgdiplus-1.9
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://go-mono.com/sources/mono/mono-1.9.1.tar.bz2
tar xvf mono-1.9.1.tar.bz2
cd mono-1.9.1
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://switch.dl.sourceforge.net/sourceforge/nant/nant-0.86-beta1-src.tar.gz
tar xvf nant-0.86-beta1-src.tar.gz
cd nant-0.86-beta1
make 
make install
cd ..

wget -c http://ftp.novell.com/pub/mono/sources/gtk-sharp212/gtk-sharp-2.12.0.tar.bz2
tar xvf gtk-sharp-2.12.0.tar.bz2
cd gtk-sharp-2.12.0
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://ftp.novell.com/pub/mono/sources/gecko-sharp2/gecko-sharp-2.0-0.13.tar.bz2
tar xvf gecko-sharp-2.0-0.13.tar.bz2
cd gecko-sharp-2.0-0.13
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://go-mono.com/sources/gnome-sharp2/gnome-sharp-2.16.1.tar.gz
tar xvf gnome-sharp-2.16.1.tar.gz
cd gnome-sharp-2.16.1
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://go-mono.com/sources/gtksourceview-sharp2/gtksourceview-sharp-2.0-0.12.tar.bz2
tar xvf gtksourceview-sharp-2.0-0.12.tar.bz2
cd gtksourceview-sharp-2.0-0.12
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://ftp.novell.com/pub/mono/sources/gnome-desktop-sharp2/gnome-desktop-sharp-2.20.1.tar.bz2
tar xvf gnome-desktop-sharp-2.20.1.tar.bz2
cd gnome-desktop-sharp-2.20.1
./configure --prefix=/usr/local
make
make install
cd ..

cd mono-1.9.1
wget  -c http://go-mono.com/sources/monodoc/monodoc-1.9.zip
unzip monodoc-1.9.zip
cd monodoc-1.9
./configure --prefix=/usr/local
make
make install
cd ../..

wget -c http://go-mono.com/sources/mono-tools/mono-tools-1.9.tar.bz2
tar xvf mono-tools-1.9.tar.bz2
cd mono-tools-1.9
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://ftp.novell.com/pub/mono/sources/mono-debugger/mono-debugger-0.60.tar.bz2
tar xvf mono-debugger-0.60.tar.bz2
cd mono-debugger-0.60
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://ftp.novell.com/pub/mono/sources/heap-buddy/heap-buddy-0.2.tar.gz
tar xvf heap-buddy-0.2.tar.gz
cd heap-buddy-0.2
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://ftp.novell.com/pub/mono/sources/mono-addins/mono-addins-0.3.1.tar.bz2
tar xvf mono-addins-0.3.1.tar.bz2
cd mono-addins-0.3.1
./configure --prefix=/usr/local
make
make install
cd ..

wget -c http://ftp.novell.com/pub/mono/sources/monodevelop/monodevelop-1.0.tar.bz2
tar xvf monodevelop-1.0.tar.bz2
cd monodevelop-1.0
./configure --prefix=/usr/local
make
make install
cd ..

note: you might want to adapt the setting of BUILDDIR!


  1. yes, i’m not using the ubuntu supplied kernel as

    1. the suspend–resume stuff is just not working on my thinkpad X60(s), and
    2. the iwl3945 WLAN driver just doesn’t grok our companies IEEE80211X setup :-(

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
May 2, 2008
filed in the early evening by DrScofield in: hacking
technorati tags:
QR code for this entry · average time to read 1:14 minutes

ever since i switched to wordpress 2.5 (and 2.5.1) i was experiencing absurdly high CPU loads whenever i posted a new blog entry or changed a page — culminating in loads of 124+ yesterday, effectively bringing our server to a standstill! :-( not good. not good at all.

a ps ax | grep apache2 | wc -l revealed a rocking 104 apache2 processes running! yikes! all with about 21MB of memory usage (at least), no wonder the poor box was thrashing for dear life…

looking at what ubuntu had installed i found that (a) we had apache-prefork running and (b) switching to apache-worker1 would remove mod_php5 — which we need to have all the PHP scripts running (including this blog). hmmm.

some googling later it transpired that switching to thread-based apache was the right thing to do and also, that the fast CGI module mod_fcgid would be the solution to the disappearing php5 apache module.

here’s what i did: first install threaded apache

% apt-get install apache2-mpm-worker

then, install the fcgid module

% apt-get install libapache2-mod-fcgid

then, modify /etc/apache2/mods-available/fcgid.conf to read as follows:

<IfModule mod_fcgid.c>
    AddHandler    fcgid-script .php
    FCGIWrapper   /usr/local/sbin/php-fcgi .php

    SocketPath    /var/lib/apache2/fcgid/sock
    SharememPath  /var/lib/apache2/fcgid/shm
    IPCConnectTimeout 60
</IfModule>

create /usr/local/sbin/php-fcgi .php with the following content:

#!/bin/sh
PHPRC="/etc/php5/apache2"
export PHPRC
PHP_FCGI_CHILDREN=1
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php5-cgi

now, all that’s left to do, is ensure that for each virtual host you have ExecCGI enabled:

<Directory /var/www/xyzzyxyzzy.net/>
        Options ExecCGI Indexes FollowSymLinks MultiViews
        AllowOverride All

        Order allow,deny
        Allow from all
</Directory>

restart your apache and we are back in business — on my box the load is now back in sane regions: instead of 124+ we are back at 0.52 for posting a blog entry (at most)!


  1. the thread based apache. 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
filed in the early afternoon by DrScofield in: hacking
technorati tags:
QR code for this entry · average time to read 0:19 minutes

having bitten the bullet and upgraded from feisty fawn to hardy heron i had to reinstall my amorok from svn to get proper support for artwork again…which requires an installation of libgpod from svn…which on hardy heron requires gdk-pixbuf…

…just installing libgdk-pixbuf2 and libgdk-pixbuf-dev didn’t satisfy libgpod’s configure script though. what did the trick was

% apt-get install libgtk2.0-dev

compiling amarok now…

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
April 30, 2008
filed late at night by DrScofield in: from the grid, hacking, linux
technorati tags:
QR code for this entry · average time to read 0:45 minutes

just thought i’d let you participate in today’s adventure: triggered by ansgar commenting on ubuntu offering him to upgrade to ubuntu 8.04 “hardy heron” i though, “hmm, good idea, let’s do a quick update”…

…well, a couple of hours later i seemed to be back in business, hardy heron was installed on “my” x60 and i was just about do another OpenSim build — when i noticed that nant was seg faulting! now, wait a moment, it clearly was not supposed to do that. ok, can happen, what with new libs and all that. so, let’s walk on over to /usr/local/src/mono/nant-0.86b and do a re-install. should be easy, peasy…

…except it wasn’t: mono’s compiler mcs kept seg faulting as well! hmmm.

ok. let’s reinstall mono. following my own script i started the re-install — which crashed as well after about 5min of mucking around.

panic stations!

googling around it transpired that this would happen when running hardy heron with a custom compiled kernel of pre-2.6.24 vintage — which i was :-(

i’m happy to report that with 2.6.25 mono is running again :-)

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
March 28, 2008
filed just before lunchtime by DrScofield in: hacking
technorati tags:
QR code for this entry · average time to read 0:32 minutes

i realized the other day that the markdown-extra plugin i am using for text markup was generating non-unique footnote anchors, resulting in any footnote #1 in a blog entry on referring back to footnote #1’s anchor in the very first blog on a page with multiple blog entries. not good. so, i had a look at the markdown-extra.php’s source — it already contains a variable fn_id_prefix but that is initialized to the empty string

yet, that is a nice starting point, because all we have to do to get unique anchors is to add the following line of code in _hashHTMLBlocks_inMarkdown():1


  1. right after the initial

    if ($text === '') return array('', '');
    

    test. 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
March 13, 2008
filed mid-afternoon by DrScofield in: from the grid, hacking
technorati tags:
QR code for this entry · average time to read 0:30 minutes

regardless of whether you check out opensim from a source repository or are using prebuild packages, opensim will always bring along its own libsecondlife.dll. as of the time of this writing this libsecondlife.dll is the subversion 1550 snapshot from libsecondlife’s subversion repo.

as mentioned in an earlier post, opensim’s libsecondlife sources are not contained within the main opensim source tree, you need to check those out separately:

% svn co http://opensimulator.org/svn/opensim-libs/libsl1550 opensim-libs

then, just go into the newly checked out opensim-libs directory and run nant to build libsecondlife.dll…

% cd opensim-libs
% nant

…and once it’s done, copy bin/libsecondlife.dll to your opensim/bin directory.

done. enjoy.

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
February 13, 2008
filed mid-morning by DrScofield in: hacking, linux, void
technorati tags:
QR code for this entry · average time to read 1:23 minutes

as you hopefully have not noticed (well, there was some downtime, but not more than usually afflicted by cablecom) i switched xyzzyxyzzy.net from gentoo to running ubuntu server 7.10 on monday.1 along with that came a reorganization of the web server directory layout — and i took the chance to clean up. pretty much everything is running again (and thx to having that complete backup of the mysql databases all blogs and photo blogs are back as well :-) — with the exception of the QR code stuff, which was not really generating QR codes for new posts anymore.

this had me baffled as all the path names and what have you were looking ok, permission were fine, the works. still no QR codes and the test image wouldn’t work either…i did manage to get it working, here’s a brief overview2 of what i did:

# install command line php5 so that we can poke at the php code manually, so to speak
% sudo apt-get install php5-cli

# qrcode lib lives in /usr/local/share/qrcode/qrcode_php0.50beta10
% cd /usr/local/share/qrcode/qrcode_php0.50beta10

# let's try invoking the sample.php via php5
% php5 sample.php
[...lots of error messages...]

those error messages revealed that i had forgotten to adjust QRCODE_DATA_PATH — for some strange reason, wp-qrcode doesn’t get that across from the wordpress configuration — fixing that path fixed the problem. sweat :-)

define ("QRCODE_DATA_PATH","/usr/local/share/qrcode/qrcode_php0.50beta10/qrcode_data");

  1. the state of gentoo currently is a sorry one. updating gentoo packages was — over the past year or so — increasingly becoming an adventure in circular dependencies, seemingly irresolvable cross-dependencies, dependencies on non-stable packages by stable ones, the whole monty of sys admin nightmare. i lost the lust for playing gentoo detective i’ve to admit, there are just too many things i’d rather do…sorry, gentoo folks. 

  2. yep, treating xyzzyxyzzy.net as a kind of brain extension here ;-) 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
next page »