<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
         xmlns:rss="http://purl.org/rss/1.0/"
         xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <rss:channel rdf:about="http://jorgenmodin.net/index_html">

        <rss:title>jorgenmodin.net - feed.rdf</rss:title>
        <rss:link>http://jorgenmodin.net/index_html</rss:link>

        
        <rss:description>jorgenmodin.net RSS 1.0 feed.</rss:description>

        <rss:image rdf:resource="http://jorgenmodin.net/logo.jpg" />

        <sy:updateperiod>daily</sy:updateperiod>
        <sy:updatefrequency>1</sy:updatefrequency>
        

        <rss:items>
            <rdf:seq>
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/09/01/a-buildout-run-from-its-own-bootstrapped-python" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/09/01/mrkliga-krigsrubriker-i-svd-om-valsystemet" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/28/europeiskt-frsvar-oroande-svagt" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/20/catch-errors-before-they-become-import-errors" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/18/a-python-script-to-count-bpm-beats-per-minute-on-linux" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/18/editing-services-on-ubuntu-104" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/18/hur-ofta-borde-man-kolla-hur-brserna-gtt" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/15/how-to-put-an-independent-vnc-server-on-ubuntu-104" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/13/link---how-to-make-rhythmbox-et-al-treat-a-storage-as-a-player" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/12/getting-the-code-for-facebooks-like-button" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/02/classicists-have-continued-their-efforts-to-suppress-wittgensteins-arguments-up-to-the-present-day-eg-on-wikipedia" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/01/the-guardian-om-sverige-gran-lindberg-och-vra-deckarfrfattare" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/08/01/when-clicking-in-folder_contents-leads-to-downloads-plone" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/30/link---on-software-project-development-estimates" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/30/checking-what-would-be-updated-before-making-an-svn-up" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/28/video-editors-on-linux" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/27/cli-id3-editors---tagging-a-tree-with-find-and-xargs" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/27/link---wrapping-mplayer-in-python" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/25/yes-please-mama" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/23/mp3cat---gets-only-the-data-part-of-the-mp3" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/23/counting-bpm-beats-per-minute-on-linux" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/21/varfr-nmner-man-att-det-var-boeing-plan" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/18/vn-av-ordning-tid-och-rum-i-expressen-och-svenskan" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/17/speaker-switch-that-daisy-chains-speakers-to-avoid-low-impedance" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/17/suspend-and-resume-an-amazon-virtual-computer" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/16/mnga-routrar-knsliga-fr-en-dns-attack" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/12/offloading-downloads-from-plone-relatively-transparently" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/07/11/spear---an-attempt-of-finding-experts-and-good-knowledge-artefacts" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/06/29/lnk---discussion-on-wifi-interference-sources" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/06/15/linux-ocr-for-getting-text-from-a-screenshot" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/06/14/lnk---finding-computers-on-a-network" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/06/06/papa-november-kalla-krigets-nummerstationers-bisarra-vrld" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/29/link---regular-expression-http-purging-with-varnish" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/21/pypi-eggs-notebook" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/21/lnk---the-economist-on-dna-synthesizing" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/20/an-explanation-for-the-down-to-cents-dip-on-the-us-stock-markets" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/16/analys-sverige-och-singapore-bland-de-f-lnder-som-kan-klara-skuldkrisen" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/09/euromedlemsskap-och-statsskuld-verkar-korrelerat-en-del" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/06/extract-cut-a-clip-with-mencoder-and-ffmpeg" />
                
                
                <rdf:li rdf:resource="http://jorgenmodin.net/index_html/archive/2010/05/05/how-to-get-the-total-size-of-a-directory-in-linux" />
                
                
            </rdf:seq>
        </rss:items>
    </rss:channel>

    <rss:image rdf:about="http://jorgenmodin.net/logo.jpg">
        <rss:title>jorgenmodin.net - feed.rdf</rss:title>
        <rss:link>http://jorgenmodin.net/index_html</rss:link>
        <rss:url>http://jorgenmodin.net/logo.jpg</rss:url>
    </rss:image>

    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/09/01/a-buildout-run-from-its-own-bootstrapped-python">
        <rss:title>A buildout run from its own bootstrapped python</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/09/01/a-buildout-run-from-its-own-bootstrapped-python</rss:link>       
        



        <content:encoded><![CDATA[<p>Just a quick note so I can find it again:</p>
<blockquote>Because the recipe plone.recipe.zope2instance relies on zc.recipe.egg, it also supports the python option.  However, the recipe plone.recipe.zope2install did not support that nice option. I added the option and made a new 3.3 release.</blockquote>
<p><br />
<br />
<a href="http://bubblenet.be/blog/building-custom-python-in-the-same-buildout-as-zope2">Building custom Python in the same buildout as Zope2 &mdash; BubbleNet - Plone and Zope services in Belgium</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-09-01T16:32+00:00</dc:date>
        <dc:modified>2010-09-01 16:32:06</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/09/01/mrkliga-krigsrubriker-i-svd-om-valsystemet">
        <rss:title>Märkliga krigsrubriker i SvD om valsystemet</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/09/01/mrkliga-krigsrubriker-i-svd-om-valsystemet</rss:link>       
        



        <content:encoded><![CDATA[<p>Man bör väl egentligen mer uppmärksamma tidningar när de gör bra saker, men ibland är det så enkelt att peka ut något som blev fel. Det finns kritik i Danmark mot det svenska valsystemet. Det kan man skriva om. Ett valbevakningsorgan skickar inte observatörer till det svenska valet för att det inte har någon kritik att framföra. Det kan man också skriva om. Men om man sätter ihop dessa diametralt motsatta nyheter i en krigsrubrik så kan det bli konstigt:</p>
<p><img alt="" src="/images/krig.png" /></p>
<p>Det verkar nämligen på rubriken som om danskarna och OSCE tycker samma sak: Danskarna kritiserar, och OSCE är så uppgivna över sakernas dåliga tillstånd att de inte en ids komma.</p>
<blockquote>Det svenska valsystemet har blivit föremål för en internationell debatt. Det är framför allt i danska tidningar som den svenska valsäkerheten blivit en het fråga</blockquote>
<p><br />
<br />
Läs mer: <a href="http://www.svd.se/nyheter/politik/valet2010/valobservatorer-nobbar-det-svenska-riksdagsvalet_5227261.svd">Valobservatörer nobbar det svenska riksdagsvalet | SvD</a></p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag" href="http://bloggar.se/om/politik">politik</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-09-01T09:57+00:00</dc:date>
        <dc:modified>2010-09-01 09:57:01</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>politik</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/28/europeiskt-frsvar-oroande-svagt">
        <rss:title>Europeiskt försvar oroande svagt</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/28/europeiskt-frsvar-oroande-svagt</rss:link>       
        



        <content:encoded><![CDATA[<p>Alltsedan andra världskriget har den demokratiska delen av Europa förlitat sig på Pax Americana - att USA har varit tillräckligt starkt för att garantera vår säkerhet.</p>
<p>Men USA står mycket möjligt inför stora ekonomiska problem som kan göra att de inte kommer att kunna - eller vilja - garantera Europas säkerhet med samma emfas som idag.</p>
<p>Inom politiken kan man vara oense om vad staten skall göra, men ett gott försvar räknas alltid till kärnverksamheten. Europa behöver ta ett större ansvar för att kunna försvara vår frihet och välstånd.<br />
<br />
<blockquote>The beginnings of a sound policy today, he argues, might be for America to withdraw from a costly war in Afghanistan and pull forces out of Europe. Such a move would shock Europeans who hope that the impact of their own defence cuts will be softened by American help in times of need. </blockquote><br />
<br />
Läs mer: <a href="http://economist.com/node/16886851?fsrc=scn/fb/wl/ar/costofweapons">The cost of weapons: Defence spending in a time of austerity | The Economist</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-28T17:12+00:00</dc:date>
        <dc:modified>2010-08-28 17:12:26</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/20/catch-errors-before-they-become-import-errors">
        <rss:title>Catch errors before they become Import Errors</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/20/catch-errors-before-they-become-import-errors</rss:link>       
        



        <content:encoded><![CDATA[<p>Just a note to self:</p>
<blockquote></blockquote>
<p>Läs mer: <a href="http://do3cc.blogspot.com/2010/08/dont-catch-import-errors-use.html">do3cc: Don't catch import errors, use pkg_resources</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-20T14:27+00:00</dc:date>
        <dc:modified>2010-08-20 14:27:10</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/18/a-python-script-to-count-bpm-beats-per-minute-on-linux">
        <rss:title>A python script to count bpm (beats per minute) on Linux</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/18/a-python-script-to-count-bpm-beats-per-minute-on-linux</rss:link>       
        



        <content:encoded><![CDATA[<p>As I have written before, soundstretch can do bpm analysis on soundfiles on Linux. However:</p>
<ul>
    <li>it needs wav rather than mp3 files.</li>
    <li>For my music it sometimes report half the correct bpm</li>
</ul>
<p>&nbsp;</p>
<p>I have written a script that wraps soundstretch and lame into a command that takes an mp3 file as input and outputs the bpm.</p>
<p>Internally, it converts the mp3 into temporary wav file with lame, runs soundstretch on the file, gets the bpm guess from soundstretch and fits that into a window of bpms.</p>
<p>I do not usually write command line scripts, so there may be problems in the below code, and there are certainly some hard coded assumptions. Use at your own risk. I intend to package this up and release it in some way, but until then, here is is in its present state:</p>
<pre>#!/usr/bin/python<br />DOC = ''' This program detects bpm for mp3 files. It relies on lame and soundstretch being<br />installed on your system. <br /><br /><br />Usage: <br /><br />    %s &lt;filename&gt;<br />    <br />-or pipe filenames to it.<br /><br />Example:<br /><br />    find . -name &quot;*.mp3&quot;| %s\n''' % (__file__, __file__)<br /><br />import os<br />import pipes<br />import select<br />import shutil<br />import subprocess<br />import sys<br />import tempfile<br /> <br />## Define the window for sane bpm values. This may depend on genre of music. ##<br />BPM_WINDOW_MAX = 240<br /># Do not change this one<br />BPM_WINDOW_MIN = BPM_WINDOW_MAX/2<br />###############################################################################<br /><br />def _get_bpm_from_soundstretch(output):<br />    &quot;&quot;&quot;Gets bpm value from soundstretch output&quot;&quot;&quot;<br />    <br />    output = output.split(&quot;\n&quot;)<br />    for line in output:<br />        if 'Detected BPM rate ' in line:<br />            bpm = line[18:]<br />            return float(bpm)<br />    return None # Could not parse output<br /><br />def fit_bpm_in_window(bpm_suggestion):<br />    &quot;&quot;&quot;Double or halve a bpm suggestion until it fits inside the bpm window&quot;&quot;&quot;<br />    <br />    if bpm_suggestion is not None:<br />        while bpm_suggestion &lt; (BPM_WINDOW_MIN):<br />            bpm_suggestion = bpm_suggestion * 2<br />        while bpm_suggestion &gt; (BPM_WINDOW_MAX):<br />            bpm_suggestion = bpm_suggestion / 2<br />    return bpm_suggestion<br />    <br />def analyze_mp3(mp3filespec):<br />    &quot;&quot;&quot;Uses lame and soundstretch to analyze an mp3 file for its bpm rate&quot;&quot;&quot;<br />    <br />    # Make a temporary working directory for storing the wav file<br />    # that soundstretch should analyze<br />    workingdir = tempfile.mkdtemp()<br />    wavfilespec = workingdir + &quot;/tempwavfile.wav&quot;<br />    <br />    # Use lame to make a wav representation of the mp3 file to be analyzed<br />    wav_command = 'lame --decode %s %s' % (mp3filespec, wavfilespec)<br />    subprocess.call([wav_command], shell=True, stderr=open(os.devnull, 'w'))<br />    <br />    # Call soundstretch to analyze the wav file<br />    bpm_command = 'soundstretch %s -bpm' % wavfilespec<br />    p = subprocess.Popen([bpm_command], shell=True,stdout=subprocess.PIPE)<br />    output = p.communicate()[0]<br />    <br />    # Delete temporary working directory and its contents<br />    shutil.rmtree(workingdir)<br /><br />    bpm_suggestion =  _get_bpm_from_soundstretch(output)<br /><br />    return fit_bpm_in_window(bpm_suggestion)<br /><br />def process_input(mp3filespec):<br />    bpm_suggestion = analyze_mp3(pipes.quote(mp3filespec))<br />    if bpm_suggestion is None:<br />        print &quot;Unable to detect bpm for file %s&quot; % mp3filespec<br />    else:<br />        print &quot;BPM rate for %s is estimated to be %s&quot; % (mp3filespec, bpm_suggestion)<br />    <br />if __name__ == &quot;__main__&quot;:<br />    argv = sys.argv[1:]<br />    if select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], []): # input is piped to program<br />        mp3filespecs = sys.stdin.readlines()<br />        for mp3filespec in mp3filespecs:<br />            process_input(mp3filespec.rstrip('\n'))<br />    elif len(argv) &lt; 1: # No pipe and no input file, print help text and exit<br />        print DOC<br />        sys.exit()<br />    else: # Input file present<br />        mp3filespec = os.path.abspath(argv[0])<br />        process_input(mp3filespec)</pre>
<p>It needs soundstretch and lame to be installed.</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-18T21:53+00:00</dc:date>
        <dc:modified>2010-08-18 21:53:25</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/18/editing-services-on-ubuntu-104">
        <rss:title>Editing services on Ubuntu 10.4</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/18/editing-services-on-ubuntu-104</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<div class="even">Summary: Install rcconf from the usual repositories and use the space bar to toggle services on or off.</div>
<p>&nbsp;</p>
<p>On CentOS 5 there is a GUI for turning on and off services. on Ubuntu 10.4 I could not find anything similar installed. So I decided to go the the Ubuntu synaptic package installer and have a look around. I found bum and rcconf that both claim to have GUIs for editing runlevels, which seems close enough to what I needed.</p>
<h3>Bum</h3>
<p>Bum did not work. Bummer. It exited with the message: &quot;cannot open display 1.0&quot;. I am testing through VNC to a daemonized tightVNC server, and maybe bum cannot handle that. Unrelated to this I had the same error message with an X utility called xcutsel, so maybe it is tightVNC doing something wrong, I do not know.</p>
<h3>rccconf</h3>
<p>rcconf worked, but it took me a while to figure out what key on the keyboard toggles a service on and off. It is the spacebar.</p>
<p style="text-align: center;"><img src="/images/spacebar.png" alt="" /></p>
<p style="font-style: italic; text-align: center;">Screenshot of rcconf. No mouse support, use pgUp and pgDown to scroll (or arrows), space bar to toggle and tab to switch to next UI element (i.e. the OK button, and then the Cancel button).</p>
<p><img alt="" src="file:///tmp/moz-screenshot.png" /></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-18T16:08+00:00</dc:date>
        <dc:modified>2010-08-18 16:15:27</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/18/hur-ofta-borde-man-kolla-hur-brserna-gtt">
        <rss:title>Hur ofta borde man kolla hur börserna gått?</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/18/hur-ofta-borde-man-kolla-hur-brserna-gtt</rss:link>       
        



        <content:encoded><![CDATA[<p>Varför skriver man om världbörsernas upp- eller nedgång som en nyhet snart varje dag på framsidan på de stora nyhetssajterna? Vore det inte bättre att ha en månatlig sammanfattning?</p>
<p>Eftersom börserna svänger varje dag, varje minut och varje sekund, så står det ju fritt att välja tidsintervall man vill rapportera. Att göra det till en daglig nyhet tillskriver dagsläget ett nyhetsvärde som det inte har. Om trenden är en fyraprocentig nedgång över en månad så är en tvåprocentig uppgång någonstans i mitten inte så intressant. Jag antar att man ändå rapporterar en snabb tvåprocentig uppgång för att vara först, eller i all fall inte sist, med nyheten.</p>
<p>Att rapportera det dagliga läget måste dock vara väldigt billigt att göra: Det är bara att läsa av förändringar under dagen, och lägga till ett känsloladdat ord: &quot;Turbulens&quot;, &quot;Uppgång&quot;, &quot;Nedgång&quot;, &quot;Oro&quot;. Det är inget fel att använda känsloladdade ord i sig för att beskriva en börs, känslor är i en funktion det vi använder för att koordinera en flock, men det blir lite mycket känslor upp och ner om man rapportera om det varje dag.</p>
<p>Nicholas Nassim Taleb rekommenderar i sin bok &quot;The Black Swan&quot; att man inte kollar börsen för ofta, just för att slippa den känslomässiga turbulensen kring rörelser som i det större perspektivet kan betraktas som slumpmässiga.</p>
<blockquote>De ledande börserna i Asien steg under onsdagens handel i linje med börserna i New York. Undantaget var de kinesiska börserna.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://www.dn.se/ekonomi/bors/mest-upp-pa-asiens-borser-1.1155387">Mest upp på Asiens börser - DN.se</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-18T07:44+00:00</dc:date>
        <dc:modified>2010-08-18 07:44:19</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/15/how-to-put-an-independent-vnc-server-on-ubuntu-104">
        <rss:title>How to put an independent VNC server on Ubuntu 10.4</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/15/how-to-put-an-independent-vnc-server-on-ubuntu-104</rss:link>       
        



        <content:encoded><![CDATA[<p>The following guide worked for putting an independent VNC server running on Ubuntu 10.4. With independent I mean that is separate from the desktop session running on the computer that is connected to the physical monitor. Instead the below guide will give you an &quot;always on&quot; desktop session independent of what you see on the monitor. One advantage compared to desktop sharing is that you can adjust the screen resolution to fit comfortably in a window on the controlling computer. Another advantage is that you can run the vnc session as another user than who is currently using the computer, or as the same user but with a different desktop.</p>
<p>&nbsp;</p>
<blockquote>This guide intends to show you how to build a headless server with tightvnc, such that you can remotely access the server&rsquo;s gui using any vnc client.  I&rsquo;m still working on it, so if you have any comments or questions, please feel free to let me know.</blockquote>
<p>&nbsp; <a href="http://www.davelachapelle.ca/guides/ubuntu-tightvnc-server/">Ubuntu TightVNC Server - Dave Lachapelle</a></p>
<p>&nbsp;</p>
<p>I followed the instructions to a &quot;T&quot; and it worked. Lachapelle recommends you remove the geometry option for Ubuntu 10.4, but it worked fine on my 10.4 computer.</p>
<p>After install i ran the script as &quot;/etc/init.d/vncserver start&quot; once. Xtightvncserver then prompted me to define passwords for accessing the new desktop, one password for full control, and one for editing only.</p>
<p>You could extend the script to start several independent vnc sessions, to make the server work as a multiple desktop provider. That is how I use my CentOS 5 server (which is soon is going to be Ubuntified).</p>
<p>&nbsp;</p>
<p style="font-style: italic;">Update 2010-08-16, 2010-08-20</p>
<p>Currently drag and drop is broken in all remote desktop sessions in Gnome on Ubuntu 10.4, including then tightvnc. Everything else seems to work though, and in most cases you can get around drag and drop by e.g. instead do a cut and paste. However for e.g. reordering playlists in Rhythmbox there is no workaround. Actually I spend a bit of time trying to figure out why the heck drag  and drop did not work, when everything else worked. A bug in Gnome  itself was not the first thing that sprang to mind.</p>
<p>See here for bug report and workaround for the drag and drop issue:</p>
<p><a href="https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/587856">https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/587856</a></p>
<p>Basically, you need to slightly downgrade a couple of Gnome packages. I did this and drag and drop started working again. There is now what seems to be identification of the offending code upstream in the Gnome bug tracker, but it is not clear when a fix will find its way into Ubuntu.</p>
<p>The downgrade at the link above seems to be volatile. When you do other installs on your system, and possibly just straight updates, the downgraded Gnome packages will be replaced. I have currently done like this to fixate (&quot;pin&quot;) the downgrade:</p>
<pre>nano -w /etc/apt/preferences.d/pinGnomeForRemoteAccess</pre>
<p>and in that file I put:</p>
<pre>Package: libgtk2.0-0<br />Pin: version 2.20.0-0ubuntu4<br />Pin-Priority: 1001<br /><br />Package: libgtk2.0-bin<br />Pin: version 2.20.0-0ubuntu4<br />Pin-Priority: 1001<br /><br />Package: libgail18<br />Pin: version 2.20.0-0ubuntu4<br />Pin-Priority: 1001<br /><br />Package: libgail-common<br />Pin: version 2.20.0-0ubuntu4<br />Pin-Priority: 1001<br /><br />Package: gtk2-engines-pixbuf<br />Pin: version 2.20.0-0ubuntu4<br />Pin-Priority: 1001</pre>
<p>I just performed this pinning so time will tell if it works, but it seemed to survive an apt-get update.</p>
<p>2010-08-26: Added version keyword to pin file</p>
<p>&nbsp;</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-15T16:59+00:00</dc:date>
        <dc:modified>2010-08-26 16:08:28</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/13/link---how-to-make-rhythmbox-et-al-treat-a-storage-as-a-player">
        <rss:title>Link - How to make Rhythmbox et al treat a storage as a player</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/13/link---how-to-make-rhythmbox-et-al-treat-a-storage-as-a-player</rss:link>       
        



        <content:encoded><![CDATA[<p><br />
<br />
<br />
<blockquote>Rhythmbox will not initially identify the device. To get rhythmbox to see the device, you simply place a text file into the root directory of the player named '.is_audio_player' (/media/Sansa View/.is_audio_player).</blockquote>You can also tell rhythmbox where to store files it transfers to the device:</p>
<pre>audio_folders=MUSIC/<br />folder_depth=2</pre>
<p><br />
<br />
Taken from: <a href="http://www.micahcarrick.com/sansa-view-ubuntu.html">Sandisk Sansa View on Ubuntu Linux</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-13T22:27+00:00</dc:date>
        <dc:modified>2010-08-13 22:27:46</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/12/getting-the-code-for-facebooks-like-button">
        <rss:title>Getting the code for Facebook's "Like" button</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/12/getting-the-code-for-facebooks-like-button</rss:link>       
        



        <content:encoded><![CDATA[<p>Here is a <a href="http://developers.facebook.com/docs/reference/plugins/like/code">link</a> going directly to a page on Facebook with boiler plate code for making a Facebook &quot;Like&quot; button.</p>
<p>This evening I tried filling out a <a href="http://developers.facebook.com/docs/reference/plugins/like">form</a> on Facebook that should give me the code for a Facebook button to put on a page. Trying with different browsers I could not get it to output any code, the submit did not seem to work. Analyzing the submit button, it submits to a url that if you just <a href="http://developers.facebook.com/docs/reference/plugins/like/code">access it directly</a> (i.e. a GET without parameters) you get some boiler plate code where you easily can replace relevant parts. I guess the form submit button will start to work again, but if not accessing the taget url directly works somewhat.</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-12T00:13+00:00</dc:date>
        <dc:modified>2010-08-12 00:13:59</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/02/classicists-have-continued-their-efforts-to-suppress-wittgensteins-arguments-up-to-the-present-day-eg-on-wikipedia">
        <rss:title>"Classicists have continued their efforts to suppress Wittgenstein's arguments up to the present day, e.g. on Wikipedia."</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/02/classicists-have-continued-their-efforts-to-suppress-wittgensteins-arguments-up-to-the-present-day-eg-on-wikipedia</rss:link>       
        



        <content:encoded><![CDATA[<p>Det här är lite utanför mitt område, men om jag förstår andemeningen så är det att logik bör betraktas som en slags ingenjörskonst, och att den måste användas på ett liknande sätt som ingenjörskunskap, dvs inom rimliga ramar, och att man får acceptera motsägelser. Författaren föreslår något som han kallar &quot;Consequently Direct Logic&quot;, som ska göra logikområdet mer relevant för t ex programvaruutveckling.</p>
<blockquote>Classicists have continued their efforts to suppress Wittgenstein's arguments up to the present day, e.g. on Wikipedia.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://knol.google.com/k/carl-hewitt-see-http-carlhewitt-info/incompleteness-theorems/pcxtp4rx7g1t/28#">Incompleteness Theorems - a knol by Carl Hewitt (see http://carlhewitt.info)</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-02T12:36+00:00</dc:date>
        <dc:modified>2010-08-02 12:36:39</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/01/the-guardian-om-sverige-gran-lindberg-och-vra-deckarfrfattare">
        <rss:title>The Guardian om Sverige, Göran Lindberg och våra deckarförfattare</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/01/the-guardian-om-sverige-gran-lindberg-och-vra-deckarfrfattare</rss:link>       
        



        <content:encoded><![CDATA[<p>Deckarförfattarna Henning Mankell, Stieg Larsson och andra har visat en bild av Sverige som är annorlunda än den idealiserade bild som ofta finns i t ex Storbritannien. Efter domen mot förre länspolischefen Göran Lindberg så undrar The Guardian's Andrew Anthony om det kanske<a href="http://www.guardian.co.uk/world/2010/aug/01/goran-lindberg-sweden-crime-palme"> ligger något i denna nya bild</a>:</p>
<p>Anthony skriver en lång och intressant artikel som redovisar synpunkter från olika svenska opinionsledare. Han avslutar med en undran om det kan vara så att svenskarna är överpragmatiska, att vi identifierar problem som ska lösas med utbildning, utan att ta in den större bilden av vad det är man försöker lösa.<br />
<br />
Läs mer: <a href="http://www.guardian.co.uk/world/2010/aug/01/goran-lindberg-sweden-crime-palme">Göran Lindberg and Sweden's dark side | feature | World news | The Observer</a></p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag"
             href="http://bloggar.se/om/The%20Guardian">The Guardian</a>,
      
      
          <a rel="tag"
             href="http://bloggar.se/om/Sverigebilden">Sverigebilden</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-08-01T21:02+00:00</dc:date>
        <dc:modified>2010-08-01 21:03:09</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>The Guardian</dc:subject>
        
        
        <dc:subject>Sverigebilden</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/08/01/when-clicking-in-folder_contents-leads-to-downloads-plone">
        <rss:title>When clicking in folder_contents leads to downloads (Plone)</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/08/01/when-clicking-in-folder_contents-leads-to-downloads-plone</rss:link>       
        



        <content:encoded><![CDATA[<p>
<div class="even">Summary: Add the portal_type on a line in the property &quot;typesUseViewActionInListings&quot; in the site_properties property sheet in portal_properties, and you will get the view instead</div>
</p>
<p>&nbsp;</p>
<p>Having created my own MP3 content type in Plone, based on the File content type, I noticed the strange behavior that clicking on any MP3 in a folder contents listing would lead to a download of the MP3. Awkward.</p>
<p>Trying out the standard File content type, this does not happen; you get to the view of the content item instead.</p>
<p>So what's the difference? With File, there is &quot;/view&quot; appended to the url of each content item in the folder contents listing, with the MP3 file there is not. Time to look through the view configurations in XML for the two content types. There were differences, specifically File tacks on &quot;/view&quot; to the specification of &quot;View&quot;. Changing this in MP3 made no difference.</p>
<p>Ok, time to take on the diving suit and chase down the code for the folder_contents view. Thankfully it was reasonably easy to find, in</p>
<p>./plone/app/content/browser/foldercontents.py</p>
<p>The view decides to tack on &quot;/view&quot; if the content type of the item to list is in this list:</p>
<pre>use_view_action = site_properties.getProperty('typesUseViewActionInListings', ())</pre>
<p>So, I added &quot;MP3&quot; on a line in the property &quot;typesUseViewActionInListings&quot; in the site_properties property sheet in portal_properties. And it worked. Not so obvious.</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-08-01T12:58+00:00</dc:date>
        <dc:modified>2010-08-01 12:58:38</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/30/link---on-software-project-development-estimates">
        <rss:title>Link - On software project development estimates</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/30/link---on-software-project-development-estimates</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<blockquote>How many estimates were accurate? </blockquote>
<p><br />
<br />
Läs mer: <a href="http://www.sitepoint.com/blogs/2010/07/29/10-reasons-why-software-project-estimates-fail/">10 Reasons Why Software Project Estimates Fail</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-30T16:05+00:00</dc:date>
        <dc:modified>2010-07-30 16:05:27</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/30/checking-what-would-be-updated-before-making-an-svn-up">
        <rss:title>Checking what would be updated before making an svn up</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/30/checking-what-would-be-updated-before-making-an-svn-up</rss:link>       
        



        <content:encoded><![CDATA[<p>If you have a working copy in subversion that is older than the latest checkin, you may want to check the differences you would get if you made an <span style="font-family: Courier New,Courier;">svn up</span>, without actually doing an svn up.</p>
<pre>svn diff --revision HEAD</pre>
<p>...will give you that.<br />
<br />
<br />
<blockquote>--revision N      The client compares TARGET@N against working copy.</blockquote><br />
<br />
Läs mer: <a href="http://svnbook.red-bean.com/en/1.0/re09.html">svn diff</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-30T09:59+00:00</dc:date>
        <dc:modified>2010-07-30 09:59:59</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/28/video-editors-on-linux">
        <rss:title>Video editors on Linux</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/28/video-editors-on-linux</rss:link>       
        



        <content:encoded><![CDATA[<p>Here is a list of Video editors available on Linux. I have tried them all, save Lombard. Will try to summarize more experiences at a later time.&nbsp;&nbsp;&nbsp;</p>
<ul>
    <li><a href="http://cinelerra.org">Cinelerra</a> (<a href="http://www.g-raffa.eu/Cinelerra/HOWTO/index.html">Cinelerra for Grandma</a>)</li>
    <li><a href="http://lives.sf.net">LiVES</a> The best one I have found for extracting short video clips from a video.  My use case was extracting individual three second long moves from salsa dance performances. I tried three Linux based video editors for this: LiVES, Cinelerra and Pitivi. The best by far for this particular application was LiVES. It was easy to &quot;scrub&quot; with, essential for finding the right cut point.</li>
    <li><a href="http://www.kdeenlive.org">Kdenlive</a> Has a lot of filters you can apply to video. Unsure of how cutting works.</li>
    <li><a href="http://www.pitivi.org">Pitivi</a></li>
    <li><a href="http://yorba.org/lombard/">Lombard</a> Very recent contribution, supports only basic editing at this point in time, according to web site.</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-28T16:23+00:00</dc:date>
        <dc:modified>2010-07-28 16:41:38</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/27/cli-id3-editors---tagging-a-tree-with-find-and-xargs">
        <rss:title>CLI ID3 editors - tagging a tree with find and xargs</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/27/cli-id3-editors---tagging-a-tree-with-find-and-xargs</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<div class="even">Summary: None of the tested CLI editors work with find and xargs as tested. On Linux, <span style="font-weight: bold;">eyeD3</span> does recursively add a genre, but it is just because it is recursive by default. In fact it added genre tags to any and all files it found, including m3u playlist files. <br />
The other command line utilities tested, <span style="font-style: italic;">id3tool</span>, <span style="font-style: italic;">id3ren</span> and <span style="font-style: italic;">id3v2</span> (all from Ubuntu's repository for 9.10 Karmic Koala) did not work at all. Note that there probably are other ways of making these editors work for the use case.</div>
<p>&nbsp;</p>
<p>I needed to tag a whole directory tree of MP3 files with the genre tag &quot;Salsa&quot;. This blog post is about whether the above mentioned command line tagging tools worked as expected with find and xargs to batch add a tag.</p>
<p>Now, a standard way in the shell on unixish systems to dig up files and pipe them to a command is something like this:</p>
<pre>find -print0 -name &quot;*.mp3&quot;|xargs -0 tag-command --flags</pre>
<ul>
    <li>&quot;find&quot; finds all items and prints them out for you,</li>
    <li>the &quot;-name &quot;*.mp3&quot; limits it to items ending in mp3,</li>
    <li>the &quot;-print0&quot; prints them in such a way that the next command in the chain does not get confused by any weird characters in the file names, achieved by putting a NULL character in between them. MP3 files often have weird file names</li>
</ul>
<p>&quot;xargs&quot; then executes tag-command for each item that find finds. The &quot;-0&quot; flag is to unpack the NULL delimited items xargs gets from find.</p>
<p>&nbsp;</p>
<p>Here are the results:</p>
<pre>find -print0 -name &quot;*.mp3&quot;|xargs -0 id3tool -G=Salsa<br /> Error is: id3tool: Can't open file &quot;.&quot; for write.</pre>
<p>id3tool misinterprets the item spec it got</p>
<pre>find -print0 -name &quot;*.mp3&quot;|xargs -0 id3ren -genre Salsa<br /> id3ren: id3_read_file: Error reading .: Is a directory</pre>
<p>id3ren does the same</p>
<pre>find -print0 -name &quot;*.mp3&quot;|xargs -0 id3v2 -g 143<br /> fopen: .: id3v2: Is a directory</pre>
<p>..and id3v2 too</p>
<p>&nbsp;</p>
<p>eyeD3 <span style="font-style: italic;">seemed</span> to work like a charm though:</p>
<pre>find -print0 -name &quot;*.mp3&quot;|xargs -0 eyeD3 -G Salsa<br /><br />a file.mp3&nbsp;&nbsp;&nbsp; [ 4.29 MB ]<br />-------------------------------------------------------------------------------<br />Time: 03:14&nbsp;&nbsp;&nbsp; MPEG1, Layer III&nbsp;&nbsp;&nbsp; [ ~193 kb/s @ 44100 Hz - Joint stereo ]<br />-------------------------------------------------------------------------------<br />Setting track genre: Salsa<br />Writing tag...<br />ID3 v2.3:<br />title: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; artist: <br />album: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; year: None<br />track: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; genre: Salsa (id 143)<br /> UserTextFrame: [Description: Tagging time]<br />2010-07-27T21:18:38</pre>
<p>...and eyeD3 just chugged on like that, adding tags. Actually it added tags to my *.m3u playlists as well, even though these were not included in the output from find. eye3D seems to work recursively by default, and somehow it managed to divine something it deemed useful from find's output.</p>
<p>I used eye3D's --remove-tags flag to remove the tags from the playlists.</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-27T21:39+00:00</dc:date>
        <dc:modified>2010-07-27 22:07:03</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/27/link---wrapping-mplayer-in-python">
        <rss:title>Link - Wrapping mplayer in python</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/27/link---wrapping-mplayer-in-python</rss:link>       
        



        <content:encoded><![CDATA[<p>Sometimes I'd just like to make a video player/editor with the functions <span style="font-style: italic;">I</span> need and nothing else: Slow motion, select a short piece and save it. If I ever get around to that, this may be a good starting point:</p>
<blockquote>This article will just focus on creating a really simple Media Player that you can play movies with.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://www.blog.pythonlibrary.org/2010/07/24/wxpython-creating-a-simple-media-player/">wxPython: Creating a Simple Media Player &laquo; The Mouse Vs. The Python</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-27T11:47+00:00</dc:date>
        <dc:modified>2010-07-27 11:47:41</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/25/yes-please-mama">
        <rss:title>Yes please mama</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/25/yes-please-mama</rss:link>       
        



        <content:encoded><![CDATA[<p>I asked a friend a question yesterday, about how to remember rhythms. This afaik is for samba: &quot;Yes please mama, I want cake, mama&quot;. I guess there are many rhythms in samba, though,</p>
<blockquote>One of our patterns with a phrase to help you remember it: &quot;Yes please mama, I want cake, mama!&quot; When you play it, &quot;mama&quot; is played with open notes, all the rest are closed. See, easy!</blockquote>
<p><br />
<br />
<a href="http://www.samba-ottawa.org/index.php?pagename=sounds&amp;PHPSESSID=62de998a13b2ae4728f8f7f29a99a790">Samba Ottawa Home Page</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-25T16:43+00:00</dc:date>
        <dc:modified>2010-07-25 16:43:13</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/23/mp3cat---gets-only-the-data-part-of-the-mp3">
        <rss:title>Mp3cat - gets only the data part of the mp3</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/23/mp3cat---gets-only-the-data-part-of-the-mp3</rss:link>       
        



        <content:encoded><![CDATA[<p>One's mp3 files have a tendency to get duplicated over different computers, hard disks and portable players. Some of the tags may also get edited on some copies but not others. Since tags are stored in the file there is no easy way to detect which mp3s are identical music-wise by just hashing the file with md5, sha-1 or other hashing algorithm. Instead you need to run the hashing on only the data part.</p>
<p>I have not found any modules for python that does this. I have found one python module which will report the byte offset of where the data starts, but I guess that only works if the meta data are in the start of the file. The <span style="font-style: italic;">only</span> command line tool I have found that can extract the data part is <a href="http://tomclegg.net/mp3cat">mp3cat</a>:</p>
<blockquote>This is the mp3cat home page. Download the latest release tarball mp3cat-0.4.tar.gz or (better) check out the current version from my subversion repository: http://svn.tomclegg.net/repos/trunk/mp3cat</blockquote>
<p><br />
My intial evaluation is favorable, i.e. an md5 hash of two files with different meta data but same music data gets the same hash value. Found mp3cat via this blog post:</p>
<blockquote>The author wants the same thing I am searching for&ndash;the  ability to generate a checksum of the audio stream and store it in the  file header as a tag.  Furthermore, he mentions his use of mp3cat!  I  pulled down a copy of mp3cat and compiled it on my archive box.  Then  the fun began</blockquote>
<p><br />
&nbsp;<a href="http://tmoshea.org/2009/09/02/checksum-mp3-audio-frames-the-data-and-not-the-headers/">Tim's Mind Organized &raquo; Checksum mp3 audio frames (the data and not the headers)</a></p>
<p>&nbsp;There has at least existed one java program that does the data extraction and hashing in one fell swoop. It is mentioned in <a href="http://www.hydrogenaudio.org/forums/lofiversion/index.php/t42276.html">this discussion</a>, but the download link does not seem to work.</p>
<p>&nbsp;</p>
<div class="even">
<p>Update 2010-07-25</p>
<p>I now looked into the CPAN archive, and as usual there is a Perl module, Audio::Digest::MP3 that does exactly what you want :-)</p>
</div>
<p>&nbsp;</p>
<p><blockquote>Audio::Digest::MP3 - Get a message digest for the audio stream out of an MP3 file (skipping ID3 tags</blockquote><a href="http://search.cpan.org/%7Ebartl/Audio-Digest-MP3-0.1/lib/Audio/Digest/MP3.pm">Audio::Digest::MP3 - search.cpan.org</a></p>
<p>Untested by me so far.</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-23T13:15+00:00</dc:date>
        <dc:modified>2010-07-25 11:35:50</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/23/counting-bpm-beats-per-minute-on-linux">
        <rss:title>Counting bpm (beats per minute) on Linux</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/23/counting-bpm-beats-per-minute-on-linux</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<div class="even">Summary: Use the command line tool <a href="http://www.surina.net/soundtouch/soundstretch.html">soundstretch</a>:<br />
<pre>soundstretch file.wav -bpm</pre>
It detects about 50% of my salsa music correctly. For better performance (~80%) and automatic bpm detection with a GUI, use the free Abyssmedia <a href="http://www.abyssmedia.com/bpmcounter/">BPM Counter</a>, and run it under Wine. For manual beat counting, use Salsa City <a href="http://www.salsacity.com/text/beat-counter">Beat Counter</a>.&nbsp;</div>
<p>&nbsp;</p>
<p>What software can you use to count beats per minute in your songs using Linux? Although there is a slew of software on Windows, the selection is smaller on Linux. There are open source Linux products besides soundstretch that have beat counting code like <a href="http://www.mixxx.org/">Mixxx</a> and <a href="http://bpmdj.yellowcouch.org/aftersplash.html">BpmDj</a>, so if someone could just factor out that code it could be a basis for generic libraries.</p>
<p>&nbsp;</p>
<div class="even">Update 2010-08-04: Found <a href="http://www.surina.net/soundtouch/soundstretch.html">soundstretch</a>. Initial tests indicate it to have satisfactory performance at about 50% accuracy. It is a command line tool that mainly is used for pitch transformation, but it can also detects bpms as shown in the summary above. It operates on wav files and not mp3. It is supposed to accept stdin as argument, but I have had no luck in making it do that. I have written a pyton script that wraps conversion and bpm detection.</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I you have looked at the Salsa City <a href="http://www.salsacity.com/text/beat-counter">Beat Counter</a> you may have noticed that it further down on the page says &quot;bar&quot; not &quot;beat&quot;. Let's sort out the difference between bars per minute and  beats per minute, and why at all you want to know any of those for a  piece of music.&nbsp; For most music there will be 4 beats to a bar, so a  song which has 160 bpm (beats per minute) has 40 bpm( ehrm, <span style="font-style: italic;">bars</span> per minute). In this text bpm will henceforth always mean <span style="font-style: italic;">beats per minute</span>.</p>
<p>The reason you want to know the bpm, well since you are reading this text you probably already precisely know  why you want to know it, but generally speaking, it is useful in  connection with dancing. If you are DJ'ing or practicing dancing, it is  useful to play songs that fit in a certain range of dance speed.</p>
<p>I have written a wrapper around soundstretch for bpm assessment of mp3 files. It is <a href="/index_html/archive/2010/08/18/a-python-script-to-count-bpm-beats-per-minute-on-linux/weblogentry_view">here</a>.</p>
<p>One of the most recommended automatic beat counters for Windows is <a href="http://www.mixmeister.com/bpmanalyzer/bpmanalyzer.asp">MixMeister</a>, but it does not run well under Wine on Linux according to the database at winehq.</p>
<p>There is a Linux native product calledd <a href="http://bpmdj.yellowcouch.org/aftersplash.html">BpmDj</a>, but I did not get it to compile in the time I was willing to spend with (and the pre compiled binary did not work on Ubuntu 9.10).</p>
<p>However Abyssmedia <a href="http://www.abyssmedia.com/bpmcounter/">BPM Counter</a> for Windows runs just fine under Wine, and does a pretty good job. With BPM counter you will have to read the bpm counts off the screen;  there is no facility for writing back to the mp3 files or to a separate  file. It detected 80% of my salsa music correctly, and there are many rhythms in salsa songs for a poor piece of software to latch on to. It did more or less consistently though report <span style="font-style: italic;">half</span> the bpm of each song. I got about 70% of the songs classified at half speed. A simple reality check fixed that though: Salsa music ranges from 150 bpm to 210 bpm, so 96 bpm classification is actually 192 bpm. The same adjustments were made for soundstretch.</p>
<p>How do I know that it was correct? I double checked it (well not all songs, but many) with the javascript based manual beat counter  <a href="http://javascript.internet.com/math-related/beat-counter.html">Beat Counter</a>, which runs in a browser, and hence works just fine under Linux. With Beat Counter, you start it with a mouse click and tap the beat with any key on the keyboard (do not use space bar on Linux though, it will scroll the page).</p>
<p>Bear in mind that the mouse click is counted as one tap, and if you casually start it with a mouse click and then <span style="font-style: italic;">wait</span> a few secs before tapping, it will assume there was a super long beat between the mouse click and the first tap. This will result in the average bpm be wrong and slowly rise but never reach the true bpm of the song.</p>
<p>Update: Here is a better beat counter: <a href="http://www.salsacity.com/text/beat-counter">Salsa City bar counter</a>, a bit easier to use.</p>
<p>There is a piece of Dj software called <a href="http://www.mixxx.org/">Mixxx</a>, that runs on Linux, it has beat counting built in, but it is quite awkward to use for bpm classification purposes, with many user interface steps for getting the bpm of one song. There is a checkbox for writing the bpm count to a tag on the mp3 file, but alas that checkbox is always disabled and from what I have found on the Internet the code for that checkbox has not been written yet.</p>
<p>Getting back to <a href="http://www.mixmeister.com/bpmanalyzer/bpmanalyzer.asp">Mixmeister bpm analyzer</a>, I finally gave in and installed it on a Windows Vista machine. It dumps the bpm data to a tab delimited data file, with bpm count as the last item in each row. I ran it on the same files as I had classified with BPM counter (and adjusted manually). In these I had encoded the bpm count right into the file name, and since the file names were included in the data file put out by mixmeister, it made for easy comparison of the bpm classifications of Mixmeister and Abyssmedia, and it turned out that they were often within one bpm. Reading more on the Internet it sems like Mixmeister <span style="font-style: italic;">does</span> write to the bpm ID3v2 tag! It just doesn't tell you about it. Looking into one of the files I tested with in a hex editor there is indeed a TBPM field. It may be worth firing up Windows just for Mixmeister then, as long as it does not overwrite an existing BPM tag.</p>
<blockquote>BPM Counter is a fast and accurate beats per minute detector for MP3 music. </blockquote>
<p><br />
<br />
&nbsp; <a href="http://www.abyssmedia.com/bpmcounter/">BPM Counter - detect BPM of any song.</a></p>
<p>&nbsp;</p>
<blockquote>A manual Beats per Minute (BPM) counter for DJs. Counts the beats-per-minute of a song by tapping a key or the mouse to the beat of a song. Simply click on the page to start the time then tap any key to the beat.</blockquote>
<p><br />
<br />
&nbsp;<a href="http://javascript.internet.com/math-related/beat-counter.html">The JavaScript Source: Math Related: Beat Counter</a></p>
<p>&nbsp;</p>
<p>Trying to find something that writes to tags directly, I also tried BPM ProScan running in a win2k installation under vmware. It did not perform well on Salsa songs. As an example Lollobrigida by Ricardo Lemvo was classified as having 120 bpm. It has 180 bpm in the first half and a bit over 160 bpm in the second half. Other bpm counters sometimes get it at 90 bpm, which is understandable, but 120bpm is right out.</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-23T11:09+00:00</dc:date>
        <dc:modified>2010-08-21 10:33:36</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/21/varfr-nmner-man-att-det-var-boeing-plan">
        <rss:title>Varför nämner man att det var Boeing-plan?</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/21/varfr-nmner-man-att-det-var-boeing-plan</rss:link>       
        



        <content:encoded><![CDATA[<p>Två trafikflygplan, ett från SAS och ett från Finnair var hyfsat nära att kollidera ovanför Östersund för några veckor sedan. TT väljer att beskriva detta som att två <span style="font-weight: bold;">Boeing</span>-plan var nära att kollidera. Att nämna planens fabrikat känns ungefär lika relevant som att vid en incident mellan två personbilar skriva t ex &quot;Två Renault-bilar nära att krocka på Storgatan&quot;.</p>
<p>Det är väl inte särskilt sannolikt att det är det faktum att planen är av fabrikatet Boeing som gjort att de låg nära varandra i luftrummet?</p>
<p>På Internet finns det ju gott om konspirationsteorier, och denna TT-artikel som jag såg i Svenskan fick nästan mig att börja tänka i sådana banor. Konkurrensen är hård mellan Airbus och Boeing, och vissa uttryck som t ex &quot;If it's not Boeing, I'm not going&quot;, och &quot;Scarebus&quot; har fått fotfäste bland en del internetdebattörer. Det blir liksom viral marknadsföring om vilken tillverkare som är bäst.<br />
<blockquote>Två Boeing - en 737 från SAS och en 757 från Finnair - med passagerare möttes den 2 juli 11 000 meter över Östersund. Kurserna skar varandra, höjden var densamma. Kollisionsrisken var uppenbar</blockquote><br />
<br />
Läs mer: <a href="http://www.svd.se/nyheter/inrikes/boeing-nara-krocka-over-ostersund_5019599.svd">Boeing nära krocka över Östersund | Inrikes | SvD</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-21T17:37+00:00</dc:date>
        <dc:modified>2010-07-21 17:37:25</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/18/vn-av-ordning-tid-och-rum-i-expressen-och-svenskan">
        <rss:title>Vän av ordning: tid och rum i Expressen och Svenskan</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/18/vn-av-ordning-tid-och-rum-i-expressen-och-svenskan</rss:link>       
        



        <content:encoded><![CDATA[<p>Så här i semestertider - eller är det värmen? - kan det bli lite extra fel i artiklar. Speciellt kul blir det&nbsp; om man liksom bryter mot tid och rum.</p>
<h3>Hopblandning av tid</h3>
<p>Expressens nätupplaga skriver just nu på förstasidan att Pete Doherty gjorde bra ifrån sig under konserten på Arvikafestivalen, trots en incident med polisen <span style="font-style: italic;">efter</span> konserten.</p>
<p>&nbsp;</p>
<p><img src="/images/doherty.png" alt="" /></p>
<p>&nbsp;</p>
<p>Här vill jag mena att det mest effektiva sättet att rent praktiskt hantera universum är att förutsätta att händelser som inträffar efter i tiden, <span style="font-style: italic;">inte kan påverka det som redan hänt</span>. &quot;Trots incidenten <span style="font-style: italic;">efteråt</span>&quot;???</p>
<p>&nbsp;</p>
<h3>Hopblandning av rum (geografi)</h3>
<p>I Svenskan kan man nu <a href="http://www.svd.se/nyheter/inrikes/krypen-frodas-i-varmeboljan_5008573.svd">läsa</a> att en tropisk sjukdom siktats i Frankrike, och:</p>
<blockquote>Fallet var det första i Europa i år, men för några år sedan avled 77 personer på den <span style="font-weight: bold;">franska ön Reúnion</span></blockquote>
<p>Men Reúnion ligger tusen mil från Europa (i fyrkanten på wikipediakartan nedan):</p>
<p><img src="/images/reunion.png" alt="" /></p>
<p>Får väl skicka en tidspil till Expressen och en karta til SvD?</p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag" href="http://bloggar.se/om/nyheter">nyheter</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-07-18T23:40+00:00</dc:date>
        <dc:modified>2010-07-18 23:47:52</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>nyheter</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/17/speaker-switch-that-daisy-chains-speakers-to-avoid-low-impedance">
        <rss:title>Speaker switch that daisy chains speakers, to avoid low impedance</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/17/speaker-switch-that-daisy-chains-speakers-to-avoid-low-impedance</rss:link>       
        



        <content:encoded><![CDATA[<p>At work, we have a stereo and four 4 ohm speakers, and a sub woofer. The amplifier only has one set of speaker outputs and is rated for outputting at 4 ohms. How do we go about connecting the speakers without getting to low an impedance? The speaker switch boxes at the local shop all seem to expand the speaker connections by putting them in parallel, which would bring the load the amplifier sees down to 2 ohms, nominally.</p>
<p>The sub woofer has connectors both for line in levels (250 mV or 775 mV I presume) and for speaker cable. I assume the speaker cable input is high impedance (kilo ohms or higher).</p>
<p>I thought about what the schematics could be for a simple speakers switch box, and below is what I came up with. It is untested:</p>
<p><img alt="" src="/images/schematics.png" /></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-17T15:51+00:00</dc:date>
        <dc:modified>2010-07-17 15:53:07</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/17/suspend-and-resume-an-amazon-virtual-computer">
        <rss:title>Suspend and resume an Amazon virtual computer?</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/17/suspend-and-resume-an-amazon-virtual-computer</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<div class="even">With the brand new possibilty to use your own  kernels, it ought to be possible for a virtual computer on the Amazon  grid to be shut down with its state intact, saved to disk</div>
<p>Virtual servers, where you can think of a cloud of services where you  pick and choose what you want and expand and contract your capacity in  minutes, are becoming - I'd say - the premier choice for many outfits. There  are a number of well-reputed providers, such as Amazon and Linode, but  in the case of Amazon the smallest server is still rather big and pricey  for being used as a alternative desktop or for throw-away development  servers.</p>
<p>However Amazon's storage prices are low enough that  having a number of standby servers, ready to recreate their state in  seconds, could lend it to new applications, such as desktop machines and a company having a slew of development, staging and testing servers.</p>
<p>With the advent of persistent storage of your operating system on Amazon EC2 (September 2009) and now the brand new possibilty to use your own kernels, it ought to be possible for a virtual computer on the Amazon grid to be shut down with its state intact, saved to disk (i.e. hibernate), and the be woken up at later time, and you can just continue working where you are. There are such facilities in the Linux kernel, and there is also the <a href="http://www.tuxonice.net/">Tux on ice</a> project. Tux on ice allows you to save the RAM state to a file on the file system, so no need for a persistent swap partition.</p>
<p>&nbsp;</p>
<blockquote>This Feature Guide below is designed to teach System Administrators and other IT professionals how to utilize the User Provided Kernels in Amazon EC2. With this feature, Amazon allows you to load a para‐virtual Linux kernel within an Amazon Machine Image (AMI) or Amazon EBS volume. You can also now seamlessly upgrade the kernel on Amazon EBS‐backed instances.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://developer.amazonwebservices.com/connect/entry.jspa?categoryID=174&amp;externalID=3967">Amazon Web Services Developer Community : Enabling User Provided Kernels in Amazon EC2</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-17T14:55+00:00</dc:date>
        <dc:modified>2010-07-18 07:56:27</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/16/mnga-routrar-knsliga-fr-en-dns-attack">
        <rss:title>Många routrar känsliga för en DNS-attack</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/16/mnga-routrar-knsliga-fr-en-dns-attack</rss:link>       
        



        <content:encoded><![CDATA[<p>Många internetuppkopplingar har en router som sitter mellan Internet och ett internt nätverk med ofta flera datorer på. En säkerhetskille har enligt egen utsago gjort ett program som gör det möjligt att ta sig in innanför routern på ett sådant nätverk, givet att någon på nätverket besöker en webbplats som har attackkod. Många routrar verka kunna falla för denna attack. Forbes (se nedan) har publicerat en lista över routrar där man kan se om ens egen router är i farozonen. Tredjepartsprogramvarorna DD-WRT och OPENWRT är listade som möjliga att attackera. Tomato är inte listad, men såvida den inte har ändrad kod i det anfäktade området än Linksys originalkod (som Tomato bygger på) så är väl risken stor att den också är attackerbar. Snabba motmedel är att ändra lösenordet på routern från fabriksinsällningarna, och att aldrig lagar lösenordet för routern i webbläsaren.</p>
<blockquote>Heffner's trick is to create a site that lists a visitor's own IP address as one of those options. When a visitor comes to his booby-trapped site, a script runs that switches to its alternate IP address--in reality the user's own IP address--and accesses the visitor's home network, potentially hijacking their browser and gaining access to their router settings.</blockquote>
<p><a href="http://it.slashdot.org/comments.pl?sid=1721806&amp;cid=32925350"> <br />
Läs mer: <a href="http://blogs.forbes.com/firewall/2010/07/13/millions-of-home-routers-vulnerable-to-web-hack/">&ldquo;Millions&rdquo; Of Home Routers Vulnerable To Web Hack &laquo; The Firewall - Forbes.com</a></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Så här fungerar attacken verkar det som:</p>
<blockquote>As I understand it, it generally works like this: You set a ridiculously short TTL on the server hosting the exploit. When a victim connects you grab their IP address, add it and any other likely target IPs to the list of A records for the server and reload the zone. Your attack code just needs to wait for the TTL to expire, DNS to refresh and then try and connect to the target, which now appears to come from an attack on a trusted network.</blockquote>
<p><br />
Läs mer: <a href="http://it.slashdot.org/comments.pl?sid=1721806&amp;cid=32925350">Slashdot Comments | Millions of Home Routers Are Hackable</a></p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag"
             href="http://bloggar.se/om/IT-s%C3%A4kerhet">IT-säkerhet</a>,
      
      
          <a rel="tag" href="http://bloggar.se/om/routrar">routrar</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-07-16T13:31+00:00</dc:date>
        <dc:modified>2010-07-16 16:06:01</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>IT-säkerhet</dc:subject>
        
        
        <dc:subject>routrar</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/12/offloading-downloads-from-plone-relatively-transparently">
        <rss:title>Offloading downloads from Plone, (relatively) transparently</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/12/offloading-downloads-from-plone-relatively-transparently</rss:link>       
        



        <content:encoded><![CDATA[<p>I've just built a first version of a system that offloads file downloads from the responsibility of Plone, while keeping authentication and authorization. With help from Apache and <a href="http://pypi.python.org/pypi/iw.fss/">iw.fss</a>, surprisingly few lines of code are needed to accomplish this.</p>
<p>Here comes first two bulleted summaries of what is going on. Look further down in this post for a longer description:</p>
<p>&nbsp;</p>
<p>Workflow</p>
<ul>
    <li>User accesses page in Plone, where he is offered to download a file</li>
    <li>When clicking the download link, a redirect is made to a sub domain, with the exact same path + filename</li>
    <li>The subdomain &quot;steals&quot; a cookie from the user and uses that to authenticate an xml-rpc call to check if user has the right to download the file</li>
    <li>If True, mod_python lets the request through, and file is downloaded through Apache</li>
</ul>
<p>&nbsp;</p>
<p>Technology</p>
<ul>
    <li>Have Apache in front,</li>
    <li>use iw.fss to store files on the file system</li>
    <li>Serve the files out on a subdomain with Apache</li>
    <li>Use url rewrite to make authentication cookie or session cookie accessible to the sub domain</li>
    <li>Use mod_python as access handler for download sub domain</li>
    <li>The mod_python script has an xmlrpc client that can be configured with cookies</li>
    <li>The xmlrpc client is configured with cookies, so to Plone it is the user himself</li>
    <li>xmlrpc asks plone if dowload is ok by accessing proxy method of object of download desire</li>
</ul>
<h3><span style="font-weight: bold;">Longer description</span></h3>
<p>Plone is not very good at serving out big files. A couple of concurrent huge downloads would take up a lot of Zope processes and threads. Here is a way of offloading the file downloading to other server processes (in this case Apache) with authentication and authorization intact.</p>
<p>The stuff needed is</p>
<ul>
    <li>Apache with mod_python and mod_rewrite</li>
    <li>A custom transport agent for xml-rpc (included in this post)</li>
    <li>Plone</li>
</ul>
<p>Let's look at how it is set up, going from the outside in:</p>
<h3>Make the authentication or session cookie available to the download server</h3>
<p>The user is browsing the web site. The first thing the user's browser hits is the Apache server, sending the request further to Plone. The user may or may not be logged in. The virtual server directive in Apache looks something like this:</p>
<pre>&lt;VirtualHost *:80&gt;<br /> ServerName server.topdomain<br /> proxyPreserveHost on<br /> RewriteEngine On<br /> # Match the __ac cookie if present, and make a new cookie with same value, but that can be sent to sub domains<br /><span style="font-weight: bold;"> RewriteCond %{HTTP_COOKIE} __ac=([^;]+) [NC]</span><br /> RewriteRule ^/(.*) http://localhost:6080/VirtualHostBase/http/%{HTTP_HOST}:80/site/VirtualHostRoot/$1 [<span style="font-weight: bold;">co=__download__ac:%1:.server.topdomain</span>,L,P]<br /> RewriteRule ^/(.*) http://localhost:6080/VirtualHostBase/http/%{HTTP_HOST}:80/site/VirtualHostRoot/$1 [L,P]<br /><br />&lt;/VirtualHost&gt;</pre>
<p>The RewriteRule looks pretty standard, it rewrites the request to fit the virtual host monster in Plone, and the Plone site with the id &quot;site&quot; is served out. However there is some extra stuff, particularly the line:</p>
<pre>RewriteCond %{HTTP_COOKIE} __ac=([^;]+) [NC]</pre>
<p>This line is a condition, that is triggered if the incoming request has a cookie by the name &quot;__ac&quot;. The &quot;__ac&quot; cookie contains information that authenticates the user to the Plone site. If your site uses another cookie than &quot;__ac&quot; then put its name here instead. It does not matter if the cookie contains just a session id or the login information. The important thing is this part:</p>
<pre>([^;]+)</pre>
<p>...it matches the cookie value, and the brackets mean that Apache <span style="font-style: italic;">remembers</span> this part of the pattern. Since this is the first (and actually only) pair of brackets in the pattern, it will be remembered as %1 (Apache's way of denoting back references from the environment or http headers is with a percentage sign, inside a url pattern it is the standard dollar sign though).</p>
<p>Now, let's look at the rewrite rule:</p>
<pre>RewriteRule ^/(.*) http://localhost:6080/VirtualHostBase/http/%{HTTP_HOST}:80/site/VirtualHostRoot/$1 [<span style="font-weight: bold;">co=__download__ac:%1:.server.topdomain</span>,L,P]</pre>
<p>The first part is standard. The square brackets at the end usually only contains control flow information (such as &quot;stop here&quot; or somesuch) but within the square brackets at the end here there is also an instruction to send a cookie with the response out:</p>
<pre><span style="font-weight: bold;">co=__download__ac:%1:.server.topdomain</span></pre>
<p>We define here a new cookie called __download__ac (it can be called anything), but the important thing here is the dot in front of the domain. This means that the cookie is available to the domain server.topdomain and all sub domains. In this way this cookie can be shared with sub domains.</p>
<p>The standard __ac cookie in Plone does not have the capability to be shared with sub domains. The __ac cookie is a bit insecure because it actually contains the user name and password in scrambled form, but for other reasons we wanted to keep it with this system.</p>
<p>Another way of making the cookie shared would be to write a PAS plugin for Plone that can be configured to send out the cookie with a dot-prefixed domain qualifier, but the above rewrite is hard to beat for brevity.</p>
<p>If one goes with the more secure session cookie, there seem to be a PAS plugin that already allows configuration with a a dot-prefixed domain, and in that case the rewrite above is not necessary. Well, either way you do it, at this point you should have cookie with authentication information that can be read by sub domains.</p>
<h3>Apache config of download server</h3>
<p>When the user click on the download link he will be redirected to a sub domain. Let's look at the Apache configuration for that:</p>
<pre>&lt;VirtualHost *:80&gt;<br /> ServerName download.server.topdomain<br />  DocumentRoot /var/www/html<br />  &lt;Location /&gt;<br />   #Extend the Python path to locate your callable object<br />  PythonPath &quot;sys.path+['/var/www/mod_python']&quot;<br />  # Make Apache aware that we want to use mod_python<br />  AddHandler mod_python .py<br /><span style="font-weight: bold;">  PythonAccessHandler downloadauth</span><br />  &lt;/Location&gt;<br />&lt;/VirtualHost&gt;</pre>
<p>This looks pretty much like a standard virtual server directive in Apache, for serving out static files from the file system. The only embellishment being that a python script gets registered to be <span style="font-style: italic;">access handler</span> for all requests. This means that the script is actually not serving out any content, it just sits as a gatekeeper and says yay or nay to if Apache should serve out the requested content to the user.</p>
<p>As per the configuration above, the script is defined above as having the name &quot;downloadauth.py&quot; and that it should live in the &quot;/var/www/mod_python&quot; directory on the server. Let's take a look at that script:</p>
<pre>#!/usr/bin/env python<br /># -*-python-*-<br /># <br />from mod_python import apache, Cookie<br />import xmlrpclib<br />from cookiestransport import CookiesTransport<br />PLONE_URL = 'http://192.168.1.51:6080/site'<br /><br /><br />def accesshandler(req):<br />    &quot;&quot;&quot;Return apache.OK if the authentication was successful,<br />    apache.HTTP_UNHAUTORIZED otherwise.<br />    &quot;&quot;&quot;<br />    plone_local_uri = &quot;/&quot;.join(req.uri.split(&quot;/&quot;)[:-1])<br />    xmlrpc_server_url = PLONE_URL + plone_local_uri<br />    <br />    # Get the __ac cookie<br />    cookies = Cookie.get_cookies(req)<br />    # apache rewrite adds this cookie as a sub domain friendly copy of &quot;__ac&quot;<br />    cookie = cookies.get('__download__ac', None)<br />    cookies_spec = []<br /><br />    if cookie is not None:<br />        cookie_value = cookie.value<br />        # Cookies values are delivered wrapped in quotes<br />        cookie_value = cookie_value.replace('&quot;','')<br />        # We configure xmlrpc to use it as &quot;__ac&quot;<br />        cookie_spec = ['__ac', cookie_value]<br />        cookies_spec.append(cookie_spec)<br />    server = xmlrpclib.Server(xmlrpc_server_url, transport=CookiesTransport(cookies=cookies_spec))<br />    if server.can_i_download():<br />        return apache.OK<br />    else:<br />        return apache.HTTP_UNAUTHORIZED</pre>
<p>This script takes the cookie we defined, and sends an xml-rpc call to Plone. The xml-rpc client is configured with a special transport agent that can take cookies. <span style="font-style: italic;">In this way the xml-rpc client get authenticated as the user doing the download.</span> Plone runs on Zope and Zope supports xml-rpc out of the box. All we need now is to access a method in Plone that has the same acess rights as the file the user wants to download.</p>
<p>If we assume the object in Plone holding the download looks something like this:</p>
<pre>object<br />     method: download (permission: 'View')<br />     method: can_i_download (permission: 'View')</pre>
<p>I.e. it has two methods,</p>
<ul>
    <li>One that serves out the object from inside of Plone</li>
    <li>One that just returns True</li>
</ul>
<p>The first method is never going to be used; we do not want Plone to serve out the file from within Plone. However we make a note of what permission that method has (usually &quot;View&quot;). We then make a method &quot;can_i_download&quot; (or whatever name you fancy) with the same permission. This method just returns True. It can look like this:</p>
<pre>security.declareProtected(permissions.View,'can_i_download')        <br />    def can_i_download(self):<br />        &quot;&quot;&quot;If user has permission to run this method, he <br />        has permission to download the file&quot;&quot;&quot;<br />        return True</pre>
<h4>The cookie aware transport agent for xmlrpc</h4>
<p>The code for the cookie aware transport class largely taken from:</p>
<p><a href="http://www.roccoangeloni.it/wp/2008/06/13/xmlrpclib-with-cookie-aware-transport/">Roberto Rocco Angeloni &raquo; Blog Archive &raquo; Xmlrpclib with cookie aware transport</a></p>
<p>My version does away with the ability to receive cookies from the server</p>
<p>Adds capabilty to configure client with arbitrary cookies from code</p>
<p>&nbsp;</p>
<pre># A module with a class that allows the xmlrpc client to be configured with a list of cookies<br /># For authentication with plone xml-rpc methods<br /># Based completely on code from Rooco Angeloni:<br /># http://www.roccoangeloni.it/wp/2008/06/13/xmlrpclib-with-cookie-aware-transport/<br /><br />import xmlrpclib<br />class CookiesTransport(xmlrpclib.Transport):<br />    &quot;&quot;&quot;A transport class for xmlrpclib, that can be configured with<br />    a list of cookies and uses them in the xml-rpc request&quot;&quot;&quot;<br />    def __init__(self, cookies=[]):<br />        &quot;&quot;&quot; cookies parameter should be a list of two item lists/tuples [id,value]&quot;&quot;&quot;<br />        if hasattr(xmlrpclib.Transport, '__init__'):<br />            xmlrpclib.Transport.__init__(self)<br />        self.cookies=cookies<br /><br />    def request(self, host, handler, request_body, verbose=0):<br />        # issue XML-RPC request<br />        h = self.make_connection(host)<br />        if verbose:<br />            h.set_debuglevel(1)<br />        self.send_request(h, handler, request_body)<br />        self.send_host(h, host)<br />        fo = open('/tmp/modpythonlogger.txt','a')<br />        fo.write('Value for cookiespec is:%s\n' % self.cookies)<br />        fo.close()<br />        for cookie_spec in self.cookies:<br />            h.putheader(&quot;Cookie&quot;, &quot;%s=%s&quot; % (cookie_spec[0],cookie_spec[1]) )<br />        self.send_user_agent(h)<br />        self.send_content(h, request_body)<br />        errcode, errmsg, headers = h.getreply()<br />        if errcode != 200:<br />            raise xmlrpclib.ProtocolError(<br />                host + handler,<br />                errcode, errmsg,<br />                headers<br />                )<br />        self.verbose = verbose<br />        try:<br />            sock = h._conn.sock<br />        except AttributeError:<br />            sock = None<br />        return self._parse_response(h.getfile(), sock)</pre>
<h3>&nbsp;</h3>
<h3>iw.fss - care and feeding</h3>
<p>iw.fss is a very slick product for external storage from Ingeniweb. Deciding what fields should be stored externally can be done with a ZCML file, you do not need to touch the code of the content types.</p>
<h4>Making migration work in iw.fss</h4>
<p>iw.fss has a control panel that allows you to migrate the already stored data in the fields, to the external storage. In our case a good number of field migrations failed. It turned out that at least in our system (which was prepopulated from an old legacy system) the data was sometimes stored in an object type, &quot;OFS.Image.Pdata&quot;, that iw.fss migration could not handle (a bug ticket has been submitted to the iw.fss people about this).</p>
<p>The following monkey patch (used with collective.monkeypatcher), stored in a &quot;patches.py&quot; file fixed that problem:</p>
<pre>import cgi<br />from ZPublisher.HTTPRequest import FileUpload<br />import cStringIO<br />from iw.fss.FileSystemStorage import FileUploadIterator<br /><br />old__init__ = FileUploadIterator.__init__<br /><br />def new__init__(self, file, streamsize=1&lt;&lt;16):<br />    &quot;&quot;&quot; this is a file upload &quot;&quot;&quot;<br />    if not hasattr(file, 'read') and hasattr(file,'data'):<br />        data = str(file) # see OFS.Image.Pdata<br />        fs = cgi.FieldStorage()<br />        fs.file = cStringIO.StringIO(data)<br />        file = FileUpload(fs)<br />    return old__init__(self, file, streamsize)</pre>
<p>&nbsp;</p>
<p>...with the following ZCML:</p>
<pre>&lt;configure<br />    xmlns=&quot;http://namespaces.zope.org/zope&quot;<br />    xmlns:monkey=&quot;http://namespaces.plone.org/monkey&quot;<br />    i18n_domain=&quot;my.application&quot;&gt;<br /><br />  &lt;include package=&quot;collective.monkeypatcher&quot; /&gt;<br /><br />  &lt;monkey:patch<br />     description=&quot;Patching FileUploadIterator to handle OFS.Image.Pdata objects&quot;<br />     class=&quot;iw.fss.FileSystemStorage.FileUploadIterator&quot;<br />     original=&quot;__init__&quot;<br />     replacement=&quot;.patches.new__init__&quot;<br />     /&gt;<br /><br />&lt;/configure&gt;</pre>
<h4>Selecting storage strategy in iw.fss and how to make the url redirect</h4>
<p>iw.fss can store the external files in different layouts, called &quot;strategies&quot;. I chose &quot;site2&quot;. &quot;site2&quot; mirrors the directory structure of Plone completely, and then adds the file in the innermost sub directory. Problem is, the path inside of Plone goes to the last sub directory, but Plone does not tack on the name of the file at the end of the url, i.e. if the file object in Plone has the url:</p>
<p>http://server.topdomain/afolder/another/folder/file_object</p>
<p>iw.fss will store it (with site2 layout) as:</p>
<p>/afolder/another/folder/file_object/filename</p>
<p>That &quot;filename&quot; can be anything. Thankfully iw.fss also stores a file next to the file with a fixed name &quot;fss.cfg&quot;. This stores the name of the other file (the one we want to serve out).</p>
<p>I wrote a tool that can be configured with info on where on the file system iw.fss stores its data, and what the url is of the download server. Let's say the tools is called &quot;tool_that_stores_fss_info&quot;. If you do not want to write a tool, a config sheet in portal_properties will do too.</p>
<p>In your file object, write a method that goes something like this:</p>
<pre>security.declarePublic('redirectToExternalFile')        <br />    def redirectToExternalFile(self):<br />        &quot;&quot;&quot;Redirects to external download url&quot;&quot;&quot;<br />        sc_tool = getToolByName(self, 'tool_that_stores_fss_info')<br />        portal_url = getToolByName(self, 'portal_url')()<br />        <br />        local_url = self.absolute_url()[len(portal_url):] # Extract local part of url<br />        file_path_to_download = sc_tool.fs_path_to_download_root + local_url<br />        config = ConfigParser.ConfigParser()<br />        config.read(file_path_to_download  + '/fss.cfg')<br />        file_name = config.get('FILENAME', 'file')<br />        url_to_download = sc_tool.url_to_download_root + local_url + &quot;/&quot; + file_name<br />        #return url_to_download<br />        self.REQUEST.response.redirect(url_to_download)</pre>
<p>&nbsp;</p>
<h4>Buildout configuration of iw.fss</h4>
<p>Below is an fss configuration that works for a Plone site named &quot;site&quot; stored in the Zope root, using &quot;site2&quot; as storage layout, and the external files get stored inside the var directory of the buildout.</p>
<pre>[fss]<br />recipe = iw.recipe.fss<br />zope-instances =<br />    ${instance:location}<br />storages =<br /># The first is always generic<br />    global /<br />    site /site site2 ${buildout:directory}/var/fss_storage_site</pre>
<h4>Other location of the external files</h4>
<p>In the above case the files gets stored in the var directory inside of the Plone buildout. It may be a better idea to store it on the server in a directory structure with more permanence, like &quot;/var/www/html&quot; as is suggested in the Apache configuration for the dowload server earlier in this post. The var directory in a buildout does not get overwritten on invocations of buildout, but it is still in the buildout directory structure.</p>
<p>Make sure however you have the iw.fss storage on the same volume as the Plone buildout:</p>
<p>Many unixish systems have different directories (/tmp, /home, /var and so on) on different mounted volumes. Python's os.rename cannot handle this and therefore the code in iw.fss that uses os.rename cannot handle the storage being on a different mounted volumes (say, on &quot;/var/www/html&quot;, when the Plone site is a buildout in the &quot;/home&quot; hierarchy). shutil.move may be an alternative to os.rename. (a bug ticket has been submitted to the iw.fss people about this).</p>
<h3>Some possible improvements and simplifications</h3>
<p>What changes could be made to make this more of a solution ready out-of-the box, to be deployed on different servers?</p>
<h4>Getting the cookie to the sub domain</h4>
<ul>
    <li>The rewrite in Apache could be simplified, or</li>
    <li>The cookie handler in Plone could check what domain it is serving the cookie in, and tack on a dot. This behavior could be switched on and off with a checkbox in the ZMI. In this way no Apache rewrite would be necessary at all.</li>
</ul>
<h4>mod_python contacting Plone</h4>
<ul>
    <li>Assuming Plone runs on port 8080 and with the same ip number as mod_python could be a default in the mod_python script</li>
</ul>
<h4>Constructing the right url to redirect to</h4>
<ul>
    <li>The redirect code could be factored out into a view (if they work with xml-rpc), or some other mechanism, so that a simple ZCML configuration would connect a downloadable field in a content type with the redirect code</li>
    <li>It is probably possible to ask iw.fss where its file system storage is, in that way no separate setting would be needed for this in a tool or property sheet</li>
    <li>The default domain to redirect to could be the one Plone is on, with &quot;download.&quot; tacked on in front. Together with the preceding suggestion, no settings would need to be stored in Plone</li>
</ul>
<h4>Replacing xml-rpc</h4>
<ul>
    <li>Instead of xml-rpc, maybe one could simply use an authenticated HEAD request to the file in Plone? Then no custom authentication method would be needed.</li>
</ul>
<h4>Change the architecture</h4>
<p><a href="http://www.infrae.com/products/tramline">Tramline</a> (<a href="http://plone.org/products/plonetramline/">PloneTramline</a>) uses Apache filters to intercept request and responses in Apache. In this way it can monitor all request and responses and insert a file on the way out, and take care of a file on the way in.</p>
<p>It would be cool if were possible to configure Apache in such a way that you can choose proxying based on the <span style="font-style: italic;">response</span> headers (from the first proxy you try). If those response headers match some criterion (such has there being an &quot;x-dowload-from-somewhere-else&quot; header), Apache would simply switch to another server it proxies. I do not think it can be done, but this page talks about a possible implementation:</p>
<p><a href="http://www.apachetutor.org/dev/smart-filter">Smart filter</a></p>
<p>&nbsp;</p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag"
             href="http://bloggar.se/om/forplanetplone">forplanetplone</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-07-12T10:47+00:00</dc:date>
        <dc:modified>2010-08-22 16:49:19</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>forplanetplone</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/07/11/spear---an-attempt-of-finding-experts-and-good-knowledge-artefacts">
        <rss:title>SPEAR - an attempt of finding experts and good knowledge artefacts</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/07/11/spear---an-attempt-of-finding-experts-and-good-knowledge-artefacts</rss:link>       
        



        <content:encoded><![CDATA[<p>One year ago&nbsp; or so I stumbled upon a guide on how you &quot;can be an expert on almost anything&quot;, by manually identifying what knowledge was of most utility in a field. One part of this guide was about using delicio.us as a help for identifying clusters of knowledge.</p>
<p>Apparently, there is some research into finding algorithms that can automatically sift through and rank both people and documents, at heart using some heuristics, such as users that recommend or tag something early are more likely to be experts than later followers.</p>
<blockquote>My co-worker Ching-man Au Yeung from University of Southampton and I presented the SPEAR algorithm in our joint paper &quot;Telling Experts from Spammers: Expertise Ranking in Folksonomies&quot; at the ACM SIGIR 2009 Conference</blockquote>
<p><br />
<br />
Läs mer: <a href="http://www.michael-noll.com/wiki/SPEAR_Algorithm">SPEAR Algorithm - Michael G. Noll</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-07-11T00:08+00:00</dc:date>
        <dc:modified>2010-07-11 00:13:07</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/06/29/lnk---discussion-on-wifi-interference-sources">
        <rss:title>Länk - Discussion on WiFi interference sources</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/06/29/lnk---discussion-on-wifi-interference-sources</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<blockquote>Almost every evening, between 8:30 and 10:00, my Wi-Fi just dies.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://ask.slashdot.org/story/10/06/28/2235236/Tracking-Down-Wi-Fi-Interference?art_pos=3">Slashdot Ask Slashdot Story | Tracking Down Wi-Fi Interference?</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-06-29T10:01+00:00</dc:date>
        <dc:modified>2010-06-29 10:01:56</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/06/15/linux-ocr-for-getting-text-from-a-screenshot">
        <rss:title>Linux ocr for getting text from a screenshot</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/06/15/linux-ocr-for-getting-text-from-a-screenshot</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<div class="even">Summary: For a 72dpi screenshot,&nbsp; <a href="http://jocr.sourceforge.net/">gocr</a> returned something intelligible, <a href="http://code.google.com/p/tesseract-ocr/">tesseract</a> returned nothing and <a href="http://www.gnu.org/software/ocrad/ocrad.html">ocrad</a> returned gibberish. <br />
<br />
Multiplying the pixel count by 4, and interpolating helped tesseract and ocrad to output text at all, but they were still not superior to gocr</div>
<p>&nbsp;</p>
<p>These OCR programs are probably not calibrated for making text out of pixel-perfect low-resolution screen shots, but from high-resolution somewhat noisy scans of different type faces on paper. Doing OCR from a screenshot ought to be quite easy: Each letter is pixel perfect and looks exactly the same, and there are no problems with slanting text or other distortions. In fact, writing your own OCR program is a distinct possibility for this.</p>
<p>I had via mail received a 72dpi screenshot that I wanted to get the text from. The top part looked like this:</p>
<p style="text-align: center;">&nbsp;<img width="0" height="0" alt="" src="./resolveUid/d406f3719458c3cf7b5353341945ecd0/image_preview" /><img width="0" height="0" src="./resolveUid/d406f3719458c3cf7b5353341945ecd0/image" alt="salsatext.png" /><img src="/images/salsatext.png" alt="" /></p>
<p style="text-align: center;">The top of the screenshot</p>
<p>Tesseract, which is a program that is highly recommended on the web, returned nothing when run on this screenshot. At first after reading <a href="http://groups.google.com/group/tesseract-ocr/browse_thread/thread/2434f09ed180c092/e5ed41969097c708?lnk=gst&amp;q=screenshot&amp;pli=1">this</a>, I thought this had to do with my tif possibly having a layer of transparency, but ensuring it was not there did not change anything.</p>
<p>According to <a href="http://groups.google.com/group/tesseract-ocr/browse_thread/thread/2434f09ed180c092/e5ed41969097c708?lnk=gst&amp;q=screenshot&amp;pli=1">the same discussion</a>, it seems like tesseract wants to have a high resolution image (see tests on that further down).</p>
<p>&nbsp;</p>
<p>Now the ocrad program returned this:</p>
<pre>Al Po_ Po_ _ Al _|_o _|_o _ M_|_o_hl_o<br />lollob_IOldo _|_o_do l_m_o<br />A_ _ol__lo _ _|_o_do l_m_o<br />__ _o _| Colmo_ _ ____ _ ___ T__o_<br />OIOo Ml__ __o C_o_o_o_ O_O____o<br />llo_o_do__ _ l_|_ __llO_ Co__ol__<br />_| Mo_|___o O_O____o A_oOo_<br />A_ Amo_ C_o_do Woblo_ lo_ Ml_odo_ _ Alb___o Bo__o_ _| Tl_o_ D<br />_o_ldo B___lol _ _|_hl_ _o_ b Bobb_ c___<br />lo_ Tomoll_o_ D_ OIOo O_O____o A_oOo_ _o__<br />A_ld _o_ Bo_____o<br />_o_ Wo_ Wo_ B___o _|__o C_bo_ Plo____</pre>
<p>&nbsp;...and so on.</p>
<p>Gocr returned this:</p>
<pre>y 9 999)        9       9     _J   ypp yyy    y<br />AI P a n P a n Y AI Vin o Vin o             m eIc o c hita<br />L oIIo brigid a                    Ric ard o L e m v o<br />A V aIeria                    Ric ard o L e m v o<br />Se Va EICaiman                 fru ko Y Sus Tesos<br />Oiga mire Vea                   Guayacan Orquesta<br />LIora n d ote                    L uis F eIi e G o n z aIe z<br />EImanisero                    Orquesta Aragȯn<br />A Amor Cuando HabIan Las miradas       AIberto Barros''EITitan D.<br />S o nid o B e stiaI                  Ric hie R a 6 B o b b C ru z<br />Los TamaIitos De OIga               Orquesta Aragȯn,Josė<br />A cid                       R a y B arretto<br />Ran Kan Kan                   Buena Vista Cuban PIayers<br />Undanta                     Bo Kas ers Orkester</pre>
<p>...and so on, which given the non-outputting competition, must be deemed fantastic. Still, it cannot deal with any characters extending below the baseline (p, g and y for example), and all <span style="font-style: italic;">l</span>s are interpreted as <span style="font-style: italic;">1</span>s.</p>
<p><span style="font-weight: bold;">Increasing the pixel density of the image</span></p>
<p>This turned out to be non trivial with the tools I had at hand. I finally got resampling working with the program pnmenlarge, part of the <a href="http://netpbm.sourceforge.net/">netpbm</a> suite of command line unixish image processing tools:</p>
<pre>cat salsatext.pnm | pnmenlarge 4 &gt; enlarged.pnm</pre>
<p>This quadrupled each pixel, and now tesseract magically started working!</p>
<p>&nbsp;(convert to to tif first)</p>
<pre>Fil Pen Pen 'ii Fil '&middot;.&middot;'inp '&middot;.&middot;'inp et`} i&middot;&middot;&middot;1el&curren;:p&middot;:hite<br />Lpllplznrigide Riterdp Lem&middot;-rp<br />.&middot;!&middot;.&middot;-,# '&middot;.&middot;'elerie et`} Riterdp Lem&middot;-rp<br />5e '&middot;.&middot;'e El Ceimen et`} Frulce 'ii 5us Tesps<br />Ciige i&middot;&middot;&middot;1ire '&middot;.&middot;'ee Gueyeten Ordueste<br />Llprendpte et`} Luis Felipe Gpneelee<br />El i&middot;&middot;&middot;1eniserp Ordueste ifiregdn<br />.&middot;!&middot;.&middot;-,# Famer, Cuendp Hel:&middot;len Les i&middot;&middot;&middot;1iredes et`} .&middot;!&middot;.ll:&curren;ertp Eerrps &quot;El Titen D. ..<br />Epnidp Eestiel et`} Richie Re&middot;-,# El Epl:&middot;l:&middot;3r Crue<br />Lps Temelitps De Cilge Ordueste ifiregdn, _|pse  <br />.&middot;!&middot;.&curren;:id Re&middot;-,# Eerrettp<br />Ren Ken Ken Euene '&middot;.&middot;'iste &middot;Zul:&middot;en F&lsquo;le3&middot;&middot;ers<br />Llndenteg et`} Ep iiespers Orltester</pre>
<p>Well, it does at least produce output, but the quality is at the point that you can barely guess which line it is trying to decode.</p>
<p>Let's try switching to Spanish as language:</p>
<pre>.ü.| Pan Pan &quot;x‛ .ü.| '&middot;.&middot;'ina '&middot;.&middot;'ina &mdash;l=*.`Š f'&middot;'1a|&middot;:&middot;:&middot;&middot;:|'&bull;i|:a<br />La||a|:&middot;ri&middot;;|i&middot;:|a F&lsquo;xi&middot;:ar&middot;:|a Lam'&shy;.&laquo;a<br />.ü.'-,&laquo; '&middot;.&middot;'a|aria &mdash;l=*.`Š F&lsquo;xi&middot;:ar&middot;:|a Lam'&shy;.&laquo;a<br />Sa '&middot;.&middot;'a El Caiman &mdash;l=*.`Š FrukJ:&middot; &quot;x‛ 5uS TaSaS<br />Diga Mira '&middot;.&middot;'aa Cuaşracan Dr&middot;:]uaS|:a<br />Llarandata &mdash;l=*.`Š LuiS Falipa Ganzalaz<br />El f'&middot;'1aniSara Dr&middot;:]uaS|:a Aragón<br />.ü.'-,&laquo; Fumar, Cuanda Ha|:&middot;|an LaS f'&middot;'1ira&middot;:|aS &mdash;l=*.`Š .ü.||:&middot;ar|:&middot;:&middot; EarraS &quot;EI Titan D. ..<br />Sanida EaS|:ia| &mdash;l=*.`Š F&lsquo;xi&middot;:|'&bull;ia Ra'-; Ex Ea|:&middot;|:&middot;ş&raquo; Cruz<br />LaS Tama|i|:aS Da Diga Dr&middot;:]uaS|:a Aragón, _|aSa  <br />.ü.&middot;:i&middot;:| Ra'-; Earratta<br />F&lsquo;xan Kan Kan Euana '&middot;.&middot;'iSta Cu|:&middot;an F&lsquo;|aş&middot;'arS<br />L|n&middot;:|an|:a&middot;; &mdash;l=*.`Š Ba kaS|:&middot;arS DrkaStar</pre>
<p>&nbsp;</p>
<p>That was not good. Maybe the enlargement needs to be <span style="font-style: italic;">smoother</span>?</p>
<p>pamstretch, also from the netpbm package, also increases pixel count but additionally smooths the output by interpolating pixels.</p>
<p>As many unixish tools, pamstretch takes data from stdin and outputs it to stdout:</p>
<pre>cat salsatext.pnm | pamstretch 4 &gt; stretched.pnm</pre>
<p>Tesseract needs tif format, handled here by Imagemagick's <span style="font-style: italic;">convert</span> command</p>
<pre>convert&nbsp; stretched.pnm&nbsp; stretched.tif</pre>
<p>run tesseract on it in this case with <span style="font-style: italic;">-l spa</span>, which means Spanish language</p>
<pre>tesseract stretched.tif str -l spa</pre>
<p>The result:</p>
<pre>AI Pan Pan 'l&quot; AI Vino Vino &mdash;.?&bull;.`$ Molcochita<br />Lollobrigida Ricardo Lomyo<br />Ay 'o&lsquo;aloria &mdash;.?&bull;.`$ Ricardo Lomyo<br />5o 'o&lsquo;a El Caiman &mdash;.?&bull;.`$ Fruko 'l&quot; Sus Tosos<br />Diga Miro 'o&lsquo;oa Guayacan ûrquosta<br />Llorandoto &mdash;.?&bull;.`$ Luis Folipo Gonzalo:<br />El Manisoro ûrquosta Aragon<br />Ay Amor, Cuando Hablan Las Miradas &mdash;.?&bull;.`$ Alborto Barros &quot;El Titan D. ..<br />5onido Eostial &mdash;.?&bull;.`$ Richio Ray En Bobby Cruz<br />Los Tamalitos Do Olga ûrquosta Aragon, José  <br />Acid Ray Earrotto<br />Ran Kan Kan Euona 'liista Cuban Playors<br />Undantag &mdash;.?&bull;.`$ Bo Iäaspors ûrkostor</pre>
<p>...better. Let's try English:</p>
<pre>AI Pan Pan 'i&quot; AI 'a'inu 'a'inu 3} Ms|cuchita<br />Lu||ubrigic|a Ricarclu Lsmyu<br />Ay 'a'a|sria 3} Ricarclu Lsmyu<br />5s 'a'a El Caiman 3} Fruku 'i&quot; 5us Tssus<br />Diga Mirs 'a'sa Guayacan Drqussta<br />L|uranduts 3} Luis Fs|ips Gun:a|s:<br />El Manissru Drqussta Aragun<br />Ay Amur, Cuanclu Hab|an Las Miradas 3} Albsrtu Earrus &quot;El Titan D. ..<br />5unic|u Esstia| 3} Richis Ray E: Eubby Cru:<br />Lus Tama|itus Ds D|ga Drqussta Aragun, juss  <br />Acid Ray Earrsttu<br />Ran Iian Iian Eusna 'a'ista Cuban Playsrs<br />Unclantag 3} Eu Iiaspsrs Drksstsr</pre>
<p>That is worse.</p>
<p>How does ocrad perform?</p>
<pre>Al Pan Pan Y Al Vino Vino __ Melcochila<br />Lollobrigida Ricardo Lemvo<br />Ay Valeria __ Ricardo Lemvo<br />Se Va El Caiman __ FrukD Y Sus Tesos<br />Oiga Mire Vea Guayacan Orquesla<br />Llorandole __ Luis Felipe Gonzalez<br />El Manisero Orquesla Arag�n<br />Ay Amor, Cuando Nablan Las Miradas __ Alberlo Barros &quot;El Tilan D,,,<br />Sonido Beslial __ Richie Ray bBobby Cruz<br />Los Tamalilos De Olga Orquesla Arag�n, los� , , ,<br />Acid Ray Barrello<br />Ran Kan Kan Buena Visla Cuban Players<br />Undanlag __ Bo Kaspers OrkPsler</pre>
<p>&nbsp;</p>
<p>A lot better than the line noise seen before. With enlarged but not interpolated:</p>
<pre>Al Pan Pan Y Al Vino Vino __ Melcochi_a<br />Lollobrigida Ricardo Lemvo<br />Ay Valeria __ Ricardo Lemvo<br />Se Va El Caiman __ FrukoYSusTesos<br />Oiga Mire Vea Cuayacan Orques_a<br />Llorando_e __ Luis Felipe Conzalez<br />El Manisero Orques_a Arag�n<br />Ay Amor, Cuando Hablan Las Miradas __ Alber_o Barros &quot;El Ti_an D,,,<br />Sonido Bes_ial __ Richie Ray b Bobby Cruz<br />Los Tamali_os De Olga Orques_a Arag�n, _os� ,,,<br />Acid Ray Barre__o<br />Ran Kan Kan Buena Vis_a Cuban Players</pre>
<p>That's worse.</p>
<p>So, tesseract and ocrad needs the input to be &quot;scannified&quot; by multiplying the pixel count and interpolating to get a bit of smoothness, but they still do not clearly beat gocr.</p>
<p>For scanned in documents the ranking seems reversed.</p>
<p>&nbsp;<a href="http://www.mscs.dal.ca/%7Eselinger/ocr-test/">Peter Selinger: Review of Linux OCR software</a>:</p>
<blockquote>Of course, it must be stressed that the test results reported here are derived from only two scanned pages. It is possible that for other inputs, the programs rank differently. However, based on the tests reported on this page, here is a summary of my conclusions: <br />
* Tesseract gives extremely good output at a reasonable speed. It is the clear overall winner of the test. The only caveat is that one absolutely must convert the input to bitonal. <br />
* Ocrad gives reasonable output at extremely high speed. It can be useful in applications where speed is more important than accuracy. <br />
* GOCR gives poor output at a slow speed.</blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-06-15T16:52+00:00</dc:date>
        <dc:modified>2010-06-15 16:55:50</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/06/14/lnk---finding-computers-on-a-network">
        <rss:title>Länk - Finding computers on a network</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/06/14/lnk---finding-computers-on-a-network</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<blockquote>Nmap is good for this - use the -O option for OS fingerprinting and -oX &quot;filename.xml&quot; for output as xml</blockquote>
<p><br />
<br />
Läs mer: <a href="http://stackoverflow.com/questions/105676/get-a-list-of-all-computers-on-a-network-w-o-dns">Get a list of all computers on a network w/o DNS - Stack Overflow</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-06-14T15:46+00:00</dc:date>
        <dc:modified>2010-06-14 15:46:47</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/06/06/papa-november-kalla-krigets-nummerstationers-bisarra-vrld">
        <rss:title>Papa November: Kalla krigets nummerstationers bisarra värld</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/06/06/papa-november-kalla-krigets-nummerstationers-bisarra-vrld</rss:link>       
        



        <content:encoded><![CDATA[<p>Det finns en hel värld av kortvågsstationer som sänder vad som verkar vara meningslös och repetitiv information, men som ibland är kodade meddelanden till hemliga agenter. Dessa stationer skickar ut något som skulle kunna beskrivas som antitetesen till spam: Vad gäller spampost så är det utformat för att verka intressant och viktigt, men innehåller egentligen banal och ointressant information. Syftet är att nå så många som möjligt med denna skräp-information.</p>
<p>Nummerstationerna sänder istället ut något som verkar banalt och ointressant, men som innehåller viktig information. Syftet är att nå några få agenter med vanliga kortvågsradioapparater.</p>
<p>Aktiviteten har sjunkit sena kalla krigets slut, men det finns tydligen många igång fortfarande.</p>
<p>Efter en snabb titt på sajten <a href="http://www.simonmason.karoo.net/page30.html">Number Stations</a> så kan man hitta sådana här guldkorn, som Papa November:</p>
<p><blockquote>I remember tuning into a station in 1971 and being almost hypnotised by the strange interval signal (it is a different one now). It consisted of a female voice repeating &quot;Papa November&quot; over and over continuously with a sort of snake charmer's flute playing in the background. This went on for five minutes, after which a woman would start sending messages in five figure groups.</blockquote>Läs mer: <a href="http://www.simonmason.karoo.net/page9.html">G15 Papa November</a></p>
<p>Eller den franska tyrolerstationen:</p>
<blockquote>Here is the full Tyrolean Music station transmission starting with a music box rendition of the &quot;Internationale&quot;, followed by several yodelling songs with the message for Helmut, Kruse and Frank buried in there somewher</blockquote>
<p>Hittade alltihopa via en Slashdotdiskussion:<br />
<br />
Läs mer: <a href="http://www.simonmason.karoo.net/page12.html">G1 Tyrol</a></p>
<p><blockquote>You never know, the Russian Woodpecker [wikipedia.org] signal turned out to be a nuclear launch detection radar in Chernobyl.</blockquote></p>
<p><br />
<br />
Läs mer: <a href="http://tech.slashdot.org/story/10/06/06/032235/Mysterious-Radio-Station-UVB-76-Goes-Offline?art_pos=9">Slashdot Technology Story | Mysterious Radio Station UVB-76 Goes Offline</a></p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag" href="http://bloggar.se/om/spionage">spionage</a>,
      
      
          <a rel="tag"
             href="http://bloggar.se/om/nummerstationer">nummerstationer</a>,
      
      
          <a rel="tag"
             href="http://bloggar.se/om/kalla%20kriget">kalla kriget</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-06-06T17:54+00:00</dc:date>
        <dc:modified>2010-06-06 17:54:06</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>spionage</dc:subject>
        
        
        <dc:subject>nummerstationer</dc:subject>
        
        
        <dc:subject>kalla kriget</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/29/link---regular-expression-http-purging-with-varnish">
        <rss:title>Link - Regular expression http purging with varnish</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/29/link---regular-expression-http-purging-with-varnish</rss:link>       
        



        <content:encoded><![CDATA[<p>Just a quick note to self about some documentation on how to purge the Varnish cache with regular expressions in the purge urls, untested by me at this point in time.</p>
<blockquote>. However, this way of implementing purge does not support wildcard purge. If you want to do that, use something like:  acl purge {         &quot;localhost&quot;;         &quot;192.0.2.14&quot;; }  sub vcl_recv {         if (req.request == &quot;PURGE&quot;) {                 if (!client.ip ~ purge) {                         error 405 &quot;Not allowed.&quot;;                 }                 purge(&quot;req.url ~ &quot; req.url);         }  where the URL is then a regular expression to purge. </blockquote>
<p><br />
<br />
Läs mer: <a href="http://varnish-cache.org/wiki/VCLExamplePurging">VCLExamplePurging &ndash; Varnish</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-05-29T15:11+00:00</dc:date>
        <dc:modified>2010-05-29 15:11:36</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/21/pypi-eggs-notebook">
        <rss:title>Pypi eggs notebook</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/21/pypi-eggs-notebook</rss:link>       
        



        <content:encoded><![CDATA[<p>This is just a post for me to keep jotting down info on eggs on pypi that for some reason or other seem to be of interest.</p>
<p>&nbsp;</p>
<p>Not an egg but a way to store references on the object instesd of in a catalog:</p>
<p>(untested by me)</p>
<p><a href="http://svn.plone.org/svn/collective/SimpleReferenceField/">SimpleReferenceField</a></p>
<hr style="width: 100%; height: 2px;" />
<p>Best way to set up a mirror?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<blockquote>This article describes how to set up an own mirror of the Python Package index (aka Cheese-Shop)</blockquote>
<p><br />
<br />
Läs mer: <a href="http://bluedynamics.com/articles/jens/setup-z3c.pypimirror">Setting up a PyPI mirror (with z3c.pypimirror) &mdash; BlueDynamics Alliance</a></p>
<hr style="width: 100%; height: 2px;" />
<p>&nbsp;</p>
<p>&nbsp;<br />
Making sharing roles in plone via xml:</p>
<p>&nbsp;</p>
<blockquote>Specifically, it provides a GenericSetup handler  to export/import the available roles. The file should be called  sharing.xml, and have the following format:</blockquote>
<p><br />
<br />
Läs mer: <a href="http://pypi.python.org/pypi/collective.sharingroles/1.0b4">Python Package Index : collective.sharingroles 1.0b4</a></p>
<hr style="width: 100%; height: 2px;" />
<p>&nbsp;</p>
<p>Take a look at how the authentication is done:</p>
<p>&nbsp;</p>
<blockquote>The http proxy server will authenicate user credentials based on backend Plone user sources and provide a extra session on top of Plone's session (cookie).</blockquote>
<p>Läs mer: <a href="http://pypi.python.org/pypi/leocornus.django.ploneproxy/0.1dev-r420">Python Package Index : leocornus.django.ploneproxy 0.1dev-r420</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<hr style="width: 100%; height: 2px;" />
<p>An alternative to Getpaid? Should install this and take a look.</p>
<p>&nbsp;</p>
<blockquote>PCommerce (Plone commerce) provides a simple shop system which supports</blockquote>
<p>Läs mer: <a href="http://pypi.python.org/pypi/pcommerce.core/0.4">Python Package Index : pcommerce.core 0.4</a></p>
<hr style="width: 100%; height: 2px;" />
<p>&nbsp;</p>
<blockquote>drainers is an abstraction around subprocess.Popen to read and control process output event-wise. It also allows you to abort running processes either gracefully or forcefully without having to directly interact with the processes or threads themself.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://pypi.python.org/pypi/drainers/0.0.3">Python Package Index : drainers 0.0.3</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<hr style="width: 100%; height: 2px;" />
<p>&nbsp;</p>
<blockquote>This is practical for caching purposes: it is the ideal place to determine and insert caching headers into the response.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://pypi.python.org/pypi/plone.postpublicationhook/1.1">Python Package Index : plone.postpublicationhook 1.1</a></p>
<p>&nbsp;</p>
<hr style="width: 100%; height: 2px;" />
<p>&quot;parses an HTML file for external resources (JavaScript, CSS and image files) and assembles them into a stand-alone document&quot;</p>
<p>Läs mer: <a href="http://pypi.python.org/pypi/spackager/0.5.0">Python Package Index : spackager 0.5.0</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<hr style="width: 100%; height: 2px;" />
<p>This can speed up repetitive web entry tasks, such as testing a web function through the browser over and over again:</p>
<p>&nbsp;</p>
<blockquote>Web testing framework intended for complete automation of user interface testing, with strong test debugging and recording capabilities.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://pypi.python.org/pypi/windmill/1.3">Python Package Index : windmill 1.3</a></p>
<p>&nbsp;</p>
<hr style="width: 100%; height: 2px;" />
<blockquote>Update ZODB class references for moved or renamed classes</blockquote>
<p><br />
<br />
Läs mer: <a href="http://pypi.python.org/pypi/zodbupdate/0.4">Python Package Index : zodbupdate 0.4</a></p>
<p>&nbsp;</p>
<hr style="width: 100%; height: 2px;" />
<p>&nbsp;</p>
<blockquote>uwosh.timeslot offers a simple way to allow users of a Plone site to register for events (for example: training sessions).</blockquote>
<p><br />
<br />
Läs mer: <a href="http://pypi.python.org/pypi/uwosh.timeslot/">Python Package Index : uwosh.timeslot 1.4.7</a></p>
<p>&nbsp;</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-05-21T10:41+00:00</dc:date>
        <dc:modified>2010-08-19 16:36:46</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/21/lnk---the-economist-on-dna-synthesizing">
        <rss:title>Länk - The Economist on DNA synthesizing</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/21/lnk---the-economist-on-dna-synthesizing</rss:link>       
        



        <content:encoded><![CDATA[<p>&nbsp;</p>
<blockquote>No one now knows how easy it would be to turbo-charge an existing human pathogen, or take one that infects another type of animal and assist its passage over the species barrier. We will soon find out, though.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://www.economist.com/opinion/displayStory.cfm?story_id=16163154&amp;source=hptextfeature">Synthetic biology: And man made life | The Economist</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-05-21T00:10+00:00</dc:date>
        <dc:modified>2010-05-21 00:10:51</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/20/an-explanation-for-the-down-to-cents-dip-on-the-us-stock-markets">
        <rss:title>An explanation for the down-to-cents dip on the US stock markets?</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/20/an-explanation-for-the-down-to-cents-dip-on-the-us-stock-markets</rss:link>       
        



        <content:encoded><![CDATA[<p>The strange dip down to cents of some shares on the US stock markets could have a simple explanation. There might have been automated systems that had been programmed to sell some shares if they went below a certain market price. If these systems have many shares, they may sell a lof of them at the same time.</p>
<p>Now if the <span style="font-style: italic;">buying</span> if these shares is also automated, there may have been an area of prices that the automated selling and buying systems weren't configured for. For example, say share X is normally priced at $100. For some reason it is pushed to $80. A this point one system with a heck of a lot of shares sell, or several systems that all have roughly the same sell point, sell.</p>
<p>Now other automated systems snap up these cheap shares, but there are not enough of them so the price goes down a bit further, to say $75. At this price point the systems that just <span style="font-style: italic;">bought</span> the shares <span style="font-style: italic;">sell again</span>. Now there should be systems picking up at that price, but let's say that those (bottom feeding) systems may have been configured to trade not in one share but in a low market in general, preferring to snap up a combination of shares. So they do not buy one low share.</p>
<p>So basically the shares that were sold a pennies, were sold at pennies because they were deemed stable. Noone could imagine prices going so low for them, without a general market crash.</p>
<p>If this explanation or one similar is correct , we have encountered something counter intuitive:</p>
<p>That the shares went down to pennies <span style="font-style: italic;">because</span> the companies are solid as rock.</p>
<blockquote>A stop order triggers when a price goes under a specific price, and sells as a market order: It takes the best offer available at the time.</blockquote>
<p><br />
<br />
Läs mer: <a href="http://yro.slashdot.org/comments.pl?sid=1658158&amp;cid=32271912">Slashdot Comments | New &quot;Circuit Breaker&quot; Imposed To Stop Market Crash</a></p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag" href="http://bloggar.se/om/economy">economy</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-05-20T10:15+00:00</dc:date>
        <dc:modified>2010-05-20 10:21:03</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>economy</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/16/analys-sverige-och-singapore-bland-de-f-lnder-som-kan-klara-skuldkrisen">
        <rss:title>Analys: Sverige och Singapore bland de få länder som kan klara skuldkrisen</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/16/analys-sverige-och-singapore-bland-de-f-lnder-som-kan-klara-skuldkrisen</rss:link>       
        



        <content:encoded><![CDATA[<p>...problemet är att det inte är så bra att vara ett litet land när de stora ekonomierna&nbsp; (USA, Euroland, förmodligen även Kina) går i väggen.</p>
<p>&quot;Den som är satt i skuld är icke fri&quot; hette Göran Perssons självbiografi. Nu visar det sig att de flesta länder i väst har skuldsatt sig så till den milda grad att det kommer att bli mycket svårt för dem att bli skuldfria: De besparingar som faktiskt krävs framför kan vara omöjliga att genomföra.</p>
<p>Johan Norberg skriver om skuldsättningen i Svenskan:</p>
<blockquote>När bolag är bankrutta kan de räddas av staterna. När det gör staterna konkursfärdiga kan de räddas av EU. Men vem kan rädda EU? </blockquote>
<p><a href="http://www.svd.se/opinion/ledarsidan/en-bro-som-slutar-over-avgrunden_4722975.svd">En bro som slutar över avgrunden | Ledarsidan | SvD</a></p>
<p>&nbsp;</p>
<p>Bank for International Settlement har gjort ett <a href="http://www.bis.org/publ/work300.pdf?noframes=1">working paper</a> och Bloggen Hotel Ivory har gjort en <a href="http://hotelivory.wordpress.com/2010/05/15/well-western-world-that-was-a-nice-500-year-streak/">analys</a> och visar ett diagram ur rapporten, på hur det går för olika länder med:</p>
<ul>
    <li>Inga åtstramningar</li>
    <li>Åtstramningar</li>
    <li>Mycket kraftiga åtstramningar (blå streckad linje)</li>
</ul>
<p><img src="/images/bis.jpg" alt="" /></p>
<p>Observera att många länder inte kommer igenom skuldkrisen ens med de kraftigaste åtstramningarna (blå streckad linje).</p>
<p>Kanske bör dessa länder ställa in betalningarna? Ryssland gjorde det, likaså Mexiko för inte så länge sedan.</p>
<p>&nbsp;</p>
<blockquote>The only developed countries I see, that have pretty good fiscal discipline and will only be affected indirectly by the problems of the other countries are:      <br />
* Norway (thanks to the North Sea oil and gas,  Norway&rsquo;s balance sheet is rock solid &ndash; don&rsquo;t think they have any net debt)     <br />
* Sweden     <br />
* Denmark (The currency is pegged to the euro though)     <br />
* Switzerland     <br />
* Singapore     <br />
* Canada     <br />
* Australia     <br />
* New Zealand     <br />
* and maybe South Korea , Taiwan and Chile</blockquote>
<p><br />
<br />
Läs mer: <a href="http://hotelivory.wordpress.com/2010/05/15/well-western-world-that-was-a-nice-500-year-streak/">Well, Western World, that was a nice 500 year streak &laquo; Hotel Ivory</a></p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag" href="http://bloggar.se/om/politik">politik</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-05-16T12:01+00:00</dc:date>
        <dc:modified>2010-05-16 12:07:14</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>politik</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/09/euromedlemsskap-och-statsskuld-verkar-korrelerat-en-del">
        <rss:title>Euromedlemsskap och statsskuld verkar korrelerat en del</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/09/euromedlemsskap-och-statsskuld-verkar-korrelerat-en-del</rss:link>       
        



        <content:encoded><![CDATA[<p>Holländska sajten nrc.nl visar en flash där man kan se följande stapediagram. Ljusare stapel är utanför euroland:<br />
<br />
<img src="/images/skuld.png" alt="" /></p>
<p>&nbsp;</p>
<p>Det verkar som att de mörkare staplarna samlats i den övre delen av diagrammet.<br />
<blockquote>Print this article </blockquote><br />
<br />
Läs mer: <a href="http://www.nrc.nl/international/article2160480.ece">nrc.nl - International - Economic crisis in European Union</a></p> 
  
    
  
  
<span>
                  <i><a href="http://intressant.se/intressant">Taggar p&aring; intressant.se:</a>

      
          <a rel="tag"
             href="http://bloggar.se/om/statsskuld">statsskuld</a>,
      </i>
      <br><br>
   </span>
  

]]></content:encoded>



        
        <dc:date>2010-05-09T11:18+00:00</dc:date>
        <dc:modified>2010-05-09 11:18:02</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
        
        <dc:subject>statsskuld</dc:subject>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/06/extract-cut-a-clip-with-mencoder-and-ffmpeg">
        <rss:title>Extract (cut) a clip with mencoder and ffmpeg</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/06/extract-cut-a-clip-with-mencoder-and-ffmpeg</rss:link>       
        



        <content:encoded><![CDATA[<p>ffmpeg -sameq -ss 00:02:00 -t 8 -i long.mov short.mov</p>
<p>ffmpeg -y -i input.avi -ss 30 -t 10 -vcodec copy -acodec copy output.avi</p>
<p>mencoder -ss 1284 -endpos 102 movie.avi -oac copy -ovc copy -o movie-clip.av</p>
<p>&nbsp;</p>
<p>mencoder also accepts hh:mm:ss format</p>
<blockquote>mencoder -ss 1284 -endpos 102 movie.avi -oac copy -ovc copy -o movie-clip.avi</blockquote>
<p><br />
<br />
Läs mer: <a href="http://judsonsnotes.com/notes/index.php?option=com_content&amp;view=article&amp;id=237:compressing-video&amp;catid=37:tech-notes&amp;Itemid=59">handy mencoder/ffmpeg commands</a></p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-05-06T09:40+00:00</dc:date>
        <dc:modified>2010-05-06 09:47:51</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
    
    <rss:item rdf:about="http://jorgenmodin.net/index_html/archive/2010/05/05/how-to-get-the-total-size-of-a-directory-in-linux">
        <rss:title>How to get the total size of a directory in Linux</rss:title>
        <rss:link>http://jorgenmodin.net/index_html/archive/2010/05/05/how-to-get-the-total-size-of-a-directory-in-linux</rss:link>       
        



        <content:encoded><![CDATA[<p>du -sh</p>
<p>-h means print it human readable (with MB, kB)</p>
<p>-s mean summarize, i.e. don't print the size of sub directories</p> 
  
    
  
  

  

]]></content:encoded>



        
        <dc:date>2010-05-05T15:05+00:00</dc:date>
        <dc:modified>2010-05-05 15:05:20</dc:modified>
        
        <dc:creator>jorgen</dc:creator>
        
    </rss:item>
    
    
    
</rdf:RDF>

