<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Wheeeeeee... kayssun</title>
    <description>Was mir so gerade einfällt.
</description>
    <link>https://kayssun.de/</link>
    <atom:link href="https://kayssun.de/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Tue, 07 May 2019 16:02:37 +0200</pubDate>
    <lastBuildDate>Tue, 07 May 2019 16:02:37 +0200</lastBuildDate>
    <generator>Jekyll v3.1.6</generator>
    
      <item>
        <title>Passing data through segues when called dynamicly</title>
        <description>&lt;p&gt;tl;dr: I don’t. I grab the top view controller from the stack of the navigation controller.&lt;/p&gt;

&lt;p&gt;From my DetailView, I wanted to push to a new ViewController for adding a comment. The “link” to add a new comment was in an action sheet (UIAlertController), so I had to call the segue from the code. To create the segue in the StoryBoard, I had to connect the NavigationController (not the UITableViewController) with the new ViewController.&lt;/p&gt;

&lt;p&gt;This means, that when I call&lt;/p&gt;

&lt;div class=&quot;language-swift highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;navigationController&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;performSegue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;withIdentifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;downtimeSegue&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;sender&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;the segue will be perform correctly. BUT. The method&lt;/p&gt;

&lt;div class=&quot;language-swift highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;prepare&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;segue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;UIStoryboardSegue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;sender&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Any&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;will not be called since it is implemented in my DetailViewController, not in the NavigationController.&lt;/p&gt;

&lt;p&gt;So I am not able to pass any data in that method.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Solution&lt;/em&gt;: I just grabbed the DetailViewController via the NavigationController and so I can access all properties.&lt;/p&gt;

&lt;div class=&quot;language-swift highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;viewDidLoad&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;controller&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;navigationController&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;viewControllers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;controller&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;DetailViewController&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;delegate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;controller&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as?&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;DetailViewController&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
        <pubDate>Tue, 07 May 2019 00:00:00 +0200</pubDate>
        <link>https://kayssun.de/passing-data-segue/</link>
        <guid isPermaLink="true">https://kayssun.de/passing-data-segue/</guid>
        
        <category>swift</category>
        
        <category>ios</category>
        
        <category>development</category>
        
        
      </item>
    
      <item>
        <title>Limiting scp uploads via authorized_keys</title>
        <description>&lt;p&gt;During an automated compile and deployment process you problaby want to copy the new file(s) to
the destination server. Since the process will be running within the deployment environment (gitlab-ci in my
case) you cannot supply a password every time. So you use SSH keys to authenticate against the server. I found this
to be common practice and it is well documented.&lt;/p&gt;

&lt;p&gt;Only much later I found that you can limit the command one key is allowed to run on the server. So you might have
a script on the server which pulls a built package from the repo after your build pipeline put it there. You simply
add a “command=” flag before the key in authorized_keys:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;command=&quot;/usr/bin/pull-softare-update&quot; ssh-rsa AAAAB123...
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;This way, you can run &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh user@server.example.com /usr/bin/pull-softare-update&lt;/code&gt; but nothing else. Supplying another
command via ssh will still result in “pull-software-update” beeing run on the server.&lt;/p&gt;

&lt;p&gt;There are cases, though, where you don’t explicitly run a command on the server but still use ssh. Those are rsync and
scp. Both start a process on the other side to manage sending/receiving files so you can use the command= feature
here, too.&lt;/p&gt;

&lt;p&gt;For receiving files, there is an answer on &lt;a href=&quot;https://serverfault.com/questions/852309/limit-ssh-key-to-scp-only&quot;&gt;Serverfault&lt;/a&gt; which
gives a hint on how this might work.&lt;/p&gt;

&lt;p&gt;scp starts a process with the hidden command line parameters -f to provide a file or directory for download and -t to
specify a directory to put files into (-f: from / -t: to).&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;command=&quot;scp -t /srv/storage/foo&quot; ssh-rsa AAAAB123...
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;To further limit the key, you can explicitly disallow other ssh features like port forwarding:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;command=&quot;scp -t /srv/storage/foo&quot;,no-pty,no-port-forwarding,no-agent-forwarding,no-X11-forwarding ssh-rsa AAAAB123...
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
        <pubDate>Wed, 20 Feb 2019 00:00:00 +0100</pubDate>
        <link>https://kayssun.de/scp-security/</link>
        <guid isPermaLink="true">https://kayssun.de/scp-security/</guid>
        
        
      </item>
    
      <item>
        <title>Fulmar für kleine Projekte</title>
        <description>&lt;p&gt;&lt;a href=&quot;https://github.com/CORE4/fulmar&quot;&gt;Fulmar&lt;/a&gt; basiert auf Rake und bringt einige Erweiterungen mit, um mit wenig Code ein Deployment durchzuführen. Zusätzlich zu den Rake-Tasks liest es eine Konfigurationsdatei ein, die unter anderem definiert, welche Ziele es gibt.&lt;/p&gt;

&lt;p&gt;Die Basiskonfiguration von Fulmar liegt in zwei Dateien: “Fulmarfile” liegt im Basisverzeichnis des Projekts. Dazu kommt ein Unterverzeichnis “Fulmar”, das eine oder mehrere .config.yml-Dateien enthält.&lt;/p&gt;

&lt;h2 id=&quot;konfiguration&quot;&gt;Konfiguration&lt;/h2&gt;

&lt;p&gt;Meine Konfigurationsdatei &lt;code class=&quot;highlighter-rouge&quot;&gt;Fulmar/kayssun.config.yml&lt;/code&gt; für dieses Blog sieht wie folgt aus:&lt;/p&gt;

&lt;div class=&quot;language-yml highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;s&quot;&gt;environments&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;local&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;blog&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;local_path&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;live&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;blog&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;remote_path&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/srv/www/www.kayssun.de&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;local_path&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;_site&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;rsync&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;hostname&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ada&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Fulmar unterteilt die Ziele einerseits in Environments, bei größeren Projekten in der Agentur wären das zum Beispiel “vagrant” für die lokale Entwicklung, “staging” für erste Tests, “preview” für eine Kundenvorschau und “live” für das Produktivsystem. Hier habe ich nur die Einvironments “local” und “live”. Darunter können beliebig viele “targets” angelegt werden, hier “blog”. Das wird nötig, wenn zu einem Projekt mehrere Dateien gehören, die an unterschiedliche Stellen auf dem Server kopiert werden müssen (zum Beispiel Konfigurationsdateien für andere Dienste).&lt;/p&gt;

&lt;p&gt;Hier in meinem Beispiel setze ich die lokalen und entfernten Pfade, die Art des Syncs und den Hostname des Servers.&lt;/p&gt;

&lt;p&gt;Die Targets werden dann im &lt;code class=&quot;highlighter-rouge&quot;&gt;Fulmarfile&lt;/code&gt; geladen:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;Prepare site (build blog)&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;setup: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;environment:local:blog&#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;local_shell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;jekyll build&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:deploy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;Deploy blog to live system&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;live: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;environment:live:blog&#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;file_sync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;transfer&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Der erste Task lädt die lokale Konfiguration. &lt;code class=&quot;highlighter-rouge&quot;&gt;local_shell.run&lt;/code&gt; führt den Befehl im &lt;code class=&quot;highlighter-rouge&quot;&gt;local_path&lt;/code&gt; der gewählten Konfiguration aus. Das wäre hier “.”, also das Verzeichnis, in dem sich &lt;code class=&quot;highlighter-rouge&quot;&gt;Fulmarfile&lt;/code&gt; befindet.&lt;/p&gt;

&lt;p&gt;Der zweite Task synchronisiert das Verzeichnis “_site” auf den Server. Über &lt;code class=&quot;highlighter-rouge&quot;&gt;remote_shell.run&lt;/code&gt; könnten auf dem Server noch Befehle ausgeführt werden, etwa um Caches zu löschen.&lt;/p&gt;

&lt;h2 id=&quot;benutzung&quot;&gt;Benutzung&lt;/h2&gt;

&lt;p&gt;Über &lt;code class=&quot;highlighter-rouge&quot;&gt;fulmar -T&lt;/code&gt; kann die Liste der verfügbaren Tasks eingesehen werden. &lt;code class=&quot;highlighter-rouge&quot;&gt;fulmar setup&lt;/code&gt; kompiliert in meinem Fall das Blog und stellt es unter “_site” bereit. Mit &lt;code class=&quot;highlighter-rouge&quot;&gt;fulmar deploy:live&lt;/code&gt; kann dieses Verzeichnis auf den Server synchronisiert werden.&lt;/p&gt;

&lt;h2 id=&quot;ausbau&quot;&gt;Ausbau&lt;/h2&gt;

&lt;p&gt;Fulmar wird erst für größere Projekte interessant. In der Agentur (&lt;a href=&quot;https://www.core4.de&quot;&gt;CORE4 GmbH&lt;/a&gt;) nutzen wir für alle Projekt möglichst das gleiche Schema. Das macht es leichter, sich in fremde Projekte einzuarbeiten. &lt;code class=&quot;highlighter-rouge&quot;&gt;fulmar setup&lt;/code&gt; ist dabei immer der erste Befehl nach dem Auschecken aus dem Git. Damit werden alle nötigen Abhängigkeiten geholt und das System für die Entwicklung vorbereitet. Fulmar bringt Unterstützung für Git, MySQL/MariaDB, rsync, Versionierung der Deployments. S3 und weitere Features werden folgen.&lt;/p&gt;
</description>
        <pubDate>Tue, 08 Mar 2016 00:00:00 +0100</pubDate>
        <link>https://kayssun.de/fulmar/</link>
        <guid isPermaLink="true">https://kayssun.de/fulmar/</guid>
        
        
      </item>
    
      <item>
        <title>Animiertes Flurlicht</title>
        <description>&lt;p&gt;&lt;img src=&quot;/img/rainbow_light.jpg&quot; alt=&quot;Regenbogen-Beleuchtung&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Das Licht in meinem Flur wird von einem Raspberry Pi mit 2x 5m LED-Streifen und 2 Bewegungsmeldern gesteuert.&lt;/p&gt;

&lt;p&gt;Für die Steuerung der LED-Streifen wäre nicht unbedingt ein Raspberry Pi nötig, die Logik ließe sich auch mit einem Arduino abbilden. Allerdings wollte ich meinen Code mit Ruby schreiben und später auch noch weitere Funktionen mit dem Rechner im Flur implementieren.&lt;/p&gt;

&lt;h2 id=&quot;vorbereitung&quot;&gt;Vorbereitung&lt;/h2&gt;

&lt;p&gt;Folgende Komponenten sind nötig:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Raspberry Pi&lt;/li&gt;
  &lt;li&gt;SD-Karte&lt;/li&gt;
  &lt;li&gt;ein oder zwei selbstklebende LED-Streifen WS2801&lt;/li&gt;
  &lt;li&gt;ein oder zwei Bewegungsmelder (z.B. HC-SR501)&lt;/li&gt;
  &lt;li&gt;&amp;gt;=120W-Netzteil, 5V&lt;/li&gt;
  &lt;li&gt;einige Kabel&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/img/ws2801.jpg&quot; alt=&quot;WS2801-LED-Streifen&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;aufbau&quot;&gt;Aufbau&lt;/h2&gt;

&lt;p&gt;Die LED-Streifen haben vier Anschlüsse: +5V, Ground, Clock und Data. Die ersten beiden müssen mit dem Netzteil verbunden werden, die anderen mit dem Raspberry Pi. Der Raspberry Pi muss wiederrum an den Ground vom Netzteil angeschlossen werden. Die Bewegungsmelder werden ebenfalls +5V, Ground und jeweils eine Datenleitung benötigen.&lt;/p&gt;

&lt;p&gt;Die LED-Streifen habe ich an die Decke geklebt und die Datenleitungen auf der gegenüberliegenden des Raspis verbunden. Die Stromleitungen habe ich jeweils an den spitzen des ‘U’ angeschlossen, damit sie nicht zu lang werden.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/led_strip_connections.png&quot; alt=&quot;Verkabelung der LED-Streifen&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Die Bewegungsmelder sind in der Mitte des Flurs und schauen jeweils nach links und rechts, so dass der Raspberry Pi auf die Richtung reagieren kann, aus der man in den Flur geht.&lt;/p&gt;

&lt;p&gt;Der Raspberry Pi könnte über das Netzteil mit betrieben werden, indem man den 5V-Pin (und Ground) des Pis mit dem Netzteil verbindet, das würde aber die Sicherung umgehen, soweit ich weiß. Ich habe also ein separates USB-Netzteil genommen, das mit später auch erlaubt, mit einem Relais das große Netzteil abzuschalten, wenn es länger nicht gebraucht wird. Nachts etwa.&lt;/p&gt;

&lt;h2 id=&quot;bewegungsmelder&quot;&gt;Bewegungsmelder&lt;/h2&gt;

&lt;p&gt;Die Bewegungsmelder sind recht einfach anzuschließen. Sie benötigen 5V vom Netzteil und haben jeweils einen Datenausgang, den man mit dem Rasperry Pi verbinden kann. Wenn sie eine Bewegung feststellen, liegt Spannung am Ausgang an, sonst nicht. Ich habe die Bewegungssensoren an die Decke gehängt. Damit sie in der richtigen Position halten, brauchte ich eine Art Gehäuse, das ich aus Bügelperlen gebaut habe. :)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/motion_sensors.jpg&quot; alt=&quot;Bewegunssensoren im Bügelperlengehäuse&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Die Bügelperlen habe ich an eine dünne Holzplatte geklebt. Silikon eignet sich hier nicht (für euch erprobt) aber normaler Haushaltskleber tuts eigentlich. Das ganze Ding habe ich dann an die Decke geschraubt.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/motions_sensors_ceiling.jpg&quot; alt=&quot;Bewegungssensoren an der Decke&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;verkabelung&quot;&gt;Verkabelung&lt;/h2&gt;

&lt;p&gt;Die Bewegungssensoren müssen im Grunde einfach nur an einen der freien GPIO-Pins angebracht werden. Die Bildersuche von Google liefert dieverse Treffer zur Belegung, ein Beispiel für die zur Zeit aktuellen Raspberry-Pi-Modelle wäre ein &lt;a href=&quot;http://diyhacking.com/raspberry-pi-gpio-control/&quot;&gt;Artikel auf diyhacking.com&lt;/a&gt;. Ich habe die Pins 23 und 24 genommen, diese Werte sind auch im späteren Gem zur Lichtsteuerung voreingetragen.&lt;/p&gt;

&lt;p&gt;Die LED-Streifen müssen über die SPI-Schnittstelle des Raspberry Pis angeschlossen werden. Das sind die Pins 19 und 23. 19 ist der Datenausgang, 23 die Clock, die das Timing für das Signal vorgibt.&lt;/p&gt;

&lt;p&gt;Pin 6 zum Beispiel ist Ground und muss mit dem Netzteil verbunden werden, damit alle Geräte einen gemeinsamen Nullpunkt haben.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/raspi_cables.jpg&quot; alt=&quot;Verkabelung des Raspberry Pi&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;software&quot;&gt;Software&lt;/h2&gt;

&lt;p&gt;In den Konfigurationssoftware des Raspberry Pi findet sich in den erweiterten Einstellungen die Option, um die SPI-Schnittstelle zu aktivieren. Nach einem Neustart müsste die Geräte /dev/spidev0.0 und /dev/spidev0.1 zur Verfügung stehen.&lt;/p&gt;

&lt;p&gt;Ist die Verkabelung genau wie hier beschrieben, kann der Ruby-Gem &lt;a href=&quot;https://rubygems.org/gems/ws_light/&quot;&gt;ws_light&lt;/a&gt; direkt genutzt werden:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gem install ws_light
ws_light
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ich habe bisher noch keine Konfigurationsdatei vorgesehen. Wenn Bedarf besteht, kann ich das aber schnell nachrüsten.&lt;/p&gt;

&lt;p&gt;Ansonsten lässt sich der Gems auch selbst anpassen, der Code liegt auf &lt;a href=&quot;https://github.com/kayssun/ws_light&quot;&gt;github&lt;/a&gt;. Die Konfiguration der GPIO-PINs für die Bewegungsmelder ist in der Datei bin/ws_light.&lt;/p&gt;

&lt;h2 id=&quot;tagsber&quot;&gt;Tagsüber&lt;/h2&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/-giFwVmdrN4&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;nachts&quot;&gt;Nachts&lt;/h2&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/lCNg5Pd8_dU&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;rckmeldungen&quot;&gt;Rückmeldungen&lt;/h2&gt;

&lt;p&gt;Diese Zusammenfassung ist womöglich als Anleitung für eine Anfängerin noch etwas zu knapp. Ich würde mich über Rückmeldungen freuen und gebe auch gerne Hilfestellung.&lt;/p&gt;
</description>
        <pubDate>Tue, 08 Mar 2016 00:00:00 +0100</pubDate>
        <link>https://kayssun.de/animiertes-flurlicht/</link>
        <guid isPermaLink="true">https://kayssun.de/animiertes-flurlicht/</guid>
        
        
      </item>
    
      <item>
        <title>Jekyll</title>
        <description>&lt;p&gt;Beginnend mit einem Meta-Post will ich mal schnell mein Setup beschreiben, mit dem ich nun zu bloggen gedenke.&lt;/p&gt;

&lt;p&gt;Als Blog-Software nutze ich &lt;a href=&quot;http://jekyllrb.com&quot;&gt;Jekyll&lt;/a&gt;, das aus ein paar Dateien eine statische Seite generiert. Ich nutze das &lt;a href=&quot;https://github.com/adueck/cayman-blog&quot;&gt;“Cayman Theme”&lt;/a&gt; von Jason Lang. Für das hochladen auf meinen Webserver habe ich mir schnell &lt;a href=&quot;https://github.com/CORE4/fulmar&quot;&gt;Fulmar&lt;/a&gt; eingerichtet und zum tatsächlichen Schreiben der Posts nutze ich &lt;a href=&quot;http://www.sublimetext.com&quot;&gt;Sublime Text&lt;/a&gt; auf dem Mac. Die statischen Dateien auf dem Server ersparen mir Sicherheitsupdates und generell mag ich Dinge, die sich in ein Git-Repo einchecken lassen.&lt;/p&gt;

&lt;p&gt;Der Server läuft mit nginx auf einem Debian-System und das Zertifikat für SSL/TLS habe ich von &lt;a href=&quot;https://letsencrypt.org&quot;&gt;Let’s encrypt&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Sat, 05 Mar 2016 00:00:00 +0100</pubDate>
        <link>https://kayssun.de/jekyll/</link>
        <guid isPermaLink="true">https://kayssun.de/jekyll/</guid>
        
        
      </item>
    
  </channel>
</rss>
