Christoph Polcin

Pagan

Pagan

Here we dance on the grave
of the noth­ing­ness they've created:
There is no evil nor good.
Better back in chains than being saved.

Inspired by Magdalene - Sail with the tide

Kleinzschocher ist schraeg

Kleinzschocher ist schraeg

Sturm

Sturm

Heiszeluft

Heiszeluft

Gefangen

Gefangen

Chemnitzer Linux-Tage 2015 mit Gentoo

Gentoo Linux ist bei den Chemnitzer Linux-Tagen am Samstag 21. und Sonntag 22. März 2015 mit einem Stand vertreten. Es gibt unter anderem Gentoo-T-Shirts, Lanyards und Buttons zum selbst kom­pi­lie­ren.

Wir freuen uns euch zu sehen.

My PDF attach_files script

pdftk is a awesome toolkit to modify PDF files. The shell script below converts a input file to a PDF file with the help of Open- or Li­bre­Of­fice and attaches the source to the end of the output file. It does an additional convertion if the input file is a docx, rft or txt file.

 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
#!/bin/sh
# http://christoph-polcin.com/

TMP=/tmp

[ $# -lt 1 ] && \
    echo "usage: $(basename $0) input_file [output.pdf]" && \
    exit 1

[ ! -f "$1" ] && \
    echo "input file not found: $1" && \
    exit 1

IN=$1
NAME=$(echo -n "$IN" | sed 's/\.[^\.]*$//')

if [ $# -gt 1 ]; then
    OUT=$2
else
    OUT=./${NAME}.pdf
fi

[ -e "$OUT" ] && \
    echo "output already exists: $OUT" && \
    exit 1

if which libreoffice >/dev/null; then
    CONVERTER=libreoffice
else
    CONVERTER=openoffice
fi

EXT=$(echo -n "$IN" | sed 's/^.*\.//;s/.*/\L&/')
case "$EXT" in
    pdf)
        echo "inputfile is already a pdf: $IN"
        exit 1
        ;;
    docx|rtf|txt)
        $CONVERTER --convert-to odt --headless --outdir ${TMP} "$IN"
        IN=${TMP}/${NAME}.odt
        ;;
    *)
        ;;
esac;

$CONVERTER --convert-to pdf --headless --outdir ${TMP} "$IN"

pdftk "${TMP}/${NAME}.pdf" \
    attach_files "$IN" topage end \
    output "$OUT"

rm -f "${TMP}/${NAME}.pdf"

echo output: ${OUT}

My Libreoffice Concatenate Cells Macro

Li­bre­Of­fice is a modern heavy­weight, formerly OpenOffice. The built-in CONCATENATE function accepts only single cells as arguments but not a range of cells. This has always bugged me. To con­cate­nate a range of cells you must create a macro, which does the work for you. Afterwards you can use the function across your document. Andrew Pitonyak has written a nice and profound macro doc­u­men­ta­tion for OpenOffice, which is available as book too. These docs will also work for Li­bre­Of­fice. Likewise, the official doc­u­men­ta­tion is a good starting point.

To create custom macros you need to open a document and execute Tool > Macros > Organize Macros > LibreOffice Basic from the ap­pli­ca­tion menu. Select your document, create a new module and paste the snippet. Save the document and close the window. Now you can use =MyConcat($A1:$A99, "; ") or =MyConcat($A1:$F1) to con­cate­nate a range of cells.

REM  *****  BASIC  *****

Sub Main

End Sub

Function MyConcat(arr(), Optional sep as String) as String
Dim i as String
Dim r as String
Dim s as String

If Not IsMissing (sep) Then   
    s = sep
Else
    s = ", "
EndIf

r = ""
For Each i In arr()
    If i <> "" Then
        r = r & i & s
    EndIf
Next i

If Len(r) > Len(s) Then
    r = Left(r, Len(r)-Len(s))
EndIf

MyConcat = r

End Function

WRTNode Ausgepackt

Endlich etwas Zeit gefunden, um den kleinen WRTnode zumindest einmal aus­zu­pa­cken. Für 25$ gibts ein Hacker freund­li­ches MIPS Board mit 600 Mhz, 512Mb RAM, WLAN 802.11n, 23 GPIO-Ports, sowie JTAG, SPI, I2C, Uart Lite und USB 2.0 HOST Schnitt­stel­le. Quellcode und Schaltbild stehen frei zur Verfügung. U-Boot und ein an­ge­pass­tes Open Wrt Linux mit einem 3.10er Kernel treiben die 4.5 x 5.0 cm Platine an. Das Wiki ist ein guter Startpunkt.

DIY Kinderherd

Eine Holzkiste, Schaniere, Schrauben, Farbe, Holzreste, Drehregler vom Schrott­con­tai­ner, Werkzeug und ein wenig Zeit.