Sourcepole - Aktuell tag:www.sourcepole.com,2010:mephisto/ Mephisto Drax 2010-07-17T12:56:32Z tpo tag:www.sourcepole.com,2010-07-17:5899 2010-07-17T12:45:00Z 2010-07-17T12:56:32Z spam acl condition: error reading from spamd socket: Connection reset by peer <p>Occassionaly we’ve been seeing messages like:</p> <pre> spam acl condition: error reading from spamd socket: Connection reset by peer </pre> <p>in <code>/var/log/exim4/paniclog</code></p> <p>But lately the problem has become much more persistent. I found out, that there’s some arsehole spammer sending us 500K spams every ca. 70 minutes. From <code>/var/log/mail.log</code>:</p> <pre> Jul 17 08:52:32 mail spamd[477]: spamd: identified spam (7.9/5.0) for spamd:1004 in 288.5 seconds, 505669 bytes. </pre> <p>Now since spamassassin would take that long (nearly 5 minutes!!!) to find out whether that mail is a spam or not, exim would simply timeout it’s connection to spamassassin and the result was the message seen above.</p> <p>What I did was to use sa-compile to compile the SA rules to “native code” and to enable “Rule2XSBody”, which on Debian lives in <code>/etc/spamassassin/v320.pre</code>.</p> <p>This seems to make SA quite a lot faster and to use less CPU.</p> <p>If this won’t help we could also restrict the maximum size of messages to scan.</p> <p>Yours Tomáš Pospíšek</p> pka tag:www.sourcepole.com,2010-06-22:5889 2010-06-22T07:39:00Z 2010-06-22T07:46:56Z FOSS4G 2010 Barcelona <p>Die internationale Open Source GIS-Konferenez <a href="http://2010.foss4g.org/">FOSS4G</a> findet dieses Jahr vom 6.-9. September 2010 in Barcelona statt.</p> <p>Sourcepole ist mit drei Vorträgen vertreten:</p> <ul> <li>Comparison of Open Source Virtual Globes</li> <li>Performance and statistical analysis of WMS servers</li> <li>SpatiaLite, the Shapefile of the future?</li> </ul> <p>Zusätzlich unterstützen wir den QGIS-Workshop und nehmen mit dem <a href="http://karlinapp.ethz.ch/qgis_wms/">QGIS-Mapserver</a> an WMS Performance Shootout teil.</p> tpo tag:www.sourcepole.com,2010-06-04:5872 2010-06-04T00:08:00Z 2010-06-04T00:08:23Z Translation of Twinkle SIP phone presentation <p>Since I found Michel de Boer’s explanation of many of the fundamental SIP concepts in his 2005 dutch presentation of the Twinkle SIP phone very short and easy to follow - contrary to a lot of other material about SIP out there - I’ve translated it to english.</p> <p>Here it is: <a href="https://www.sourcepole.ch/assets/2010/6/3/twinkle_en.ppt">Twinkle - a SIP softphone for Linux</a></p> tpo tag:www.sourcepole.com,2010-06-03:5874 2010-06-03T23:52:00Z 2010-06-04T00:04:32Z Graphing ping times <p>Well, sometimes one wonders why people write tools that wheight a megabyte, when it’s easy to stick together one or two tools with a script and have the same thing.</p> <p>Here’s a ruby script that generates a ping latency graph (target is google):</p> <pre> #!/usr/bin/ruby # # based on # http://oss.oetiker.ch/rrdtool/prog/rrdruby.en.html example # with help of the tutorial # http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html # and the docu # http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html # # placed in the public domain by Tomáš Pospíšek require "RRD" $rrd = `mktemp /tmp/tmp.XXXXXXXX`.chomp $grafik = `mktemp /tmp/tmp.XXXXXXXX`.chomp $start = 0 def now() Time.now.to_i end def create() $start=now() RRD.create( $rrd, "--start", "#{$start - 1}", "--step", "#{1}", # every 1s "DS:pinglatency:GAUGE:10:0:200", # 10s of missing data are OK, min=0, max=200 (ping time) "RRA:AVERAGE:0.5:1:#{60*30}") # 60 seconds * 30 minutes puts "RRD database created #{$rrd} at #{$start}" puts "Your graph is at #{$grafik}" end def ping_latency `ping -c 1 -n -w 1 google.com` =~ /.* time=(\d+)/ # 64 bytes from 74.125.43.147: icmp_seq=1 ttl=52 time=31.6 ms return $1 end def update() puts "updating #{$rrd} with #{now()}:#{ping_latency()}" RRD.update($rrd, "#{now()}:#{ping_latency()}") end def generate_gfx() # puts "generating graph #{$grafik}" RRD.graph( "#{$grafik}", "--title", " Ping latency to Google", "--x-grid", "SECOND:10:MINUTE:1:MINUTE:2:0:%X", "--start", $start.to_s, # "--end", # -> now "--interlace", "--imgformat", "PNG", "--width=450", "DEF:pinglatency=#{$rrd}:pinglatency:AVERAGE", "AREA:pinglatency#00b6e4:ms") end #main create() while(true) update() generate_gfx() sleep 1 end </pre> <p>It generates a graph like this:</p> <p></p> pka tag:www.sourcepole.com,2010-04-23:5697 2010-04-23T08:26:00Z 2010-04-23T08:27:42Z Folien QGIS User Meeting Bern <p>Das erste deutschsprachige QGIS User Meeting in Bern war mit rund 80 Teilnehmern ein grosser Erfolg.</p> <p>Die Folien der Präsentation des OpenLayers-Plugin sind <a href="/assets/2010/4/23/qgis_bern_2010_openlayers_plugin.pdf">hier</a> erhältlich.</p> <p>Die gesammelten Präsentation werden auf der <a href="http://qgis.org/">QGIS-Homepage</a> veröffentlicht.</p> pka tag:www.sourcepole.com,2010-03-08:1357 2010-03-08T14:15:00Z 2010-03-08T14:16:29Z Referate FOSSGIS 2010 <p>Sourcepole war an der deutschsprachigen <a href="http://www.fossgis.de/konferenz/wiki/Main_Page">FOSSGIS-Konferenz 2010</a> in Osnabrück gleich mit drei Vorträgen vertreten.</p> <p>Die Präsentationsunterlagen können hier heruntergeladen werden:</p> <ul> <li><a href="/assets/2010/3/8/fossgis10_gis_mit_ruby_on_rails.pdf">GIS mit Ruby on Rails</a> </li> <li><a href="/assets/2010/3/8/fossgis10_wms.pdf">Performance und Verfügbarkeit von WMS-Servern</a></li> <li><a href="/assets/2010/3/8/fossgis10_spatialite.pdf">SpatiaLite, das Shapefile der Zukunft?</a></li> </ul> <p>Die detaiilierte Anleitung für den WMS-Performance Test kann im <a href="http://wiki.osgeo.org/wiki/FOSS4G_Benchmark">OSGEO-Wiki</a> nachgelesen werden.</p> <p>Besten Dank für das sehr positive Feedback!</p> pka tag:www.sourcepole.com,2010-03-05:1354 2010-03-05T10:23:00Z 2010-04-23T08:33:51Z QGIS User Meeting Bern 21.4.10 <p>Am 21. April 2010 findet das erste deutschsprachige QGIS User-Meeting in Bern statt. Das Programm und die detaillierten Angaben können auf der <a href="http://qgis.org/en/user-meetings.html">QGIS-Homepage</a> nachgelesen werden.</p> <p>Sourcepole stellt bei dieser Gelegenheit ihr OpenLayers-Plugin vor, das Google Maps und Konsorten als QGIS-Layer ins Desktop-GIS integriert.</p> <p>Alle QGIS-Anwender und Interessierte sind herzlich zu diesem Anlass eingeladen!</p> tpo tag:www.sourcepole.com,2010-02-24:1345 2010-02-24T20:25:00Z 2010-04-23T08:33:07Z Testing complex Webapps with wget <p>How do you test web applications? You can use Selenium, but Selenium is very heavy.</p> <p>I tried wget.</p> <p>To find out what exactly to send to the app, I started Firebug inside Firefox, went to the “Network” section and recorded what I would do, to see, whether the application works. Then I took the accessed URLs together with the parameters and first tried to send them manually from the command line. Observe, that Firebug lets you copy the exact <span class="caps">POST</span>/GET parameter as was sent by the browser, when you right click on the <span class="caps">POST</span>/GET command in the Firebug Network log. Once I managed to redo all the steps manuall from the commandline I transferred what I did into a script and edited it until it was nice and would run through:</p> <pre> $ history &gt; test_my_web_app </pre> <code>test_my_web_app</code> now looks as follows: <pre> #!/bin/bash # # check availability of: url="http://www.example.org/my-app" # exit immediately if something goes wrong -&gt; test fails! set -e echo "Testing $url" # save an error log in case there's an error so that # we can analyse it further error_log=$( mktemp ) cookies=$( mktemp ) echo "In case the tests fail, you'll find the error log under $error_log" # send everything that goes to STDERR to the log exec 2&gt;$error_log echo "Getting a cookie..." wget --save-cookies $cookies "$url" -O /dev/null # we could put username/password directly into the script but we're cautuous and don't echo -n "please enter user for $url: "; read user echo -n "please enter password for $url: "; read -s pass echo echo "Logging in..." # if we logged in successfully, then the webapp will send us an html page # that contains the following string: to_verify="You're logged in" # POST to the webapp: wget --load-cookies $cookies \ --post-data "login=Login&user_login=$user&user_password=$pass" \ --save-cookies $cookies \ --keep-session-cookies \ "$url/login" \ -O - \ | grep -q "$to_verify" # now we're logged in echo "Query component DB..." # First search the DB (parameters need to be URI encoded...) num_components_found=$( wget --load-cookies $cookies \ --save-cookies $cookies \ --post-data 'action=set_params&crit%5Bcolor%5D=red&crit%5Bmin_size%5D=0' \ "$url/prepare-picture" \ -O - \ | grep 'Number of matching components:' \ | sed 's/.*Number of matching components:&lt;\/td&gt;&lt;td&gt;//; s/&lt;.*//' ) echo "Make sure that the app found something..." [ $num_components_found -gt 0 ] echo "Generate and get picture..." wget --load-cookies $cookies \ --save-cookies $cookies \ --post-data 'index=0' \ "$url/get-pic" \ -O /dev/null echo "Hooray, $url successfully tested" rm $error_log rm $cookies &lt;pre&gt; Surprisingly easy, isn't it? pka tag:www.sourcepole.com,2010-02-23:1344 2010-02-23T09:29:00Z 2010-04-23T08:33:31Z FOSSGIS 2010 <p>Auch dieses Jahr ist Sourcepole an der deutschsprachigen FOSSGIS-Konferenz vertreten. Die <a href="http://www.fossgis.de/konferenz/wiki/Main_Page">FOSSGIS 2010</a> findet vom 2.-5. März 2010 in Osnabrück statt.</p> <p>Sourcepole ist mit drei Vorträgen vertreten:</p> <ul> <li><a href="http://www.fossgis.de/konferenz/2010/events/126.de.html">GIS mit Ruby on Rails</a> </li> <li><a href="http://www.fossgis.de/konferenz/2010/events/128.de.html">Performance und Verfügbarkeit von WMS-Servern</a></li> <li><a href="http://www.fossgis.de/konferenz/2010/events/127.de.html">SpatiaLite, das Shapefile der Zukunft?</a></li> </ul> <p>Vorinformation: Die internationale Open Source GIS-Konferenez <a href="http://2010.foss4g.org/">FOSS4G</a> findet dieses Jahr vom 6.-9. September 2010 in Barcelona statt.</p> tpo tag:www.sourcepole.com,2010-02-01:1341 2010-02-01T09:38:00Z 2010-04-23T08:33:25Z munin plugin multi_http_responsetime doesn't recognize dead servers <p>Here’s a patch:</p> <pre> # diff -u multi_http_responsetime.orig multi_http_responsetime --- multi_http_responsetime.orig 2010-02-01 10:13:22.000000000 +0100 +++ multi_http_responsetime 2010-02-01 10:30:23.000000000 +0100 @@ -16,6 +16,9 @@ use Time::HiRes qw( time ); use IO::Socket; +$FAILED=0; +$INFINITE=999999; + # ----- config ----- push(@url_array, "http://www.google.de"); push(@url_array, "http://www.t-online.de"); @@ -34,7 +37,7 @@ PeerPort => 80, Proto => 'tcp' ); - return(0) unless ($sock); + return($FAILED) unless ($sock); print $sock "GET $baseurl HTTP/1.1\nHost: $vhost\nConnection: close\n\n"; while (&lt;$sock>) { $data .= $_; @@ -63,11 +66,16 @@ $baseurl =~ s@^\w+://.+?(/)@\1@; $tick1 = time(); - geturl; + $retval = geturl; $tick2 = time(); - $tspent = $tick2-$tick1; - $msecs = ($tspent * 1000); + if ($retval == $FAILED) { + $msecs = $INFINITE; + } + else { + $tspent = $tick2-$tick1; + $msecs = ($tspent * 1000); + } printf "timespent$i.value %.3f\n", $msecs; } </pre> tpo tag:www.sourcepole.com,2010-01-23:1334 2010-01-23T00:18:00Z 2010-04-23T08:33:21Z Chopped up SIP <p>Since upgrading to Karmic I had the problem under Ubuntu that SIP calls under Twinkle would start get all chopped up every few minutes.</p> <p>Turns out it’s NetworkManager that scans the wireless spectrum every two minutes for networks even if you are allready connected to some AP.</p> <p>While people seem to be fixing the problem in the proper way, by making scanning interfere less with an active connection, there’s a good soul that provides patched versions of NetworkManager that gives up scanning while there’s an active connection to an AP.</p> <p>See https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/373680</p> pka tag:www.sourcepole.com,2010-01-19:1332 2010-01-19T16:56:00Z 2010-04-23T08:33:16Z Rack::Monitor <p><a href="http://github.com/pka/rack-monitor">Rack::Monitor</a> is Rack middleware collecting run-time information for monitoring tools like Munin.</p> <p><a href="http://github.com/pka/rack-monitor">Rack::Monitor</a> is Rack middleware collecting run-time information for monitoring tools like Munin.</p> <p>It can be integrated in any Rack based appication. Sample configuration for Ruby on Rails:</p> <pre><code> config.middleware.use Rack::Monitor, :url =&gt; '/rack_status', :watch =&gt; ['/', '/ping'] </code></pre> <p>The collected statistical values can be accessed at /rack_status. It is recommended to limit access to this path with our contributed middleware Rack::Access from <a href="http://github.com/rack/rack-contrib">rack-contrib</a>.</p> <p>Sample munin output:</p> <p> <em>status</em>codes-day”/></p> tpo tag:www.sourcepole.com,2010-01-19:1331 2010-01-19T13:54:00Z 2010-01-19T14:00:42Z removing gnome-screensaver <p>In https://bugs.launchpad.net/bugs/509411 I had the problem, that locking the screen would just not work any more. It turned out that gnome-screensaver must be perpetualy runnung in the background in order to be able to lock the screen.</p> <p>Also this would affect the computer not locking the screen when suspending.</p> <p>It might be that Gnome/Ubuntu are user-friendly, however the bloat is starting to annoy me. Why do I need to be running 214 processes, when the only thing that is actually being used is firefox and a terminal? Why do I need a process (gnome-screensaver) that is using up CPU cycles and virtual memory, when it’s actually never doing anything useful?</p> <p>Thus I purged gnome-screensaver (8MB) and installed i3lock.</p> <p>There are three things missing:</p> <p>1) Make the laptop lock the screen when suspending:</p> <pre> $ cat /etc/pm/sleep.d/01_screenlock #!/bin/bash # # 01_screenlock: lock screen at suspend with i3lock # based on http://bbs.archlinux.org/viewtopic.php?id=68158 # USER=henry DISPLAY=:0.0 IS_ACTIVE="$( pidof i3lock )" lock_screen() { # skip if i3lock is allready running if [ ! "$IS_ACTIVE" ]; then su - $USER -c "/bin/sh -c 'DISPLAY=$DISPLAY /usr/bin/i3lock'" & fi } case $1 in hibernate) lock_screen ;; suspend) lock_screen ;; thaw) # not required. ;; resume) # not required. ;; *) exit $NA ;; esac </pre> <p>2) Add it to the panel:</p> <pre> $ cat ~/.gnome2/panel2.d/default/launchers/i3lock.desktop #!/usr/bin/env xdg-open [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Icon=/usr/share/icons/gnome/scalable/actions/gnome-lockscreen.svg Name=Lock the Screen Exec=i3lock </pre> <p>3) integrate it into package management, so that I don’t accidentaly remove packages on which the screen locking depends:</p> <pre> $ cat control Section: misc Priority: optional Standards-Version: 3.6.2 Package: lock-screen Maintainer: Tomas Pospisek Depends: i3lock, pm-utils, gnome-icon-theme Files: 01_screenlock /etc/pm/sleep.d/01_screenlock i3lock.desktop /home/henry/.gnome2/panel2.d/default/launchers/i3lock.desktop Description: lock screen on suspend/hybernate bla $ equivs-build control $ sudo dpkg -i lock-screen_1.0_all.deb </pre> <p>Of course, it’s a hack. However it works and is easy to adapt. Let me know at tpo at sourcepole.ch in case you get to make it more generic.</p> <p>That’s it. Saved runtime bloat. Saved disk space (i3lock is 60K large).</p> pka tag:www.sourcepole.com,2010-01-15:1330 2010-01-15T10:55:00Z 2010-01-15T10:57:29Z osgEarth for Ubuntu <p><a href="http://osgearth.org/">osgEarth</a> is a scalable terrain rendering toolkit for OpenSceneGraph.</p> <p>Our package for Ubuntu is now available at <a href="https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable">UbuntuGis</a>!</p> <p><a href="http://osgearth.org/">osgEarth</a> is a scalable terrain rendering toolkit for OpenSceneGraph.</p> <p>Our package for Ubuntu is now available at <a href="https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable">UbuntuGis</a>!</p> <p>osgviewer sample call:</p> <pre><code> OSG_FILE_PATH=/usr/share/osgearth osgviewer --window 50 50 900 700 /usr/share/osgearth/maps/srtm.earth </code></pre> <p>Press ‘h’ for help. See also <a href="http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgviewer">OSG Wiki</a></p> <p>osgearth_simple sample call:</p> <pre><code>OSG_FILE_PATH=/usr/share/osgearth osgearth_simple --window 50 50 900 700 /usr/share/osgearth/maps/geopole.earth </code></pre> <p>Press ‘1’-‘5’ for predefined viewpoints. Drag mouse with left+right click for tilt.</p> pka tag:www.sourcepole.com,2009-12-02:1324 2009-12-02T20:23:00Z 2009-12-02T20:23:57Z OssimPlanet for Ubuntu <p><a href="http://www.ossim.org/">OssimPlanet</a> is an open source project for accurate, high performance, 3D Geo-spatial visualization.</p> <p>Our package for Ubuntu is now available at <a href="https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable">UbuntuGis</a>!</p>