ftblog

:: widerstand zwecklos ::
email jabber gpgkey
hackergotchi

February 07, 2010

Zeichen und Wunder #0

Filed under: computer -- 13:59

Sie geschehen noch.

NetBSD nutzt jetzt terminfo an Stelle von termcap.

February 01, 2010

Time heals all wounds

Filed under: news -- 13:30

Erinnert sich noch jemand an die kleine Bankenkrise von vor kurzem?
Nein? Nicht so schlimm. In den Chefetagen der Banken weiß das auch
keiner mehr. Der Goldman-Sachs Chef bekommt jedenfalls erst einmal
100 Millionen Dollar Bonus
. Das sind 25 Millionen Dollar mehr als
das gesamte Unternehmen damals als Strafe beim Bescheißen im New
Economy Boom aufgebrummt bekommen hat.

January 23, 2010

le Système international d'unités

Filed under: news -- 12:19

Haha, gerade mal den Wikipedia Eintrag zum Si Einheitensystem gelesen. Das
benutzt ja so ziemlich jeder. Sogar die Briten (auch wenn da im Alltag das
imperiale System noch stark in Gebrauch ist).

Insgesamt gibt es drei (DREI!) Staaten in denen das nicht in Gebrauch ist.
Das wären: Burma, Liberia und - waaaaait for it - die vereinigten Staaten von
Amerika.

Way to go!

January 21, 2010

interface the web using zsh

Filed under: computer -- 17:48

This has been lingering on my laptop for some time now. For about a year,
actually. If you know surfraw, you know the idea.

If you don't, then imagine you'd like to search something via google real
quick from the command line like this:
lookup google that-thing-i-want-to-know-about

If you think, that's worth having, read on.

"This" is called `zsh-lookup', or `lookup' for short (or `lu' for really
short). It's implemented in zsh and does not share any code with surfraw.
It's licenced under the same terms as zsh is - which is BSD-ish.

Why reinvent the wheel if surfraw exists? Well, since lookup is written
in zsh and not in POSIX shell, it can take advantage of all those features zsh
has to offer. That means, really flexible configuration via `zstyle',
completion based on compsys - context sensitive correctly working for all
shipped backends - and, in my opinion, cleaner code because zsh knows about
arrays and associative arrays (read: hashes). Lookup also has support for
creating aliases for its backends (similar to git aliases); and completion for
those aliases just works. Out of the box.

Surfraw does support more web services than lookup does. A lot more. Something
like 100 vs. 20. I don't care for most of the services that lookup doesn't
implement - which is the reason they aren't implemented in the first place.

Feel free to implement new backends for lookup. The `LOOKUP_be_leo' file should
walk you through most of the questions that may arise during the process. Read
it beforehand. Really. If you'd like to look at a very simple backend, take a
look at the one for `cpan'. More complex backends would be `gmane' and `rfc'.

Now, after a year of using the thing, I'm pretty confident that it works well
enough. I am thinking about submitting it to zsh upstream for inclusion - if
the maintainers think that it's worth it.

For now, you can get the latest code from github:
git clone git://github.com/ft/zsh-lookup.git

To get it working you may use the `import_into_fpath.sh' script. After that you
need to load and initialise the system:
autoload -Uz lookupinit; lookupinit

The backends all document themselves, so if you'd like to know how the `gmane'
backend works, do:
lu -h gmane

Here's the documentation that would be available via "man zshcontrib" if lookup
ever gets included in zsh:
WORLD WIDE WEB SERVICES FOR ZSH
    Loading this subsystem enables the user to access useful webservices
    (such as google, gmane, wikipedia and many more) via the command line.

    In order to load and initialize the system, you need a issue the fol
    lowing command:

           autoload -Uz lookupinit && lookupinit

    After that, a function called lookup is available. Its basic syntax is
    as follows:

           lookup [GLOBAL-OPTION(s)...] <backend> OPTION(s)...

    <backend> is a string describing the service that will be accessed.
    Backends are self-documenting. To access a backends documentation, use
    lookups -h global-option as described below.

    -h [backend]
           Print a help message.

           If [backend] is defined, it will display the self-documentation
           of the named backend.

    -i (Re)initialize the lookup subsystem.

           This is usually not required (unless you add new backends at
           runtime).

    -a <alias-definition>
           Add a backend alias.

           <alias-definition> has this format: alias-identifier="back
           end-name -options".

    -d <alias-identifier>
           Remove the backend alias named <alias-identifier>.

    -Q Let a handler function create the QUERY string.

           See Query Handlers below.

    -q <argument>
           same as -Q, but lets you give an argument for the handler func
           tion, too.

    -l List available backends.

    -L List defined backend aliases.

    -P Print which browser command would be used instead of actually
           executing it.

    -R Send url to remote (GUI) browser (like firefox).


Quickstart
    This section is for people who do not want to setup the lookup system
    on their own:

           zstyle ':lookup:*' txt-browser w3m
           zstyle ':lookup:*' txt-formats "%s"
           zstyle ':lookup:*' gui-browser firefox
           zstyle ':lookup:*' gui-formats -remote "openurl(%s)"
           zstyle ':lookup:*' use-pager true
           zstyle ':lookup:*' pager-auto true
           zstyle ':lookup:*' pager less -M

    If you want to use other browsers, youll figure it out from here.

    Now to find out what backends there are, do:

           lookup -l

    To get documentation for a backend do (the gmane backend here):

           lookup -h gmane

    Feel free to use lu instead of lookup to avoid a lot of typing. So, if
    you want to search the web via google.com for zsh, do:

           lu google zsh


Configuration
    The lookup feature is primarily configured via zstyle. For additional
    convenience the user can define and remove aliases for backends via the
    -a and -d options of the lookup function (see examples below).

    The context used for zstyle is:
           :lookup:<execution-ident>:<backend>:<local-part>

    <executing-ident>
           Is an identifier for the code region in which a style is looked up.
           Valid strings are: -main-, -backend-, -queryhandler-, -hook- and
           -browser-. These are provided for maximum control of the con
           text. Usually using * for this field will be good enough.

    <backend>
           Is the backend in question. Find out about valid strings via:
           lookup -l.

    <local-part>
           Usually, this is set to -default-. Backends may set this to
           another value, though (the rfc backend does, for example). See
           the backends documentation for details.

    This is a description of all styles that are looked up by the main sys
    tem itself. Backends do look up other styles as well; they are
    described in the backends self-documentation.

    debug When set, lookup will print some debugging information to stdout
           and it only prints out what command if would run instead o actu
           ally running it (the latter has the same effect as the -P
           option). [Type: boolean; Default: false]

    txt-browser
           This sets up the text based browser, which lookup will call to
           access a web service. [Type: string; Default: $BROWSER, if that
           is unset: w3m]

    txt-formats
           A list of arguments that is passed to the text based browser.
           Within these arguments the string %s is replaced by the URL that
           the browser should open. [Type: string; Default: %s]

    gui-browser
           This is the "remote" GUI browser, which is called when the -R
           option of lookup is used. The default is the same as for the
           text based browser.

           Thus, for making use of the -R option you will have to set up
           this style and possibly the txt-formats style (See below, and
           Examples). [Type: string; Default: see txt-browser]

    gui-formats
           A list of arguments that is passed to the "remote" GUI browser.
           Within these arguments the string %s is replaced by the URL that
           the browser should open. [Type: string; Default: see txt-for
           mats]

    use-pager
           When displaying a backends self-documentation, you may want to
           read that text in a pager because the text may be too long for
           your terminal.

           Setting this style will always put the help text into a pager
           (unless pager-auto is set, too). [Type: boolean; Default: false]

    pager-auto
           If set, a pager is only used to display help-texts if the text
           would not fit on the screen (see prompt-height below). This has
           no effect if use-pager is not set to true. [Type: boolean;
           Default: false]

    pager The pager to use for displaying help texts. [Type: string;
           Default: $PAGER, if that is unset: more]

    prompt-height
           This is the height of the prompt assumed when calculating
           whether to use a pager when pager-auto is set. [Type: integer;
           Default: 1]

    query-handlers
           A list of handlers, that may be used to alter (and possibly gen
           erate) a query for a web service. See Query Handlers and Exam
           ples below. [Type: list; Default: empty]

    hooks A list of functions to run at a certain time. There is one hook
           type directly before a backend is run; and one that is run
           directly after a backend ran and a browser is to be spawned. (If
           a backend runs other hooks, it will document those itself). See
           Hooks below. [Type: list; Default: empty]


Query Handlers
    Query Handlers can be used to automate the generation and changing of
    queries. Usually, after all option parsing is done, the remaining argu
    ments to a backend are copied into the QUERY variable, concatenating
    them by single spaces.

    This QUERY variable is a global parameter to the lookup system, so that
    you may change it in query handlers and the caller will used the
    changed variable.

    Such a handler itself is just a shell function named LOOKUP_qh_name,
    where name is the name of the handler which you use in the query-han
    dlers style.

    The <execution-identifier> part of the zstyle context used in such han
    dlers is -queryhandler- (this is only important if you want to make
    your handlers configurable by zstyle).

    The Examples section below has an example of how to automate queries
    using such a handler.


Hooks
    The basic lookup system (backends may run their own hooks, which they
    will document themselves if they do) runs two hooks: One before a back
    end is run, the other after a backend was run, before the browser is
    spawned.

    The hook list for the former is looked up in the :lookup:-main-:<back
    end>:-default- context, for the latter in the :lookup:-browser-:<back
    end>:-default- context.

    In contrast to query handlers the name of a hook in the zstyle list is
    the same as the functions that is called. The following arguments are
    provided to these functions: In the -main- context: the same arguments
    that are passed to the backend. In the -browser- context: the same URL
    that is handed over to the browser.

    There is a special variable unencQUERY that is available in hooks in
    the -browser- context. It contains the unencoded query string. With
    that the -browser- hooks can be used to set xterm or GNU screen titles.

    The <execution-identifier> part of the zstyle context used in hooks is
    -hook- (this is only important if you want to make your hooks config
    urable by zstyle).


Examples
    Basic calls:
           lookup google zsh
           lookup deb_bts -p zsh

    Calls using the shorter lu:
           lu google zsh
           lu usenet zsh

    Example backend aliases:
           lu -a s=google
           lu -a d=leo
           lu -a z=zsh_mla
           lu -a wd="wikipedia -l de"

    And use those aliases:
           lu s zsh compsys
           lu d sugar
           lu z -w 12345
           lu wd zsh

    Setup firefox as your "remote" GUI browser:
           zstyle ':lookup:*' gui-browser firefox
           zstyle ':lookup:*' gui-formats -remote "openurl(%s)"

    Do the same for opera:
           zstyle ':lookup:*' gui-browser opera
           zstyle ':lookup:*' gui-formats -newtab -remote "openURL(%s)"

    And finally an example for Query Handlers:

    Lets assume, you have a command that queries your music player as to
    which Song is currently playing, in one of the following formats:

           np: Artist - Album - Track
           np: Artist - Track

    Lets further assume such a program is called audio-stat. If the player
    is stopped is displays: -stopped-

    Now wouldnt it be convenient if we could use such information in order
    to make queries with the letssingit backend (which queries www.letssin
    git.com)? It would and the following does:

           zstyle ':lookup:*:letssingit:*' query-handlers letssingit
           function LOOKUP_qh_letssingit() {
               local mode=${lookup_communicate[mode]}
               local np
               case ${mode} in
               (artist|album|song)
                   np="$(audio-stat)"
                   np=${np/np: /}
                   if [[ ${np} == -stopped- ]] ; then
                       printf \n Currently not playing anything!\n\n
                       return 3
                   fi
                   ;;
               esac
               case ${mode} in
               (artist)
                   QUERY=${np%% - *}
                   ;;
               (album)
                   np=${np% - *}
                   if [[ ${np} == *\ -\ * ]] ; then
                       QUERY=${np#* - }
                   else
                       printf \n Could not get album (%s)!\n\n "$(audio-stat)"
                       return 3
                   fi
                   ;;
               (song)
                   QUERY=${np##* - }
                   ;;
               esac
               return 0
           }

    Now, to search for the lyrics of the currently running song, you can do
    this:
           lu -Q letssingit -m song

    You can use -m artist or -m album in order to search for lyrics of the
    currently playing artist or album, too.

December 30, 2009

tail -f Congress

Filed under: tech -- 10:51

Alles muß ja einmal ein Ende haben...

REM Dec 30 2009 AT 12:45 DURATION 2:15 MSG Lightning Talks
REM Dec 30 2009 AT 14:00 DURATION 1:00 MSG Blackbox JTAG Reverse Engineering
REM Dec 30 2009 AT 16:00 DURATION 1:00 MSG Hacking the universe
REM Dec 30 2009 AT 17:15 DURATION 1:00 MSG Security Nightmares

December 29, 2009

Tag Drei, Null Neun

Filed under: tech -- 12:27

Heute, beim 26c3:

REM Dec 29 2009 AT 12:45 DURATION 2:15 MSG Lightning Talks
REM Dec 29 2009 AT 11:30 DURATION 2:00 MSG CCC-Jahresrückblick
REM Dec 29 2009 AT 14:00 DURATION 1:00 MSG DECT (part II)
REM Dec 29 2009 AT 16:00 DURATION 1:00 MSG Playing with the GSM RF Interface
REM Dec 29 2009 AT 17:15 DURATION 1:00 MSG Using OpenBSC for fuzzing of GSM handsets
REM Dec 29 2009 AT 17:15 DURATION 1:00 MSG Optimised to fail
REM Dec 29 2009 AT 21:45 DURATION 1:00 MSG Fnord-Jahresrückblick 2009
REM Dec 29 2009 AT 23:00 DURATION 1:00 MSG Black Ops Of PKI
REM Dec 30 2009 AT 00:00 DURATION 1:00 MSG Nougatbytes - Ein Wortspiel, bunt und in Stereo

December 28, 2009

Heute beim 26c3

Filed under: tech -- 11:14

Es wird wieder geströmt.
"Lightning Talks" wird es auch geben.

Meine Highlights:
REM Dec 28 2009 AT 11:30 DURATION 1:00 MSG Building a Debugger (JTAG)
REM Dec 28 2009 AT 12:45 DURATION 2:15 MSG Lightning Talks
REM Dec 28 2009 AT 17:15 DURATION 1:00 MSG Vier Fäuste für ein Halleluja
REM Dec 28 2009 AT 17:15 DURATION 1:00 MSG Advanced microcontroller programming
REM Dec 28 2009 AT 18:30 DURATION 1:00 MSG Die Schlacht um die Vorratsdatenspeicherung
REM Dec 28 2009 AT 20:30 DURATION 1:00 MSG Defending the Poor
REM Dec 29 2009 AT 00:00 DURATION 1:00 MSG Hacker Jeopardy

December 27, 2009

Chaostage '09

Filed under: tech -- 12:24

Der Choas Computer Congress läuft wieder.
Und dieses Jahr ist das ganze auch noch dezentral: Dragons everywhere!

Gerade findet die Keynote von Frank Rieger statt. Wird alles geströmt. :-)

Wer das beste Kalenderprogramm der Welt benutzt, kann folgendes sicher einfach
nachvollziehen (sind nur die Dinge - wer hätte es gedacht - die *mich*
interessieren):
REM Dec 27 2009 AT 12:45 DURATION 2:15 MSG Lightning Talks
REM Dec 27 2009 AT 20:30 DURATION 1:00 MSG GSM: SRSLY?
REM Dec 27 2009 AT 23:00 DURATION 1:00 MSG cat /proc/sys/net/ipv4/fuckups
REM Dec 28 2009 AT 00:00 DURATION 1:00 MSG CFD - Hacker Gaming Show

Was bei den "Lightning Talks" besprochen wird, hat man auch ins Netz gestellt.

December 08, 2009

RT...

Filed under: entertainment -- 20:15

...FM :-)

December 02, 2009

Neue Besen...

Filed under: computer -- 00:24

Gerade nach, na, so einer Dekade, von slrn nach tin gesprungen.

Keine Ahnung, warum der mir früher nicht gefallen hat. Mit lokalem
leafnode ist das bisher ziemlich angenehm.

November 25, 2009

Yes, we...

Filed under: news -- 11:32

...oh well, never mind...
Man rate mal, wer das mit der Ächtung von Landminen nicht sooo eng sieht...

November 15, 2009

arename - the others

Filed under: computer -- 12:18

Seems like somebody felt like raising the question whether arename should be
in debian, when there are already many many audio file renaming tools in it
.

Well, fair enough. So let's use his search pattern (~drenam ~dtag) and see
what is really there.

The first question should be: Which of these packages are actual competitors?
If we assume an open answer, it probably breaks down roughly to these:
  easytag, id3ren, lltag, mp3rename, mpgtx and tagtool.

Nevermind that this mixes GUI and CLI applications...

Let's pick off the easy ones:
  id3ren
This is a simple renamer for mp3 files - and secondly, a tagging utility.
There is virtually no flexibility in it. It has no configuration file. It has
no support for any other file types. Its documentation is limited to a
description of the supported options. Nothing more. Everything you do, you do
via numerous command line options. If anything, this tool could be used as a
backend to create a tool you would remotely want to use. This isn't a
competitor, not by a long shot.

  mp3rename
As far as renaming goes this one is comparable to id3ren. Its documentation is
worse. It does save options you used once to a configuration file, so
usability-wise it's probably a little better than id3ren. But again, there's
virtually no flexibility. Anything out of the ordinary you want to do? No-oh,
boy. Not with this one. Furthermore, this tool is limited to mp3 files. That's
not good enough to take as a serious competitor.

  mpgtx
This tool's main intend is not to rename audio files. It apparently does it,
too, but not with any more power than the two programs mentioned above. The
mpgtx documentation does contain quite some humour - which is a plus - but
it's not detailed enough at all. The renaming feature isn't really described
in the man page and it's website merely states the fact that it can do it (and
it hints at format strings like "%A" for the artist name). It's probably not
quite fair to compare it to what arename can do as mpgtx's main feature set is
something else. So, even though the "aptitude search" listed it and it debian
package description suggests it's a competitor, it really isn't.

Now one that could maybe persuade you to believe it's a worthy competitor:
  tagtool
A GUI utility to edit tags and rename files by looking at them. Let's look at
the renaming part, which is what arename does. It cannot handle track from
compilation albums. Its file name templates are not as powerful as the ones of
arename (not even version 3 - not to mention what arename version 4 will be
able to do). Tagtool does have some post-processing features - like replacing
whitespace by another character or case conversion. All of this can be very
easily done in arename hooks. When it comes to configurability tagtool is
nowhere near arename. All of the context sensitivity that you can get with
arename, tagtool just cannot offer. If you want one-shot renaming, tagtool may
do the trick for you. But anything more calls for a better renaming utility.
To close the deal, tagtool supports mp3 and ogg vorbis files. FLAC? Nope.
Also, tagtool's documentation is laughable. So no. Not really a competitor.

And now, the ones that get closer:
  lltag
At last a program that is actually documented. And it is even a command line
program. Still, comparing it to arename is not really fair. Lltag is an
automatic tagging tool, that is also able to rename files in a similar
fashion. When we only look at the renaming it soon becomes clear that lltag
cannot hold a candle to arename. Not much flexibility. No context sensitivity.
No support for compilation style albums. It does however support all file
formats, that arename3 supports (mp3, ogg vorbis and flac). Arename4 will
extend its file type support to more formats, but talking about future
features isn't fair at all. So yes, lltag is a program that can do similar
things as arename. It uses the same interface (command line) and supports the
same formats. But arename is the one that specializes in renaming. In lltag it
is just one of its features. And being a specialized tool, arename can do a
lot more than lltag when it comes to that particular feature set.

  easytag
Easytag, like lltag, can do both - edit tags and rename files by looking at
them. Its documentation could be better. It is a program with a graphical
interface. Apart from that, easytag is a pretty decent program. As for
supported file formats, it beats the living shit out of arename. It'll take
arename version 4 to close that gap. Easytag is quite configurable. It does
lack arename's context sensitivity, though. It has some post-processing
features, but not as broad as arename's hooks make it possible. Easytag
supports id3v2.4, which arename does not. That's a real advantage, as 2.4 is
the only id3v2 version that supports tags encoded in UTF-8. Arename will gain
that feature in the future (actually, the development version already does),
but currently it does not. Easytag however, doesn't have a dry-run mode.
That's a bummer. Before running over my audio library I *really* want a tool
to show me what it would do without actually doing it. (If I easytag actually
can do it, but I didn't find the button in it's GUI, feel free to mail me.)

Conclusion
In conclusion, only lltag and easytag come remotely close to arename. The
others just do not. When it comes to renaming arename also out-features lltag
pretty quickly.

Easytag has one or the other feature that arename doesn't. Mainly, it is its
wide wiiiide file format support and its support for id3v2.4. But when you
start to use advances features from arename - and be it only context sensitive
configuration - easytag cannot help you. Also, it is a GUI tool - which isn't
bad per se, but if you got a computer dedicated to serving music, say with
xmms2 serving the audio data. Chances are the machine is headless or maybe
without a working X11 installation in which case easytag wouldn't be the
weapon of choice either.

So, no. Debian really does not have "some of these" already. The specialized
renamers that actually are in debian are already inferior to the tools that do
both tagging *and* renaming.

If you want to batch-rename audio files on a debian machine, you got three
choices: lltag, easytag or arename. And when it comes to renaming, arename,
being the specialized tool it is, provides the most flexibility by far.

[Update 0]
Okay well. Seems like I missed two programs. 'Picard' and 'Exfalso'. Picard
didn't turn up in the aptitude search; exfalso, I missed. Both are GUI apps,
but what the hell.

So, exfalso. The interface is pretty straight forward. The renaming features
are not shabby. It does support more file formats than arename v3. Its
documentation is virtually non-existant. There is no context sensitivity at
all. There is a plugin feature but I couldn't find any plugins that would
enhance the renaming features. It does have a preview feature, which is nice.
It doesn't support multi-artist albums, as far as I can see. If it does, the
crappy documentation conceals it nicely. All in all, not too bad.
To me it feels viable to use this as a one-shot tool or to fix single file
names. It doesn't work recursively, so it's not usable for complete
collections either. Certainly one of the better programs, but not really
comparable with what arename has to offer.

And the last contestant, picard. Another GUI tagger-renamer combination.
It also support a truck-load of file formats. More than arename, easily.
So, until arename4 is out, this is an advantage. The on-disk documentation,
however sucks. Bad. There's something on their website... Oh well, this is a
graphical application; and who reads manuals for these anyway..? I don't find
picard's user interface to be as straight forward as the ones of easytag and
exfalso. It looks like a file manager. Though, it's not too obvious what the
difference between the left and the right window pane is. The file name
templates look quite promising - in fact more capable than arename3 (again,
arename4 will cure that). I don't see any dryrun or preview feature.
Picard does support recursive scans. But. Picard doesn't seem to actually
use the file name templates. At least the names it produces for me look
significantly different to what the default templates would suggest. Also,
it's quite slow. Six tracks took about ten seconds on a 1.5GHz Pentium
mobile. It looked quite promising at first, but it turns out, I wouldn't
use this tool on my audio collection. No way. If a template looks like this:
  $if2(%albumartist%,%artist%)/%album%/$num(%tracknumber%,2) %title%
...and the filename turns out like this: "01 Trackname.mp3" that's just not
what you'd expect...

So, I think my previous conclusion still stands. If picard would actually
behave the way its configuration dialogues would suggest, then it would have
to be among the usable solutions, too. But not the way it turned out for me.
Exfalso's lack of recursive operation takes it out of the possible choices.
Even though its interface is rather nice and the preview feature is well
thought-out.

[Update 1]
Jürgen tells me easytag does a preview by default.
Well, that's true in fact. Though, not very intuitive. It doesn't change
anything unless you hit the 'save' button. Which is nice. However, I wasn't
able to get a list that shows me all the changes that *would* be made with
respect to changing file names. I was only able to obtain that information
for the currently selected file. - But anyway, since easytag *does* have a
dryrun mode - and even active by default - that's another plus for the program.

Powered by zblog
valid css | valid xhtml | utf-8 encoded | best viewed with anybrowser