mecker. mecker. mecker. http://blog.posativ.org/ de-de Fri, 03 Feb 2012 09:34:00 GMT http://blog.posativ.org/rss/ acrylamid 0.3.0-dev Linkschleuder #16 http://blog.posativ.org/2012/linkschleuder-16/ <ul> <li><a href="https://code.google.com/p/zen-coding/">Zen Coding</a> – <em>a new way of writing <span class="caps">HTML</span> and <span class="caps">CSS</span> code</em>, <a href="https://bitbucket.org/wbond/sublime-2-zencoding">Sublime Text 2&nbsp;Plugin</a></li> <li><a href="https://github.com/apenwarr/sshuttle">sshuttle</a> – transparenter Proxy trifft <span class="caps">VPN</span>, ohne viel basteln und ärgern. Einfach&nbsp;<span class="caps">SSH</span>.</li> <li><a href="http://ziproxy.sourceforge.net/">Ziproxy</a> – ein zippender Proxy, der allerdings nicht alle externen Quellen in eine Datei packt. Dann wäre es für&#8217;s Handy praktisch&nbsp;gewesen.</li> <li><a href="http://thechangelog.com/post/16464262046/gitfinger-finger-github-users-from-the-command-line">gitfinger</a> – Stalking auf&nbsp;GitHub.</li> <li><a href="http://python-for-humans.heroku.com/">python for humans</a> – ein sehr witziger Rant über Python und was die Community besser machen&nbsp;kann.</li> <li><a href="http://blog.ezyang.com/2011/11/how-to-read-haskell/">How to read Haskell like&nbsp;Python</a></li> <li><a href="http://crate.io/">crate.io</a> – ein PyPi-Mirror, der quelloffen ist und mehr Features bietet als <a href="http://pypi.python.org/pypi">PyPi</a>.</li> <li><a href="http://www.merproject.org/">mer</a> – eine offene, optimiert für Mobilgeräte, Distribution á la <a href="https://www.meego.com/">MeeGo</a> mit Fokus auf Qt und&nbsp;<span class="caps">HTML5</span>.</li> <li><a href="http://plasma-active.org/">plasma active</a> – ein <span class="caps">KDE</span> Projekt für Tablets und Mobilgeräte, der doch schon etwas besser als Android aussieht. Ein weiterer Beweis, dass <span class="caps">KDE</span> verdammt modular&nbsp;ist.</li> <li><a href="http://goaccess.prosoftcorp.com/">goaccess</a> – ein (Apache) Common Logfile Reader. Mit ncurses (!) und für große Bildschirme optimiert! <a href="http://blog.posativ.org/img/2012/goaccess.png">Beispiel</a>?</li> <li><a href="http://shop.oreilly.com/product/0636920022473.do"><span class="caps">HTML5</span> for Publishers</a> – kostenlos in <span class="caps">PDF</span>, epub und Mobi (auch für <a href="http://www.schockwellenreiter.de/blog/2012/01/23/kostenlose-ebooks-uber-ebooks/">Kindle</a>) nach&nbsp;Registrierung</li> </ul> Fri, 03 Feb 2012 09:34:00 GMT tag:blog.posativ.org,2012-02-03:/2012/linkschleuder-16 Linkschleuder #15 http://blog.posativ.org/2012/linkschleuder-15/ <p>Diesmal etwas *hust* sehr *hust*&nbsp;Mac-lastig.</p> <ul> <li><a href="http://www.aramzamzam.net/nativa/">Nativa</a> – <em>der</em> Client für <a href="http://libtorrent.rakshasa.no/">rtorrent</a>&nbsp;schlechthin.</li> <li><a href="http://chipmunkninja.com/Tunneler">TunnelerX</a> – und der Vorgänger <a href="http://www.chipmunkninja.com/Tunneler-0.9---An-SSH-1g@">Tunneler</a>, der ein Icon in die Leiste setzt, um ad-hoc einen <span class="caps">SSH</span>-Tunnel&nbsp;aufzubauen.</li> <li><a href="http://d.hatena.ne.jp/os0x/20100612/1276330696">NinjaKit</a> – GreaseMonkey für&nbsp;Safari.</li> <li><a href="http://mplayerx.org/">MplayerX</a> – eine Art <span class="caps">VLC</span> nur in hübsch (und&nbsp;funktionaler).</li> <li><a href="http://www.postbox-inc.com/">Postbox</a> – ein kommerzieller Mozilla Thunderbird Fork, der einfach nur etwas mehr Mac-<span class="caps">GUI</span> hat. Nicht&nbsp;empfehlenswert.</li> <li><a href="http://www.lynapp.com/">Lyn</a> – möchte eine leichtgewichtige iPhoto-Alternative&nbsp;sein.</li> <li><a href="http://homepage.mac.com/nsekine/SYW/software/english/miniusage/index.html">MiniUsage</a> – zeigt diverse (unzählig viele) Statusinformationen leicht zugänglich per Dropdown-Menü in der Leiste&nbsp;an.</li> <li><a href="http://www.macdentro.com/MacDentro/Home.html">MacDentro</a> – <span class="caps">OS</span> X Wartungstool, das die <span class="caps">UNIX</span>-Dienste und -Interna aufräumt (cronjobs laufen, etc. pp.). Gibt&#8217;s auch in hübsch und kommerziell: <a href="http://www.maintain.se/cocktail">Cocktail.app</a>.</li> <li><a href="http://www.enqueueapp.com/">Enqueue</a> – eine leichtgewichtige iTunes-Alternative. Klare Empfehlung von&nbsp;mir!</li> <li><a href="http://www.bean-osx.com/Bean.html">Bean</a> – eine Textverarbeitung für <span class="caps">OS</span> X. Hilfreich, wenn man auf Pages/Open|LibreOffice verzichten&nbsp;möchte.</li> <li><a href="http://www.sourcetreeapp.com/">SourceTree</a> – kostenloser Client für Mercurial und Git mit Integration von <a href="https://github.com/">github.com</a> und <a href="https://bitbucket.org/">bitbucket.org</a>. Erfordert nach einem Monat eine kostenlose&nbsp;Registrierung.</li> <li><a href="http://www.inkcode.net/qute">Qute</a> – ein ziemlich hübscher Editor für <a href="http://daringfireball.net/projects/markdown/">Markdown</a>; gibt&#8217;s auch für&nbsp;<span class="caps">PC</span>.</li> <li><a href="http://tm2tips.tumblr.com/">TextMate 2 Tips</a> – ein Blog über das aufkommende TextMate 2. Unabhängig davon gibt es auch ein <a href="http://www.matewiki.com/index.php?title=Main_Page">MateWiki</a>.</li> </ul> Thu, 02 Feb 2012 20:56:00 GMT tag:blog.posativ.org,2012-02-02:/2012/linkschleuder-15 polipo – a caching web proxy http://blog.posativ.org/2012/polipo-a-caching-web-proxy/ <p>In den zwei vergangenen Wochen habe ich viel mit Proxy-Techniken rumgespielt. Anfangs noch ein <a href="https://de.wikipedia.org/wiki/SOCKS">SOCKSv5</a> über <span class="caps">SSH</span> getunnelt, über direkte <span class="caps">HTTP</span> Authentifizierung mit <a href="http://www.pps.jussieu.fr/~jch/software/polipo/">polipo</a> und <a href="http://privoxy.org/">Privoxy</a> im Chaining auf einem 128 MiB <span class="caps">RAM</span> <a href="http://edis.ch/">Host in der Schweiz</a>. Leider entsprach das nicht direkt meinem Wunsch, den Verkehr bis zum anonymisierenden Proxy im Klartext zu schicken – und langsam(er) war es auch. Für zwei Tage hatte ich auch mein SheevaPlug als caching web proxy missbraucht, nur machte das in der Verbindung mit Privoxy nicht allzu viel Spaß: über 3 Sekunden für ein Aufruf von <code>spiegel.de</code>.</p> <p>Das primäre Problem mit <span class="caps">SSH</span> war das Abbrechen der Verbindung in jedem Fall nach dem Ruhezustand (wenn nicht schon nach 5 Minuten nichts tun, was zumindest mit <code>KeepAlive</code> gehalten werden kann, eine <span class="caps">DSL</span>-Zwangstrennung überlebt das nicht). Zu spät habe ich von <a href="http://www.harding.motd.ca/autossh/">autossh</a> erfahren und habe stattdessen mit der Äpp <a href="http://www.chipmunkninja.com/Tunneler-0.9---An-SSH-1g@">Tunneler</a> bzw. dessen Nachfolger <a href="http://chipmunkninja.com/Tunneler">TunnelerX</a> (free as in free beer) gespielt, wo letzteres zwar die Ports richtig hinbekommt, nur ersteres aber die SOCKSv5-Verbindung – reconnecten nach dem Schlafen kann es auch&nbsp;nicht.</p> <p>Mit <span class="caps">DSL</span> ~4500 macht ein Setup mit einem caching web proxy in der Schweiz wenig Sinn, viel cooler wäre ja ein lokaler (oder im <span class="caps">LAN</span>, sofern man im heimischen W-<span class="caps">LAN</span> ist) Proxy der das Pseudo-Scheiß-Caching vom Firefox und Konsorten ausgleicht. Hier ein Tipp unter <span class="caps">OS</span> X: <a href="https://github.com/dustinrue/ControlPlane">ControlPlane</a>, open-source, ist ein Tool, dass verschiedene (Netzwerk-) Einstellungen je nach Abstand des Mondes oder Wifi <span class="caps">SSID</span>/<span class="caps">BSSID</span> aktivieren kann. So kann für das Uni-Netz der heimische Proxy-Server deaktiviert werden und sobald wieder das &#8216;traute Netz da ist&nbsp;aktivieren.</p> <h3>polipo</h3> <p>Warum <a href="http://www.pps.jussieu.fr/~jch/software/polipo/">polipo</a>? Primär, weil es für Einzelbenutzer oder wenige Clients konzipiert ist. Wer die hunderttausend Optionen im <a href="http://www.squid-cache.org/">squid</a> kennt, kann sicherlich auch den nutzen. Polipo gibt&#8217;s im <a href="https://github.com/mxcl/homebrew/">homebrew</a>-Repository, bringt allerdings kein <code>launchd</code>-Skript mit (gibt&#8217;s unten). Da ich meinem MacBook Pro letztens ein <span class="caps">RAM</span>-Upgrade gegeben habe, darf polipo maximal ein halbes Gigabyte <span class="caps">RAM</span> nutzen – und das empfehle ich jedem. Denn polipo ist etwas buggy. Es hat zwar einen Maintainer, aber die Commits halten sich in Grenzen. Wenn ich über <del>vkontakte.ru</del> <a href="http://vk.com/">vk.com</a> einige Songs im <span class="caps">HTML5</span> Player streame, dann gibt es nach neun oder zehn&nbsp;ein</p> <blockquote> <p>Short on chunk memory &#8211; attempting to punch holes in the middle of&nbsp;objects.</p> </blockquote> <p>und das bedeutet nichts gutes, denn es wird mitten im Streaming der Content gelöscht und die Verbindung abgebrochen, da es an <span class="caps">RAM</span> mangelt. YouTube betrifft es ebenso. Aber nichtsdestotrotz sollte man polipo nutzen, denn neben 40 <span class="caps">MB</span>/s Downstream (Firefox&#8217; <span class="caps">XML</span> Parser ist wirklich langsam ;-) bringt polipo auch nützliche Privacy-Optionen&nbsp;mit:</p> <div class="highlight"><pre><span class="c1"># censoredHeaders = from, accept-language</span> <span class="n">censorReferer</span> <span class="o">=</span> <span class="n">maybe</span> <span class="n">censoredHeaders</span> <span class="o">=</span> <span class="nb">accept</span><span class="o">-</span><span class="n">language</span><span class="p">,</span> <span class="n">from</span> </pre></div> <p>und kann auch direkt einen eigenen <span class="caps">DNS</span>-Server wie <a href="http://thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</a> nutzen (meine Hoffnung war ja, dass polipo&#8217;s <code>proxyOffline = true</code> offline &#8220;Browsen&#8221; bringt, aber die <span class="caps">DNS</span>-Queries werden dennoch ein <em>Fehler: Server nicht gefunden</em>&nbsp;bringen).</p> <h3>~/Library/LaunchAgents/org.posativ.polipo.plist</h3> <div class="highlight"><pre><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;<span class="caps">UTF</span>-8&quot;?&gt;</span> <span class="cp">&lt;!<span class="caps">DOCTYPE</span> plist <span class="caps">PUBLIC</span> &quot;-//Apple//<span class="caps">DTD</span> <span class="caps">PLIST</span> 1.0//<span class="caps">EN</span>&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span> <span class="nt">&lt;plist</span> <span class="na">version=</span><span class="s">&quot;1.0&quot;</span><span class="nt">&gt;</span> <span class="nt">&lt;dict&gt;</span> <span class="nt">&lt;key&gt;</span>Label<span class="nt">&lt;/key&gt;</span> <span class="nt">&lt;string&gt;</span>org.posativ.polipo<span class="nt">&lt;/string&gt;</span> <span class="nt">&lt;key&gt;</span>ProgramArguments<span class="nt">&lt;/key&gt;</span> <span class="nt">&lt;array&gt;</span> <span class="nt">&lt;string&gt;</span>/usr/local/bin/polipo<span class="nt">&lt;/string&gt;</span> <span class="nt">&lt;string&gt;</span>-c<span class="nt">&lt;/string&gt;</span> <span class="nt">&lt;string&gt;</span>/usr/local/etc/polipo/config<span class="nt">&lt;/string&gt;</span> <span class="nt">&lt;/array&gt;</span> <span class="nt">&lt;key&gt;</span>RunAtLoad<span class="nt">&lt;/key&gt;</span> <span class="nt">&lt;true/&gt;</span> <span class="nt">&lt;/dict&gt;</span> <span class="nt">&lt;/plist&gt;</span> </pre></div> <p>Diese plist generiert mir <a href="http://www.peterborgapps.com/lingon/">Lingon</a> für <code>/usr/local/bin/polipo -c /usr/local/etc/polipo/config</code> und sollte in den genannten Ort kopiert werden, sodass polipo beim Anmelden gestartet wird. Mit <code>launchctl load ~/Library/LaunchAgents/org.posativ.polipo.plist</code> wird der Daemon&nbsp;gestartet.</p> <h3>Adblocking mit&nbsp;adzapper</h3> <p>Privoxy ist für gewöhnlich das Tool der Wahl wenn es um Werbeblocken auf Proxy-Seite geht, aber da es viel <span class="caps">CPU</span>-Leistung verbrät, habe ich mich nach Alternativen umgeschaut. Primär Alternativen, die mit den <a href="https://easylist.adblockplus.org/de/">Easylisten von Adblock</a> kompatibel sind. <a href="http://www.pps.jussieu.fr/~jch/software/polipo/">polipo</a> hat zwar auch ein regex-kompatibles <code>polipo.forbidden</code>-file, aber die verfügbaren <a href="http://rightfootin.blogspot.com/2009/11/ad-blocking-with-polipo.html">adblock2polipo.(py|rb)</a> produzieren inkompatible reguläre Ausdrücke. Ob der Fehler bei der Liste oder polipo liegt, weiß ich nicht. Allerdings bringt polipo ein <em>redirector</em> Feature mit. Das zwischen ein Perl-Programm wie z.B. <a href="http://adzapper.sourceforge.net/">adzapper</a> <span class="caps">HTTP</span> (ohne S) und filtert anhand einiger regulären&nbsp;Ausdrücke:</p> <div class="highlight"><pre>wget http://adzapper.sourceforge.net/scripts/squid_redirect -O /usr/local/bin/adzapper <span class="nb">echo</span> <span class="s2">&quot;redirector = /usr/local/bin/adzapper&quot;</span> &gt;&gt; /usr/local/etc/polipo/config launchctl unload ~/Library/LaunchAgents/org.posativ.polipo.plist launchctl load ~/Library/LaunchAgents/org.posativ.polipo.plist </pre></div> <p>Alternativ ginge auch eine <code>forward /</code>-Direktive zu beispielsweise <a href="http://bfilter.sourceforge.net/index.php">bfilter</a> mit aktivem&nbsp;Adblock-Support.</p> Sun, 29 Jan 2012 19:21:00 GMT tag:blog.posativ.org,2012-01-29:/2012/polipo-a-caching-web-proxy Linkschleuder #14 http://blog.posativ.org/2012/linkschleuder-14/ <ul> <li><a href="http://www.keylength.com/en/compare/">Cryptographic Key Length Recommendation</a> – im Seminar aufgeschnappt; empfohlene Schlüssellängen einiger&nbsp;Behörden.</li> <li><a href="https://bitbucket.org/aykevl93/weaveclient-chromium-continued/overview">weaveclient-chromium-continued</a> – nicht getestet, aber wäre cool, wenn das&nbsp;funktioniert.</li> <li><a href="http://projects.puppetlabs.com/projects/puppet">puppet</a> – automatisiertes Einrichten eines *nix-Systems mit einer Ruby-<span class="caps">DSL</span>.<br /> „Puppet, an automated administrative engine for your *nix systems, performs administrative tasks (such as adding users, installing packages, and updating server configurations) based on a centralized&nbsp;specification.“</li> <li><a href="http://manpages.ubuntu.com/manpages/dapper/de/man8/start-stop-daemon.8.html"><code>start-stop-daemon</code></a> – ein Debian/Ubuntu-Tool, um das Schreiben von eigenen Dämonen deutlich zu erleichten (<a href="https://gist.github.com/6eec44bde70b8405ce73">Beispiel</a>).</li> <li><a href="https://github.com/visionmedia/watch">Watch</a> – A tiny C program used to periodically execute a command. (via <a href="http://thechangelog.com/post/14041353400/watch-simple-periodical-execution-utility-in-c">The Changelog</a>)</li> <li><a href="http://dcrypt.it/">dcrypt.it</a> – <span class="caps">DLC</span> Entschlüsselung mit ein paar mehr Input-Methoden als <a href="http://posativ.org/decrypt/">mein Angebot</a>.</li> <li><a href="http://www.pps.jussieu.fr/~jch/software/polipo/">Polipo</a> – a small and fast caching web proxy. Sowas wie <a href="http://www.squid-cache.org/">squid</a>, aber eher für Single-User/Home-Betrieb gedacht. Werd&#8217; ich mir mal näher&nbsp;anschauen.</li> <li><a href="http://ettercap.sourceforge.net/index.php">ettercap</a> – eine Suite für Man-in-the-Middle Angriffe im&nbsp;<span class="caps">LAN</span>.</li> </ul> Fri, 20 Jan 2012 09:43:00 GMT tag:blog.posativ.org,2012-01-20:/2012/linkschleuder-14 WhatsApp Privacy Policy: Verschlüsselung im Transportmedium. http://blog.posativ.org/2012/whatsapp-privacy-policy-verschluesselung-im-transportmedium/ <p><a href="http://www.whatsapp.com/">WhatsApp</a> kennt sicherlich jeder Smartphone-Nutzer. Hat über <a href="http://blog.whatsapp.com/index.php/2012/01/1-million-is-so-2011/">zwei Millionen</a> aktive Nutzer zu jeder Stunde und ist für jede mobile Plattform verfügbar, leider nur nicht für den Desktop. Das lässt sich ja vielleicht ändern, dachte ich mir und schmiss <a href="https://wireshark.org/">WireShark</a>&nbsp;an:</p> <div class="highlight"><pre>WA............Android-2.7.431.........~.......Z*.....8..........~._......Xbm9uY2 U9IjE4ODAwNzM1MDU3OS IscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzc w==.........cmVhbG09InMud2hhdHNhcHAubmV0IixyZXNwb25zZT0yZTY4M2U0YjlhNTA2ODdhMmN mODA3NDQ1MTMxODM3Yyxub25jZT0iMTg4MDA3MzUwNTc5IixkaWdlc3QtdXJpP SJ4bXBwL3Mud2hhdH NhcHAubmV0Iixjbm9uY2U9IjFtOWRzdGM2NzY1ZHQiLHFvcD1hdXRoLHVzZXJuYW1lPSI0OTE2MzYzMT A2MTMiLG5jPTAwMDAwMDAx.#.......Rj#.13050253130. 1620558113....t8..+......t..a.. Ich....HC..:....{.M....Ua$....HC..2.:..........,..H8...491896312624.C../..../... 404......J......H8.C..2.........s&lt;C..APA91bHEmfHjKPpBwu3MJLCOtK4hFMwe0ZWHdXimFDr1 pxIa18rznmbZ6FLB-7pFMVwX0GJiVPcUWCaAvnwTR0O_LVfEENMr--GtpzSy2FbWtq1IKSOG9_Z0N6Kz LlIit9JaKaui47VY....t......491521283131..!..HC..3.:....491521283131.....{.L.)..H8 ...491721883139.C..3......{.L...16990....t.....4914682512635..&quot;..HC..4.:... 4914682512635.....{.L.+..H8..4915152523662.C..4......{.L...128494....t......t8.. .491896312624. </pre></div> <p>Sieht ziemlich unleserlich aus. Die ersten zwei Bytes beginnen wohl das interne <span class="caps">XMPP</span>-Protokoll, WhatsApp-Version und dann&#8230; äh ja. Dann sind da meine Telefonnummer, Name, Ziel-Nummer (+ deren Zweitnummer und Geburtsdatum) der&nbsp;Gesprächspartnerin.</p> <ul> <li>Version: <em>Android-2.7.431</em></li> <li>meine Nummer: <em>491896312624</em></li> <li>Zielnummer: <em>4914682512635</em></li> <li>Zweit-Nummer: <em>4915152523662</em></li> <li>Geburtsdatum: <em>16990</em></li> </ul> <p>Wohlgemerkt ist das ein Dump, wenn ich die App einfach öffne. Wenn Text kommt, dann ist da etwas weniger (Nachricht: Ich doch nicht&nbsp;xD).</p> <div class="highlight"><pre>.F..]....4914682512635...C..316008602-1......O..........Ich doch nicht xD.@..]8 ...4914682512635.C..316008602-1........O....C..316008602-1... </pre></div> <p>Ich war etwas erstaunt. WhatsApp verschlüsselt &#8211; aber nur das eigene Protokoll, was mit den Nutzerdaten passiert, ist ihnen egal. Ich kann mir keine Erklärung dafür geben. Rechenleistung geht ja eh schon drauf, indem das Protokoll verschlüsselt wird, warum also nicht gleich noch den Rest verschlüsseln? Hauptsache keiner entwickelt einen Desktop-Clienten außerhalb ihres&nbsp;Einflussbereiches!11</p> <p>Im öffentlichen Hotspot sind die Daten für jedermann lesbar, für verschlüsseltes <span class="caps">WLAN</span> kann der Beitreber <code>ngrep</code>-en und dass <span class="caps">GMS</span>/<span class="caps">UMTS</span> nicht mehr sicher ist, weiß man spätestens nach dem <a href="http://www.spiegel.de/netzwelt/netzpolitik/0,1518,776465,00.html">Skandal in Dresden</a>. Das Problem ist auch <a href="http://rickey-g.blogspot.com/2011/05/whatsapp-connection-details.html">nicht</a> <a href="http://shakal.blog.de/2011/03/22/whatsapp-risiken-10872342/">unbekannt</a>, nur hat es noch keiner genug reverse&nbsp;engineered.</p> <p><em><span class="caps">PS</span>: alle personenbezogenen Informationen sind&nbsp;anonymisiert.</em></p> Sun, 15 Jan 2012 22:43:00 GMT tag:blog.posativ.org,2012-01-15:/2012/whatsapp-privacy-policy-verschluesselung-im-transportmedium Linkschleuder #13 http://blog.posativ.org/2012/linkschleuder-13/ <ul> <li><a href="http://tapirgo.com/">Tapir</a> – eine Alternative zu <a href="https://www.google.com/cse/">Google Custom Search</a>, sprich eine externe Suche für statische Seiten mit&nbsp;Atom-Feed-Input.</li> <li><a href="http://readthedocs.org/">Read the Docs</a> – ein <a href="http://sphinx.pocoo.org/">Sphinx</a>-Dokumentationen-Hoster, der auch auf eigene Domains serviert. <a href="http://readthedocs.org/docs/read-the-docs/en/latest/getting_started.html">Hier geht&#8217;s&nbsp;los</a>.</li> <li><a href="http://packages.python.org/an_example_pypi_project/sphinx.html">Einführung in Sphinx</a> – nicht offiziell, aber sehr hilfreich für den ersten&nbsp;Schritt.</li> <li><a href="https://github.com/kennethreitz/envoy">Envoy: Python Subprocesses for Humans.</a> – und das hat Python bitter&nbsp;nötig!</li> <li><a href="http://excess.org/article/2011/12/unfortunate-python/">Unfortunate Python</a> – auch Python ist nicht perfekt in seiner&nbsp;Implementierung.</li> <li><a href="http://nadiana.com/python-pickle-insecure">Why Python Pickle is insecure</a> and <a href="http://blog.nelhage.com/2011/03/exploiting-pickle/">Exploiting&nbsp;Pickle</a></li> <li><a href="http://rsslounge.aditu.de/">rsslounge</a> – web-basierter <span class="caps">RSS</span> Aggregator mit <span class="caps">PHP</span> und MySQL. Ganz nett, aber noch etwas bugbelastet. Drei meiner 40 Feeds (<span class="caps">OPML</span> Import) konnte er nicht laden und ist nun nicht mehr nutzbar. <a href="https://code.google.com/p/rsslounge/">Google&nbsp;Code</a></li> <li><a href="http://www.adminer.org/">Adminer</a> – Datenbank-Verwaltung (MySQL, SQLite, etc.) in einer einzigen <span class="caps">PHP</span>-Datei. Angenehm im Vergleich zu <code>mysql-client</code>.</li> <li><a href="https://github.com/satyr/coco">Coco</a> – is a CoffeeScript dialect that aims to be more radical and&nbsp;practical.</li> </ul> Thu, 12 Jan 2012 12:27:00 GMT tag:blog.posativ.org,2012-01-12:/2012/linkschleuder-13 Linkschleuder #12 http://blog.posativ.org/2012/linkschleuder-12/ <p>Es wird leider auch nicht&nbsp;weniger:</p> <ul> <li><a href="http://maps3d.svc.nokia.com/webgl/">Nokias Google Maps Fork</a> – ohne Flash, sondern in WebGL. Sehr performant und echt beeindruckende&nbsp;Qualität.</li> <li><a href="http://airdroid.com/">Wireless Android Management</a> – ein sehr hübsches Webinterface auf Knopfdruck. So lassen sich bsw. <span class="caps">SMS</span> im Browser&nbsp;schreiben.</li> <li><a href="http://torcloudservers.com/">Tor bridges in the Amazon cloud</a> – vorgefertigte Tor-Images für Amazons <span class="caps">EC2</span>, <del>ab 3$/Monat für gut 15 <span class="caps">GB</span> Traffic</del> ersten 15 <span class="caps">GB</span> Traffic sind kostenfrei, bei maximal 40 GiB kann das bis zu 3$/Monat&nbsp;kosten.</li> <li><a href="http://johnmacfarlane.net/pandoc/">Pandoc</a> – a universal document&nbsp;converter.</li> <li><a href="http://www.dehats.com/drupal/?q=node/58">Lita</a> – SQLite Administration Tool (mittels Adobe Air) ohne Error-Handling. Aber&nbsp;hübsch.</li> <li><a href="https://github.com/tthibo/SQL-Tutorial"><span class="caps">SQL</span> Tutorial using SQLite</a> und <a href="http://www.sqlite.org/syntaxdiagrams.html">Syntax-Diagramme</a> haben mir bei der Entwicklung von <a href="https://github.com/posativ/weave-minimal/">weave-minimal</a> sehr&nbsp;geholfen!</li> <li><a href="http://www.sublimetext.com/">Sublime Text 2</a> – auch wenn ich&#8217;s schon erwähnt hatte. Der Texteditor ist derzeit das nonplusultra. Es macht so viel Spaß damit zu&nbsp;arbeiten.</li> <li><a href="https://github.com/vesln/issues">GitHub Issue</a> – ein <span class="caps">CLI</span> Programm für GitHub&#8217;s Issues (wer hätte das gedacht) in&nbsp;Node.js.</li> </ul> Mon, 09 Jan 2012 13:56:00 GMT tag:blog.posativ.org,2012-01-09:/2012/linkschleuder-12 nginx http://blog.posativ.org/2012/nginx/ <p>Seit heute rennt das Blog unter <a href="http://nginx.org/">nginx</a>. Der Grund ist einfach: <a href="http://www.lighttpd.net/">lighttpd</a> ist behindert zu konfigurieren, hat keine aktuellen/coolen Features und ist zudem noch langsamer als nginx. Ich hoffte seit knapp einem Jahr, dass sich in der Entwicklung was tut, aber außer einer Beta-Version mit integriertem <a href="http://redmine.lighttpd.net/wiki/1/AbsoLUAtion">lua</a>-Support (um überhaupt ein <a href="http://redmine.lighttpd.net/wiki/1/Docs:Configuration#Conditional-Configuration">if-else</a> statt if-else-if konfigurieren zu können) und zahlreichen <em><a href="http://blog.posativ.org/2011/lighttpd-git-grack-http-417/">Won&#8217;t</a> <a href="http://redmine.lighttpd.net/issues/1532">fixes</a></em> für 1.4.x hat sich leider rein gar nichts&nbsp;getan.</p> <p>Warum <a href="http://nginx.org/">nginx</a>? Ja, das weiß ich auch nicht, aber die <a href="https://en.wikipedia.org/wiki/Comparison_of_lightweight_web_servers">Alternativen</a> zu non-Apache mit geringem Memory-Footprint, vielen Features und opensource sehen schlecht aus. <a href="https://en.wikipedia.org/wiki/Thttpd">thttpd</a> hat kein <code>mod_proxy</code>, <a href="http://www.cherokee-project.com/">Cherokee</a> bringt gleich ein Web-<span class="caps">GUI</span> zur Administration mit und <a href="http://www.litespeedtech.com/overview.html">LiteSpeed Web Server</a> ist nicht quell-offen. Also, was sind die Features von&nbsp;nginx?</p> <ul> <li>schnell und&nbsp;leichtgewichtig</li> <li>logische Konfiguration (was ich schon für behinderte Logik-Krämpfe mit lighttpd&nbsp;hatte&#8230;)</li> <li>mod_proxy, mod_fastcgi, expires, <a href="https://en.wikipedia.org/wiki/PCRE"><span class="caps">PCRE</span></a></li> </ul> <h3>Moving from lighttpd to&nbsp;nginx</h3> <p>Die Umstellung von lighttpd nach nginx ist nicht ganz ohne. Prinzipiell ist alles anders und nginx hat keine Unterstützung für <span class="caps">CGI</span> und rewrite-Regeln auf Query-Parametern. Außerdem spawnt nginx nicht automatisch einen <span class="caps">PHP</span>-Prozess für FastCGI und erlaubt keine <span class="caps">POST</span>-Requests auf statische Seiten &#8211; aber das lässt sich&nbsp;umgehen.</p> <h4>1. Präambel -&nbsp;/etc/nginx/nginx.conf</h4> <div class="highlight"><pre><span class="k">user</span> <span class="s">www-data</span><span class="p">;</span> <span class="k">worker_processes</span> <span class="mi">2</span><span class="p">;</span> <span class="k">error_log</span> <span class="s">/var/log/nginx/error.log</span><span class="p">;</span> <span class="k">pid</span> <span class="s">/var/run/nginx.pid</span><span class="p">;</span> <span class="k">events</span> <span class="p">{</span> <span class="kn">worker_connections</span> <span class="mi">2048</span><span class="p">;</span> <span class="p">}</span> <span class="k">http</span> <span class="p">{</span> <span class="kn">include</span> <span class="s">/etc/nginx/mime.types</span><span class="p">;</span> <span class="c1">#access_log /var/log/nginx/access.log;</span> <span class="c1"># cbc-mode ciphers might be vulnerable (<span class="caps">BEAST</span>)</span> <span class="kn">ssl_ciphers</span> <span class="s"><span class="caps">RC4</span>:<span class="caps">HIGH</span>:!aNULL:!<span class="caps">MD5</span></span><span class="p">;</span> <span class="kn">ssl_prefer_server_ciphers</span> <span class="no">on</span><span class="p">;</span> <span class="kn">sendfile</span> <span class="no">on</span><span class="p">;</span> <span class="kn">keepalive_timeout</span> <span class="mi">65</span><span class="p">;</span> <span class="kn">tcp_nodelay</span> <span class="no">on</span><span class="p">;</span> <span class="kn">gzip</span> <span class="no">on</span><span class="p">;</span> <span class="kn">gzip_disable</span> <span class="s">&quot;<span class="caps">MSIE</span></span> <span class="s">[1-6]\.(?!.*<span class="caps">SV1</span>)&quot;</span><span class="p">;</span> <span class="kn">index</span> <span class="s">index.php</span> <span class="s">index.htm</span> <span class="s">index.html</span><span class="p">;</span> <span class="kn">include</span> <span class="s">/etc/nginx/conf.d/*.conf</span><span class="p">;</span> </pre></div> <h4>2. vhosts -&nbsp;/etc/nginx/conf.d/posativ.org.conf</h4> <div class="highlight"><pre><span class="k">server</span> <span class="p">{</span> <span class="kn">listen</span> <span class="mi">80</span><span class="p">;</span> <span class="kn">server_name</span> <span class="s">posativ.org</span><span class="p">;</span> <span class="kn">root</span> <span class="s">/home/www/posativ.org</span><span class="p">;</span> <span class="kn">location</span> <span class="s">^~</span> <span class="s">/blog</span> <span class="p">{</span> <span class="kn">include</span> <span class="s">conf.d/pyblosxom.redirect</span><span class="p">;</span> <span class="p">}</span> <span class="kn">location</span> <span class="p">~</span> <span class="sr">^/(redmine|git)/</span> <span class="p">{</span> <span class="kn">rewrite</span> <span class="s">^/(.*)</span>$ <span class="s">https://posativ.org/</span><span class="nv">$1</span> <span class="s">redirect</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> </pre></div> <p>Selbsterklärend. Nicht mehr und nicht weniger will ich konfigurieren. Statt im lighty irgendwelche obskuren Redirects auf Sockets != 443 zu kreieren, gibt es hier ganz klar das Konzept „ich lausche auf diesen Ports mit folgenden&nbsp;Einstellungen”.</p> <h4>3.&nbsp;<span class="caps">SSL</span></h4> <p>In der Präambel lässt sich zudem noch die verwendete Cipher wählen und so ein Angriff mittels <span class="caps">BEAST</span>&nbsp;verhindern.</p> <div class="highlight"><pre><span class="k">server</span> <span class="p">{</span> <span class="kn">listen</span> <span class="mi">443</span><span class="p">;</span> <span class="kn">server_name</span> <span class="s">posativ.org</span><span class="p">;</span> <span class="kn">root</span> <span class="s">/home/www/posativ.org</span><span class="p">;</span> <span class="kn">ssl</span> <span class="no">on</span><span class="p">;</span> <span class="kn">ssl_certificate</span> <span class="s">certs/posativ.org.crt</span><span class="p">;</span> <span class="kn">ssl_certificate_key</span> <span class="s">certs/posativ.org.key</span><span class="p">;</span> <span class="kn">location</span> <span class="s">^~</span> <span class="s">/redmine</span> <span class="p">{</span> <span class="kn">proxy_pass</span> <span class="s">http://127.0.0.1:3001</span><span class="p">;</span> <span class="p">}</span> <span class="kn">location</span> <span class="s">^~</span> <span class="s">/git</span> <span class="p">{</span> <span class="kn">proxy_pass</span> <span class="s">http://127.0.0.1:7654</span><span class="p">;</span> <span class="p">}</span> <span class="c1"># ...</span> <span class="p">}</span> </pre></div> <h4>5. rewrite&nbsp;rules</h4> <p>Das war zunächst das größte Problem. Ich pflege Rückwärtskompatibilität zwischen meinen (inzwischen vier) Blogs mit unterschiedlicher Software und Permalinks. Einfach sind <span class="caps">URI</span> -&gt; <span class="caps">URI</span>&nbsp;rewrites-Rules:</p> <div class="highlight"><pre> <span class="c1"># lighttpd</span> <span class="k">url.redirect</span> <span class="o">+=</span> <span class="p">(</span><span class="s2">&quot;/blog/?$&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;https://blog.posativ.org/&quot;</span><span class="p">,</span> <span class="k">...</span><span class="p">)</span> </pre></div> &nbsp; <div class="highlight"><pre> <span class="c1"># nginx</span> <span class="k">rewrite</span> <span class="s">&quot;^/blog/?</span><span class="nv">$&quot;</span> <span class="s">&quot;http://blog.posativ.org/&quot;</span> <span class="s">permanent</span><span class="p">;</span> <span class="k">...</span> </pre></div> <p>Mit <code>perl -pe "s/\"(.+)\" =&gt; \"(.+)\",/rewrite \"\^\1\" \"\2\" permanent;/g"</code> hatte ich das grob von lighttpd auf nginx übertragen. Problem: nginx kann kein rewrite auf die Request-Parameter (zurecht aber auch). Das sollte nicht nur mich mit meinen anfänglichen <code>/?p=1dcdd17</code> stören, auch diverse <a href="http://frank.geekheim.de/">andere Blogs</a> haben dieses <span class="caps">URL</span>-Schema. Warum das nicht direkt von den rewrite-Regeln unterstützt wird, ist klar: die Query-Parameterreihenfolge ist variabel. Aber es ist nginx und da geht alles (wenn auch mit erhöhtem&nbsp;Rechenaufwand):</p> <div class="highlight"><pre><span class="k">location</span> <span class="p">=</span> <span class="s">/</span> <span class="p">{</span> <span class="c1"># das `?` am Ende leitet die <span class="caps">GET</span>-Request Paramter nicht weiter</span> <span class="kn">if</span> <span class="s">(</span><span class="nv">$arg_p</span> <span class="p">=</span> <span class="s">1dcdd17)</span> <span class="p">{</span> <span class="kn">rewrite</span> <span class="s">^</span> <span class="s">http://blog.posativ.org/2011/weitere-html-abstraktion-in-python/?</span> <span class="s">permanent</span><span class="p">;</span> <span class="c1"># ...</span> <span class="p">}</span> <span class="p">}</span> </pre></div> <h4>6. weitere&nbsp;Eigenheiten</h4> <ul> <li> <p>nginx erlaubt kein <span class="caps">POST</span>/<span class="caps">PUT</span> auf statisches <span class="caps">HTML</span>, denn sonst wäre es ja <span class="caps">CGI</span> (was aber auch nicht geht, dazu gleich mehr). Aber auch dafür gibt es die merkwürdigsten Workarounds (<span class="caps">POST</span> auf statisches <span class="caps">HTML</span> wirft&nbsp;405):</p> <div class="highlight"><pre><span class="k">error_page</span> <span class="mi">405</span> <span class="p">=</span> <span class="s">@405</span><span class="p">;</span> <span class="k">location</span> <span class="p">=</span> <span class="s">@405</span> <span class="p">{</span> <span class="kn">root</span> <span class="s">/home/www/blog.posativ.org</span><span class="p">;</span> <span class="p">}</span> </pre></div> </li> <li> <p><span class="caps">CGI</span> wird auch nicht unterstützt, denn es ist langsam und erfordert viel Verwaltungs-Logik. Das macht bsw. lighttpd speicherhungriger als Apache (!), wenn Google mal ein <span class="caps">CGI</span>-hosted Mercurial-Webinterface crawlt. Statt <span class="caps">CGI</span> sollte FastCGI oder Proxy-Magie genutzt werden. Für <span class="caps">PHP</span> spawnt nginx keinen Prozess, der muss vorher auch angelegt werden. Für Debian gibt es dafür ein <a href="http://wiki.nginx.org/PHPFcgiExample#Spawning_a_FastCGI_Process"><code>init.d</code>-Skript</a> und nach einem <code>invoke.rc-d start php-fcgi</code> lauscht ein <span class="caps">PHP</span>-Prozess auf Port&nbsp;9000.</p> </li> </ul> <h3>Rückblick</h3> <p><a href="http://www.lighttpd.net/">lighttpd</a> war zwei Jahre mein treuer Begleiter im Kampf gegen Apaches behinderte <span class="caps">XML</span>-like Konfiguration mit kleinem Speicherverbrauch, aber die Konfiguration ist inzwischen mehr als willkürlich. Schon eine Umordnung von Statements, die logisch gleichwertig sind, kann das Problem lösen oder erst&nbsp;erzeugen.</p> <p>Die nginx Konfiguration ist weitaus intuitiver, besitzt mehr Funktionialität und trotzdem ist der Server schlanker, <a href="http://wiki.nginx.org/Modules">modularer</a> und leistungsfähiger als&nbsp;lighttpd.</p> <p><span class="caps">KTHXBYE</span>&nbsp;lighttpd.</p> Sat, 07 Jan 2012 21:03:00 GMT tag:blog.posativ.org,2012-01-07:/2012/nginx Linkschleuder #11 http://blog.posativ.org/2012/linkschleuder-11/ <p>Diesmal stark apfel-lastig; zwei zu <a href="https://twitter.com/">Twitter</a>, Rest zu <span class="caps">OS</span>&nbsp;X.</p> <ul> <li><a href="https://github.com/jgoerzen/twidge/wiki">twidge</a> – full commandline twitter client (in Haskell&nbsp;geschrieben)</li> <li><a href="http://onilabs.github.com/fork-a-twitter-client/">Fork A Twitter Client</a> – Twitter komplett im Browser (wie twitter.com), jedoch in&nbsp;schlank.</li> <li><a href="https://github.com/kennethreitz/osx-gcc-installer"><span class="caps">OSX</span> <span class="caps">GCC</span> Installer</a> – <span class="caps">GCC</span>-related Tools in XCode. Erspart nächstes mal vielleicht den 4,7 GiB&nbsp;Download.</li> <li><a href="https://github.com/pdherbemont/Glasses/"><span class="caps">VLC</span> <span class="caps">GUI</span> rewrite</a> – für <span class="caps">OS</span> X, ist leider eingeschlafen, weil es sehr wenige <span class="caps">OS</span> X Entwickler&nbsp;gibt.</li> <li><a href="http://khiltd.com/software/consultants_canary">Consultant’s Canary</a> – Diff zwischen <span class="caps">OS</span> X Erst-Installation und dem Müll, der jetzt drauf ist. Äußerst&nbsp;praktisch.</li> <li><a href="http://blog.hep-cat.de/?p=5478">Vom <span class="caps">OS</span> X zum SheevaPlug</a> – inklusive Kommentar von einem Projekt mit quelloffenen&nbsp;Treibern.</li> <li><a href="http://peippo.eu/musorg/">Musorg</a> – <span class="caps">OS</span> X <span class="caps">MP3</span> Tag Editor (GPLv2), nicht wirklich fertig, dafür immerhin was <span class="caps">OS</span>&nbsp;X-natives.</li> <li><a href="http://www.celmaro.com/tubbler/">YouTube Player Client for <span class="caps">OS</span> X</a> – ressourcensparend YouTube gucken, noch&nbsp;kostenlos.</li> <li><a href="http://flavio.tordini.org/musique">Musique</a> – ehemals MiniTunes, verfügbar für Windows, Linux und Mac <span class="caps">OS</span> X, <span class="caps">GPL</span> und ohne <a href="http://cdn.last.fm/blog/posts/april12/poster_boy.jpg">AudioScrobbler-Support</a>!</li> <li><a href="http://www.pixiapps.com/ecoute/">Ecoute 3</a> – Standalone player based on your iTunes&nbsp;library.</li> </ul> Mon, 02 Jan 2012 18:11:00 GMT tag:blog.posativ.org,2012-01-02:/2012/linkschleuder-11 Profiling Memory and CPU Time of Python Programs on OS X http://blog.posativ.org/2011/profiling-memory-and-cpu-time-of-python-programs-on-os-x/ <p>As a result of my last performance improvements to <a href="https://github.com/posativ/acrylamid">acrylamid</a> I was not able anymore to measure the memory used via <em>Activity Monitor</em>. I can measure cpu time in many different ways using <code>time</code> or python&#8217;s neat <code>-m cProfile -s cumulative</code> argument in front of my real program call, but I don&#8217;t know any way to measure memory of fast ending&nbsp;applications.</p> <h3>Memory&nbsp;Profiling</h3> <p>The first fact I found is that python has no capabilities of profiling and <span class="caps">BSD</span>&#8217;s version of <code>time</code> had no memory statistics support (seems, linux version can do this). But there&#8217;s an App&#8230; erm tool for that: <a href="http://valgrind.org/">valgrind</a>. Using it with <span class="caps">OS</span> X&#8217; default python produces a lot of output and will slow down code execution, therefore you have to call valgrind with a specific supression file using <a href="http://valgrind.org/docs/manual/ms-manual.html">Massif: a heap profiler</a> (or re-compile&nbsp;--without-pymalloc):</p> <div class="highlight"><pre><span class="gp">$</span>&gt; valgrind --tool<span class="o">=</span>massif --suppressions<span class="o">=</span>Misc/valgrind-python.supp <span class="se">\</span> <span class="go"> python ../acrylamid/bin/acrylamid gen</span> <span class="gp">$</span>&gt; ms_print massif.out.1928 &gt; out.txt </pre></div> <p>The latter produces a heap profile written to out.txt. <span class="caps">KDE</span>/Linux seems to have a visualizer, <a href="http://kcachegrind.sourceforge.net/html/Home.htmls">KCacheGrind</a>, but <span class="caps">OS</span> X don&#8217;t. But there might be an application which claims to run on <span class="caps">OS</span> X as well: <a href="http://kde-apps.org/content/show.php?content=122409">Massif Visualizer</a>.</p> <div class="highlight"><pre>-------------------------------------------------------------------------------- Command: python ../acrylamid/bin/acrylamid gen Massif arguments: (none) ms_print arguments: massif.out.1928 -------------------------------------------------------------------------------- MB 38.53^ : | # : | @#:: | @ @ ::@@@@#:: ::@: | @: @ : :::@@@@#::::::@::::::@: | @@:::::@:::@::@@::@::@@::::::@@@@#::::::@::::::@: | ::::::@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | @ :: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | @:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | @:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | @:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | @:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :@:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :@:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :@:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :@:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :@:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: | :@:::@:@::: :: :@:::::@ :: ::@:::@::@ : @::@ :: :::@@@@#::::::@::::::@: 0 +-----------------------------------------------------------------------&gt;Gi 0 40.63 Number of snapshots: 86 Detailed snapshots: [2, 6, 8, 16, 23, 29, 33, 36, 39, 42, 48, 49, 50, 51, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 (peak), 73, 83] </pre></div> <h3><span class="caps">CPU</span>&nbsp;Time</h3> <p>To complete this overview article, here are the parameters to measure <span class="caps">CPU</span> usage from an earlier version of acrylamid (doing&nbsp;nothing):</p> <div class="highlight"><pre>$&gt; acrylamid --version 0.1.11-dev $&gt; python -m cProfile -s cumulative ../bin/acrylamid gen | less 392661 function calls (382947 primitive calls) in 0.684 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.685 0.685 acrylamid:7(&lt;module&gt;) 1 0.000 0.000 0.648 0.648 __init__.py:44(__init__) 1 0.001 0.001 0.647 0.647 __init__.py:177(run) 1 0.000 0.000 0.559 0.559 __init__.py:135(initialize) 1 0.000 0.000 0.514 0.514 __init__.py:35(initialize) 8 0.000 0.000 0.277 0.035 __init__.py:19(index_filters) 1 0.000 0.000 0.270 0.270 hyphenation.py:191(__init__) 1 0.000 0.000 0.270 0.270 hyphenation.py:150(build) 1 0.010 0.010 0.269 0.269 hyphenation.py:34(__init__) 14263 0.130 0.000 0.257 0.000 hyphenation.py:45(_insert_pattern) 25/23 0.004 0.000 0.244 0.011 {__import__} 28848 0.031 0.000 0.201 0.000 re.py:228(_compile) 1 0.003 0.003 0.191 0.191 rst.py:7(&lt;module&gt;) 248 0.000 0.000 0.161 0.001 re.py:188(compile) 174 0.001 0.000 0.161 0.001 sre_compile.py:495(compile) 5 0.001 0.000 0.156 0.031 __init__.py:10(&lt;module&gt;) 1 0.002 0.002 0.096 0.096 __init__.py:68(&lt;module&gt;) 1 0.003 0.003 0.090 0.090 states.py:101(&lt;module&gt;) 174 0.000 0.000 0.085 0.000 sre_compile.py:480(_code) </pre></div> <p>With some optimization acrylamid 0.2.1 is now about 4 times faster (685ms versus 140ms), just by lazy evaluate hyphenation patterns and docutils import. You can also pass ncalls, tottime, percall and so on instead of cumtime, see python&#8217;s <a href="http://docs.python.org/library/profile.html#pstats.Stats.sort_stats">profile</a> for all sort&nbsp;keys.</p> <div class="highlight"><pre>$&gt; acrylamid --version 0.2.1 $&gt; python -m cProfile -s cumulative ../bin/acrylamid gen | less 81785 function calls (78036 primitive calls) in 0.140 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.141 0.141 acrylamid:7(&lt;module&gt;) 1 0.000 0.000 0.103 0.103 __init__.py:45(__init__) 1 0.000 0.000 0.101 0.101 __init__.py:197(run) 1 0.000 0.000 0.098 0.098 __init__.py:143(initialize) 1 0.000 0.000 0.051 0.051 __init__.py:36(initialize) 17 0.003 0.000 0.051 0.003 {__import__} 1 0.000 0.000 0.046 0.046 __init__.py:38(initialize) 5 0.000 0.000 0.045 0.009 __init__.py:22(index_views) 5 0.000 0.000 0.043 0.009 environment.py:763(from_string) 5 0.000 0.000 0.043 0.009 environment.py:453(compile) 1 0.003 0.003 0.038 0.038 __init__.py:20(&lt;module&gt;) 73 0.000 0.000 0.035 0.000 re.py:188(compile) 73 0.001 0.000 0.035 0.000 re.py:228(_compile) 67 0.000 0.000 0.034 0.001 sre_compile.py:495(compile) 1 0.001 0.001 0.023 0.023 __init__.py:28(&lt;module&gt;) 5 0.000 0.000 0.023 0.005 environment.py:396(_parse) 1 0.000 0.000 0.022 0.022 md.py:7(&lt;module&gt;) 1 0.001 0.001 0.021 0.021 __init__.py:31(&lt;module&gt;) 1 0.002 0.002 0.021 0.021 hyphenation.py:4(&lt;module&gt;) </pre></div> Wed, 28 Dec 2011 21:10:00 GMT tag:blog.posativ.org,2011-12-28:/2011/profiling-memory-and-cpu-time-of-python-programs-on-os-x TextMate http://blog.posativ.org/2011/textmate/ <p>Bevor ich so langsam zum <a href="http://www.sublimetext.com/2">Sublime Text</a> Editor wechseln werde (es sei denn, <a href="http://net.tutsplus.com/tutorials/tools-and-tips/essential-textmate-shortcuts-tips-and-techniques/">Version 2</a> bringt es), noch einmal kurz meine Lieblings-Bundles, sprich Macros, Themes und&nbsp;Snippets.</p> <ul> <li><a href="http://net.tutsplus.com/tutorials/tools-and-tips/essential-textmate-shortcuts-tips-and-techniques/">Essential TextMate Shortcuts, Tips and&nbsp;Techniques</a></li> <li><a href="http://ethanschoonover.com/solarized">Solarized (light) Theme</a> – the one and only one. Gibt nichts&nbsp;besseres.</li> </ul> <h3>Bundles</h3> <ul> <li><a href="https://github.com/foxostro/x86-assembly-textmate-bundle/tree/master/x86%20Assembly.tmbundle/">x86 Assembler</a> – Intel86 Syntax&nbsp;Highlighting!1</li> <li><a href="https://github.com/textmate/lilypond.tmbundle">lilypond</a></li> <li><a href="http://www.governatori.net/TextMate/index.html">LaTeXExtension</a> – mit $O[Ausrufezeichen]$ -&gt; $\Omega$ und&nbsp;so</li> <li><a href="https://github.com/textmate/restructuredtext.tmbundle">reStructuredText</a></li> <li><a href="https://github.com/seaofclouds/sass-textmate-bundle"><span class="caps">SASS</span></a></li> <li><a href="https://github.com/mitsuhiko/jinja2/blob/master/ext/JinjaTemplates.tmbundle.tar.gz">Jinja2&nbsp;Templating</a></li> <li><a href="https://github.com/ppierre/python-pep8-tmbundle">Python <span class="caps">PEP</span>&nbsp;8</a></li> <li><a href="https://github.com/dcramer/python-tools-tmbundle">Python Tools</a> – ⌘+S mit Syntax&nbsp;Validierung</li> </ul> <p>Installiert wird das alles nach <code>~/Library/Application Support/TextMate/</code>.</p> Sun, 18 Dec 2011 17:02:00 GMT tag:blog.posativ.org,2011-12-18:/2011/textmate weave-minimal – a Firefox Sync full-server fork http://blog.posativ.org/2011/weave-minimal-a-firefox-sync-full-server-fork/ <p>The first time I tried to get a custom Firefox Sync server running, I used <a href="https://hg.mozilla.org/services/server-full/"><code>server-full</code></a> and even though I know python (the server is written in python), the configuration was highly difficult. There&#8217;s no click <span class="amp">&amp;</span> install. You have to choose between Redis, MySQL, PostgreSQL and Sqlite3. For most people, sqlite3 is quite fine. Sqlite and sync-server config files have summed up almost 80 LoC. And you still don&#8217;t know how to authenticate unless you have already a <span class="caps">LDAP</span> server&nbsp;running.</p> <p>There are some alternatives: <a href="https://github.com/tolumak/ffpyweave">ffpyweave</a>, <a href="https://github.com/jedie/django-sync-server/">django sync server</a> and formerly <a href="http://ymartin59.free.fr/wordpress/index.php/2011/03/05/my-own-firefox-sync-weave-server/">weave-minimal</a> too, written in <span class="caps">PHP</span> but not supported anymore. But I&#8217;ve forked the official <a href="https://hg.mozilla.org/services/server-full/"><code>server-full</code></a> (well I completely rewrote) to a more easier installation without multiple backends but completely relying on a simple sqlite&nbsp;database.</p> <h3>Requirements</h3> <ul> <li>a web server with proxy or FastCGI/<span class="caps">WSGI</span>&nbsp;support</li> <li>python runtime (&gt;=&nbsp;2.5)</li> <li>shell&nbsp;access</li> </ul> <h3>Installation</h3> <div class="highlight"><pre><span class="nv">$ </span>easy_install -U werkzeug </pre></div> &nbsp; <div class="highlight"><pre><span class="nv">$ </span>wget https://github.com/posativ/weave-minimal/tarball/master -O weave-minimal.tar.gz <span class="nv">$ </span>tar xfz weave-minimal.tar.gz <span class="nv">$ </span><span class="nb">cd </span>posativ-weave-minimal </pre></div> <h3>Usage</h3> <p>Currently, Firefox does not you create a user account on your own server. I <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=708256">filed a bug</a> in a week ago. Therefore you need to set up every account&nbsp;manually:</p> <div class="highlight"><pre><span class="nv">$ </span>./weave.py --register myname:mypassword <span class="o">[</span>info<span class="o">]</span> database <span class="k">for</span> <span class="sb">`</span>myname<span class="sb">`</span> created at <span class="sb">`</span>.data/myname.91dfd9ddb4198aff<span class="sb">`</span> <span class="nv">$ </span>./weave.py -p 8080 </pre></div> <p><em>Please note that only alpha-numerical characters are&nbsp;allowed!</em></p> <p>The last command launches weave.py on port 8080. You can now configure mod_proxy in your webserver of choice or you some mod_fastcgi magic. See <a href="https://github.com/posativ/weave-minimal"><span class="caps">README</span>.md</a> for an example&nbsp;configuration.</p> <p>For the Firefox Sync Setup see in <a href="https://github.com/posativ/weave-minimal"><span class="caps">README</span>.md</a>,&nbsp;too.</p> <h3>Hints</h3> <ul> <li>using an <span class="caps">SSL</span>-encrypted server is recommended but not&nbsp;required</li> <li>Firefox never transmits browser data unencrypted, just your username/password are sent base64-encoded over the air (<span class="caps">HTTP</span> Basic&nbsp;Authentication).</li> <li>you can have multiple user per weave-minimal&nbsp;instance</li> <li>the user password is stored <span class="caps">SHA1</span>-hashed (first 16 characters) into the database filename <code>name.91dfd9ddb4198aff</code>.</li> <li>in case your web server sucks and does not send <code>HTTP_X_SCRIPT_NAME</code>, start <code>weave.py</code> with <code>--prefix=/url/prefix</code>.</li> </ul> Sun, 18 Dec 2011 16:35:00 GMT tag:blog.posativ.org,2011-12-18:/2011/weave-minimal-a-firefox-sync-full-server-fork Linkschleuder #10 http://blog.posativ.org/2011/linkschleuder-10/ <ul> <li><a href="http://cr.yp.to/daemontools.html">daemontools</a> – nein nicht die <a href="http://www.daemon-tools.cc/">Daemon Tools</a>, um äh Sicherheitskopien zu mounten, sondern einen Prozess-Supervisor wie <code>init.d</code> und kann im userspace laufen (<a href="http://uberspace.de/">via</a>).</li> <li><a href="http://code.dogmap.org/runwhen/">runwhen</a> – eine Art besseres <code>cron</code>. Unterstützt z.B. direktes Ausführen eines Tasks und kann sekundengenau Arbeiten (<a href="http://uberspace.de/dokuwiki/system:runwhen">via</a>).</li> <li><a href="http://www.getontracks.org/">Tracks</a> – eine nette Todoliste mit Ruby on Rails, die gerade mal lächerliche 100 <span class="caps">MB</span> <span class="caps">RAM</span> idle verbrät. Unterstützt&nbsp;Mobil-Geräte.</li> <li><a href="http://piwigo.org/">Piwigo</a> – your own photo gallery (in <span class="caps">PHP</span> und MySQL), gibt&#8217;s direkt im Repository von Debian und Ubuntu. Ganz hübsch, aber ein leichter Overkill für einen&nbsp;Einzelnutzer.</li> <li><a href="http://macfusionapp.org/">Macfusion</a> – <span class="caps">SSH</span> <span class="amp">&amp;</span> <span class="caps">FTP</span> Filesystem im Userspace aka <span class="caps">FUSE</span>. Mit&nbsp;<span class="caps">GUI</span>!1</li> <li><a href="http://mac.github.com/">github:mac</a> – gibt&#8217;s in Version 1.1 und unterstützt unter anderem partielles Hinzufügen aka <code>git add --patch</code> (wenn auch sehr&nbsp;umständlich).</li> <li><a href="http://redmine.lighttpd.net/wiki/lighttpd/AbsoLUAtion">Lua Scripting im lighty 1.5</a> – könnte <a href="/2011/grack-redmine-auth-git-smart-http/">Grack+Redmine</a> unnötig machen, würde es denn irgendwann Version 1.5&nbsp;geben.</li> <li><a href="https://github.com/aaronsw/html2text"><span class="caps">HTML</span> nach Text konvertieren</a> – ist sogar Markdow-valide, was da hinterher&nbsp;rauskommt!</li> <li><a href="http://hisz.rsoe.hu/">Disaster and Emergency AlertMap</a> – auch mit <a href="http://hisz.rsoe.hu/alertmap/index2.php">Europa</a></li> <li><a href="http://developer.yahoo.com/yslow/">YSlow</a> – Yahoo Tool um die Webseiten-Geschwindigkeit zu&nbsp;analysieren.</li> <li><a href="http://rubybestpractices.com/">Ruby Best Practices (Buch)</a> – <em>&#8220;We can all write better Ruby code&#8221;</em>.</li> </ul> Fri, 16 Dec 2011 18:31:00 GMT tag:blog.posativ.org,2011-12-16:/2011/linkschleuder-10 Firefox Sync auf dem eigenen Server. Ja. Wirklich. http://blog.posativ.org/2011/firefox-sync-auf-dem-eigenen-server-ja-wirklich/ <p>Vor gut <a href="/2011/firefox-sync-auf-dem-eigenen-server-vielleicht-nein/">zwei Wochen habe ich festgestellt</a>, dass es irgendwie unmöglich ist, einen eigenen Server für Firefox Sync zu nehmen. Aber so unmöglich ist es dann gar nicht. Wenn man weiß, wie behindert das Setup ist, dann ist das&nbsp;kinderleicht.</p> <p>Was nicht geht: ein neues Konto auf dem eigenen Server anlegen. Warum? Weil Mozilla diese Service-<span class="caps">URL</span> <a href="">auth.services.mozilla.com</a> fest in den Firefox kodiert hat. Die <span class="caps">API</span>, um sich zu registrieren, hängt aber an obiger <span class="caps">URL</span> + <code>/user</code>, genauer gesagt <code>PUT /user/1.0/mein_username</code>. Da sich die <span class="caps">URL</span> für den Registrierungsserver (der Server ist in zwei Teilprojekte unterteilt, <code>server-reg</code> und <code>server-full</code>) nicht einmal in der <a href="">about:config</a> einstellen lässt, wird dieser Workaround genutzt. Wir wissen ja, <em><a href="https://support.mozilla.com/de/questions/712986">89 people have this problem</a>. I have this problem,&nbsp;too!</em></p> <h3>Workaround in&nbsp;Firefox</h3> <p>Anstatt sich ein neues Nutzerkonto zu klicken, wählt man stattdessen aus, dass man bereits ein Konto hat. Dafür wird allerdings wirklich ein Konto benötigt, was zu einem unschönen Weg in die Kommandozeile führt (oder ins Webinterface, sofern der Server derartiges anbietet). Nachdem man sich auf seinem Server einen Nutzer registriert hat, geht&#8217;s weiter. Anstatt das Gerät mit dem drei-stelligen Code zu aktivieren (ich wüsste nicht, wie das mit eigenen Servern funktioniert), wählt man <em>&#8220;Ich habe das Gerät nicht bei mir&#8221;</em>, gibt seine Daten ein, wählt <em>&#8220;Eigenen Server verwenden&#8230;&#8221;</em> aus und gibt seine <span class="caps">URL</span> ein. Das&nbsp;war&#8217;s.</p> <p>An Servern dürften damit wohl *noch* alle letztens aufgezählten funktionieren, ob, das habe ich aber nicht&nbsp;getestet:</p> <ul> <li><a href="https://hg.mozilla.org/services/server-full/">offizielle Server-Implementierung</a>, nicht gerade leicht zu installieren,&nbsp;Bloatware++.</li> <li><a href="http://ymartin59.free.fr/wordpress/index.php/2011/03/05/my-own-firefox-sync-weave-server/">weave-minimal in <span class="caps">PHP</span></a>, der ehemalige, offizielle Weave-Server,&nbsp;discontinued.</li> <li><a href="https://github.com/jedie/django-sync-server/">Django Sync&nbsp;Server</a></li> <li><a href="https://github.com/tolumak/ffpyweave">ffpyweave</a>, ein single-file&nbsp;<span class="caps">CGI</span>-Skript</li> <li><a href="https://github.com/posativ/weave-minimal">weave-minimal</a>, meine Implementierung von <code>server-full</code> in Python, nur ohne&nbsp;Bloatware-Adapter.</li> </ul> <p>Derweil habe ich einen <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=708256">Bugreport mit meinem Unmut gefiledt</a>.</p> Wed, 07 Dec 2011 19:01:00 GMT tag:blog.posativ.org,2011-12-07:/2011/firefox-sync-auf-dem-eigenen-server-ja-wirklich Firefox Sync auf dem eigenen Server. Vielleicht. Nein. http://blog.posativ.org/2011/firefox-sync-auf-dem-eigenen-server-vielleicht-nein/ <p>So habe ich heute Firefox <del>Weave</del> Sync kennengelernt. Ich dacht mir, hey ich hab&#8217; &#8216;nen Server, oh und hey, der Sync-Server ist in Python geschrieben, das wird bestimmt kinderleicht!1 Aber die Community Policy, die Mozilla da seit geraumer Zeit fährt, macht jegliche Offenheit des Source Codes sinnlos, weil es einfach nicht für den kleinen Mann <a href="http://docs.services.mozilla.com/server-devguide/configuration.html">dokumentiert ist</a>. Das ist so miserabel dokumentiert, dass ich ohne Studieren des Source Codes nicht weiß, ob der <a href="https://hg.mozilla.org/services/server-full/"><code>server-full</code></a> überhaupt dafür konzipiert ist, geschlossen für einen, oder maximal auch zwei Nutzer zu laufen. Denn ganz sicher werde ich für einen Single-User-Betrieb keine <span class="caps">LDAP</span>-Authentifizierung&nbsp;aufsetzen.</p> <p>Früher™ gab es ja mal diesen <a href="https://tobyelliott.wordpress.com/2011/03/25/updating-and-deprecating-the-weave-minimal-server/">diesem Minimal Server</a>. Der scheint aufgrund von <a href="http://docs.services.mozilla.com/storage/apis-1.1.html"><span class="caps">API</span>-Änderungen</a> nicht mehr ganz zu funktionieren bzw. ist sowieso <em><a href="https://hg.mozilla.org/services/deprecated/minimal-server/">deprecated</a></em> (ist ja logisch, warum sowas kleines weiterführen, wenn man mit <span class="caps">LDAP</span> gleich die ganze Welt verwalten kann). Von einem <a href="http://ymartin59.free.fr/wordpress/index.php/2011/03/05/my-own-firefox-sync-weave-server/">Server in <span class="caps">PHP</span></a> hab&#8217; auch ich gehört. Ein (älteres) <a href="https://github.com/tolumak/ffpyweave">single-file <span class="caps">CGI</span>-Skript in python</a> gibt&#8217;s ebenfalls. Ob das funktioniert, weiß ich nicht. Einen <a href="https://github.com/jedie/django-sync-server/">Django-Klon</a> gibt&#8217;s auch, das ist aber die erste genannte Variante mit denselben Zielen, Millionen von Nutzern zu verwalten, nur mit Django. Nicht viel&nbsp;gekonnt.</p> <p>Es ist ja nicht so, dass ich zu unfähig bin, den offiziellen <code>server-full</code> oder das <span class="caps">CGI</span>-Skript <code>pyweave</code> zum Laufen zu bekommen. Das Problem ist das&nbsp;hier:</p> <p><img alt="Please enter valid server URL" src="/img/2011/firefox-sync.png" /></p> <p><a href="https://support.mozilla.com/de/questions/712986">89 people have this problem </a>. I have this problem,&nbsp;too!1</p> <p>Wie gut, dass das Projekt (ich vermute, das ist es) <a href="https://hg.mozilla.org/services/server-reg/"><code>server-reg</code></a> so überragend dokumentiert&nbsp;ist:</p> <div class="highlight"><pre><span class="gp">$</span>&gt; cat <span class="caps">README</span> <span class="go">========</span> <span class="go">Sync 1.1</span> <span class="go">========</span> <span class="go">This is the Python implementation of the Sync Server 1.1.</span> <span class="go">The documentation is located in the doc folder.</span> <span class="gp">$</span>&gt; ls <span class="go"><span class="caps">MANIFEST</span>.in <span class="caps">README</span> SyncReg.spec etc/ setup.py syncreg/</span> <span class="go">Makefile <span class="caps">RELEASE</span>.txt dev-reqs.txt prod-reqs.txt stage-reqs.txt</span> </pre></div> Sat, 26 Nov 2011 22:03:00 GMT tag:blog.posativ.org,2011-11-26:/2011/firefox-sync-auf-dem-eigenen-server-vielleicht-nein Humble Introversion Bundle mit DEFCON http://blog.posativ.org/2011/humble-introversion-bundle-mit-defcon/ <p>Wuhuuu. Das <a href="http://www.humblebundle.com/">Humble introversion Bundle</a> gibt&#8217;s wieder und diesmal mit dem Klassiker <span class="caps">DEFCON</span>. Ich fand den Preis damals™ (15€) etwas zu hoch. Und jetzt gibt&#8217;s für 3,49$ gleich sechs Spiele auf einmal. Das würde ich allein für Defcon zahlen. Denn wer träumt nicht heimlich vom (virtuellen) Weltkrieg mit Atomwaffen und das sogar&nbsp;crossplattform?</p> <p>&mdash; <a href="http://www.humblebundle.com/">the Humble introversion&nbsp;Bundle</a></p> Tue, 22 Nov 2011 19:43:00 GMT tag:blog.posativ.org,2011-11-22:/2011/humble-introversion-bundle-mit-defcon Linkschleuder #9 http://blog.posativ.org/2011/linkschleuder-9/ <ul> <li><a href="http://www.toastball.net/toast/">toast</a> &#8211; packageless package manager for Unix systems and non-root&nbsp;users </li> <li><a href="http://www.backblaze.com/">Backblaze</a> &#8211; wohl billigste Cloud-Backup Lösung überhaupt. Halt mit mangelnder Redundanz und&nbsp;so.</li> <li><a href="http://rolffreitag.de/projects/liberal/randomize.html">IPv4 Logs randomisieren</a> &#8211; hatte ich letztens wieder eine Diskussion. Meine Lösung ist inzwischen aber <code>127.0.0.1</code> im&nbsp;<span class="caps">IP</span>-Feld.</li> <li>Es gibt übrigens einen <a href="https://tools.ietf.org/html/rfc5023">Standard um mit <span class="caps">HTTP</span></a> ein Blog zu administrieren. Das ist dann so mit <span class="caps">PUT</span> und <span class="caps">DELETE</span> und halt &#8216;ne etwas behindertere <span class="caps">REST</span>-<span class="caps">API</span>. <a href="http://bitworking.org/news/AtomAPI_Quick_Reference">Hier</a> und <a href="https://www.ibm.com/developerworks/library/x-atompp1/">hier</a> ein Tutorial. Primäres Problem: wenn man so ein Blog hätte, dann gäbe es keine Tools&nbsp;dafür.</li> <li><a href="http://enable-cors.org/">enable cross-origin resource sharing</a> &#8211; wer sich an die etwas restriktive <a href="https://en.wikipedia.org/wiki/Same_origin_policy">same-origin-policy</a> stört, der kann es für seine Website individuell oder allgemein&nbsp;aktiveren.</li> <li><a href="http://pastebin.com/FD3xe6Jt">Don&#8217;t Use&nbsp;MongoDB</a></li> <li><a href="http://www.dabeaz.com/coroutines/">A Curious Course on Coroutines and Concurrency</a> (in&nbsp;Python!).</li> <li><a href="http://packages.python.org/itsdangerous/">It&#8217;s dangerous to send data to an untrusted environment</a> &#8211; eine Python-Lib, um im Web kryptografisch zu signieren. Mit Timestamps und&nbsp;so.</li> <li><a href="http://effbot.org/zone/unicode-convert.htm">Unicode nach Ascii</a> &#8211; zumindest für Latin1. Macht aus Æ ein Th und aus ß ein&nbsp;ss.</li> <li><a href="http://pypi.python.org/pypi/translitcodec/0.2">Unicode nach Ascii++</a> &#8211; für Support von € in <span class="caps">EUR</span> oder gar ☺ in :-). Ziemlich nützlich, um schöne URLs in Blogs zu bekommen und eine bessere Alternative als die üblichen Ansätze in WordPress und so mit <span class="caps">NFKD</span> zu&nbsp;normalisieren.</li> <li><a href="http://pocoo.org/~mitsuhiko/badideas.pdf">5 Years of Bad Ideas</a> &#8211; über Zauberei in Python. Gute und schlechte Zauberei, Zauberei mit Fallback und ungewöhnliche Zauberei. Sehr&nbsp;lesenswert!</li> <li><a href="http://ncannasse.fr/projects/hss"><span class="caps">CSS</span> Syntax mit Variablen und nested Blocks</a> &#8211; in einer mir unbekannten yetanother C++/Java-Klon Sprache namens <a href="http://nekovm.org/">Neko</a> geschrieben. Die gibt&#8217;s sogar als <code>mod_neko</code>.</li> <li><a href="http://learnboost.github.com/stylus/">Yet another <span class="caps">CSS</span>&nbsp;Preprocessor</a></li> <li>und zu guter letzt noch ein <a href="http://dailyjs.com/2010/11/01/node-tutorial/">node.js-Tutorial</a> (<a href="https://github.com/alexyoung/dailyjs/">GitHub</a>)</li> </ul> Sun, 20 Nov 2011 12:37:00 GMT tag:blog.posativ.org,2011-11-20:/2011/linkschleuder-9 lighttpd + git/grack = HTTP 417 http://blog.posativ.org/2011/lighttpd-git-grack-http-417/ <p>Just in case, anyone experiences this, too. <a href="http://lighttpd.net/">Lighttpd</a> can not handle <code>Expect: 100-continue</code> properly. Pushing with <a href="http://git-scm.org/">git</a> fails (sometimes) with something like&nbsp;this:</p> <div class="highlight"><pre># git push origin master Counting objects: 11, done. Delta compression using up to 24 threads. Compressing objects: 100% (10/10), done. Writing objects: 100% (11/11), 1.94 KiB, done. Total 11 (delta 0), reused 0 (delta 0) error: RPC failed; result=22, HTTP code = 417 fatal: The remote end hung up unexpectedly fatal: The remote end hung up unexpectedly </pre></div> <p>It&#8217;s fixed in lighttpd 1.5 but is a <em>Wont&#8217;t fix</em> for version 1.4.29. As you may know, version 1.5 is still beta and not finished yet. Since four years, now. Great fix, though. A workaround can be <a href="http://www.lighttpd.net/2009/2/16/1-4-21-yes-we-can-do-another-release">found here</a>:</p> <div class="highlight"><pre><span class="n">server</span><span class="o">.</span><span class="n">reject</span><span class="o">-</span><span class="n">expect</span><span class="o">-</span><span class="mi">100</span><span class="o">-</span><span class="n">with</span><span class="o">-</span><span class="mi">417</span> <span class="o">=</span> <span class="s">&quot;disable&quot;</span> </pre></div> Sun, 23 Oct 2011 13:01:00 GMT tag:blog.posativ.org,2011-10-23:/2011/lighttpd-git-grack-http-417 Linkschleuder #8 http://blog.posativ.org/2011/linkschleuder-8/ <ul> <li><a href="http://kodapp.com/">Kod</a> – ein neuer Texteditor für <span class="caps">OS</span> X, der aussieht wie Chrome und recht dunkel ist. Noch in der Entwicklung, open-source und auf <a href="https://github.com/rsms/kod">GitHub</a> zu&nbsp;finden.</li> <li><a href="http://resizesafari.com/">Rezise Safari</a> – Presets für diverse Endgeräte. Sicher nützlich für Webentwickler. Kostet&nbsp;aber.</li> <li><a href="http://unhosted.org/">Unhosted</a> – eine Gegenbewegung zu „you get our app, we get your&nbsp;data”</li> <li><a href="http://www.matekarte.de/">matekarte</a> – eine Karte mit Mate-Lieferanten in deiner Nähe. Wirklich cool!&nbsp;:-)</li> <li><a href="https://www.userscripts.org/scripts/show/24894">Wikipedia lesbarer: <span class="caps">GM</span> Skript</a> – <a href="https://github.com/posativ/snippets/blob/master/wikipedia_-_easy_read.user.js">etwas von mir gepimpt</a>, damit es die gesamte Breite&nbsp;einnimmt.</li> <li><a href="http://nodebeginner.org/">The Node Beginner Book – A comprehensive Node.js&nbsp;tutorial</a></li> <li><a href="http://queue.acm.org/detail.cfm?id=2038036">OCaml for the Masses</a> – ich glaub, das nehm ich mir für dieses Semester vor. Rockt irgendwie.&nbsp;Schon.</li> <li><a href="http://mirror.ocamlcore.org/ocaml-tutorial.org/index.html">Objective <span class="caps">CAML</span>&nbsp;Tutorial</a></li> <li><a href="https://github.com/jgm/yst">yst - static websites from <span class="caps">YAML</span> and string templates</a> – in Haskell&nbsp;geschrieben!1</li> <li><a href="http://python-requests.org/">Requests: <span class="caps">HTTP</span> for Humans</a> – für&nbsp;python</li> </ul> Sat, 22 Oct 2011 18:19:00 GMT tag:blog.posativ.org,2011-10-22:/2011/linkschleuder-8 Über Git und Mercurial und warum Windows und Java nerven (und Eclipse auch) http://blog.posativ.org/2011/ber-git-und-mercurial-und-warum-windows-und-java-nerven-und-eclipse-auch/ <p>Ich finde es ja beinahe traurig, dass ich mich im 3. Semester als &#8216;was mit <em>~informatik</em>-Student damit rumärgern muss, wieso ich beim kollaborativem Entwickeln darauf achten muss, dass das auch ja unter Windows geht. Denn Microsoft hat ganze Arbeit geleistet und selbst fortgeschrittene Informatik-Studenten (wohlgemerkt „angewandte Informatik”) sind nicht in der Lage, von dieser Linie abzuweichen. Man lebt ja in einer homogenen Umgebung. Sollen sich doch die anderen anpassen! Ja, und das mache ich dann auch mal wieder. Bei fünf (ich hatte Java mal in der Uni gehabt, und Delphi in der Schule) versus einen (also wir brauchen da jetzt Redmine, Git und &#8216;ne anständige Programmiersprache) bleibt dann nur noch Anpassen an die behinderte Windows&nbsp;Umgebung.</p> <p>Leute, <strong>mit Windows kann man nicht programmieren!</strong> Windows ist wie Android und iOS ein <span class="caps">ANTI</span>-Programmier-Betriebssystem. Und Java übrigens auch! Denn wenn man mal anständig crossplattform mit Libs und so entwickeln will, dann merkt man auch ganz schnell, das <em>compile once, run everywhere</em> eher Slogan denn Realität ist. Aber wen interessiert denn schon Linux/Mac. Das sind ja nur Konkurrenten. Wenn&#8217;s auf Windows läuft, läuft es ja eh überall. Das ist auch eine Art&nbsp;crossplattform.</p> <p>Die verwendete <span class="caps">IDE</span> ist nach kurzem Überlegen <a href="http://www.eclipse.org/">Eclipse</a> geworden. Nicht, dass das irgendwie sinnvoll ist. Eclipse ist eine Krankheit. Aber was anderes hatten wir in dem Semester „Strukturiertes Programmieren” samt Tutorium „wie bediene ich Eclipe?” nicht gehabt. Und den Leuten Eigeninitiative zu zeigen wird wohl erst im Master funktionieren oder wenn der Kurs „Kompetenz für Informatiker” angeboten&nbsp;wird.</p> <p>Dieses Eclipse hat neben einer hässlichen Oberfläche und 130 <span class="caps">MB</span> Größe allerdings noch keine Versionskontrollsysteme enthalten. Diese zwei Megabyte sind leider zu viel. Da es aber sinnvoll ist, als Gruppe verteilte Versionskontrolle zu nutzen, habe ich mich nach einem Plugin für Eclipse umgeschaut (<a href="http://www.cygwin.com/">Cygwin</a> muss nicht sein). Gibt <a href="http://eclipse.org/egit/">EGit</a> und das scheint eine komplette Implementierung von <a href="http://git-scm.com">Git</a> in Java zu sein. Und das funktioniert dann nicht mit meinem Server, weil das <span class="caps">SSL</span>-Cert eine unbekannte Identität hat – und <span class="caps">DAMIT</span> konnte wohl <span class="caps">NIEMAND</span> rechnen!!1! Da sieht man wieder Enterprise-Entwickler bei der Arbeit. Einen hübschen Git-Client für Windows habe ich nicht gefunden, aber mir war <a href="http://tortoisehg.bitbucket.org/">TortoiseHG</a> ein Name. Hübsches <span class="caps">GUI</span>, erfordert allerdings ein anderes Backend auf&#8217;m&nbsp;Server.</p> <p>Aber ein <a href="http://mercurial.selenic.com/wiki/HgWebDirStepByStep">Mercurial Server</a> mit <a href="http://www.redmine.org/">Redmine</a> wie <a href="https://blog.posativ.org/2011/grack-redmine-auth-git-smart-http/">ich es mit Git habe</a>, lässt sich nicht ohne weiteres implementieren. Das geht entweder mit Apache und dem Apache-only Auth-Handler Skript oder über <span class="caps">HTTP</span> Basic/Digest Auth. Das bringt mit Redmine aber nichts. Redmine nutzt <code>sha1(sha1(passwd) + salt)</code>, was auch die sinnvollste Methode ist. Nun stehe ich da, sehe ein high sophisticated Webinterface (aka <code>hg serve</code>) und möchte eigentlich nur <code>hg push</code> und <code>hg fetch</code> machen. Von Redmine&nbsp;authentifiziert.</p> <p>Ich hasse diese&nbsp;Enterprise-Software-Welt.</p> Sat, 22 Oct 2011 18:01:00 GMT tag:blog.posativ.org,2011-10-22:/2011/ber-git-und-mercurial-und-warum-windows-und-java-nerven-und-eclipse-auch Grack + Redmine Auth = Git Smart HTTP++ http://blog.posativ.org/2011/grack-redmine-auth-git-smart-http/ <p>So, nach gut zwei Wochen weiterem Probieren und Failen habe ich nun auch eine richtige Authentifizierung für <a href="http://redmine.org/">non-Apache</a> Webserver mittels <a href="http://www.redmine.org/projects/redmine/wiki/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl">Redmine</a>. Ich nutze hierbei das neue Smart <span class="caps">HTTP</span> Transport Protokoll, das seit Git 1.6.6 unterstützt wird. Über <span class="caps">SSL</span> getunnelt ist es <a href="http://www.heise.de/security/meldung/Ueber-500-Zertifikate-Ausmass-des-CA-Hacks-schlimmer-als-erwartet-1336603.html">fast</a> so sicher und genauso schnell wie die Übertragung über <span class="caps">SSH</span> oder Git-Daemon. Nur halt mittels plain <span class="caps">HTTP</span>, Webserver und etwas&nbsp;mod_proxy.</p> <p>Weil schon die <a href="/2011/redmine-sqlite3-lighttpd-thin/">Installation abseits von Apache/Nginx</a> eine Qual wegen nicht vorhandener Dokumentation war, will ich auch hier wieder dokumentieren, indem ich mein Setup als Beispiel angebe. Wie immer nutze ich <a href="http://lighttpd.net/">lighttpd</a> und eine Redmine-Installation Version 1.2.1, betrieben mit <a href="http://code.macournoyer.com/thin/">thin</a>. Weil Hype cool ist, existieren Wrapper für git-http natürlich nur in <a href="https://github.com/pedro/gnode">nodejs</a> und <a href="https://github.com/schacon/grack">ruby</a>. Argh. Naja, hab&#8217; ich schon Ruby am Hals, nehm ich halt den letzteren. Mein Code baut auf <a href="https://github.com/maxlapshin/grack">maxlapshin/grack</a> auf, das ist ein ungemergter Fork eines ungemergten Fork von <a href="https://github.com/schacon/grack">schacon/grack</a>&nbsp;x(</p> <h3>Schema</h3> <p>Mein angestrebtes <span class="caps">URL</span>-Layout sieht wie folgt&nbsp;aus:</p> <div class="highlight"><pre>/redmine &lt;- meine Redmine-Installation, HTTPS-getunnelt /git/myproject.git &lt;- das Repository </pre></div> <p>Meine Ordnerstruktur ist so&nbsp;aufgebaut:</p> <div class="highlight"><pre>~/posativ.org/redmine/ &lt;- die Redmine-Installation ~/posativ.org/grack/ &lt;- dort liegt grack später™ ~/repositories/git/myproject &lt;- das Beispielprojekt </pre></div> <p>In der <em>/etc/lighttpd/lighttpd.conf</em> steht dann wieder das&nbsp;übliche:</p> <div class="highlight"><pre><span class="nv">$<span class="caps">HTTP</span></span><span class="p">[</span><span class="s">&quot;host&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&quot;posativ.org&quot;</span> <span class="p">{</span> <span class="c1"># some conf here</span> <span class="c1"># index-file.names = (&quot;index.html&quot;) und so weiter</span> <span class="c1"># mod_proxy ist erforderlich, logischerweise</span> <span class="nv">$<span class="caps">HTTP</span></span><span class="p">[</span><span class="s">&quot;url&quot;</span><span class="p">]</span> <span class="o">=~</span> <span class="s">&quot;/git&quot;</span> <span class="p">{</span> <span class="n">proxy</span><span class="o">.</span><span class="n">server</span> <span class="o">=</span> <span class="p">(</span><span class="s">&quot;&quot;</span> <span class="o">=&gt;</span> <span class="p">((</span><span class="s">&quot;host&quot;</span> <span class="o">=&gt;</span> <span class="s">&quot;127.0.0.1&quot;</span><span class="p">,</span> <span class="s">&quot;port&quot;</span> <span class="o">=&gt;</span> <span class="mi">7654</span><span class="p">)))</span> <span class="p">}</span> <span class="p">}</span> </pre></div> <h3>Installation – Fortführung von <a href="/2011/redmine-sqlite3-lighttpd-thin/">dem&nbsp;hier</a></h3> <p>Damit das auch funktioniert, habe ich <em>grack</em> <a href="https://github.com/posativ/grack">auch geforkt</a>:</p> <div class="highlight"><pre><span class="gp">$</span> git clone https://github.com/posativ/grack ~/posativ.org/grack <span class="gp">$</span> thin config -c /home/www/posativ.org/grack/ -p 7654 -a 127.0.0.1 -e production <span class="se">\</span> <span class="go"> -l grack.log -C /etc/thin/grack.yml</span> </pre></div> <p>Dann noch die <code>config.ru</code> anpassen. Das Teil ist so gepatcht, dass es <span class="caps">SSL</span>-Zertifikate nicht prüft, denn das tut es nämlich irgendwie falsch. Angegeben werden muss <em>use_redmine_auth</em>, <em>redmine</em> und in meinem Falle auch <em>grack_suburi</em>, denn es wird unter <code>/git/myproject.git</code> gehostet.</p> <div class="highlight"><pre><span class="l-Scalar-Plain">config = {</span> <span class="l-Scalar-Plain">:project_root =&gt; &quot;/home/www/repositories/git&quot;,</span> <span class="l-Scalar-Plain">:git_path =&gt; &#39;/usr/bin/git&#39;,</span> <span class="l-Scalar-Plain">:upload_pack =&gt; true,</span> <span class="l-Scalar-Plain">:receive_pack =&gt; true,</span> <span class="l-Scalar-Plain">:use_redmine_auth =&gt; true,</span> <span class="l-Scalar-Plain">:redmine =&gt; &#39;https://posativ.org/redmine&#39;,</span> <span class="l-Scalar-Plain">:grack_suburi =&gt; &#39;/git&#39;</span> <span class="l-Scalar-Plain">}</span> </pre></div> <p>Dann noch ein&nbsp;schnelles</p> <div class="highlight"><pre><span class="gp">$</span> invoke-rc.d thin stop <span class="o">&amp;&amp;</span> invoke-rc.d thin start </pre></div> <p>und <em>grack</em> läuft über Port 7654 auf localhost und wird von Webserver getunnelt. Sogar mit <span class="caps">SSL</span>. Damit die Redmine-Authentifizierung auch läuft, muss die <a href="http://www.redmine.org/projects/redmine/wiki/Rest_api"><span class="caps">REST</span> <span class="caps">API</span></a> aktiviert werden. Die findet sich unter <em>Administration</em> -&gt; <em>Konfiguration</em> -&gt; <em>Authentifizierung</em> -&gt; <em><span class="caps">REST</span> Schnittstelle aktivieren</em>. Denn was (mein) Grack macht, ist einfach <code>https://redmine.tld/projects/myproject.xml</code> mittels der Nutzerdaten aufrufen, das bei Zugriff auf dieses Projekt 200 Ok oder eben 403 Forbidden&nbsp;zurückgibt.</p> <h3>Usage</h3> <p>Das Handling ist jetzt noch etwas suboptimal, ich hoffe, es gibt dazu aber noch schöne Redmine-Plugins. Denn ein Git-Repository muss als <em>--bare</em> erstellt werden (Voraussetzung für&nbsp;<span class="caps">HTTP</span>):</p> <div class="highlight"><pre><span class="gp">$</span> <span class="nb">cd</span> ~/repositories/git <span class="gp">$</span> git init --bare myproject.git <span class="gp">$</span> <span class="c"># oder via git clone --bare ~/myproject myproject.git ein altes Projekt umwandeln</span> </pre></div> <p>Dann lässt sich das Repository über <a href="https://domain.tld/git/myproject.git">https://domain.tld/git/myproject.git</a> klonen und pushen. Ganz&nbsp;hübsch.</p> Sat, 08 Oct 2011 14:39:00 GMT tag:blog.posativ.org,2011-10-08:/2011/grack-redmine-auth-git-smart-http Goodbye Wuala http://blog.posativ.org/2011/goodbye-wuala/ <p>Mal ernsthaft. Wie übel muss man failen, um <a href="https://forum.wuala.com/viewtopic.php?f=39&amp;t=2231">so eine Scheiße</a> zu fabrizieren? Seit einem Jahr tut sich da nichts nennenswertes mehr. Andauernd wird von <em>wir-haben-<span class="caps">GROSSE</span>-unterderhaube-sachen-gemacht!11</em> geredet und so elementare Dinge wie <span class="caps">GUI</span> und Backup <span class="amp">&amp;</span> Sync Interface werden außer Acht gelassen. Wen haben die eigentlich als Vorbild? Hat DropBox/Azure/JungleDisk dauernd davon erzählt, wie toll sie im Backend funktionieren? Nein! Und das mit einem elementaren Unterschied: sie taugen als gute&nbsp;Backup-Lösung.</p> <p>Was hat Wuala jetzt zu bieten? Eine unglaublich behinderte Java-<span class="caps">GUI</span>, enormen <span class="caps">CPU</span>-Verbrauch und nicht-zuende-entwickelte Gruppen/Social-Features. Und dann kam wer auf die Idee, ach lass&#8217; uns doch mal so richtig tief ins Klo greifen, und das Trading-Feature („Ich tausche 100 <span class="caps">GB</span> und bekomme dafür 100 <span class="caps">GB</span> verteilt”) killen. Mir war so in Erinnerung, als dass das Hauptmerkmal beim <a href="http://www.youtube.com/watch?v=3xKZ4KGkQY8">Google Tech Talk</a> war. Und jetzt? Ich kann mir auch ein paar Amazon S3 Instanzen zusammenklicken, einen Client in Python schreiben und etwas <span class="caps">AES</span>-Crypto anwerfen und das würde trotzdem besser laufen als <del>diese Scheiße</del> Wuala!</p> <p>Ich kann das auch absolut nicht nachvollziehen. Sie nutzen ja dennoch weiterhin ihren undokumentierten, high secure (!11) <a href="http://wualablog.blogspot.com/2011/05/wualas-encryption-revisited.html">Cryptree</a> – dessen Implementierung sie btw auch irgendwann mal offenlegen wollten. Sicherlich. Der einzige Vorteil ist jetzt, dass sie nun das Dateigrößenlimit auf 100 GiB anheben (da eigentlich jede Datei vorher in Chunks gesplittet wird, eh ein Fail für sich, dass gerade das nicht lief) und auch wie-auch-immer-implementiert inkrementelle Backups erlauben (das ist eigentlich konzept-bedingt nicht&nbsp;möglich).</p> <p>Naja, aber anscheinend hat Wuala irgendwelche Abnehmer gefunden. Die gehören sicherlich zur Kategorie der <span class="caps">SAP</span> und Microsoft-Nutzer. Halt freie Marktwirtschaft und immer schön <em><span class="caps">ABER</span> <span class="caps">DIE</span> <span class="caps">DATEN</span> <span class="caps">BEI</span> <span class="caps">AMAZON</span> <span class="caps">LIEGEN</span> <span class="caps">JA</span> <span class="caps">GAR</span> <span class="caps">NICH</span> <span class="caps">IN</span> <span class="caps">EUROPA</span>!!!111!!</em> anprangern. Das ist so miserabel ins <a href="https://forum.wuala.com/viewtopic.php?f=39&amp;t=2231#p9428">Gesicht gelogen</a>. Einfach nur&nbsp;traurig:</p> <blockquote> <p>We have strong security and privacy. If you want to have client-side-encryption and if you want to have your data stored in Europe, Wuala is your only&nbsp;option.</p> </blockquote> <p>Genau!1 Noch einmal zum mitschreiben: mein <code>rsync</code> läuft mit einem Bruchteil der Leistung feature-reicher und zuverlässiger als irgendeine Version von Wuala in den vergangenen drei Jahren. Und sogar auf Servern innerhalb Deutschlands und meiner&nbsp;Wohnung!</p> <p>Und ein weiteres mal sehe ich mich nach Alternativen um. Und jede davon wird angenehmer zu bedienen sein als Wuala. Zur Auswahl stehen jetzt <code>rsync</code> mit <a href="http://duplicity.nongnu.org/">duplicity</a>, <a href="https://www.tarsnap.com/">Tarsnap</a> als low-level Systeme und <a href="http://www.aerofs.com/">AeroFS</a> (invite-only, ich hätt&#8217; gern einen) sowie <a href="http://sparkleshare.org/">SparkleShare</a>. Leider alles nix mit etwas social-dingens Support und ohne Backend. Hilft wohl nur <a href="http://adamas.ai/cgi-bin/index.cgi?page=permlink&amp;id=4">selber coden</a>.</p> Wed, 05 Oct 2011 21:43:00 GMT tag:blog.posativ.org,2011-10-05:/2011/goodbye-wuala Linkschleuder #7 http://blog.posativ.org/2011/linkschleuder-7/ <ul> <li><a href="http://tyrs.nicosphere.net/index.html">ncurses Twitter client</a> – bin ja nach <a href="https://github.com/jugyo/earthquake">earthquake</a> nun erstmal bei <a href="http://www.echofon.com/">Echofon</a> im&nbsp;Firefox.</li> <li><a href="https://secure.wikimedia.org/wikipedia/commons/wiki/Category:Icons_themes">Icon Stocks</a> – Creative Commons und so, sehr&nbsp;nützlich.</li> <li><a href="http://www.opennicproject.org/">alternative (unabhängige) Top-Level-Domains</a> – erfordert allerdings Anpassung der <em>/etc/resolv.conf</em>, aber &#8216;ne nette&nbsp;Idee.</li> <li><a href="http://www.frameloss.org/2011/09/18/firewire-attacks-against-mac-os-lion-filevault-2-encryption/">FireWire attacks against Lion&#8217;s FileVault 2</a> – tja, aus diesem Grund habe ich FireWire entfernt. Ein potentielles Problem&nbsp;weniger.</li> <li><a href="https://github.com/sebest/collectd-mongodb">collectd-Plugin für MongoDB</a> – hab ich <a href="https://posativ.org/jarmon/">im Einsatz</a> und funktioniert&nbsp;einwandfrei.</li> <li><a href="http://www.linushoppe.de/2011/09/22/hyperpolyglot-org-kurzreferenzen-der-bekannten-programmiersprachen/">Kurzreferenzen bekannter Programmiersprachen – Übersicht</a> – unter anderen mit <a href="http://hyperpolyglot.org/scripting"><span class="caps">PHP</span>, Perl, Python, Ruby</a>, <a href="http://hyperpolyglot.org/embeddable">Tcl, Lua, JavaScript, Io</a>, <a href="http://hyperpolyglot.org/c">C, C++, Objective C, Java, C#</a> und <a href="http://hyperpolyglot.org/ml"><span class="caps">ML</span>, OCaml, Scala und&nbsp;Haskell</a></li> <li><a href="http://www.mathnews.uwaterloo.ca/Issues/mn11103/QuantumBogoSort.php">Warum wir Quantencomputer <em>wirklich</em>&nbsp;brauchen</a></li> <li><a href="http://www.tinypy.org/">a minimalist implementation of python in 64k of code</a> – <em>Q: What more could you possibly want? A: a&nbsp;pony?</em></li> <li><a href="http://wtforms.simplecodes.com/">WTForms</a> – Form validation and rendering library in python. Syntax überzeugt, Name&nbsp;auch.</li> <li><a href="http://www.nodebox.net/code/index.php/">NodeBox</a> – sowas wie <a href="http://processing.org/">Processing</a> nur für python (und&nbsp;Mac-only).</li> <li><a href="https://github.com/tthibo/SQL-Tutorial">A Gentle Introduction to <span class="caps">SQL</span> Using&nbsp;SQLite</a></li> <li><a href="http://www.currybet.net/cbet_blog/2010/08/html5-for-journalists.php"><span class="caps">HTML5</span> for journalists</a> – via <a href="http://www.schockwellenreiter.de/blog/2011/09/29/html5-fur-journalisten/">Schockwellenreiter</a></li> <li><a href="http://blog.jhr-online.de/290">zsh, tab completion, remote hosts, and&nbsp;collaboration</a></li> </ul> Fri, 30 Sep 2011 09:57:00 GMT tag:blog.posativ.org,2011-09-30:/2011/linkschleuder-7 sqlite dump mit python http://blog.posativ.org/2011/sqlite-dump-mit-python/ <p>Shell:</p> <div class="highlight"><pre><span class="n">sqlite3</span> <span class="n">my</span><span class="p">.</span><span class="n">db</span> <span class="o">&gt;&gt;</span> <span class="k"><span class="caps">SELECT</span></span> <span class="o">*</span> <span class="k"><span class="caps">FROM</span></span> <span class="n">sqlite_master</span><span class="p">;</span> </pre></div> <p>python:</p> <div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span><span class="o">,</span> <span class="nn">os</span> <span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">&quot;my.db&quot;</span><span class="p">)</span> <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s">&quot;dump.sql&quot;</span><span class="p">,</span> <span class="s">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">con</span><span class="o">.</span><span class="n">iterdump</span><span class="p">():</span> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%s</span><span class="se">\n</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">line</span><span class="p">)</span> </pre></div> <p>via <a href="http://stackoverflow.com/questions/305378/get-list-of-tables-db-schema-dump-etc-in-sqlite-databases">stackoverflow</a>. Denn ich stehe auf Kriegsfuß mit dieser dämlichen <span class="caps">SQL</span>-Logik. <a href="https://couchdb.apache.org/">CouchDB</a> und <a href="http://www.mongodb.org/">MongoDB</a>&nbsp;ftw.</p> Sat, 24 Sep 2011 11:28:00 GMT tag:blog.posativ.org,2011-09-24:/2011/sqlite-dump-mit-python ForkLift as Finder replacement in Lion http://blog.posativ.org/2011/forklift-as-finder-replacement-in-lion/ <p>Today, I did a short maintenance to my MacBook running <span class="caps">OS</span> X Lion. I found out, Macfuse is no longer supported and dead as well. But there is <a href="http://osxfuse.github.com/"><span class="caps">OSXFUSE</span></a>, which installs without any problems. OpenPGP does not work for Mail, too and since the release of Lion (that&#8217;s about two months ago) there is <a href="http://gpgtools.lighthouseapp.com/projects/65764/tickets/135">no <span class="caps">GPG</span> support</a>. Really embarrassing. After I&#8217;ve updated to Lion, I had iTunes and QuickTime, carefully removed, installed again and <a href="http://www.reggieashworth.com/appdelete">AppDelete</a> was unable to remove it. I&#8217;ve updated to the last version and could remove this crappy software again – waiting for the next <span class="caps">OS</span> X update&nbsp;m(</p> <p>Since I am using a Mac, I am using <a href="http://totalfinder.binaryage.com/">TotalFinder</a>, because <span class="caps">OS</span> X&#8217; Finder sucks a lot. Every time I use it. It feels like you must not handle your files. Unfortunately TotalFinder looks like <del>shit</del> Chrome and I don&#8217;t like Chrome&#8217;s <span class="caps">UI</span> and prefer Safari&#8217;s or Firefox&#8217; tabbing style. I did another search for a Finder replacement and ended up with <a href="http://www.binarynights.com/">ForkLift</a> – replacing <a href="http://www.panic.com/transmit/">Transmit</a> and <a href="http://archiverapp.com/">Archiver</a> as well). To replace the Finder, I&#8217;ve made the&nbsp;following:</p> <ul> <li>first, we need the Finder&#8217;s icon located in <em>/System/Library/CoreServices/Dock.app/Contents/Resources/finder.png</em></li> <li>convert it to an icon file (.icns) with <code>png2icns finder.icns finder.png</code>, which didn&#8217;t work for me so I used this <a href="http://iconverticons.com/">cool web&nbsp;service</a></li> <li>open you Applications folder, locate <em>ForkLift</em> and control-rightclick and select &#8220;show package content&#8221; and navigate to <em>Contents/Resources/</em></li> <li>backup the existing <em>forklift.icns</em> and move your converted <em>finder.icns</em> to <em>forklift.icns</em></li> </ul> <p>Now your ForkLift icon is identical to Finder. Lets remove the Finder from&nbsp;Dock.app.</p> <ul> <li><code>cd</code> to <em>/System/Library/CoreServices/Dock.app/Contents/Resources/</em> and open <em>DockMenus.plist</em>.</li> <li>change &#8220;finder-quit&#8221; and/or &#8220;finder-running&#8221; (don&#8217;t know, which one worked for me) to&nbsp;include</li> </ul> <p>DockMenus.plist</p> <div class="highlight"><pre><span class="nt">&lt;dict&gt;</span> <span class="nt">&lt;key&gt;</span>command<span class="nt">&lt;/key&gt;</span> <span class="nt">&lt;integer&gt;</span>1004<span class="nt">&lt;/integer&gt;</span> <span class="nt">&lt;key&gt;</span>name<span class="nt">&lt;/key&gt;</span> <span class="nt">&lt;string&gt;</span>REMOVE_FROM_DOCK<span class="nt">&lt;/string&gt;</span> <span class="nt">&lt;/dict&gt;</span> </pre></div> <ul> <li>do <code>killall Dock</code> which didn&#8217;t work for me or log out and in again to restart&nbsp;Dock.app</li> <li>now you can rightclick the Finder&#8217;s icon and select remove from&nbsp;Dock</li> <li>stick ForkLift to&nbsp;Dock.app</li> </ul> Thu, 22 Sep 2011 09:17:00 GMT tag:blog.posativ.org,2011-09-22:/2011/forklift-as-finder-replacement-in-lion