<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jens Kohl</title>
    <description>The latest articles on DEV Community by Jens Kohl (@jk).</description>
    <link>https://dev.to/jk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F17817%2F434a5c65-4641-46e0-b6c2-6119150b4353.png</url>
      <title>DEV Community: Jens Kohl</title>
      <link>https://dev.to/jk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jk"/>
    <language>en</language>
    <item>
      <title>RANT: Skype for Business Mac</title>
      <dc:creator>Jens Kohl</dc:creator>
      <pubDate>Thu, 16 Aug 2018 09:13:13 +0000</pubDate>
      <link>https://dev.to/jk/rant-skype-for-business-mac-g2g</link>
      <guid>https://dev.to/jk/rant-skype-for-business-mac-g2g</guid>
      <description>

&lt;p&gt;Some years ago the company I'm with decided we need an instant messaging solution. Since most of our colleagues have become one with their Windows PCs and Exchange servers the evaluation of the messenger market was rather short: Hello Lync – the Microsoft solution for messaging. Later renamed to Skype for Business.&lt;/p&gt;

&lt;p&gt;Most of my Windows colleagues are quite happy with it, but only a few are really fond to work with it. At least they don't have any bigger issues in their day to day usage.&lt;/p&gt;

&lt;p&gt;But there're a handful of developers and creatives in the company which are Mac users and there's even a Mac version of Skype for Business available (let alone that the rebranding of Lync to Skype for Business came years after they rebranded the Windows version). Hooray, I guess. Not so much. The status quo of the Mac version is awful. Imagine you're in an office building which is not the main building where the most of your colleagues are located you've to work with. One can think that sending and receiving files is a basic, yet mandatory feature a messenger should support. Not Skype for Business on a Mac. The Windows version has this feature.&lt;/p&gt;

&lt;p&gt;Okay… I can deal with that, I mentioned the exchange server. I can send emails, crappy backup included on the mail server :) Now and then a colleague and I pair program on an issue and I'll share my desktop via Skype for Business. At least that works… but when I want to delegate the mouse and keyboard to my colleague… ERR not supported in the Mac version. The Windows version has this feature.&lt;/p&gt;

&lt;p&gt;Mmmm… I guess, at least my colleagues can improve on their vocal explanation skills. Thank god, I don't need to work on all the issues I'm assigned to myself. More than two developers work on the same project, so it would be awesome if we can all join the same chat room and organize ourselves there. You guessed it: Not Skype for Business on a Mac. The Windows version has this feature.&lt;/p&gt;

&lt;p&gt;The reader can respond to this rant: Open a bug report. That's what I thought, too. So I googled their bug tracker and searched for file sending/receiving feature and I found it. I did that years ago and when I found it, it was a bug report already 3 years old… I don't have high hopes that this gets sorted out.&lt;/p&gt;

&lt;p&gt;I presume (and haven't checked yet) that Microsoft thinks the solution to all this is Microsoft Teams, their Slack clone for enterprises. Yeah, probably, but the thing with enterprises is, once a decision was made it takes decades to take them back and replace them with something better.&lt;/p&gt;

&lt;p&gt;After all, they fixed a rather embarrassing Mac bug. A particularly beautiful specimen: As in any larger company, we have to change our passwords periodically. Since we use a single sign-on system, this naturally also applies to signing in to Skype for Business. In an earlier version of Skype for Business, if you changed your password, it didn't replace the old password from your Mac keychain with the new one, it just added the new password. And the same version tried to use the old password instead of the new one every time it was started.&lt;/p&gt;


</description>
      <category>microsoft</category>
      <category>enterprise</category>
      <category>company</category>
      <category>skypeforbusiness</category>
    </item>
    <item>
      <title>Run various PHP versions side-by-side via Docker using CodeRunner on macOS</title>
      <dc:creator>Jens Kohl</dc:creator>
      <pubDate>Thu, 26 Oct 2017 14:28:06 +0000</pubDate>
      <link>https://dev.to/jk/run-various-php-versions-side-by-side-via-docker-using-coderunner-on-macos-7n5</link>
      <guid>https://dev.to/jk/run-various-php-versions-side-by-side-via-docker-using-coderunner-on-macos-7n5</guid>
      <description>&lt;p&gt;I'm doing a lot of small things in PHP these days, non of them is actual web development. The environments in which these scripts are meant to run have various PHP versions installed (I'm looking at you, CentOS LTS). Since most of my tasks involve short PHP scripts it isn't worth it to fire up &lt;a href="https://www.jetbrains.com/phpstorm/" rel="noopener noreferrer"&gt;phpStorm&lt;/a&gt; and setup a whole project.&lt;/p&gt;

&lt;p&gt;So I went to my go-to tool for small scripts: &lt;a href="https://coderunnerapp.com" rel="noopener noreferrer"&gt;CodeRunner&lt;/a&gt;, but right out of the box it only supports one version at a time for PHP, since it uses the pre-installed PHP which comes with macOS High Sierra fairly outdated. You can install other PHP versions via &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew (package manager)&lt;/a&gt; but using them in parallel isn't really a pleasure. I prefer using &lt;a href="https://www.docker.com/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; for that. And that's what we gonna do, so let's start configuring CodeRunner:&lt;/p&gt;

&lt;h1&gt;
  
  
  Setting up CodeRunner
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;First go to the settings (&lt;code&gt;⌘;&lt;/code&gt;) → Languages and search for &lt;code&gt;PHP&lt;/code&gt; in the list on the left.&lt;/li&gt;
&lt;li&gt;Duplicate &lt;code&gt;PHP&lt;/code&gt; with the »Settings«-Button below that list &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0wl2c1e9stp8zebfs27t.png" alt="duplicate the PHP language" width="363" height="628"&gt;
&lt;/li&gt;
&lt;li&gt;Rename it to something meaningful, like &lt;code&gt;PHP 7.1 via Docker&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;For the &lt;strong&gt;Run Command&lt;/strong&gt; enter
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;:/opt/project php:7.1 &lt;span class="nt"&gt;-f&lt;/span&gt; /opt/project/&lt;span class="nv"&gt;$filename&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What this does is running a new container from the image named &lt;code&gt;php:7.1&lt;/code&gt;. &lt;code&gt;-v $(pwd):/opt/project&lt;/code&gt; mounts the current directory in which CodeRunner will run your code into &lt;code&gt;/opt/project&lt;/code&gt; inside of the container. &lt;br&gt;
&lt;code&gt;-f /opt/project/$filename&lt;/code&gt; tells the php binary living inside of the container to run the script named &lt;code&gt;/opt/project/$filename&lt;/code&gt;. &lt;br&gt;
&lt;code&gt;$filename&lt;/code&gt; is actually a placeholder for the filename CodeRunner will (temporarily) save your code to. &lt;br&gt;
And last but not least, &lt;code&gt;--rm&lt;/code&gt; will ensure, that after CodeRunner executed your code, it will remove the just created container from your system again. &lt;br&gt;
That has also the benefit, that every time you run your code within CodeRunner it gets executed in a fresh environment (everything you save from your code above the &lt;code&gt;/opt/project&lt;/code&gt; directory gets wiped)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Close the settings window and bring the CodeRunner window to the front&lt;/li&gt;
&lt;li&gt;In the toolbar, there is a dropdown subtitled »Language«. Choose your newly created PHP environment labeled as &lt;code&gt;PHP 7.1 via Docker&lt;/code&gt;. &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46jw1tal5njqpx50iz6q.png" alt="Choose PHP 7.1 via Docker from Languages dropdown" width="537" height="375"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  Setting up Docker for Mac
&lt;/h1&gt;

&lt;p&gt;Before we can start, we have to give &lt;strong&gt;Docker for Mac&lt;/strong&gt; permission to mount (the &lt;code&gt;-v&lt;/code&gt; flag) the directory where CodeRunner places its temporary files. To do that&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Docker for Mac »Preferences…« via its menu item &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffaahioebtq1ioi9uce62.png" alt="Open Docker for Mac Preferences via its menu item" width="282" height="368"&gt;
&lt;/li&gt;
&lt;li&gt;Go to the &lt;code&gt;File Sharing&lt;/code&gt; tab and click the &lt;code&gt;+&lt;/code&gt; button&lt;/li&gt;
&lt;li&gt;This will open the system open dialog. It doesn't really matter which directory you open, so you just click the »Open« button in the bottom right&lt;/li&gt;
&lt;li&gt;The newly create list item you have to double click. Now you can modify it&lt;/li&gt;
&lt;li&gt;Enter &lt;code&gt;/var/folders/pc&lt;/code&gt; and press return (↩) &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2ui17s4yzc549l7emcy.png" alt="Docker for Mac after adding /var/folders/pc to the file sharing tab" width="380" height="423"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  Bringing it all together
&lt;/h1&gt;

&lt;p&gt;You're no good to go, enter something like the script below to test your newly created CodeRunner docker environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'PHP '&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nb"&gt;phpversion&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="kc"&gt;PHP_EOL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you're using the &lt;code&gt;php:7.1&lt;/code&gt; Docker image for the first time it needs to download it from the Docker Hub first, this can take some seconds to minutes, depending on your internet connection. It will look like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unable to find image 'php:7.1' locally
7.1: Pulling from library/php

85b1f47fba49: Already exists 
66e22dddbf92: Already exists 
bf0df491fd2e: Already exists 
0cbe7899c5b5: Already exists 
515aeb1bd86c: Already exists 
842bd485599e: Already exists 
Digest: sha256:9d847a120385a1181ffa8ba4d17f28968fb2285923a0ca690b169ee512c55cb1
Status: Downloaded newer image for php:7.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And after that you'll get the output of your PHP script: &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnumie664gpu3pmm8e2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnumie664gpu3pmm8e2f.png" alt="Running PHP 7.1 with CodeRunner via Docker" width="682" height="601"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What to do next?
&lt;/h1&gt;

&lt;p&gt;Congratulations, you're done and can run your short PHP scripts via Docker in CodeRunner. You can clone the &lt;code&gt;PHP 7.1 via Docker&lt;/code&gt; environment for other PHP versions. Right now there are several versions in the official PHP docker image, even the latest pre-release versions of PHP 7.2.&lt;/p&gt;

&lt;p&gt;But this approach is not limited to PHP. I guess you can setup something similar for your python, node.js and ruby environments.&lt;/p&gt;

&lt;p&gt;But there's one caveat: You have to read the corresponding &lt;code&gt;Dockerfile&lt;/code&gt; to find out where to set the mount point (it's probably not &lt;code&gt;/opt/project&lt;/code&gt;) in the image, so that when running the docker container you find your files you want to execute.&lt;/p&gt;

</description>
      <category>php</category>
      <category>docker</category>
      <category>macos</category>
      <category>workflow</category>
    </item>
  </channel>
</rss>
