mysql-client.As a result of my last performance improvements to acrylamid I was not
able anymore to measure the memory used via Activity Monitor. I can measure
cpu time in many different ways using time or python’s neat -m cProfile -s
cumulative argument in front of my real program call, but I don’t know any
way to measure memory of fast ending applications.
The first fact I found is that python has no capabilities of profiling and
BSD’s version of time had no memory statistics support (seems, linux version
can do this). But there’s an App… erm tool for that: valgrind. Using it
with OS X’ 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 Massif: a heap profiler
(or re-compile --without-pymalloc):
$> valgrind --tool=massif --suppressions=Misc/valgrind-python.supp \
python ../acrylamid/bin/acrylamid gen
$> ms_print massif.out.1928 > out.txt
The latter produces a heap profile written to out.txt. KDE/Linux seems to have a visualizer, KCacheGrind, …weiterlesen.
Bevor ich so langsam zum Sublime Text Editor wechseln werde (es sei denn, Version 2 bringt es), noch einmal kurz meine Lieblings-Bundles, sprich Macros, Themes und Snippets.
Installiert wird das alles nach ~/Library/Application Support/TextMate/.
The first time I tried to get a custom Firefox Sync server running, I used
server-full and even though
I know python (the server is written in python), the configuration was highly
difficult. There’s no click & 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’t
know how to authenticate unless you have already a LDAP server running.
There are some alternatives:
ffpyweave, django sync
server and formerly
weave-minimal
too, written in PHP but not supported anymore. But I’ve forked the official
server-full (well I
completely rewrote) to a more easier installation without multiple backends
but completely relying on a simple sqlite database.
$ easy_install -U werkzeug
$ wget https://github.com/posativ/weave-minimal/tarball/master -O weave-minimal.tar.gz
$ tar xfz weave-minimal.tar.gz
$ cd posativ-weave-minimal
Currently, Firefox does not you create a user account on your own server. I filed a bug …weiterlesen.
Vor gut zwei Wochen habe ich festgestellt, 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 kinderleicht.
Was nicht geht: ein neues Konto auf dem eigenen Server anlegen. Warum? Weil
Mozilla diese Service-URL auth.services.mozilla.com fest in den
Firefox kodiert hat. Die API, um sich zu registrieren, hängt aber an obiger
URL + /user, genauer gesagt PUT /user/1.0/mein_username. Da sich die URL
für den Registrierungsserver (der Server ist in zwei Teilprojekte unterteilt,
server-reg und server-full) nicht einmal in der about:config einstellen
lässt, wird dieser Workaround genutzt. Wir wissen ja, 89 people have this
problem. I have this problem, too!
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’s weiter. Anstatt das Gerät mit dem drei-stelligen Code zu aktivieren …weiterlesen.
So habe ich heute Firefox Weave Sync kennengelernt. Ich dacht mir,
hey ich hab’ ‘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 dokumentiert ist. Das
ist so miserabel dokumentiert, dass ich ohne Studieren des Source Codes nicht
weiß, ob der server-full
ü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 LDAP-Authentifizierung aufsetzen.
Früher™ gab es ja mal diesen diesem Minimal Server. Der scheint aufgrund von API-Änderungen nicht mehr ganz zu funktionieren bzw. ist sowieso deprecated (ist ja logisch, warum sowas kleines weiterführen, wenn man mit LDAP gleich die ganze Welt verwalten kann). Von einem Server in PHP hab’ auch ich gehört. Ein (älteres) single-file CGI-Skript in python gibt’s ebenfalls. Ob das funktioniert, weiß ich nicht. Einen Django-Klon gibt’s auch, das ist aber die erste genannte Variante mit denselben Zielen, Millionen von Nutzern zu verwalten, nur mit Django. Nicht …weiterlesen.
127.0.0.1 im IP-Feld.Shell:
sqlite3 my.db
>> SELECT * FROM sqlite_master;
python:
import sqlite3, os
con = sqlite3.connect("my.db")
with open("dump.sql", "w") as f:
for line in con.iterdump():
f.write("%s\n" % line)
via stackoverflow. Denn ich stehe auf Kriegsfuß mit dieser dämlichen SQL-Logik. CouchDB und MongoDB ftw.
pydoc im Quellcode.So, mehr hab’ ich an diesem Trauertag leider nicht. Reicht ja auch.