<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Norman Sutorius on Medium]]></title>
        <description><![CDATA[Stories by Norman Sutorius on Medium]]></description>
        <link>https://medium.com/@Soulfected?source=rss-33b4a6236f90------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6vTMPi4FDOku93c0rvNBNw.jpeg</url>
            <title>Stories by Norman Sutorius on Medium</title>
            <link>https://medium.com/@Soulfected?source=rss-33b4a6236f90------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 17:55:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Soulfected/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Part 2: One File. One Database. No Drama.]]></title>
            <link>https://medium.com/@Soulfected/part-2-one-file-one-database-no-drama-10e901fd6024?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/10e901fd6024</guid>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[simplicity]]></category>
            <category><![CDATA[mac-mini]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Fri, 02 Jan 2026 15:30:24 GMT</pubDate>
            <atom:updated>2026-01-02T15:45:54.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*81hy7pV6n16j18HmO8k2MQ.png" /></figure><p>At some point, every developer gets tired.</p><p>Tired of, database clusters, replicas, failover diagrams &amp; “managed” services that mostly manage your anxiety.</p><p>I didn’t want to run a database platform.<br>I just wanted to run an app.</p><p>And that’s when the obvious question appeared:</p><p><strong>What if a single file is enough?</strong></p><p>Spoiler! It is.</p><h3>SQLite Is Not a Compromise. It’s a Decision.</h3><p>SQLite still has a reputation problem.</p><p>People treat it like decaf coffee, acceptable, but not serious. That’s nonsense. SQLite is fast, stable, battle-tested, local &amp; boring (in the best possible way) Most importantly, SQLite is honest.</p><p>No hidden network hops, No magic, No background complexity quietly waiting to fail.</p><p>Just, a file on a very fast disk.</p><p>On a Mac mini, that’s not a limitation. That’s the sweet spot.</p><h3>The Storage Location: Boring on Purpose</h3><p>My production database lives here:</p><pre>/Users/apprunner/storage/local_s3/cupcounter/production.sqlite3</pre><p>No mystery.<br>No container voodoo.<br>No “where are my data actually stored?”</p><p>If I want to see my data, I know exactly where to look. That matters more than people admit.</p><h3>Deployments Should Not Own Backups</h3><p>Important clarification, Backups do NOT run as part of the deployment.</p><p>During a deploy, Kamal does exactly what it should do:</p><ul><li>build the image</li><li>run migrations</li><li>restart containers</li></ul><p>That’s it.</p><p>Backups are a different concern. Coupling backups to deployments is how people lose data while feeling safe. Deployments should be fast. Backups should be boring. Those responsibilities don’t belong together.</p><h3>Backups as a Kamal Accessory</h3><p>Instead of hooking backups into deploys, I run them as a long-running Kamal accessory.</p><p>That means:</p><ul><li>backups are time-based, not event-based</li><li>deploys stay predictable</li><li>no “deploy failed because backup failed” nonsense</li></ul><p>Here’s the full setup:</p><pre>accessories:<br>  backup:<br>    image: normansutorius/cupcounter<br>    host: homeserver.local<br>    directories:<br>      - &quot;/Users/apprunner/storage/local_s3/cupcounter:/rails/storage&quot;<br>    env:<br>      clear:<br>        DB_PATH: /rails/storage/production.sqlite3<br>        BACKUP_DIR: /rails/storage/backups<br>        BACKUP_KEEP: 5<br>    cmd: &quot;bash -lc &#39;while true; do /rails/bin/backup_sqlite; sleep 86400; done&#39;&quot;</pre><p>What this does:</p><ul><li>runs continuously</li><li>creates <strong>one backup per day</strong></li><li>keeps only the last <strong>N backups</strong></li><li>runs independently of deploys</li></ul><p>No cron, No scheduler, No external service. Just a loop and sleep.</p><p>Boring. Reliable. Correct.</p><h3>The Backup Script (Simple, Explicit, Safe)</h3><p>This is the full backup_sqlite script:</p><pre>#!/usr/bin/env bash<br>set -euo pipefail<br># Configuration via ENV with defaults<br>DB_PATH=&quot;${DB_PATH:-/rails/storage/production.sqlite3}&quot;<br>BACKUP_DIR=&quot;${BACKUP_DIR:-/rails/storage/backups}&quot;<br>KEEP=&quot;${BACKUP_KEEP:-5}&quot;<br>mkdir -p &quot;$BACKUP_DIR&quot;<br>TIMESTAMP=&quot;$(date +&quot;%Y-%m-%d_%H-%M-%S&quot;)&quot;<br>TEMP_FILE=&quot;${BACKUP_DIR}/temp_${TIMESTAMP}.sqlite3&quot;<br>BACKUP_FILE=&quot;${BACKUP_DIR}/production_${TIMESTAMP}.sqlite3&quot;<br>echo &quot;[backup] Vacuum from ${DB_PATH} -&gt; ${BACKUP_FILE}&quot;<br># Create a consistent backup using VACUUM INTO<br>sqlite3 &quot;$DB_PATH&quot; &quot;VACUUM INTO &#39;${TEMP_FILE}&#39;;&quot;<br>mv &quot;${TEMP_FILE}&quot; &quot;${BACKUP_FILE}&quot;<br>echo &quot;[backup] Created ${BACKUP_FILE}&quot;<br># Rotation: keep only the newest KEEP files<br>cd &quot;${BACKUP_DIR}&quot;<br>ls -1t production_*.sqlite3 | sed -e &quot;1,${KEEP}d&quot; | xargs -r rm --<br>echo &quot;[backup] Rotation done (keep=${KEEP}).&quot;</pre><p>Why this matters:</p><ul><li>VACUUM INTO guarantees a <strong>consistent snapshot</strong></li><li>the database stays online</li><li>no file corruption</li><li>rotation is explicit and predictable</li><li>failure is loud (set -euo pipefail)</li></ul><p>This is exactly how SQLite wants to be backed up.</p><h3>Volumes: Persistence Without Theater</h3><p>The database lives outside the container and is mounted as a volume:</p><pre>volumes:<br>  - &quot;/Users/apprunner/storage/local_s3/cupcounter:/rails/storage&quot;</pre><p>Containers are disposable, images are replaceable &amp; the file stays.</p><p>That’s the contract.</p><h3>Simplicity vs. Database Theater</h3><p>Here’s the uncomfortable truth. Most database setups exist not because they’re needed,but because they’re <em>possible</em>. Complexity often feels like progress. It isn’t.</p><p>Real progress is, fewer moving parts, fewer failure modes &amp; less cognitive load. SQLite on a Mac mini delivers exactly that.</p><h3>What This Setup Gives You</h3><ul><li>a production Rails app</li><li>a persistent database</li><li>continuous, reliable backups</li><li>clear ownership of your data</li><li>zero deploy/backup coupling</li><li>no ops burnout</li></ul><p>All built on one file</p><h3>Final Thought</h3><p>I thought I needed a “real” database. I got a file instead.</p><p>It turns out, that was the more professional choice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10e901fd6024" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prepare the Mac mini — turning macOS into a tiny Heroku]]></title>
            <link>https://medium.com/@Soulfected/prepare-the-mac-mini-turning-macos-into-a-tiny-heroku-55dac2f303b2?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/55dac2f303b2</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[m4-mac-mini]]></category>
            <category><![CDATA[simple]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 19:18:24 GMT</pubDate>
            <atom:updated>2026-01-02T15:32:21.918Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>You don’t need a cloud to deploy Rails</strong></h3><h3>Turning a Mac mini into a tiny Heroku</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2RkSVlk0heP4eaRFRcS1dw.jpeg" /></figure><p><em>Part 1 of the “Home-Server Rails Deploy” series</em></p><p>There’s something charming about the idea of hosting your own app.<br>Not in a cloud region.<br>Not behind a wall of YAML.<br>Just on a simple machine sitting quietly in your home office, a Mac mini.</p><p>But here’s the catch:</p><p>A Mac mini is <em>not</em> a Linux server.<br>And all the tools that make modern deployment delightful — Rails 8, Docker, Kamal — are built with Linux in mind.</p><p>So the question became:</p><blockquote><strong><em>What do you have to do to a Mac mini so it behaves a bit like Heroku or Cloud Foundry?</em></strong><em><br>Meaning: build, deploy, run — without turning it into a DevOps museum.</em></blockquote><p>Turns out, not much.<br>But it <em>has</em> to be the right “not much”.</p><p>Let’s go through it.</p><h3>1. macOS is not Linux, so we give it a Linux inside</h3><p>Heroku doesn’t run BSD.<br>Cloud Foundry doesn’t run BSD.<br>Your app expects Linux.</p><p>So the Mac needs a small, invisible Linux layer that behaves like a real container host.</p><p>Enter <strong>Colima, </strong>the simplest way to run a Docker-compatible Linux VM on macOS. Lightweight, no drama.</p><p>Install it:</p><pre>brew install colima<br>colima start --cpu 2 --memory 4 --vm-type vz</pre><blockquote><em>vz uses Apple’s native virtualization fast, efficient, perfect when your Docker images are </em><em>arm64.</em></blockquote><p>If you can now run:</p><pre>docker ps</pre><p>…you’re in business.</p><p>That’s your “Heroku dyno host” right there.</p><h3>2. Turn the Mac mini into a real server (SSH + deploy user)</h3><p>A server is a server because you can log in and deploy to it.<br>So treat the Mac mini exactly like a Linux VM.</p><p>Create a user (I use apprunner):</p><ul><li>System Settings → Users &amp; Groups</li><li>Add standard user</li><li>Give it a password</li><li>Enable <strong>Remote Login (SSH)</strong></li></ul><p>Copy your SSH key:</p><pre>ssh-copy-id apprunner@homeserver.local</pre><p>Add this to your SSH config:</p><pre>Host homeserver<br>  HostName homeserver.local<br>  User apprunner<br>  IdentityFile ~/.ssh/id_ed25519_kamal</pre><p>Now you can run:</p><pre>ssh homeserver<br>docker ps</pre><p>Your Mac mini is now pretending, convincingly, be a Linux box in your basement.</p><h3>3. macOS ships BSD tools, Rails deploy scripts expect GNU tools</h3><p>Half the world discovers this too late.</p><p>You run a script from the Linux ecosystem, and suddenly sed behaves like it has a different personality.</p><p>Simplify your life:</p><pre>brew install coreutils findutils gnu-sed gnu-which</pre><p>You now have exactly the tooling Heroku would expect under the hood.</p><h3>4. A proper Docker runtime (via Colima)</h3><p>Everything modern deployment touches belongs in a container.</p><p>Rails 8 assumes it.<br>Kamal assumes it.<br>Your app benefits from it.</p><p>When Colima is running, Docker behaves exactly like on Linux:</p><ul><li>build images</li><li>run containers</li><li>mount volumes</li><li>expose ports</li><li>share networks</li></ul><p>Nothing special.<br>Just boring, reliable container runtime — the best kind.</p><h3>5. Persistent volumes, because SQLite is a file, not a service</h3><p>Heroku’s filesystem is ephemeral.<br>Yours doesn’t have to be.</p><p>Your Mac mini has a disk.<br>Let’s use it like adults.</p><p>e.q. in your Kamal deploy config deploy.yml</p><pre>volumes: <br>  # Host-Storage (incl. production.sqlite3) -&gt; /rails/storage in Container<br>  - &quot;/Users/apprunner/storage/local_s3/cupcounter:/rails/storage&quot;</pre><p>This is where your SQLite database lives.<br>Safe, simple, predictable.</p><p>No RDS instance.<br>No managed cluster.<br>Just one file — and Rails loves it.</p><h3>6. Kamal: your private Heroku CLI</h3><p>The magic moment is when you run, its like cf push:</p><pre>kamal deploy</pre><p>And the Mac mini:</p><ul><li>builds the image</li><li>pushes it</li><li>spins up the new container</li><li>checks health</li><li>swaps containers</li><li>and keeps the old one for rollback</li></ul><p>Exactly how Heroku dynos behave.<br>Just without the invoice.</p><p>Kamal turns your Mac mini into a tiny PaaS.<br>One command.<br>All taken care of.</p><h3>7. Optional: a tiny private container registry</h3><p>If you want to go all in:</p><pre>colima start --registry</pre><p>Now your Mac mini also hosts its own container registry — <br>a private Heroku slug store, basically.</p><p>Rails developers two years ago would cry tears of joy.</p><h3>Pro Tip for macOS Users</h3><p>If you’re on a Mac and you think brew services start colima is a good idea…<br>it isn’t.</p><p>That command launches Colima like some spooky root daemon hiding in the attic — no PATH, no Homebrew, no limactl, no joy.</p><p>Start Colima the way macOS actually works: <strong>inside the user session</strong> with a real shell and a sane PATH.</p><p>Create:</p><pre>~/Library/LaunchAgents/com.colima.start.plist</pre><p>Insert:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;plist version=&quot;1.0&quot;&gt;<br>&lt;dict&gt;<br>  &lt;key&gt;Label&lt;/key&gt;<br>  &lt;string&gt;com.colima.start&lt;/string&gt;<br>  &lt;key&gt;ProgramArguments&lt;/key&gt;<br>  &lt;array&gt;<br>    &lt;string&gt;/bin/zsh&lt;/string&gt;<br>    &lt;string&gt;-lc&lt;/string&gt;<br>    &lt;string&gt;PATH=/opt/homebrew/bin:/usr/local/bin:$PATH colima start&lt;/string&gt;<br>  &lt;/array&gt;<br>  &lt;key&gt;RunAtLoad&lt;/key&gt;<br>  &lt;true/&gt;<br>&lt;/dict&gt;<br>&lt;/plist&gt;</pre><p>Load it:</p><pre>launchctl load ~/Library/LaunchAgents/com.colima.start.plist</pre><p>From now on, every reboot gives you a clean Linux VM, Docker ready, Kamal deploys humming along, without that haunted-house feeling you get from root daemons.</p><p>Simple beats clever. Always.</p><h3>The big realization</h3><p>A Mac mini doesn’t magically turn into Heroku.<br>But with:</p><ul><li>Colima</li><li>a clean SSH deploy user</li><li>GNU tools</li><li>Docker</li><li>Kamal</li></ul><p>…it gets surprisingly close.</p><p>Close enough that deploying Rails apps becomes fun again.<br>Close enough that a tiny home server feels like your own little cloud.<br>Close enough that you start wondering why we ever made some things so complicated.</p><h3>Part 2</h3><p><strong>Backups, Volumes &amp; Kamal Hooks, keeping things simple without losing your data</strong></p><p>I’ll show how I keep a SQLite database alive, healthy, backed-up, and boring, using nothing but containers and common sense.</p><p><a href="https://medium.com/@Soulfected/part-2-one-file-one-database-no-drama-10e901fd6024">https://medium.com/@Soulfected/part-2-one-file-one-database-no-drama-10e901fd6024</a></p><pre>image source: https://www.apple.com/de/mac-mini/</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55dac2f303b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tally GO! A tiny Rails app to count coffee. Because why not.]]></title>
            <link>https://medium.com/@Soulfected/tally-go-a-tiny-rails-app-to-count-coffee-because-why-not-82af04e5be99?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/82af04e5be99</guid>
            <category><![CDATA[hobby]]></category>
            <category><![CDATA[fun]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[coffee]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 17:36:31 GMT</pubDate>
            <atom:updated>2025-12-11T07:09:56.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xmNhwQiDJxK2QaNHqgYyjA.png" /></figure><h4>There are things in life that really don’t need to be complicated.<br>Drinking coffee, for example. Or counting coffee.</h4><p>So the other day I’m sitting there, working away, and suddenly I ask myself:<br>How many cups have I actually had today?</p><p>Sounds trivial. And that’s exactly the problem.<br>For something so simple, there’s no good tool.</p><p>Notion? Far too heavy.<br>Apple Notes? You <em>could</em> use it, but it feels like driving a semi-truck to pick up a single bread roll.<br>Health app? Not a chance.</p><p>I didn’t want a tracker, gamification, or scientific analysis.<br>I just wanted <strong>one damn button</strong> that increments a cup of coffee.</p><p>So… I built one.</p><p>A few years ago I had some contact with Ruby on Rails, but more in the mindset of:<br>“Sure, but we’ll rebuild this in Go because it’s faster out of the box.”<br>Well… whatever.</p><p>Now, with a bit of distance, I wanted to experience Rails again with fresh eyes.<br>Not for work, not under pressure.<br>Just: learning, building, having fun.</p><p>So I opened up Rails 8, created a model, a few views, added Tailwind on top.<br>Nothing big, no architecture workshop, no hexagons.<br>Just craftsmanship.</p><p>After a few hours, the thing was running.</p><p>A simple logbook for coffee.<br>A counter.<br>A chart.<br>An icon that doesn’t look terrible.<br>Done.</p><p>The best part?<br>I deployed it to my Mac mini.</p><p>No Kubernetes, no AWS, none of the whole “let me complicate that for you” circus.</p><p>Rails 8, SQLite, Kamal.<br>Simple.<br>Stable.<br>Fast.</p><p>Maybe Tally Go! will stay exactly that:<br>A tiny tool that does one thing well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYnZyQStAZJ6EsVEhLXyQQ.png" /></figure><p>Maybe I’ll build more on top later.<br>Or maybe not.</p><p>Software is allowed to be fun — without a business case, without a roadmap, without stakeholder alignment.</p><p>If you want to know how this thing runs on a Mac mini, stick around.</p><p>Sometimes everything starts with a cup of coffee.<br>And a button. ✌🏻</p><p>If you want to try it out — or just peek at how simple a tiny Rails app can be,<br>here’s the code:<a href="https://github.com/idev4u/CoffeeCupLogbook"><br>https://github.com/idev4u/CoffeeCupLogbook</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82af04e5be99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I build a team board to support pair programming?]]></title>
            <link>https://medium.com/@Soulfected/why-i-build-a-team-board-to-support-pair-programming-ba4ee80d93e7?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba4ee80d93e7</guid>
            <category><![CDATA[pair-programming]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[vapor]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Sun, 14 Jun 2020 09:33:44 GMT</pubDate>
            <atom:updated>2021-03-12T18:51:18.821Z</atom:updated>
            <content:encoded><![CDATA[<p>Practicing is everything, this is a avdvice I’ve got from some of my mentors and from my dad as well. I really like to build something with code. But sadly in my current job I do not practicing that much, that I feel it is enough. So I decided I should build something to follow my goal, become better in server side swift. This blogpost should document what I build and why does it took 10 month to build such a simple thing like Course.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nycujitEcM0I0uOCJnnBig.png" /></figure><h3>What is Course?</h3><p>It is a pairing board inspired by pair-up. At time I decide to build course, <a href="https://github.com/julz/pairup">pair-u</a>p wasn’t open sourced, now it is. But anyway, my motivation to build Course was on one hand, I would like to have a pairing board for a team and on the other hand practicing server side swift. Especially become more familiar with Vapor. After around 10 month I think it, I have a proper MVP so I can release it to the world. I provide some basic functionallity, but things like drag and drop for assign people to a track could be good candidate to extend this app. I’m currently okish with the current version, but I will not stop to improve it. I’m happy about everyone, who think this is useful and I accept any kind of feedback for example as Pull Request or Issues.</p><p><a href="https://github.com/idev4u/course">https://github.com/idev4u/course</a></p><p>The name “Course” btw. is used in the seafaring and defines the path of the current day. I think with the driver and navigator pattern this is good relation to the topic of pairing.</p><p>Do wanna see course in action, here is the chance: <a href="https://course-pair.herokuapp.com/">https://course-pair.herokuapp.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHqxjAhLzC9J_ROhPDeHvQ.png" /></figure><h3>What was the initial plan?</h3><p>At first, I would do something which is cool and as I already wrote I would do something with Swift. And second as I’m heavly inspired by my former job and especially by the Cloud Foundry community where pair programming is the default. I thought something to support pairing is a good thing. So first I reminisced on how we did our daily standup with analog board and how efficient it was. And then I got on my mind, that there was already a tool which was used by a team, which I know from my former job. They used a tool called pair-up. I showed this some of my new colleague and they said this looks cool. Where can we get this. Hmm good question pair-up wasn’t open source at this time. What can I do? So first I contacted the creator of pair-up with request pleases open source it and in the mean time I thought this my chance to become a “Copy Cat 😸” of pair-up 😀. And with this I decided to build the a pairing board with Swift to learn and practicing my Swift Vapor development skills. That was plan behind this project.</p><h4>Why it took me 10 Month?</h4><p>Well I thought, I was familiar enough to quickly write this in few hours. But ups, I wasn’t right. I relazied my html plus css skill and as well the style of coding with Leaf wasn’t that easy from scratch. The documentation is quite good, but for some details it took me a while to understand how to organize the templates. So any kind of small issue you have, when you try out new things. But anyways, this was not the only thing. I had started a new job and this job is much different then my old one. This means for me a lot of new other things. Good things and bad things and I had to sort them out. Don’t understand me wrong the company I’m currently work on makes awesome products, but the company itself is on transition. And with this you can imagine why not everything is perfect. I don’t wanna cry, I activly change the environment, because I believe everyone has to invest to change things, that’s part of our job. And of course with this we also influence the culture of a company. But I hope you see I was in a situtation which I’m out of comfort zone. And you can imagine that I was needed a lot of energy at my daily job and I had no more motivation to do addtional things after 8 hours intensive work. I don’t no why, but I was shortly able to motivate me, to start writing some ugly basic code, but I quickly put this on hold. <br>So times are changing. When I was kind of comfortable with my new job I had a second issue which prevents me to follow up with this. I did short after work trail ride with my mountain bike and ended up in the hospital with a broken collarbone and with this I was off for around 2 month from the keyboard. Shit happens 😀.</p><p>What should I say, the whole life comes with ups and downs. After around 2 month of recovery I was able to join Cloud Foundry Summit, where I got motivated to start work on my project again and I did a bit of progress but still not that much. Then the year ends and for me, this is the perfect time to try out new things. So I took the time to think about, why I would build Course and this motivates me to more actively work on Course.</p><h4>Why did I not stop?</h4><p>Excetly, I would learn something new and build something others can you use. So this time, I decided to be more structured and goal focused to get things done. I made a <a href="https://martinfowler.com/articles/lean-inception/">inception</a> with myself and based of the outcome. I had created some task, which I have to work on for maximum an hour. And with this I was able to work on small things every day, which I could finish in one hour or less. With this I made good progress. I kept my proejct organisation very simple. I just used the project board inside GitHub and used milestone and issues to structure my tasks.</p><h4>How did I motivate me?</h4><p>Well at first let me say it in that way, closing issues feels good and getting things done also. A second thing is, talking about with others that you are working on somethings. Mostly triggers them to expect an outcome of your investmanet, which is also cool. So I did 2 things, first I did some tweets on twitter to tell someone else that I work on something. And second, frankly spoken for me the main key for my progress, was that I only created tasks which could be finished in 1 hour or less. So I was able to finish minimum one issue every time. This stratgie let me stay focus and is very useful if you learn new things. Just do it timeboxed.</p><h4><strong>Why pair programming?</strong></h4><p>A other question which come to your mind is, why pair programming? Well it’s just cool. No seriously, I believe that when you do things together, you are able to provide very good outcome. I know a lot people are not so comfortable with pairing, but this is normal, cause all humans are different. So I personally made very good expierence with pair programming and when ever I can, I’m happy to do it. And that brings me to the next question.</p><h4><strong>Why do you need a pairing board?</strong></h4><p>In my former job as Software Development Engineer we used a offline version of “Course” so called pairing board. This was just a simple whiteboard and cause every one was at the same location, this was good enough. But what is, if you wanna work with people and some of them are remote. You could try to use the camera of your laptop and show the whiteboard. Seriously this is not possible every time. Much better is the approach to use a web based paring tool and Course is one option for you. In short way summarized, a pairing board allows your team to visible the things the team is working on and second who works on what. Based on this you could structure your daily standup a bit better then you would without. I know there are other solutions but I believe Course is a quite simple tool for a team and I hope you give it a chance.</p><p>Thanks for reading Cheers Norman</p><ul><li><a href="https://github.com/idev4u/course">idev4u/course</a></li><li><a href="https://course-pair.herokuapp.com/">Course</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba4ee80d93e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vapor 3 with Mongo DB]]></title>
            <link>https://medium.com/@Soulfected/vapor-3-with-mongo-db-ea2e59347dd6?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea2e59347dd6</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[server-side-swift]]></category>
            <category><![CDATA[vapor]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Mon, 07 Jan 2019 16:16:01 GMT</pubDate>
            <atom:updated>2019-01-07T16:16:01.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-G95Pydr-zvTv7hz0O8rPg.png" /></figure><p>Any new project starts with a big idea. Then you have to look at the architecture. And for good ideas you should expect a big scale and a lot of data. And for this reason you should use a NoSQL Database. For my latest project, I thought the easiest thing is using MongoDB. So I start to setup my project and looking in the documentation of vapor 3 as a starting point how to connect to a mongo db. Surprisingly the documentation for vapor 3 was empty 😱. But this didn’t stop me. So did a bit research at diffrent areas and I found 2 solutions one of them was Mongokitten, which seems the most used solution for vapor 2 and the other one was the mongo db swift driver from MongoDB itself.</p><p>So I appreciate the effort of MongoDB to build a kindly native swift driver which support the useage of Swift Package Manager. Which I thought it could be good fit for my server-side swift project. And I decide to use the driver from MongoDB.</p><p>So how to start? At first I had to add the dependency to my existing vapor 3 project. For this I had to add the url and the version for the mongo driver to the Package.swift file and fetch the new sources.</p><pre><strong>let</strong> package = Package(<br>dependencies: [<br><em>...<br>// Mongo Db<br></em>.package(url: &quot;https://github.com/mongodb/mongo-swift-driver.git&quot;, from: &quot;0.0.7&quot;)<br>],<br>targets: [<br>.target(name: &quot;App&quot;, dependencies: [&quot;MongoSwift&quot;, &quot;Vapor&quot;]),<br>...<br>])</pre><p>That was easy, but now I needed to know, how to use this inside the vapor framework. I found a starting point in the example area of the mongo swift driver project. And with this code examples I could setup the database connection and register the client instance as a service in the vapor framework runtime. To do this it was necessary to extend the Mongo Client so that the service protocol is applied to.</p><pre>//configure.swift</pre><pre><em>// make mongo collection service ready</em></pre><pre><strong>public</strong> <strong>func</strong> configure(<strong>_</strong> config: <strong>inout</strong> Config, <strong>_</strong> env: <strong>inout</strong> Environment, <strong>_</strong> services: <strong>inout</strong> Services) <strong>throws</strong> {<br><em>...<br> // Register Mongo Client<br> </em><strong>let</strong> client = <strong>try</strong>! MongoClient(connectionString:   <br> &quot;mongodb://localhost:27017&quot;)<br> <strong>let</strong> db = <strong>try</strong>! client.db(&quot;myDB&quot;)<br> <strong>let</strong> collection:MongoCollection&lt;Document&gt;<br> <strong>do</strong> {<br>   collection = <strong>try</strong> db.createCollection(&quot;myCollection&quot;)<br> } <strong>catch</strong> {<br>   collection = <strong>try</strong> db.collection(&quot;myCollection&quot;)<br> }services.register(client)</pre><pre>}</pre><pre><strong>extension</strong> MongoClient: Service {}</pre><p>As descriped in the vapor docs the services framework allows you to register anything you might need in your application. In this case we need the Mongo Client. The registration setup made it possible to access the mongo db client from inside a router function. Why? So vapor 3 has the concept of a container, a container does manage the interaction with services. There are 3 types of containers in vapor 3 Application, Request and Response. This brings me back to our registered mongo db client as service. This service is now available in the Request container. And the following code snippet of a simple query explain how to create a mongo db client in a Request container and query documents from the db.</p><pre>router.get(&quot;/purine/dailysummary/&quot;) { req -&gt; [DailySummary] in<br><strong> let</strong> client = <strong>try</strong>! req.make(MongoClient.<strong>self</strong>)<br> <strong>return</strong> getCurrentDialySummary(client: client)<br>}</pre><pre>...<br><strong>func</strong> getCurrentDialySummary(client :MongoClient) -&gt; [DailySummary] {</pre><pre><strong> let</strong> collection = <strong>try</strong>! client.db(&quot;myDB&quot;)<br>    .collection(&quot;myCollection&quot;, withType: DailySummary.<strong>self</strong>)</pre><pre><strong> let</strong> documents = <strong>try</strong>! collection.find(<br>     [&quot;timestamp&quot;: DateFormatterController()<br>                    .currentDayInSeconds()<br>                    .timeIntervalSince1970]<br>     )<br> <strong>var</strong> listOfDailySummary = [DailySummary]()<br> <br> <strong>for</strong> d <strong>in</strong> documents { <br>    listOfDailySummary.append(d)<br> }<br> <strong>return</strong> listOfDailySummary<br>}</pre><p>If you like to get more information about this topic you can checkout the whole project on GitHub <a href="https://github.com/idev4u/purine-guardian">https://github.com/idev4u/purine-guardian</a> .This is still work in progress, but I already had build a CRUD based api which should help to get more example code to solve some open questions how vapor 3 and mongodb fits together.</p><p>Thanks for reading! Please provide feedback and don’t be shy to ask questions.</p><p>Cheers Norman</p><p>Links:</p><ul><li><a href="https://github.com/mongodb/mongo-swift-driver">mongodb/mongo-swift-driver</a></li><li><a href="https://github.com/mongodb/mongo-swift-driver/tree/master/Examples/Vapor">mongodb/mongo-swift-driver</a></li><li><a href="https://github.com/idev4u/purine-guardian">idev4u/purine-guardian</a></li><li><a href="https://docs.vapor.codes/3.0/fluent/getting-started/">Getting Started - Vapor Docs</a></li><li><a href="https://docs.vapor.codes/3.0/getting-started/services/">Services - Vapor Docs</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea2e59347dd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vapor 3 on Cloud Foundry]]></title>
            <link>https://medium.com/@Soulfected/vapor-3-on-cloud-foundry-e1861ef088d0?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1861ef088d0</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cloud-foundry]]></category>
            <category><![CDATA[vapor]]></category>
            <category><![CDATA[server-side-swift]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Sat, 05 May 2018 11:36:04 GMT</pubDate>
            <atom:updated>2018-05-07T07:43:54.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*5oIRr_JeyXJc6mh0mLN5dw.png" /></figure><p>You are interested in how you can write server-side swift code and after the first hello world you hear a voice in your head, like “where the hell I can run this”? So one solution is, run it on Cloud Foundry inside the swift runtime. I know that swift on the server side is currently a rare requested topic, but when I start working with Vapor 3, I recognized that it took me some time and some research to get this run on Cloud Foundry. My hope is, if somebody out there who is trying the same will find this blog post and it helps to get this stuff run. Now let’s get started, let me explain how you bring your Vapor 3 app to Cloud Foundry.</p><p>At first you need access to your cloud foundry environment where your app should run. The next thing you need is a swift app, in my case it is a simple CRUD service which handles todo items. As the title <br>let assume, this app uses the vapor 3 web framework. I choose this web framework, because I would use the latest swift network stack, better known as Swift NIO (released March 2018).</p><p>One of the concepts of Cloud Foundry (CF) is greatly support of the “<a href="https://12factor.net/">12 factor app</a>” pattern. And CF expect, that you follow this pattern and read all your configuration from environment variables as described in <a href="https://12factor.net/config">topic 3</a> on the “12 factor app” webpage. In my case I have to provide a database config, which is a PostgreSQL and for the cf runtime I have to read in the socket config, both will be provided via environment variable. The name of environment variables for the server socket are based on the cf runtime. The runtime uses for that, standard variables VCAP_APP_HOST and PORT to provide the socket configuration. To simplify my local development setup, I took the same and reuse it. For the database I use my own set of environment variables and prefixed them all with PSQL*.</p><p>For my local development I configured everything to local resources, the socket to 127.0.0.1:8080 and the database to my local PostgreSQL database. In the CF runtime the socket config is always provided for me, but the database variables have to be provided be my own, so I had to add the PostgreSQL variables with <em>cf set-env </em>to my CF app runtime. With this, I can read the config for my hosted cloud PostgreSQL database instance from the cf environment, in the same way I did on my local machine.</p><pre>bash$ cf set-env snatch-todos PSQLHOSTNAME psql.clouddb.hostname.com<br>bash$ cf set-env snatch-todos PSQLPORT 5432<br>bash$ cf set-env snatch-todos PSQLUSERNAME &quot;xxxxx&quot;<br>bash$ cf set-env snatch-todos PSQLDATABASE &quot;xxxxx&quot;<br>bash$ cf set-env snatch-todos PSQLPASSWORD &quot;*****&quot;</pre><p>Now that you know, how the environment behave, you have to adopt this in your swift app. And for this you have to load the config in Vapor from the environment. This is a important task, because Vapor has a fallback to start your app with a default socket on localhost:8080. This works perfect for your local development, but not in the CF runtime.</p><p>So we have to add the code for loading the environment variables for the socket to the config.swift file, which is in `<a href="https://github.com/idev4u/snatch-todo-app/tree/master/Sources">Sources</a>/<a href="https://github.com/idev4u/snatch-todo-app/tree/master/Sources/App">App</a>`. And create a new service object with the values from the environment.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c691dbcaad9120757a1dbad19403e6f5/href">https://medium.com/media/c691dbcaad9120757a1dbad19403e6f5/href</a></iframe><p>the same is necessary for the database configuration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd91460aa86f8bdc13c2ec7b548fd935/href">https://medium.com/media/fd91460aa86f8bdc13c2ec7b548fd935/href</a></iframe><p>If this works for you, you are ready to push your app to cloud foundry. The best thing on cloud foundry is cf push.</p><blockquote>“here is my source code run it on the cloud for me i do not care how” <a href="https://twitter.com/onsijoe">Onsi Fakhouri</a></blockquote><p>But before you can do this, you need to know the push command for swift runtime. The experience between all the runtimes is a bit different for some of the runtimes you only need cf push and rest works automagically, but for some them, you have to specify a “Procfile” or add the start command with the option “-c” to your cf push command. The “Procfile” or -c option (Startup command) describe, how to start the app. This explains CF how to run your app in the cloud. Swift is one of the runtimes which expect a “Procfile” or a start command. The simplest way is to build your swift app and the name of the executable is the run command. In my case as you know I use Vapor and my swift binary is called “Run”.</p><p>So before I could simply push my app, I have to create a “Procfile” with the content web: Run or extend my cli command with the -c option cf push &lt;my-app-name&gt; 32M -c Run. If you don’t like “Run” as the swift binary name you can rename this with the help of the Swift Package Manager.</p><p>This example show, how you can rename your executable from Run to “snatch-todos-service”</p><pre>import PackageDescription<br>let package = Package(<br>  name: “snatch-todos”,<br>    products: [<br>      …<br>      .executable(name: “snatch-todos-service”, targets: [“Run”]),<br>    ],<br>    dependencies: [<br>      …<br>    ],<br>    targets: [<br>      …<br>      .target(name: “Run”, dependencies: [“App”]),<br>    ]<br>)</pre><p>And after the rename, you can do cf push &lt;my-app-name&gt; 32M -c snatch-tods-service instead.</p><p>But let‘s go back to the push, the last important thing for my Vapor based app with Swift NIO under the hood is that I need swift 4.1 and this will be provided by the latest buildpack, which is already available on IBM Cloud Foundry. I think, I have to be more specific here why I mention explicit IBM. Because IBM Cloud Foundry is currently the only CF provider I know, which provide swift as runtime out of the box and this make your life as a developer much easier. So finally, let me summarise the cf deployment command. I need the name of my app, I wanna specify the memory usage of my app with 32MByte per instance and I have to tell how to start my app.</p><p>And this is the cf push command:</p><pre>cf push &lt;my-app-name&gt; 32M -c Run </pre><p>That’s everything! Now that you know, how it works, try it out! Write your own app or clone my example from <a href="https://github.com/idev4u/snatch-todo-app">here</a>. Then follow Onsi’s advice, “run it on the cloud for me, I do not care how”.</p><p>Cheers</p><p>Norman</p><p>Links:</p><p><a href="https://vapor.codes/">Vapor</a></p><p>Example on github:</p><p><a href="https://github.com/idev4u/snatch-todo-app">idev4u/snatch-todo-app</a></p><p>Example app in action 😀</p><p><a href="http://snatch-todos.eu-gb.mybluemix.net/todos">http://snatch-todos.eu-gb.mybluemix.net/todos</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1861ef088d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Say hello to the Bits-Service Mascot]]></title>
            <link>https://medium.com/@Soulfected/say-hello-to-the-bits-service-mascot-70c87c8f4133?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/70c87c8f4133</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[cloud-foundry]]></category>
            <category><![CDATA[logo-design]]></category>
            <category><![CDATA[storytelling]]></category>
            <category><![CDATA[bits-service]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Fri, 16 Mar 2018 14:03:50 GMT</pubDate>
            <atom:updated>2018-03-16T23:52:12.000Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*JcwMdFDWN_oGUiSPWVNzng.png" /></figure><p>Maybe the most of you felt more connected to a project or a product, if it has nice logo. That’s true for me, too. So when ever I join a team, I try to ramp up the team spirit in the way like startups often do. Most of the cool startups have a good brand or a cool logo which represent their mission. I believe that this is something which you can use also on a team level. Simple create a team logo, a mantra or something similar. Such things like a logo or a mantra are very useful for the team spirit and with a good spirit, the team can find their identity and get a better connection to their mission. The bits-service team had already a good team spirit, but I thought for a open source project, it’s cool to have a logo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQxAoCHTfPZ0XqVi3bOJ-Q.jpeg" /></figure><h4><strong>Go back in time</strong></h4><p>But before we go into the creation process of the logo, let me go back in time, where is the bits service team came from. The team was build in 2015 with the mission to focus on Performance and Event Broadcasting aka PEB, so the only meaningful funny thing, they found was pebbles and with this the “flintstone” team and the name of it was born. Currently the situation at cloud foundry is, that all the team names should represent the component they work on. So we had to rename the “flintstone team” into “bits-service team”. And everybody can imagine with the name change there are some dependency, which also has to change. For example, we used Fred from the flintstones as avatar on GitHub and some other terms. So the team agreed to have a common logo which represent the bits-service would be cool.</p><h4>Creation process<strong> of the logo</strong></h4><p>Based on the name flintstone I had already some scribbles in my box and the first thing I did was to take the flintstone logo and but a B on it. But as expected this was ugly. Out of sheer desperation, I scribbled a bit, but all the results doesn’t look good. I shared my ugly ones with the team and other ideas came up, like some bits in a box, but this looks more like a amazon package, then a logo. So I remember on the words of our Product Manager <a href="https://twitter.com/mosersd">Simon</a>. He said „it would be cool to have a animal and think in the direction of a object store“. So I had a discussion with my wife and I thought a hamster would be perfect. So I go back to the drawing board and I draw a hamster as good as I can. And team reaction was more like, ok? So I decide, I need a better draw of the idea.</p><h4><strong>Meet with the designer</strong></h4><p>I know my drawing skills are, hmm? Ok don’t talk about my drawing skills. So I realized, I need professional help. And for my mission I had luck, because there are also a design department in our Lab in Boeblingen and I contact one them. Her name is <a href="https://twitter.com/morganadalmeida">Morgana D’Almeida</a> and she did an awesome job for us. I explained her the idea behind the hamster and she knows what has to be done and has drawn directly a first design. In summary we met us around 4 times and I took every iteration into the team and at the end we get the Bits Mascot. Finally we had different versions of the mascot one of them was very angry, but we decide to use the more neutral friendly one. Even though we know manage the bits is hard work, so why the mascot should not look a bit angry. The team is now happy with the result and we invested directly in some stickers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qgXBYXiYCcD08gasf4av8g.jpeg" /></figure><p>Say hello to the bits-service mascot, this is our new logo. I would like to say thank you, to <a href="https://dribbble.com/morganadalmeida">Morgana</a> for drawing. And if you met one of us on a meetup or at the Cloud Foundry summit, talk to us and ask us for stickers. That’s the story behind the bits-service Mascot.</p><p><em>Cheers Norman</em></p><h4>Links</h4><p>Github : <a href="https://github.com/cloudfoundry-incubator/bits-service">https://github.com/cloudfoundry-incubator/bits-service</a></p><p>Api doc: <a href="http://cloudfoundry-incubator.github.io/bits-service/">http://cloudfoundry-incubator.github.io/bits-service/</a></p><p>Dribbble: <a href="https://dribbble.com/shots/4192778-Bits-mascot">https://dribbble.com/shots/4192778-Bits-mascot</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70c87c8f4133" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Talk HTTPs to the Bits Service]]></title>
            <link>https://medium.com/@Soulfected/talk-https-to-the-bits-service-38cd19b71c86?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/38cd19b71c86</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[cloud-foundry]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Wed, 31 Jan 2018 15:19:11 GMT</pubDate>
            <atom:updated>2018-02-03T09:51:47.730Z</atom:updated>
            <content:encoded><![CDATA[<p>Maybe you heard about the Bits-Service and what it is, if not checkout this <a href="https://medium.com/@peter.gtz/lifting-the-veil-of-mystery-around-the-cloud-foundry-bits-service-5e386845d33f">blog</a> post written by <a href="https://medium.com/@peter.gtz?source=post_header_lockup">Peter Goetz</a>.</p><p>As you get from the blog post the bits-service manage all the app bits storage for the cloud controller. Now lets talk about the latest improvement of the bits-service. As you know most of the Cloud Foundry components are communicating internally only over https. And this is something the bits-service should also do, this is not something special. But what really different is, is that the bits-service consequently only accepts https connection for his internal and public endpoints. What I like to clarify is, that the bits-service takes advantage of a features from the go router. This new feature allows to have https/http connection to the go router and from the go-router to the bits-service we enforce to have only https connections. With this setup, the bits-service is accessible from the outside world over https, through the go-router. For the bits-service we decide to accept only https, and this feature was a necessary piece to realize this. This draft shows the architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Te_d1IzOTYClTpFTu3ieWg.png" /></figure><p>The following code block, is a snippet of the necessary changes to enable https routing for the bits-service.</p><pre>- type: replace <br>  path: /instance_groups/name=api/jobs/name=route_registrar/properties/route_registrar/routes/-<br>value:<br>  name: bits-service<br>  tls_port: 443<br>  registration_interval: 20s<br>  uris:<br>  - bits-service.((system_domain))<br>  server_cert_domain_san: <a href="https://bits-service.((system_domain))/">https://bits-service.((system_domain))</a><br>  tags:<br>    component: bits-service</pre><pre>- type: replace<br>  path: /instance_groups/name=router/jobs/name=gorouter/properties/router/backends?/enable_tls<br>  value: true</pre><pre>- type: replace<br>  path: /instance_groups/name=router/jobs/name=gorouter/properties/router/ca_certs?<br>  value: ((bits_service_ssl.ca))</pre><p>If you would like to know more about how it work’s, checkout the latest <a href="https://github.com/cloudfoundry/cf-deployment/blob/develop/operations/experimental/bits-service.yml">ops files</a> of the bits-service in cf-deployment. This shows how the bits-service team is using this feature. If you are interested in a detail explanation, pls take a look at the <a href="https://github.com/cloudfoundry/gorouter#registering-routes-via-nats">documentation</a> of the go-router. The interesting sections are “tls_port” and “server_cert_domain_san”. The TLS feature was released in the end of October 2017 and the bits-service team give them a try and it works. Maybe we are the first Cloud Foundry component which adopt this and that’s the foundation for this post, if you wanna share any feedback reach out to us.</p><p><strong>Cheers</strong></p><h3>Links</h3><blockquote><em>Bits-Service Ops-File:</em></blockquote><p><a href="https://github.com/cloudfoundry/cf-deployment/blob/develop/operations/experimental/bits-service.yml">https://github.com/cloudfoundry/cf-deployment/blob/develop/operations/experimental/bits-service.yml</a></p><blockquote><em>PR: </em>Allow CF with bits-service to use https only</blockquote><p><a href="https://github.com/cloudfoundry/cf-deployment/pull/390">https://github.com/cloudfoundry/cf-deployment/pull/390</a></p><blockquote><em>Go Router Docs:</em></blockquote><p><a href="https://github.com/cloudfoundry/gorouter#registering-routes-via-nats">https://github.com/cloudfoundry/gorouter#registering-routes-via-nats</a></p><blockquote><em>Slack:</em></blockquote><p><a href="https://cloudfoundry.slack.com/messages/bits-service">https://cloudfoundry.slack.com/messages/bits-service</a></p><blockquote><em>Introduction Bits-Service:</em></blockquote><p><a href="https://medium.com/@peter.gtz/lifting-the-veil-of-mystery-around-the-cloud-foundry-bits-service-5e386845d33f">https://medium.com/@peter.gtz/lifting-the-veil-of-mystery-around-the-cloud-foundry-bits-service-5e386845d33f</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38cd19b71c86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logging for cloud native apps]]></title>
            <link>https://medium.com/@Soulfected/logging-for-cloud-native-apps-537192893981?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/537192893981</guid>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cloud-foundry]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[swift-programming]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Thu, 19 Oct 2017 18:07:53 GMT</pubDate>
            <atom:updated>2017-10-20T05:17:03.769Z</atom:updated>
            <content:encoded><![CDATA[<p>Where are my logfiles? Before I answer this question let me explain the context. I work in the cloud development world and we have a methodology, which is called the 12 factor-app. One of the 12 factors is Logs and here is how this factor is defined.</p><blockquote>A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will view this stream in the foreground of their terminal to observe the app’s behavior.</blockquote><p>If you are not familiar with the 12 factor app, <a href="https://12factor.net/">here</a> you get more info about it.</p><p>But what does this mean for me as a developer? The answer is simple, I write all my logs to stdout. For example, I write my next cool web service in swift. Then you need a minimum of this 2 lines, for writing to stdout.</p><blockquote>// Disable Buffering to write directly to stdout</blockquote><blockquote>setbuf(stdout, nil)</blockquote><blockquote>print(“this line will be printed to stdout.”)</blockquote><p>That’s all, ok I have to be honest, you see 3 lines of code, but the comment is just for explanation, sorry. By the way <em>setbuf</em> is provided by the Standard C Library. If you need different log level’s like debug, error etc. then you might be more interested in library, which support you with this and also helps with the format of the log line. If we extend our swift app then the “HeliumLogger” will be a good option. This Logger also write’s only to stdout and this is everything we need.</p><p>Let’s talk about the different environments. If you develop on your local machine, then you can see the logs of your app in the terminal. But this is not the place where your app lives. If your app run’s on one of the cloud foundry (CF) provider, then you fetch the logs of your app with the cloud foundry cli “cf logs my-swift-app“. This is possible, because the routing of the logs in cloud foundry is managed by the runtime for you and one option for the output, could be the cloud foundry cli.</p><p><em>bash$ cf logs printer — recent | grep APP/PROC/WEB/0</em></p><p><em>2017–10–17T22:05:02.03+0200 [APP/PROC/WEB/0] OUT</em></p><p><em>Gentleman start the engine ….</em></p><p><em>2017–10–17T22:06:56.46+0200 [APP/PROC/WEB/0] OUT this line will be printed to stdout.”</em></p><p>But what is, if you need logs from the past? Honestly I don’t know, how other CF provider do handle this, but my experience with IBM Cloud Foundry is, that for this use case the logs are routed to an ELK stack and can easily access from the WebUi, which is awesome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2uebQBg7cHRn7wQElQ2k9g.png" /><figcaption>IBM Cloud Foundry Logs Web Ui</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qV5yOzrW2eMY3hNyvy7uTw.png" /><figcaption>IBM Cloud Kibana Ui</figcaption></figure><p>Finally let me say, when ever a developer from outside of the cloud development world asking me where are my logs? I tell them exactly what I have writen here.</p><p>thanks for reading cheers</p><p>Norman</p><p><strong><em>Links</em></strong></p><ul><li><a href="https://12factor.net/logs">The Twelve-Factor App</a></li><li><a href="https://github.com/idev4u/logprinter-app">idev4u/logprinter-app</a></li><li><a href="https://github.com/IBM-Swift/HeliumLogger">IBM-Swift/HeliumLogger</a></li><li><a href="https://www.elastic.co/de/webinars/introduction-elk-stack">An Introduction to the ELK Stack (Now the Elastic Stack) | Elastic</a></li></ul><p><a href="http://www.manpages.info/freebsd/setbuf.3.html">http://www.manpages.info/freebsd/setbuf.3.html</a> for macOS</p><p><a href="http://man7.org/linux/man-pages/man3/setbuf.3.html">http://man7.org/linux/man-pages/man3/setbuf.3.html</a> for Linux</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=537192893981" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Indie Developers! Don’t try this at home.]]></title>
            <link>https://medium.com/@Soulfected/indie-developers-dont-try-this-at-home-b247a91f3e9e?source=rss-33b4a6236f90------2</link>
            <guid isPermaLink="false">https://medium.com/p/b247a91f3e9e</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[bluemix]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[concourseci]]></category>
            <dc:creator><![CDATA[Norman Sutorius]]></dc:creator>
            <pubDate>Thu, 21 Sep 2017 18:57:03 GMT</pubDate>
            <atom:updated>2017-09-22T07:12:32.613Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are my thoughts, wouldn’t it be cool to have the pipeline tool of my choice running in a container on a cloud provider somewhere where I should not care.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kyCY9Tfye_YYv_09RyDdqQ.png" /></figure><p>In the last week I had the idea to move my cloud foundry application deployment from Travis-CI to Concourse-CI. Why? Because I would have a better representation of my integration pipeline and of course I already know that I would do this with concourse. At first I checked the website, how I can do this. The only useful thing I found, was a docker compose file. From the perspective of a team which have no local server hardware, this seems the best option for me. But I still had a problem I need this as a kubernetes deployment, which I can use for the container service on Bluemix. But there was none. I have to do it by my own.</p><p>So I converted the stuff from docker-compose to kubernetes deployment. First I used the “kubectl convert” tool, to convert docker compose file into a kubernetes deployment. That tool create 3 deployment files, which I used as the foundation for my kubernetes deployment. I removed the persistent disk deployment because this is not needed for concourse. The only thing I have to do, is providing the keys for concourse web and concourse worker. And exactly for this purpose kubernetes provides an option, which is called secrets. This is a special volume, which is mounted into the container. After having this configured, I created a kubernetes Cluster on Bluemix from type “<a href="https://console.bluemix.net/containers-kubernetes/launch?env_id=ibm:yp:eu-de">Lite</a>” which is free for everyone .</p><p>Finally I deployed the 3 components for concourse and set my pipeline. That’s everything. If your are interested in the kubernetes manifest, <a href="https://github.com/idev4u/concourse-ci-kube">here</a> you find the manifest and a description of the necessary steps.</p><p>Have fun with it! Cheers 🍺</p><p><strong>References</strong></p><p><a href="https://github.com/idev4u/concourse-ci-kube"><em>https://github.com/idev4u/concourse-ci-kube</em></a></p><p><a href="https://kubernetes.io/docs/user-guide/kubectl/v1.7/#convert"><em>https://kubernetes.io/docs/user-guide/kubectl/v1.7/#convert</em></a></p><p><a href="https://concourse.ci/docker-repository.html"><em>https://concourse.ci/docker-repository.html</em></a></p><p><a href="https://console.bluemix.net/containers-kubernetes/launch?env_id=ibm:yp:eu-de"><em>https://console.bluemix.net/containers-kubernetes/launch?env_id=ibm:yp:eu-de</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b247a91f3e9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>