<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ADI64 feat. n0stradamus &#187; n0stradamus</title>
	<atom:link href="http://adrian.holfter.de/blog/author/n0stradamus/feed/" rel="self" type="application/rss+xml" />
	<link>http://adrian.holfter.de/blog</link>
	<description>Reiche Eltern für alle!</description>
	<lastBuildDate>Wed, 04 Jan 2012 22:47:27 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Command-line contact management</title>
		<link>http://adrian.holfter.de/blog/2011/08/command-line-contact-management/</link>
		<comments>http://adrian.holfter.de/blog/2011/08/command-line-contact-management/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 20:41:57 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=639</guid>
		<description><![CDATA[Für diejenigen, die gerne mit der Kommandozeile arbeiten und auch ohne X-Server Zugriff auf ihre Kontakte haben möchten, bietet sich mit abook eine bequeme, auf ncurses basierende Möglichkeit. Wer für diesen Zweck kein eigenes Programm verwenden möchte, bzw. nicht in Schwierigkeiten mit dem abook-Format geraten möchte, der ist mit einer Reihe von Skripten gut beraten. [...]]]></description>
			<content:encoded><![CDATA[<p>Für diejenigen, die gerne mit der Kommandozeile arbeiten und auch ohne X-Server Zugriff auf ihre Kontakte haben möchten, bietet sich mit <strong>abook</strong> eine bequeme, auf ncurses basierende Möglichkeit. Wer für diesen Zweck kein eigenes Programm verwenden möchte, bzw. nicht in Schwierigkeiten mit dem abook-Format geraten möchte, der ist mit einer Reihe von Skripten gut beraten. Diese werden in diesem Artikel vorgestellt.<br />
<span id="more-639"></span><br />
Dieser Artikel bezieht sich auf einen älteren Artikel im <a href="http://www.linux.com/archive/articles/57894" target="_blank">linux.com-Archiv</a>. Die hier vorgestellten Skripte basieren auf dem darin vorgestellten System.</p>
<h3>mutt alias</h3>
<p><strong>abook</strong> bietet eine Funktion um aus den vorhandenen Kontaktdaten Aliase für mutt zu generieren. Das ist auch mit einem kleinen Skript möglich:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># File: cbook2alias.sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Speicherort des Addressbuches</span>
<span style="color: #007800;">CBOOK_DIR</span>=~<span style="color: #000000; font-weight: bold;">/</span>.cbook
&nbsp;
<span style="color: #007800;">MAIL_LIST</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'^Email:'</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CBOOK_DIR</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'[^ ]+$'</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">INFO_LIST</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> ADDRESS <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${MAIL_LIST[*]}</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #007800;">INFO_LIST</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'BEGIN { RS = &quot;###&quot;; FS = &quot;Email: &quot; } ($2 ~ &quot;'</span><span style="color: #007800;">$ADDRESS</span><span style="color: #ff0000;">'&quot;) { print $1 }'</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CBOOK_DIR</span>&quot;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #007800;">NAME</span>=<span style="color: #800000;">${INFO_LIST[0]:0:1}</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;alias <span style="color: #007800;">${NAME,}</span><span style="color: #007800;">${INFO_LIST[1],,}</span> &lt;<span style="color: #007800;">$ADDRESS</span>&gt;&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p><strong>Anwendungsbeispiel:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># File: ~/.cbook</span>
Ron Wesley
Fuchsbau
<span style="color: #000000;">1337</span> Irgendwo im Nirgendwo
Email: ron<span style="color: #000000; font-weight: bold;">@</span>weasley.hog
Birthday: 12.12.9000</pre></div></div>

<p><code>$ ./cbook2alias.sh<br />
alias rweasley &#60;ron@weasley.hog&#62;</code><br />
Wie man sieht, wird der Vorname auf den Anfangsbuchstaben verkürzt und dieser vor den Nachnamen gehängt. Eine Modifikation von Zeile 13 kann diesen Effekt aufheben:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>13
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">NAME</span>=<span style="color: #800000;">${INFO_LIST[0]}</span></pre></td></tr></table></div>

<p><code>$ ./cbook2alias.sh<br />
alias ronweasley &#60;ron@weasley.hog&#62;</code></p>
<h3>Geburtstagsübersicht</h3>
<p>Manche Geburtstage sollte man einfach nicht vergessen. Damit das passiert, kann man sich aus dem Addressbuch die kommenden Geburtstage anzeigen lassen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash </span>
<span style="color: #666666; font-style: italic;"># File: cbook_birthdays.sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Variables</span>
<span style="color: #007800;">CBOOK_DIR</span>=~<span style="color: #000000; font-weight: bold;">/</span>.cbook
&nbsp;
<span style="color: #666666; font-style: italic;"># This var  holds a list of all the birthdays in the contacts file</span>
<span style="color: #007800;">BD_LIST</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'^Birthday:'</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CBOOK_DIR</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'[^ ]+$'</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;"># This var will hold a list of information for the person corresponding to a birthday in BD_LIST</span>
<span style="color: #007800;">INFO_LIST</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #666666; font-style: italic;"># The persons name</span>
<span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #666666; font-style: italic;"># The flag that is relevant for output</span>
<span style="color: #007800;">ONE_MONTH_FLAG</span>=<span style="color: #c20cb9; font-weight: bold;">false</span>
<span style="color: #666666; font-style: italic;"># Current date and delimiter</span>
<span style="color: #007800;">CUR_DAY</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">CUR_MONTH</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%m&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">CUR_YEAR</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%Y&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #666666; font-style: italic;"># Birthday segment indices, delimiter and format</span>
<span style="color: #007800;">BD_DAY</span>=<span style="color: #000000;">2</span>
<span style="color: #007800;">BD_MONTH</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">BD_YEAR</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">DELIM</span>=<span style="color: #ff0000;">&quot;.&quot;</span>
<span style="color: #007800;">FMT</span>=<span style="color: #ff0000;">&quot;ymd&quot;</span>
<span style="color: #666666; font-style: italic;"># helper variables</span>
<span style="color: #007800;">TEMP</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #007800;">NUM</span>=<span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Functions</span>
<span style="color: #000000; font-weight: bold;">function</span> print_usage <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: <span style="color: #780078;">`basename $0`</span> [Options]&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Description:&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This script helps you remember birthdays. You can pass it&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;some options concerning the date format. Then you&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;will get to see a list of birthdays to come for this year.&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Options:&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-m&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> print only the birthdays for this month (the ones that are to come&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-f &lt;FORMAT&gt;&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> the date format, choose one of [dmy,mdy,ymd]&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> d for day, m for month, y for year&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-d &lt;DELIMITER&gt;&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> the date delimiter&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-h, --help&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> display this message&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Argument parsing</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
        <span style="color: #660033;">-h</span> <span style="color: #000000; font-weight: bold;">|</span> --help<span style="color: #7a0874; font-weight: bold;">&#41;</span>
               print_usage
                <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
        -m<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">ONE_MONTH_FLAG</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
                <span style="color: #7a0874; font-weight: bold;">shift</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
        -f<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #666666; font-style: italic;"># The date format of the birthday</span>
                <span style="color: #007800;">FMT</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">shift</span> <span style="color: #000000;">2</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
        -d<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #666666; font-style: italic;"># The date delimiter</span>
                <span style="color: #007800;">DELIM</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">shift</span> <span style="color: #000000;">2</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
         <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">shift</span>; <span style="color: #7a0874; font-weight: bold;">break</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#===============</span>
<span style="color: #666666; font-style: italic;"># The main work</span>
<span style="color: #666666; font-style: italic;">#===============</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># find out the date segment indices</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FMT</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;ymd&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">TEMP</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$FMT</span> <span style="color: #000000; font-weight: bold;">|</span> fold -w1<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #007800;">NUM</span>=<span style="color: #000000;">0</span>
    <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$NUM</span> <span style="color: #660033;">-lt</span> <span style="color: #800000;">${#TEMP[*]}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${TEMP[$NUM]}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
            d<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">BD_DAY</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$NUM</span>&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
            m<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">BD_MONTH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$NUM</span>&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
            y<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">BD_YEAR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$NUM</span>&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OMG! Error!&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">2</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
        <span style="color: #007800;">NUM</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$NUM</span>+<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> BDAY <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${BD_LIST[*]}</span>; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #007800;">INFO_LIST</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'BEGIN { RS = &quot;###&quot;; FS = &quot;Birthday: &quot; } ($2 ~ &quot;'</span><span style="color: #007800;">$BDAY</span><span style="color: #ff0000;">'&quot;) { print $1 }'</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CBOOK_DIR</span>&quot;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${INFO_LIST[0]}</span> <span style="color: #007800;">${INFO_LIST[1]}</span>&quot;</span>
        <span style="color: #666666; font-style: italic;"># Decide wether the birthday has already taken place</span>
        <span style="color: #007800;">TEMP</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$BDAY</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DELIM</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Print the month-only birthdays first</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CUR_MONTH</span> <span style="color: #660033;">-eq</span> <span style="color: #800000;">${TEMP[$BD_MONTH]}</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$ONE_MONTH_FLAG</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CUR_DAY</span> <span style="color: #660033;">-le</span> <span style="color: #800000;">${TEMP[$BD_DAY]}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BDAY</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #007800;">$NAME</span>(<span style="color: #007800;">$(($CUR_YEAR - ${TEMP[$BD_YEAR]})</span>))&quot;</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CUR_MONTH</span> <span style="color: #660033;">-le</span> <span style="color: #800000;">${TEMP[$BD_MONTH]}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #666666; font-style: italic;"># if were in here, it is this month or some month in the future</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CUR_DAY</span> <span style="color: #660033;">-le</span> <span style="color: #800000;">${TEMP[$BD_DAY]}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #666666; font-style: italic;"># if we're here, it has not yet passed</span>
                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BDAY</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #007800;">$NAME</span>(<span style="color: #007800;">$(($CUR_YEAR - ${TEMP[$BD_YEAR]})</span>))&quot;</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p><strong>Anwendungsbeispiel</strong><br />
Bei Verwendung des Addressbuchs von oben:<br />
<code>$ date +%Y<br />
2011<br />
$ ./cbook_birthdays.sh -f dmy<br />
12.12.9000       Ron Weasley(-6989)</code></p>
<h3>Vorteile</h3>
<p>Bei Verwendung kleiner Skripte stellt sich fast keine Problematik bezüglich verschiedenen Formaten. Eine Konversion in andere ist eigentlich immer möglich. Natürlich bedeutet das ein wenig Arbeit, aber das bedeutet nicht dass es unmöglich ist <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Dieser Artikel ist nicht in Stein gemeisselt. Die Skripte unterstehen noch einer gewissen Entwicklung. Eine aktuelle Version der Skripte gibt es auf <a href="https://github.com/n0stradamus/CLI-contact-management-scripts" title="github">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2011/08/command-line-contact-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demos aufzeichnen mit .kkapture und als .avi (Xvid/mp3) abspeichern</title>
		<link>http://adrian.holfter.de/blog/2011/04/demos-aufzeichnen-mit-kkapture-und-als-avi-xvidmp3-abspeichern/</link>
		<comments>http://adrian.holfter.de/blog/2011/04/demos-aufzeichnen-mit-kkapture-und-als-avi-xvidmp3-abspeichern/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 14:18:12 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=569</guid>
		<description><![CDATA[Entgegen dem bisherigen Linux-Fokus nun einmal ein Artikel nur über Windows In diesem Artikel soll erklärt werden, wie man &#8220;rohes&#8221; Videomaterial von Demos mit dem Tool kkapture aufnimmt und dann mit VirtualDub nachbearbeitet. Möglichkeiten, den Vorgang mittels Scripting zu automatisieren werden auch beleuchtet. Der Autor will sich keinesfalls einen Video-Profi nennen, dementsprechend erhebt dieser Leitfaden [...]]]></description>
			<content:encoded><![CDATA[<p>Entgegen dem bisherigen Linux-Fokus nun einmal ein Artikel nur über Windows <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
In diesem Artikel soll erklärt werden, wie man &#8220;rohes&#8221; Videomaterial von Demos mit dem Tool <a href="http://www.farb-rausch.de/~fg/kkapture/">kkapture</a> aufnimmt und dann mit <a href="http://www.virtualdub.org/">VirtualDub</a> nachbearbeitet. Möglichkeiten, den Vorgang mittels Scripting zu automatisieren werden auch beleuchtet. Der Autor will sich keinesfalls einen Video-Profi nennen, dementsprechend erhebt dieser Leitfaden auch keinerlei Anspruch auf Vollständigkeit.</p>
<p><span id="more-569"></span></p>
<p style="text-align: center;">&#8212;</p>
<p>Bevor richtig losgelegt werden kann, müssen einige Codecs installiert werden. Verwendet wird in unserem Beispiel <a href="http://www.koepi.info/xvid.html">Xvid</a> und <a href="http://www.rarewares.org/mp3-lame-dshow-acm.php">LAME mp3</a>. Aus Gründen der Kompabilität ist es ratsam, die 32bit-Version von VirtualDub zu verwenden. Nutzer von Windows Vista/7 finden <a href="http://granjow.net/virtualdub-tutorial-installing.html">hier</a> weitere Tipps zur Installation von LAME.</p>
<p>So, nun sind die Codecs installiert. Damit sie eingesetzt werden können, muss erstmal Videomaterial an den Start gebracht werden. Also: kkapture starten, eine Demo auswählen und unkomprimiertes Material abspeichern lassen. Falls hier schon Probleme auftreten sollten, die Tipps auf <a href="http://wurstcaptures.untergrund.net/index.php?page=kkapture">wurstcaptures</a> helfen vielleicht weiter.</p>
<p>Gehen wir davon aus, dass das Aufzeichnen mit kkapture geklappt hat und nun die gerade eben erstellte Folge von .avi-Dateien in VirtualDub geöffnet ist(<em>Open video file&#8230;</em> und <em>Append segment&#8230;</em>).<br />
<a href="http://wurstcaptures.untergrund.net/index.php?page=converting">wurstcaptures</a> empfiehlt 2-Pass Encodings für eine optimale Qualität mit Xvid, also machen wir uns VirtualDubs Job-System zunutze. Vorher legen wir aber fest, ob das Format verändert werden soll (<em>Video &gt; Filters&#8230; &gt; Add &gt; resize</em>, auf Verhältnistreue achten!), oder nur gewisse Teile des Videos im Endergebnis beinhaltet sein sollen (<em>Video &gt; Filters&#8230; &gt; Filter in der Liste auswählen &gt; Cropping&#8230;</em>).<br />
Anschließend wird der Audio-Codec eingestellt: <em>Audio &gt; Full processing mode</em> und <em> Audio &gt; Compression&#8230; &gt; Codec auswählen</em></p>
<p>Okay, damit haben wir alles eingestellt, was wir brauchen um die beiden Jobs für jeweils den ersten und den zweiten Encoding-Pass einzurichten:</p>
<p><strong>Job 1</strong></p>
<ul>
<li><em>Video &gt; Compression &gt; Xvid auswählen &gt; Configure &gt; Encoding Type: TwoPass &#8211; 1st pass</em></li>
<li><em>File &gt; Queue batch operation &gt; Save as AVI file&#8230;</em></li>
</ul>
<p><strong>Job 2 </strong></p>
<ul>
<li><em> Video &gt; Compression &gt; Xvid auswählen &gt; Configure &gt; Encoding Type: TwoPass &#8211; 2nd pass</em></li>
<li><em>File &gt; Queue batch operation &gt; Save as AVI file&#8230;</em></li>
</ul>
<p>Nun kann man per <em>File &gt; Jobs&#8230;</em> sich die Jobliste anzeigen lassen, die Abarbeitung starten und sich einen Kaffee holen gehen <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Die Größe der Datei lässt sich beeinflussen, indem man Auflösung, Bitrate und Framerate des  Videos verändert. Um A/V-Desynchronisation zu vermeiden, kann man die gewünschte Framerate gleich in kkapture festlegen. Es gibt bestimmt auch Wege, dies in VirtualDub zu tun, diese führten beim Autor aber zum Misserfolg <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Weiterführendes:</strong><br />
Wer sich mit dem .avi-Containerformat nicht zufriedengeben möchte, ist vielleicht mit <a href="http://virtualdubmod.sourceforge.net/">VirtualDubMod</a> glücklicher. Dieses unterstützt mehrere Containerformate, darunter auch .mkv<br />
Freunde der Kombination h.264/AAC finden auf <a href="http://wurstcaptures.untergrund.net/index.php?page=converting">wurstcaptures</a> weiterführendes. Wie man merkt, war wurstcaptures eine meiner Hauptquellen <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
Die Jobs von VirtualDub nehmen einem viel Arbeit ab, sie kann man auch scripten. Ein Tool das dabei hilft, wäre <a href="http://dubman.sourceforge.net/">DubMan</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2011/04/demos-aufzeichnen-mit-kkapture-und-als-avi-xvidmp3-abspeichern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Binärbaum zeichnen</title>
		<link>http://adrian.holfter.de/blog/2011/04/binarbaum-zeichnen/</link>
		<comments>http://adrian.holfter.de/blog/2011/04/binarbaum-zeichnen/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 14:52:04 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[do it yourself]]></category>
		<category><![CDATA[n0stradamus]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=465</guid>
		<description><![CDATA[In diesem Artikel möchte ich ein Verfahren erklären, der einem die links abgebildete Datenstruktur ähnlich wie bei einem Aufruf des Befehls pstree ausgiebt]]></description>
			<content:encoded><![CDATA[<p>Im Rahmen dieses Artikels möchte ich ein Verfahren erklären,<img class="alignright" src="http://www.coder-wiki.de/uploads/Algorithmen/vollstaendiger-binaerbaum.png" alt="" width="143" height="100" /> das einem die rechts abgebildete Datenstruktur bereitstellt, sodass eine Ausgabe ähnlich der von <em>pstree -A</em> wäre.</p>
<p>Das fertige Ergebnis sollte folgendermaßen aussehen (In Anlehnung an den rechts dargestellten Baum &#8211; die Nummerierung erfolgt von links nach rechts):</p>
<pre>[Wurzel] + [Blatt 1, Ebene 1] + [Blatt 1, Ebene 2] + [Blatt 1, Ebene 3]
         |                    |                    ` [Blatt 2, Ebene 3]
         |                    ` [Blatt 2, Ebene 1] + [Blatt 3, Ebene 3]
         |                                         ` [Blatt 4, Ebene 3]
         `[Blatt 2, Ebene 1] + [Blatt 3, Ebene 2] + [Blatt 5, Ebene 3]
                             |                    ` [Blatt 2, Ebene 3]
                              ` [Blatt 2, Ebene 1] + [Blatt 3, Ebene 3]
                                                    ` [Blatt 4, Ebene 3]</pre>
<p><span id="more-465"></span></p>
<p>Wir zeichnen also bei jeder Verzweigung ein Plus, dann den Namen des Blattes und immer so weiter, bis ein Blatt erreicht ist, dass sich nicht mehr verzweigt. Dann wird eine neue Zeile begonnen und so lange unter jedes Plus ein &#8220;|&#8221; geschrieben, bis man wieder auf dem Level angelangt ist, zu dem das Blatt gehört. Soweit so gut, ist ja nicht so komplex.</p>
<p>Die Probleme fingen bei mir an, als ich diese Idee in Code umsetzen musste: Ich hatte eine Liste mit Objektinstanzen, aus denen ein Baum generiert werden sollte.</p>
<p>Jedes Objekt hatte drei für die Ausgabe relevante Attribute:</p>
<pre>Objekt* child1; <span style="color: #339966;">//Der Pointer auf das erste Blatt dieser Objektinstanz</span>
Objekt* child2; <span style="color: #339966;">//Der Pointer auf das zweite Blatt dieser Objektinstanz</span>
string name; <span style="color: #339966;">// Der Name dieser Objektinstanz
//Die Pointer beziehen sich jeweils auf andere, in der Liste vorhandene Instanzen.</span></pre>
<p>Also hatte ich folgende fixe Idee: Ich baue in das Objekt eine Funktion ein, die mir den String zusammenbastelt und sich, um die Verschachtelung darzustellen, wieder selbst aufruft. Damit muss ich nicht festhalten, welche Information von welchem Blatt nun ausgegeben werden soll. Fassen wir diese Idee in Pseudo-Pseudocode zusammen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Die Funktion erhält eine Liste, in der jeder Index eine Zeile symbolisiert</span>
<span style="color: #808080; font-style: italic;"># Zeile 1 also Index 0 usw...</span>
<span style="color: #ff7700;font-weight:bold;">def</span> generate_tree <span style="color: black;">&#40;</span>list_of_strings<span style="color: black;">&#41;</span>:
 <span style="color: #808080; font-style: italic;"># An die aktuelle Zeile den Namen unseres Blattes dranhängen</span>
 list_of_strings.<span style="color: black;">back</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span> name <span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Wenn unser Objekt ein Kind hat, dann müssen wir ein </span>
<span style="color: #808080; font-style: italic;"># Plus dranhängen und die Rekursion anstoßen.</span>
<span style="color: #808080; font-style: italic;"># Die Unterscheidung ob &quot;+&quot; oder &quot;-&quot; ist nicht notwendig, </span>
<span style="color: #808080; font-style: italic;"># sieht aber am Ende schicker aus:</span>
 <span style="color: #ff7700;font-weight:bold;">if</span> has_child1:
  <span style="color: #ff7700;font-weight:bold;">if</span> has_child2:
   list_of_strings.<span style="color: black;">back</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span> <span style="color: #483d8b;">&quot;+&quot;</span> <span style="color: black;">&#41;</span>
  <span style="color: #ff7700;font-weight:bold;">else</span>:
   list_of_strings.<span style="color: black;">back</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;"># Hiermit starten wir die Rekursion</span>
  <span style="color: #808080; font-style: italic;"># Das Folgende soll einen Memberaufruf symbolisieren :)</span>
  child1.<span style="color: black;">generate_tree</span><span style="color: black;">&#40;</span> list_of_strings <span style="color: black;">&#41;</span>
&nbsp;
 <span style="color: #ff7700;font-weight:bold;">if</span> has_child2: <span style="color: #808080; font-style: italic;"># Ein Objekt kann ja bis zu zwei Kinder haben</span>
  buffer = <span style="color: #483d8b;">&quot;&quot;</span> <span style="color: #808080; font-style: italic;">#Einen Buffer anlegen</span>
  <span style="color: #808080; font-style: italic;"># Die Position des letzten Plusses rausfinden</span>
  p = list_of_strings.<span style="color: black;">back</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">find_last_of</span><span style="color: black;">&#40;</span> <span style="color: #483d8b;">&quot;+&quot;</span> <span style="color: black;">&#41;</span> 
  <span style="color: #808080; font-style: italic;"># Die Position des letzten Strichs rausfinden</span>
  k = list_of_strings.<span style="color: black;">back</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">find_last_of</span><span style="color: black;">&#40;</span> <span style="color: #483d8b;">&quot;|&quot;</span> <span style="color: black;">&#41;</span> 
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">if</span> p <span style="color: #66cc66;">&lt;</span> k: <span style="color: #808080; font-style: italic;">#Den höheren Wert der beiden müssen wir nehmen</span>
   p = k
&nbsp;
<span style="color: #808080; font-style: italic;"># Von 0 bis p in Einerschritten durchgehen</span>
  <span style="color: #ff7700;font-weight:bold;">for</span> i=<span style="color: #ff4500;">0</span> | i <span style="color: #66cc66;">&lt;</span>= p | i++
   <span style="color: #ff7700;font-weight:bold;">if</span> i <span style="color: #66cc66;">&lt;</span> p:
    <span style="color: #ff7700;font-weight:bold;">if</span> list_of_strings.<span style="color: black;">back</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> == <span style="color: #483d8b;">&quot;+&quot;</span> <span style="color: #ff7700;font-weight:bold;">or</span> list_of_strings.<span style="color: black;">back</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> == <span style="color: #483d8b;">&quot;|&quot;</span>:
     buffer.<span style="color: black;">append</span><span style="color: black;">&#40;</span> <span style="color: #483d8b;">&quot;|&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
     buffer.<span style="color: black;">append</span><span style="color: black;">&#40;</span> <span style="color: #483d8b;">&quot; &quot;</span> <span style="color: black;">&#41;</span>
   <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff7700;font-weight:bold;">if</span> i == p:
    buffer.<span style="color: black;">append</span><span style="color: black;">&#40;</span> <span style="color: #483d8b;">&quot;`&quot;</span> <span style="color: black;">&#41;</span>
&nbsp;
  list_of_strings.<span style="color: black;">append</span><span style="color: black;">&#40;</span> buffer <span style="color: black;">&#41;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;"># Wieder eine Rekursion starten</span>
  <span style="color: #808080; font-style: italic;"># Das ist auch ein Memberaufruf</span>
  child2.<span style="color: black;">generate_tree</span><span style="color: black;">&#40;</span> list_of_strings <span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;"># ENDE der Funktion</span></pre></td></tr></table></div>

<p>So&#8230;diese Zeilen verlangen ein wenig nach Erklärung:<br />
Zeile 1: Wir hängen den Namen des Blattes an das letzte Element in der Liste dran. Es ist egal ob die aktuelle Instanz jetzt Wurzel ist oder nicht. Wichtig ist nur, dass die übergebene Liste nicht leer ist. Dafür muss beim Aufruf der Funktion beim Wurzelelement gesorgt sein.</p>
<p>Zeile 11-15: Hier wird nur unterschieden, ob die aktuelle Instanz ein oder zwei Blätter hat und dementsprechend das Verbindungszeichen gewählt</p>
<p>Zeile 19/20: Hier wird die Funktion <em>generate_tree</em> bei dem ersten Kind aufgerufen, mit Übergabe der auch von dieser Funktion verwendeten Liste. Dadurch ist gewährleistet, dass alle ersten Kinder des jeweils vorhergehenden Blatts in einer Zeile stehen.</p>
<p>Zeile 21: Nun ist die Funktion für das erste Kind durchgelaufen, wenn es ein zweites Kind gibt, wird es nun etwas schwieriger, einen String zusammenzubauen.</p>
<p>Zeile 22-26: Es wird ein Puffer angelegt (er wird am Ende die neue Zeile enthalten, die wir zusammengebaut haben), der Index des letzten Plusses und der Index des letzten senkrechten Striches herausgefunden. Zur Erinnerung: Striche sollten die Verzweigung über mehrere Zeilen hinweg kenntlich machen. Plusse sollten zeigen, dass dieses Blatt mehr als ein Kind hat.</p>
<p>Zeile 28-Ende: Die Zuweisung in Zeile 29 macht nur Sinn, wenn man sich die for-Schleife danach anschaut. Wir gehen jeden einzelnen Index der letzten Zeile in der Liste bis <em>p</em> durch. <em>p</em> ist der Index des letzten Plusses/letzten Striches, je nachdem welcher Index höher ist. Solange <em>i &lt; p </em> gilt, wird unter jeden Strich/jedes Plus ein weiterer Strich gehängt (indem man dieses Zeichen an den Puffer hängt). Haben wir <em>p</em> erreicht, so wird ein &#8220;`&#8221; an den Puffer gehängt, weil jetzt endlich der Name des zweiten Kindes kommen kann.<br />
Dazu hängen wir den Buffer an die Liste dran (er symbolisiert ja eine neue Zeile) und rufen <em>generate_tree</em> bei dem zweiten Kind auf, mit unserer Liste als Parameter.</p>
<p style="text-align: center;">&#8212;&#8211;</p>
<p style="text-align: left;">Eine Implementierung dieses Algorithmus in C++ könnte folgendermaßen aussehen: <a title="Beispiel-Implementierung" href="http://adrian.holfter.de/blog/wp-content/uploads/2011/04/objekt_de.cpp">*klick*</a></p>
<p>Die Funktion funktioniert allerdings nur unter zwei Bedingungen:</p>
<ul>
<li>Verwendung eines Monospace-Fonts bei der Ausgabe</li>
<li>Die übergebene Liste ist beim Aufruf der Funktion beim Wurzelelement NICHT leer. Sie muss mindestens einen leeren String enthalten.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2011/04/binarbaum-zeichnen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neue Bibliotheksnamen bei openCV 2.2.0-2</title>
		<link>http://adrian.holfter.de/blog/2011/01/neue-bibliotheksnamen-bei-opencv-2-2-0-2/</link>
		<comments>http://adrian.holfter.de/blog/2011/01/neue-bibliotheksnamen-bei-opencv-2-2-0-2/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 14:06:00 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=368</guid>
		<description><![CDATA[Nach dem letzten pacman -Syu hatte ich einige Probleme, meine Projekte mit den neuen Bibliotheken zu verlinken. Alle openCV-Bibliotheken tragen nun das Präfix &#8220;opencv_&#8221;: libcv -&#62; libopencv_core libhighgui -&#62; libopencv_highgui Somit muss man auch die Verlinkungs-flags des gcc/g++ auf den neuesten Stand bringen: -lcv -&#62; -lopencv_core -lhighgui -&#62; -lopencv_highgui ...etc]]></description>
			<content:encoded><![CDATA[<p>Nach dem letzten pacman -Syu hatte ich einige Probleme, meine Projekte mit den neuen Bibliotheken zu verlinken. Alle openCV-Bibliotheken tragen nun das Präfix &#8220;opencv_&#8221;:</p>
<pre>libcv -&gt; libopencv_core
libhighgui -&gt; libopencv_highgui
</pre>
<p>Somit muss man auch die Verlinkungs-flags des gcc/g++ auf den neuesten Stand bringen:</p>
<pre>-lcv -&gt; -lopencv_core
-lhighgui -&gt; -lopencv_highgui
...etc
</pre>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2011/01/neue-bibliotheksnamen-bei-opencv-2-2-0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code-Completion für vim</title>
		<link>http://adrian.holfter.de/blog/2011/01/code-completion-fur-vim/</link>
		<comments>http://adrian.holfter.de/blog/2011/01/code-completion-fur-vim/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 16:02:00 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=358</guid>
		<description><![CDATA[Als ob es nicht schon genügend Artikel darüber im Netz gäbe, hier ist ein weiterer darüber: wie bekomme ich etwas IntelliSense-ähnliches in mein vim? Bisher ließen sich drei möglichkeiten aufdecken: omnicppcomplete gccsense clang_complete Im Folgenden möchte ich die drei kurz vorstellen: omnicppcomplete&#8230;verwendet eine mit ctags erstellte Datenbank. Das ist ganz nützlich wenn man beispielsweise viel [...]]]></description>
			<content:encoded><![CDATA[<p>Als ob es nicht schon genügend Artikel darüber im Netz gäbe, hier ist ein weiterer darüber: wie bekomme ich etwas IntelliSense-ähnliches in mein vim?</p>
<p>Bisher ließen sich drei möglichkeiten aufdecken:</p>
<ul>
<li>omnicppcomplete</li>
<li>gccsense</li>
<li>clang_complete</li>
</ul>
<p>Im Folgenden möchte ich die drei kurz vorstellen: <span id="more-358"></span><strong> </strong></p>
<p><strong>omnicppcomplete</strong>&#8230;verwendet eine mit ctags erstellte Datenbank. Das ist ganz nützlich wenn man beispielsweise viel mit Qt arbeitet und sich aus dessen Klassen wieder eigene Klassen zusammenbastelt. Allerdings muss man dann für seine eigenen Header wieder eine ctag-Datenbank erstellen. Das vim-wiki enthält einen guten <a href="http://vim.wikia.com/wiki/C%2B%2B_code_completion" target="_blank">Leitfaden</a> zum Einstellen des Plugins.</p>
<p>Im [extra]-Repo lässt es sich unter &#8220;vim-omnicppcomplete&#8221; finden. Leider wurde die letzte Änderung an diesem Plugin am 27.09.2007 vorgenommen.</p>
<p><strong>gccsense.</strong>..verzichtet auf eine Datenbank &#8211; ist aber auch kein Plugin. Es ist ein Programm, das theoretisch von jedem Editor benutzt werden kann &#8211; auch Emacs <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Es verwendet einen extra kompilierten gcc, ist insofern schon etwas unhandlich. Ich habe es aber nicht benutzt und kann nichts über die Verwendung und/oder Güte der Completion sagen <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Mehr Infos gibt es <a href="Mehr Infos hier: http://cx4a.org/software/gccsense/" target="_blank">hier</a>.</p>
<p><strong>clang_complete</strong>&#8230;verwendet das Programm clang (community/clang) um die Vervollständigungsmöglichkeiten zu bestimmen. Das Plugin läuft out-of-the-box und benötigt keinerlei Konfiguration. Zudem ist die letzte Version vom 18. Dezember 2010 und somit deutlich neuer als die beiden anderen Varianten. Infos: <a href="http://www.vim.org/scripts/script.php?script_id=3302" target="_blank">*hier*</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2011/01/code-completion-fur-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nativer 64-Bit Flashplayer Square im Kommen</title>
		<link>http://adrian.holfter.de/blog/2010/09/nativer-64-bit-flashplayer-square-im-kommen/</link>
		<comments>http://adrian.holfter.de/blog/2010/09/nativer-64-bit-flashplayer-square-im-kommen/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 14:16:06 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=332</guid>
		<description><![CDATA[Spätestens seit dem Artikel auf heise.de ist bekannt, dass die nspluginwrapper-Krux ein Ende hat Adobe hat offenbar eingesehen, dass es gar nicht so wenige 64Bit-System gibt und hat schonmal eine Vorabversion des neuen Flashplayers Square veröffentlicht. Wer das Plugin nicht selbst herumkopieren möchte, kann sich mit dem PKGBUILD aus dem AUR helfen.]]></description>
			<content:encoded><![CDATA[<p>Spätestens seit dem <a href="http://www.heise.de/newsticker/meldung/Adobe-zieht-Flash-Update-vor-1081650.html" target="_blank">Artikel auf heise.de</a> ist bekannt, dass die nspluginwrapper-Krux ein Ende hat <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Adobe hat offenbar eingesehen, dass es gar nicht so wenige 64Bit-System gibt und hat schonmal eine Vorabversion des neuen <a href="http://labs.adobe.com/technologies/flashplayer10/" target="_blank">Flashplayers Square</a> veröffentlicht. Wer das Plugin nicht selbst herumkopieren möchte, kann sich mit dem PKGBUILD aus dem <a href="http://aur.archlinux.org/packages.php?ID=32072" target="_blank">AUR</a> helfen.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2010/09/nativer-64-bit-flashplayer-square-im-kommen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArchLinux auf der Seagate DockStar</title>
		<link>http://adrian.holfter.de/blog/2010/09/archlinux-auf-der-seagate-dockstar/</link>
		<comments>http://adrian.holfter.de/blog/2010/09/archlinux-auf-der-seagate-dockstar/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 17:02:33 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Archlinux]]></category>
		<category><![CDATA[do it yourself]]></category>
		<category><![CDATA[Dockstar]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Plugbox]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=312</guid>
		<description><![CDATA[Wer sich letztens eine dieser extrem günstigen Dockingstationen (~20€) gekauft hat, bekommt dafür ordentlich Dampf &#8211; geknechtet von BusyBox und einem nach bestimmter Nutzungsdauer kostenpflichtigen Dienst, nämlich Pogoplug. Hardware: - Marvell 88F6281 SoC mit 1,2 GHz Sheeva CPU - 128MB DDR2 - 256MB NAND-Flash - 3x USB 2.0 Ports - 1x Mini-USB für Seagate Go [...]]]></description>
			<content:encoded><![CDATA[<p>Wer sich letztens eine dieser extrem günstigen Dockingstationen (~20€) gekauft hat, bekommt dafür ordentlich Dampf &#8211; geknechtet von BusyBox und einem nach bestimmter Nutzungsdauer kostenpflichtigen Dienst, nämlich <a href="http://www.pogoplug.com/home-en.html?" target="_blank">Pogoplug</a>.</p>
<p><img class="alignleft size-medium wp-image-336" title="Seagate-FreeAgent-DockStar-Network-Adapter-front-back" src="http://adrian.holfter.de/blog/wp-content/uploads/2010/09/Seagate-FreeAgent-DockStar-Network-Adapter-front-back-284x300.jpg" alt="" width="204" height="216" />Hardware:</p>
<p>- Marvell 88F6281 SoC mit 1,2 GHz Sheeva CPU<br />
- 128MB DDR2<br />
- 256MB NAND-Flash<br />
- 3x USB 2.0 Ports<br />
- 1x Mini-USB für Seagate Go Festplatten<br />
- 100/1000 MBit Ethernet</p>
<p>Wer sich nicht mit den durch den Pogoplug-Dienst gegebenen Einstellungen/Einschränkungen zufriedengeben möchte, kann aber auch mit ein paar Tricks ein vollständig funktionstüchtiges PlugBoxLinux(eine auf Arch basierende Distro) an den Start bringen <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><span id="more-312"></span>Bevor es losgeht, möchte ich auf die Gefahr hinweisen, dass man mit manchen dieser Schritte das Gerät bricken, also unnutzbar machen kann. Alles geschieht auf eigene Verantwortung.</p>
<p style="text-align: center;">&#8212;&#8212;</p>
<p>Aber no risk, no fun, also los gehts:</p>
<p>1. )Seagate Dockstar ans Netzwerk anschließen, aber darauf achten dass sie <em><strong><span style="color: #ff0000;">keinen</span></strong></em> Zugriff auf das Internet erhält.(Adi64 und ich haben einfach einen kleinen Switch genommen) Noch ist nämlich ein Service aktiv, der Updates installiert. Unter anderem eines, das ssh deaktiviert und das root-Passwort ändert&#8230;</p>
<p>2.)Die IP des Gerätes herausfinden.<br />
Bei uns hat es gereicht, die letzten beiden Byte der MAC-Addresse(steht unten drauf) zu kennen.<br />
Angenommen diese beiden Bytes wären AB(=171) und CD(=205), dann ist die IP <strong><em> </em></strong></p>
<pre style="padding-left: 60px;">169.254.171.205</pre>
<p>Wenn das bei euch nicht so sein sollte, kommt ihr nicht darum, die Dockstar per nmap zu suchen:</p>
<pre style="padding-left: 60px;">nmap -sP 169.254.0.0/16</pre>
<p>3.)Per ssh einlogggen:<em> </em></p>
<pre style="padding-left: 60px;">ssh root@169.254.171.205
root@169.254.171.205's password: stxadmin #ist für alle gleich <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </pre>
<p>4.)Den Pogoplug-Updateservice abschießen und aus dem Startup rausnehmen: <em><strong> </strong></em></p>
<pre style="padding-left: 60px;">killall hbwd
mount -o remount,rw / #root als writeable remounten
vi /etc/init.d/rcS
#Jetzt die Zeile mit "/etc/init.d/hbmgr.sh start" auskommentieren
mount -o remount,ro /
#Jetzt kann man das Gerät theoretisch gefahrlos ans Netz anschließen</pre>
<p>5.)Backup, Backup, Backup. USB-Stick anschließen und danach die Daten sicher verwahren:</p>
<pre style="text-align: left; padding-left: 60px;">cd /tmp
mkdir usb
mount /dev/sda1 /tmp/usb
wget <a title="http://plugapps.com/os/pogoplug/uboot/nanddump" rel="nofollow" href="http://plugapps.com/os/pogoplug/uboot/nanddump">http://plugapps.com/os/pogoplug/uboot/nanddump</a>
chmod +x nanddump
./nanddump -nf usb/mtd0 /dev/mtd0
./nanddump -nf usb/mtd1 /dev/mtd1
./nanddump -nf usb/mtd2 /dev/mtd2
umount /dev/sda1</pre>
<p>6.)Das U-Boot, den Bootloader, installieren. Das ist an sich der gefährlichste Teil, weil ein Teil der Flash-Speichers bearbeitet wird. Ein Neustart danach ist nicht notwendig, es gibt ja noch nichts Besseres wo man reinbooten könnte <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre style="padding-left: 60px;">cd /tmp
wget <a title="http://plugapps.com/os/pogoplug/uboot/install_uboot_mtd0.sh" rel="nofollow" href="http://plugapps.com/os/pogoplug/uboot/install_uboot_mtd0.sh">http://plugapps.com/os/pogoplug/uboot/install_uboot_mtd0.sh</a>
chmod +x install_uboot_mtd0.sh
./install_uboot_mtd0.sh</pre>
<p>7.)Einen USB-Stick(1GB sollte drin sein) formatieren, mit einer mindestens 512MB großen ext2-Partition. Das Formatieren muss nicht unbedingt auf dem DockStar erfolgen.</p>
<p>8.)PlugBox Linux herunterladen, auf dem USB-Stick speichern:</p>
<pre style="padding-left: 60px;">#cd auf den USB-Stick
wget <a title="http://plugapps.com/os/1.1/Plugbox-Linux-1.1-rootfs.tar.gz" rel="nofollow" href="http://plugapps.com/os/1.1/Plugbox-Linux-1.1-rootfs.tar.gz">http://plugapps.com/os/1.1/Plugbox-Linux-1.1-rootfs.tar.gz</a></pre>
<p>9.)Das heruntergeladene Archiv auf dem USB-Stick extrahieren, danach das Archiv löschen. Dies sollte auf der DockStar erfolgen, sonst drohen Berechtigungsprobleme (Danke an GerhardSchr!)</p>
<pre style="padding-left: 60px;">tar -xzvf Plugbox-Linux-1.1-rootfs.tar.gz # Dauert ein bisschen auf der Plugbox, ~15min
rm Plugbox-Linux-1.1-rootfs.tar.gz</pre>
<p>10.)Den USB-Stick einstecken, falls nicht schon geschehen und die Box neustarten. Auf das Beste hoffen ;D</p>
<pre style="padding-left: 60px;">/sbin/reboot</pre>
<p style="text-align: left;">11.)Nach dem Neustart ist die alte IP natürlich nicht mehr gültig. Die Box bezieht sie über DHCP, sofern ein entsprechender Router/Server vorhanden ist. Bewaffnet mit der MAC könnt ihr ja mal im Listing der auf dem Router angemeldeten Geräte nachschauen. <a href="http://wiki.archlinux.org/index.php/Using_SSH_Keys" target="_blank">Keys</a> und <a href="http://www.dyndns.com/" target="_blank">DynDNS</a> werden Vielnutzer von ssh bestimmt kennen und schätzen. Wenn nicht &#8211; es ist definitiv einen Versuch wert.</p>
<p style="text-align: center;">&#8212;&#8212;</p>
<p style="text-align: left;">Weiterführendes findet ihr <a href="http://www.plugapps.com/index.php5?title=PlugApps:Pogoplug_Setboot" target="_blank">hier</a>. Debian-Fans finden <a href="http://jeff.doozan.com/debian/" target="_blank">hier</a> etwas &#8211; hat bei Adi64 und mir leider nicht funktioniert.</p>
<p style="text-align: left;">Wer Gentoo ausprobieren möchte, wird <a href="http://ahsoftware.de/dockstar/" target="_blank">hier</a> fündig.</p>
<p style="text-align: left;">Diejenigen, die etwas mit ihrer LED tun möchten, werden <a href="http://www.plugapps.com/index.php5?title=DockStar_LED" target="_blank">hier</a> glücklich.</p>
<p style="text-align: left;">Beispiel: Mit folgenden 3 Befehlen blinkt die LED bei jeder ssh-Aktion auf der Box orange:</p>
<pre>modprobe xt_LED #Treiber laden
iptables -A INPUT -p tcp --dport 22 -j LED --led-trigger-id web --led-delay 100
echo netfilter-web &gt; /sys/class/leds/dockstar\:orange\:misc/trigger</pre>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2010/09/archlinux-auf-der-seagate-dockstar/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Take the red pill, get the blue screen.</title>
		<link>http://adrian.holfter.de/blog/2010/08/take-the-red-pill-get-the-blue-screen/</link>
		<comments>http://adrian.holfter.de/blog/2010/08/take-the-red-pill-get-the-blue-screen/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 18:15:24 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=294</guid>
		<description><![CDATA[Momentan werkle ich ein bisschen an einer Idee für JugendForscht, deswegen geht die Postings-Rate etwas zurück. Programmieren hindert aber nicht daran, Lustiges im Netz zu finden: http://www.collegehumor.com/video:1886349]]></description>
			<content:encoded><![CDATA[<p>Momentan werkle ich ein bisschen an einer Idee für JugendForscht, deswegen geht die Postings-Rate etwas zurück. Programmieren hindert aber nicht daran, Lustiges im Netz zu finden:</p>
<blockquote><p>http://www.collegehumor.com/video:1886349</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2010/08/take-the-red-pill-get-the-blue-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update auf WordPress 3.0.1</title>
		<link>http://adrian.holfter.de/blog/2010/08/update-auf-wordpress-3-0-1/</link>
		<comments>http://adrian.holfter.de/blog/2010/08/update-auf-wordpress-3-0-1/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 12:41:18 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=292</guid>
		<description><![CDATA[Ein Update sollte wohlüberlegt sein, denn natürlich hält sich jeder an den weisen Satz &#8220;never touch a running system&#8221;&#8230;*hust* Aber WordPress schaffte es doch, mir das &#8216;vollautomatische Update zum Durchklicken&#8217; schmackhaft zu machen und so &#8211; nach einem Backup des Systems &#8211; ist die Seite abgestürzt Das Einspielen des Backups hätte auch kein Problem sein [...]]]></description>
			<content:encoded><![CDATA[<p>Ein Update sollte wohlüberlegt sein, denn natürlich hält sich jeder an den weisen Satz &#8220;never touch a running system&#8221;&#8230;*hust*</p>
<p>Aber WordPress schaffte es doch, mir das &#8216;vollautomatische Update zum Durchklicken&#8217; schmackhaft zu machen und so &#8211; nach einem Backup des Systems &#8211; ist die Seite abgestürzt <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Das Einspielen des Backups hätte auch kein Problem sein sollen, denkt man sich. Leider waren einige mySQL-Befehle falsch geschrieben worden(weiß der Geier warum) und so ging eine weitere Stunde meiner Zeit drauf, die Datei mühselig zu debuggen.</p>
<p>Damit waren die alten Posts, etc. gerettet, nicht jedoch der problemlose Zugriff auf die Site. Das Problem liegt in der alten http.php auf dem Server, die nicht auf den neuesten Stand gebracht wurden. Abhilfe schaffen diese drei Schritte:</p>
<ol>
<li>LOKAL(!) WordPress 3.0.1 runterladen @ <a href="http://wordpress.org/download/" target="_blank">http://wordpress.org/download/</a></li>
<li>$ unzip</li>
<li>$unzipdir/wordpress/wp-includes/http.php auf den Server rüberkopieren</li>
</ol>
<p>Fertig, nun läufts wieder <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2010/08/update-auf-wordpress-3-0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCV + Qt</title>
		<link>http://adrian.holfter.de/blog/2010/07/opencv-qt/</link>
		<comments>http://adrian.holfter.de/blog/2010/07/opencv-qt/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 15:01:10 +0000</pubDate>
		<dc:creator>n0stradamus</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=262</guid>
		<description><![CDATA[Wer Qt-Projekte mit OpenCV unterstuetzung kompilieren moechte, fuegt seiner .pro-Datei einfach folgende Zeile hinzu: LIBS += -lcv -lhighgui Dies waren zumindest die Libraries, die ich verwendet habe &#8211; hat meinen &#8220;Bedarf&#8221; an Bildverarbeitungstools mehr als gedeckt]]></description>
			<content:encoded><![CDATA[<p>Wer Qt-Projekte mit OpenCV unterstuetzung kompilieren moechte, fuegt seiner .pro-Datei einfach folgende Zeile hinzu:</p>
<blockquote><p>LIBS += -lcv -lhighgui</p></blockquote>
<p>Dies waren zumindest die Libraries, die ich verwendet habe &#8211; hat meinen &#8220;Bedarf&#8221; an Bildverarbeitungstools mehr als gedeckt <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/2010/07/opencv-qt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

