MQTT Bridge with Mosquitto and nginx

Author: akeil
Date: 2017-03-05
Version: 1

Set up a Mosquitto [1] MQTT broker which is available in the internet. nginx [2] is used as a reverse proxy and to handle SSL encryption. An additional Mosquitto instance on the local network is used as a bridge to forward MQTT messages from the local network to the internet and vice versa.

This allows to easily connect devices which do not support authentication or encryption on the local network with with other devices or services connected via the internet.

/images/mqtt-bridge-overview.svg

Overview for an MQTT bridge scenario. Clients on the local network use an insecure connection to talk to the local MQTT broker while clients on the internet use a secure connection.

Read more…

Firefox Sync Server on a Raspberry Pi

Author: akeil
Date: 2016-09-14
Version: 1.2
updated: 2016-09-15

The Firefox browser can use a Sync Service to synchronize settings, bookmarks and other stuff across multiple Firefox installations. By default, Mozilla's public sync server is used but it is possible to run your own sync server [1].

We will install piCore Linux and the Firefox Sync Server on a new Raspberry Pi.

Read more…

podfetch 0.4.3

Changes in podfetch 0.4.3:

The ls and update commands accept shell wildcards for subscription names:

$ podfetch ls f?o ba*

Lists subscriptions foo, bar and baz but not something-else.

If the subscriptions directory contains files that are not podfetch subscriptions, a new config option ignore can be used to tell podfetch to ignore these:

[podfetch]
ignore = .* *.bak

The option expects a whitespace separated list of patterns that should be ignored.

See the podfetch main page.

Coordinate Scripts With systemd

Author: akeil
Date: 2013-12-14
Version: 1

Use systemd to execute scripts, controlling the order of execution.

Assuming we have:
  • a single preparation unit - prep.service
  • multiple "task" units - task-N.service
  • a single cleanup script - done.service

We want to run the prep unit once, then run all our task units and finally the done unit once.

Defining dependencies between tasks is relatively simple when each task is represented by a systemd unit [1]. Dependencies are defined using Requires= or Wants= and order of execution is defined with After= and Before=.

The only thing left is to make sure that the "preparation" and "finish" steps are executed only once, even if multiple tasks are run (and not once for each task).

To achieve this a .target is created and all tasks are associated to that target.

Read more…

podfetch 0.4.0

Changes in podfetch 0.4.0:

The ls was now outputs episodes in reverse chronological order. The most recently published episodes are listed first. Episodes are sorted by date, even if episodes from multiple subscriptions are shown.

When no subscription name is specified, ls will now list episodes from all subscriptions. In previous versions, ls would output the list of subscriptions in this case. This is now done with show.

Additional parameters were added:

--newest / -n
To control the number of episodes shown
--all / -a
To not limit the number of episodes shown

Examples

List the 10 (default) most recent episodes:

$ podfetch ls

List up to 20 episodes:

$ podfetch ls -n 20

List the 10 (default) most recent episodes from subscriptions "foo" and "bar":

$ podfetch ls foo bar

Show all episodes from subscription "foo":

$ podfetch ls -a foo

A new subcommand show displays subscription details.

To view details for a specific subscription (multiple names can be specified):

$ podfetch show foo

If the subscription name is not specified, shows details for all:

$ podfetch show

New command del to remove subscriptions and optionally downloaded episodes.

To remove subscriptions "foo" and "bar":

$ podfetch del foo bar

To remove subscription "foo" including downloaded episodes:

$ podfetch del foo --episodes

See the podfetch main page.

podfetch 0.3.2

Changes in podfetch 0.3.2:

Index files are now kept under ~/.local/share/podfetch/ instead of ~/.cache/podfetch/.

Subscriptions may define an individual content_dir where episodes are stored.

[subscription]
url = http://example.com/podcast
title = Some Name
content_dir = /path/to/episodes
$ podfetch add http://example.com/podcast -d /path/to/episodes

The add command supports a (filename-) template parameter. It has the same effect as the filename_template setting in the configuration files.

$ podfetch add http://example.com/podcast --template '{title}-{id}.{ext}'
The purge command is improved:
  • select episodes by date published (was: filename)
  • simulation mode
  • correctly handle episodes with multiple files

See the podfetch main page.