Stuff
13
content/posts/2021-02-19-viktoriapark.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: "Viktoriapark"
|
||||
date: 2021-02-19T00:00:01+00:00
|
||||
draft: false
|
||||
categories: ["Images"]
|
||||
description: "Viktoriapark"
|
||||
startpage: false
|
||||
lang: img
|
||||
gallery: "/img/2021/02/viktoriapark/DSC08970.jpg"
|
||||
cc: "by-nc-sa"
|
||||
---
|
||||
# Gallery
|
||||
{{< gallery dir="/img/2021/02/viktoriapark" caption-position="none" caption-effect="fade" />}} {{< load-photoswipe >}}
|
13
content/posts/2021-02-24-oranienburg-lehnitz-kanal.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: "Oranienburg Lehnitz-Kanal"
|
||||
date: 2021-02-24T00:00:01+00:00
|
||||
draft: false
|
||||
categories: ["Images"]
|
||||
description: "Oranienburg Lehnitz-Kanal"
|
||||
startpage: false
|
||||
lang: img
|
||||
gallery: "/img/2021/02/oranienburg-lehnitz-kanal/DSC09082.jpg"
|
||||
cc: "by-nc-sa"
|
||||
---
|
||||
# Gallery
|
||||
{{< gallery dir="/img/2021/02/oranienburg-lehnitz-kanal" caption-position="none" caption-effect="fade" />}} {{< load-photoswipe >}}
|
14
content/posts/2021-02-24-ss-brotfabrik-oranienburg.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "SS-Brotfabrik Oranienburg"
|
||||
date: 2021-02-24T00:00:01+00:00
|
||||
draft: false
|
||||
categories: ["Images"]
|
||||
description: "SS-Brotfabrik Oranienburg"
|
||||
startpage: false
|
||||
lang: img
|
||||
gallery: "/img/2021/02/ss-brotfabrik-oranienburg/DSC09147.jpg"
|
||||
cc: "by-nc-sa"
|
||||
---
|
||||
In der 1939 geplanten und bis März 1941 gebaute Brotfabrik wurden bis zu 80 Häftlingen aus dem Hauptlager Sachsenhausen ab 1943 aus dem Klinkerwerk zur arbeit gezwungen. Das Gelände war von dem "Außenlager Klinkerwerk" durch einen Schießstand getrennt. Die Waren wurden für den Einsatz im Militär gebacken, eine versorgung der Zivilbevölkerung war nicht vorgesehen. Ab 1944 wurden auch andere Konzentrationslager mit Brot versorgt. Nach Kriegsende wurden die Maschienen demontiert und das Gelände von der Roten Arme zur medizinischen Versorgung der ehemaligen Häftlinge genutzt. Ab 1946 wurde der Backbetrieb als VEG wieder aufgenomme. Bis 1991 wurde in diesem Gebäude gebacken, danach wurde das Gelände verlassen.
|
||||
# Gallery
|
||||
{{< gallery dir="/img/2021/02/ss-brotfabrik-oranienburg" caption-position="none" caption-effect="fade" />}} {{< load-photoswipe >}}
|
13
content/posts/2021-02-27-von-der-schulenburg-park.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: "Von-der-Schulenburg-Park"
|
||||
date: 2021-02-27T00:00:01+00:00
|
||||
draft: false
|
||||
categories: ["Images"]
|
||||
description: "Von-der-Schulenburg-Park"
|
||||
startpage: false
|
||||
lang: img
|
||||
gallery: "/img/2021/02/von-der-schulenburg-park/DSC09185.jpg"
|
||||
cc: "by-nc-sa"
|
||||
---
|
||||
# Gallery
|
||||
{{< gallery dir="/img/2021/02/von-der-schulenburg-park" caption-position="none" caption-effect="fade" />}} {{< load-photoswipe >}}
|
13
content/posts/2021-03-07-dorfkirche-tempelhof.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: "Dorfkirche Tempelhof"
|
||||
date: 2021-03-07T00:00:01+00:00
|
||||
draft: false
|
||||
categories: ["Images"]
|
||||
description: "Dorfkirche Tempelhof"
|
||||
startpage: false
|
||||
lang: img
|
||||
gallery: "/img/2021/03/dorfkirche-tempelhof/DSC09214.jpg"
|
||||
cc: "by-nc-sa"
|
||||
---
|
||||
# Gallery
|
||||
{{< gallery dir="/img/2021/03/dorfkirche-tempelhof" caption-position="none" caption-effect="fade" />}} {{< load-photoswipe >}}
|
227
content/posts/2021-03-07-signal-dbus-golang.md
Normal file
|
@ -0,0 +1,227 @@
|
|||
---
|
||||
title: "Using the signal-cli dbus interface in golang"
|
||||
date: 2021-03-07T10:25:53+02:00
|
||||
draft: false
|
||||
description: "Using the signal-cli dbus interface in golang"
|
||||
tags: ["Blog", "Go"]
|
||||
categories: ["Programming"]
|
||||
startpage: true
|
||||
lang: en
|
||||
---
|
||||
|
||||
The [signal-cli](https://github.com/AsamK/signal-cli) tool profieds a dbus interface to get and send messages from other programms. The Documentation for that is avalible in the [signal-cli wiki](https://github.com/AsamK/signal-cli/wiki/DBus-service) but that not so easy to understand if you never work with dbus before.
|
||||
|
||||
# Setup signal-cli
|
||||
To setup signal-cli and pair it as secound device to an existing account you first need to install signal-cli, that steps based on your os. After you install it you can create a new "Pairing-Code" by runnuning `signal-cli link -n "mybot"`. The given code can used on the webpage [goqr.me](http://goqr.me/) to create an qr code, which you can scann with the signal app on your mobile device.
|
||||
|
||||
After that you can start signal-cli as deamon, for example with the following command with also print all incomming events as json on your cli:
|
||||
|
||||
```
|
||||
signal-cli -u +49176XXXXXXX -o json daemon
|
||||
```
|
||||
|
||||
# Getting Messages
|
||||
First we need to connect to the DBus system, thats possible with the [godbus/dbus](https://github.com/godbus/dbus) package. The connection based on the example from the package is really easy:
|
||||
```
|
||||
conn, err := dbus.ConnectSessionBus()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Failed to connect to session bus:", err)
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
```
|
||||
|
||||
After that we need to told the dbus package which messages we want to recive and create a channel where we can revice all signales. To got the signal messages the follwoing code works for me:
|
||||
|
||||
```
|
||||
if err = conn.AddMatchSignal(
|
||||
dbus.WithMatchInterface("org.asamk.Signal"),
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
c := make(chan *dbus.Signal, 10)
|
||||
conn.Signal(c)
|
||||
```
|
||||
than we can "listen" to the channel and got the messages the signal-cli deamon sends:
|
||||
|
||||
```
|
||||
for v := range c {
|
||||
fmt.Println(v)
|
||||
}
|
||||
```
|
||||
|
||||
That will create mainly two signales im interested in, first getting a message from another conversation partner:
|
||||
|
||||
```
|
||||
&{:1.34 /org/asamk/Signal org.asamk.Signal.MessageReceived [1615064176455 +49176XXXXXXXX [] Durchgefallen []] 11}
|
||||
```
|
||||
|
||||
and secound getting a Sync Message, it will be send if yourself send a message from another device to a conversation partner:
|
||||
|
||||
```
|
||||
&{:1.34 /org/asamk/Signal org.asamk.Signal.SyncMessageReceived [1615064055775 +49176XXXXXXXXX +49176XXXXXXX [] Ich bin ein test []] 8}
|
||||
```
|
||||
|
||||
|
||||
# Parsing Messages
|
||||
If i just focus on 1:1 chats i could parse both kinds of events. Here two examples without error handling. First on the "Incomming Messages" :
|
||||
|
||||
```
|
||||
type IncommingMessage struct {
|
||||
Timestamp int64
|
||||
Source string
|
||||
Message string
|
||||
Attachments []string
|
||||
}
|
||||
|
||||
func parseMessageReceived(v *dbus.Signal) IncommingMessage {
|
||||
msg := IncommingMessage{}
|
||||
msg.Timestamp, _ = v.Body[0].(int64)
|
||||
msg.Source = v.Body[1].(string)
|
||||
msg.Message = v.Body[3].(string)
|
||||
msg.Attachments = v.Body[4].([]string)
|
||||
return msg
|
||||
}
|
||||
```
|
||||
|
||||
and for the Snyc Events:
|
||||
|
||||
```
|
||||
type SyncMessage struct {
|
||||
Timestamp int64
|
||||
Source string
|
||||
Destination string
|
||||
Message string
|
||||
Attachments []string
|
||||
}
|
||||
|
||||
func parseSyncMessageReceived(v *dbus.Signal) SyncMessage {
|
||||
msg := SyncMessage{}
|
||||
msg.Timestamp, _ = v.Body[0].(int64)
|
||||
msg.Source = v.Body[1].(string)
|
||||
msg.Destination = v.Body[2].(string)
|
||||
msg.Message = v.Body[4].(string)
|
||||
msg.Attachments = v.Body[5].([]string)
|
||||
return msg
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
That functions will return strucs you can easy use for your application.
|
||||
|
||||
# Sending Messages
|
||||
|
||||
For the sending we also need a dbus connection, but unlike in the receving message part we don't subscribe to the events we produse one which will be consumed by the signal-cli deamon and send as chat messages to the conversation. All other devices (like your mobile phone) will get a SyncMessage event and show that "new" message too.
|
||||
|
||||
First you need to create the connection like before:
|
||||
|
||||
```
|
||||
conn, err := dbus.ConnectSessionBus()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Failed to connect to session bus:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer conn.Close()
|
||||
```
|
||||
|
||||
after that just send a call like this:
|
||||
|
||||
```
|
||||
obj := conn.Object("org.asamk.Signal", "/org/asamk/Signal")
|
||||
call := obj.Call("org.asamk.Signal.sendMessage",0, "Your really cool message", []string{}, "+49176XXXXXXX")
|
||||
if call.Err != nil {
|
||||
panic(call.Err)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
# Example
|
||||
|
||||
Here an "full" example of getting messages (without error handling)
|
||||
|
||||
```
|
||||
func listenToDbus() error {
|
||||
conn, err := dbus.ConnectSessionBus()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Failed to connect to session bus:", err)
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
if err = conn.AddMatchSignal(
|
||||
dbus.WithMatchInterface("org.asamk.Signal"),
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c := make(chan *dbus.Signal, 10)
|
||||
conn.Signal(c)
|
||||
for v := range c {
|
||||
if v.Name == "org.asamk.Signal.SyncMessageReceived" {
|
||||
msg := parseSyncMessageReceived(v)
|
||||
// do something with msg like a callback
|
||||
}
|
||||
if v.Name == "org.asamk.Signal.MessageReceived" {
|
||||
msg := parseMessageReceived(v)
|
||||
// do something with msg like a callback
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type SyncMessage struct {
|
||||
Timestamp int64
|
||||
Source string
|
||||
Destination string
|
||||
Message string
|
||||
Attachments []string
|
||||
}
|
||||
|
||||
func parseSyncMessageReceived(v *dbus.Signal) SyncMessage {
|
||||
msg := SyncMessage{}
|
||||
msg.Timestamp, _ = v.Body[0].(int64)
|
||||
msg.Source = v.Body[1].(string)
|
||||
msg.Destination = v.Body[2].(string)
|
||||
msg.Message = v.Body[4].(string)
|
||||
msg.Attachments = v.Body[5].([]string)
|
||||
return msg
|
||||
}
|
||||
|
||||
type IncommingMessage struct {
|
||||
Timestamp int64
|
||||
Source string
|
||||
Message string
|
||||
Attachments []string
|
||||
}
|
||||
|
||||
func parseMessageReceived(v *dbus.Signal) IncommingMessage {
|
||||
msg := IncommingMessage{}
|
||||
msg.Timestamp, _ = v.Body[0].(int64)
|
||||
msg.Source = v.Body[1].(string)
|
||||
msg.Message = v.Body[3].(string)
|
||||
msg.Attachments = v.Body[4].([]string)
|
||||
return msg
|
||||
}
|
||||
```
|
||||
|
||||
and another one to sending messages:
|
||||
|
||||
```
|
||||
func SendMessage(to string, msg string) {
|
||||
conn, err := dbus.ConnectSessionBus()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Failed to connect to session bus:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
obj := conn.Object("org.asamk.Signal", "/org/asamk/Signal")
|
||||
call := obj.Call("org.asamk.Signal.sendMessage",0, msg, []string{}, to)
|
||||
if call.Err != nil {
|
||||
panic(call.Err)
|
||||
}
|
||||
}
|
||||
|
||||
```
|
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09071.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09076.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09079.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09082.jpg
Normal file
After Width: | Height: | Size: 993 KiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09084.jpg
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09087.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09090.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09094.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09099.jpg
Normal file
After Width: | Height: | Size: 1,014 KiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09105.jpg
Normal file
After Width: | Height: | Size: 969 KiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09111.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
static/img/2021/02/oranienburg-lehnitz-kanal/DSC09116.jpg
Normal file
After Width: | Height: | Size: 926 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/20210224_140527.jpg
Normal file
After Width: | Height: | Size: 916 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/20210224_140609.jpg
Normal file
After Width: | Height: | Size: 906 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09120.jpg
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09122.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09123.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09126.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09127.jpg
Normal file
After Width: | Height: | Size: 949 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09129.jpg
Normal file
After Width: | Height: | Size: 950 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09132.jpg
Normal file
After Width: | Height: | Size: 1 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09135.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09140.jpg
Normal file
After Width: | Height: | Size: 775 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09146.jpg
Normal file
After Width: | Height: | Size: 838 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09147.jpg
Normal file
After Width: | Height: | Size: 941 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09149.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09151.jpg
Normal file
After Width: | Height: | Size: 909 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09153.jpg
Normal file
After Width: | Height: | Size: 762 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09154.jpg
Normal file
After Width: | Height: | Size: 836 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09156.jpg
Normal file
After Width: | Height: | Size: 780 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09157.jpg
Normal file
After Width: | Height: | Size: 1,013 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09161.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09164.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09169.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09172.jpg
Normal file
After Width: | Height: | Size: 991 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09178.jpg
Normal file
After Width: | Height: | Size: 719 KiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09180.jpg
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
static/img/2021/02/ss-brotfabrik-oranienburg/DSC09183.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
static/img/2021/02/viktoriapark/DSC08968.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
static/img/2021/02/viktoriapark/DSC08970.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/img/2021/02/viktoriapark/DSC08973.jpg
Normal file
After Width: | Height: | Size: 906 KiB |
BIN
static/img/2021/02/viktoriapark/DSC08976.jpg
Normal file
After Width: | Height: | Size: 875 KiB |
BIN
static/img/2021/02/viktoriapark/DSC08988.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
static/img/2021/02/von-der-schulenburg-park/DSC09185.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
static/img/2021/02/von-der-schulenburg-park/DSC09195.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
static/img/2021/02/von-der-schulenburg-park/DSC09198.jpg
Normal file
After Width: | Height: | Size: 1 MiB |
BIN
static/img/2021/02/von-der-schulenburg-park/DSC09199.jpg
Normal file
After Width: | Height: | Size: 1,016 KiB |
BIN
static/img/2021/02/von-der-schulenburg-park/DSC09204.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
static/img/2021/03/dorfkirche-tempelhof/DSC09214.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
static/img/2021/03/dorfkirche-tempelhof/DSC09216.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
static/img/2021/03/dorfkirche-tempelhof/DSC09224.jpg
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
static/img/2021/03/dorfkirche-tempelhof/DSC09259.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
static/img/2021/03/dorfkirche-tempelhof/DSC09271.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
static/img/2021/03/dorfkirche-tempelhof/DSC09280.jpg
Normal file
After Width: | Height: | Size: 1.5 MiB |