<?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 Viktor Šulák on Medium]]></title>
        <description><![CDATA[Stories by Viktor Šulák on Medium]]></description>
        <link>https://medium.com/@vsulak.svk?source=rss-6cec550b3318------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LB0w1yBWJnzw5plTqXwBKQ.jpeg</url>
            <title>Stories by Viktor Šulák on Medium</title>
            <link>https://medium.com/@vsulak.svk?source=rss-6cec550b3318------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:43:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vsulak.svk/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[Upgrading Drupal 8 to Drupal 9: The real-world experience]]></title>
            <link>https://medium.com/touch4it/upgrading-drupal-8-to-drupal-9-the-real-world-experience-29a2db5f72e3?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/29a2db5f72e3</guid>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[composer]]></category>
            <category><![CDATA[drupal]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Wed, 17 Jun 2020 18:39:17 GMT</pubDate>
            <atom:updated>2020-06-18T09:35:39.189Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Theory of simple upgrade from Drupal 8 to Drupal 9 without complications sounds great. So, let’s get our hands dirty. How did it go?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*boiB-PtOH41PsJrekAdHGA.png" /></figure><p>We have discussed prerequisites and changes in following article:</p><p><a href="https://medium.com/touch4it/drupal-9-is-coming-76e2807a5761">Drupal 9 is coming!</a></p><p>To make things as simple as possible, we used <a href="https://getcomposer.org/">Composer</a> and <a href="https://drushcommands.com/">Drush</a>. This is the modern way of doing Drupal using terminal.</p><p>First of all, we dumped database to have a backup. Just in case.</p><p>To start, we had to upgrade to latest version of Drupal core and modules in 8.x family. In our case it was Drupal 8.9.0. We changed composer.json file and ran update scripts.</p><pre>&quot;require&quot;: {<br>    &quot;drupal/core&quot;: &quot;^8.9.0&quot;,<br>},<br>&quot;require-dev&quot;: {<br>    &quot;drupal/core-dev&quot;: &quot;^8.9.0&quot;<br>}</pre><p>Above are lines changed in composer.json.</p><pre>composer update drupal/core drupal/core-dev --with-dependencies</pre><pre>composer update</pre><pre>drush updatedb</pre><pre>drush cache:rebuild</pre><p>After that we installed and enabled <a href="https://www.drupal.org/project/upgrade_status">Upgrade Status</a> module. This is handy tool to check readiness for upgrade. In fact, this module saved our web and a lot of troubles.</p><pre>composer require --dev &#39;drupal/upgrade_status:^2.0&#39;</pre><pre>drush en upgrade_status</pre><pre>drush cache:rebuild</pre><p>After that, we were ready to see how ready we are for the next major version of Drupal. We were not. PHP version was the only green thing in the list. Since it is an older web, we had to upgrade MySQL version (MariaDB in our case) and upgrade Drush version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAzRozIX4LIaCRo-jP48Hw.png" /><figcaption>Drupal system readiness for upgrade</figcaption></figure><p>So we did. Docker helped us with database and Composer helped with Drush.</p><pre>composer require &#39;drush/drush:^10.0&#39;</pre><p>With system ready, we were ready to check all modules and themes, both custom and contrib. So we selected all checkmarks and pressed “Scan selected”. We ran into timeout after 60 seconds. And again, and again. We had to change the attitude. We used Drush one more.</p><pre>drush upgrade_status:analyze --all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkWc7-Ecvkb5O4XX6gFVWQ.png" /><figcaption>Status Upgrade terminal output</figcaption></figure><p>We were luckier this time. Whole script passed and we had our results. In a loooong console output. Luckily, all the data could be displayed in Drupal admin zone too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoalBOAeuk40WQ5seCbN6g.png" /><figcaption>Status Upgrade warning for custom theme</figcaption></figure><p>Custom modules and theme needed only cosmetic fix. To add core_version_requirement into info file. It tells Drupal core that it can be used with Drupal core 8 and 9. But contrib modules gave us headache. Lot of them using deprecated methods even in the latest versions. Lot of them generating warnings and errors. In that very moment we knew that Drupal 9 is no go for us yet. It is not so surprising since we have tested it mere days after Drupal 9.0.0 release, but it was still a disappointment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPDpcTs7TzYy-T7C1zyiWg.png" /><figcaption>Status Upgrade in Drupal admin UI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-UBUFPkUi4CHeRnG0OtFQ.png" /><figcaption>Detailed Drupal 9 incompatibility output</figcaption></figure><p>Some of the modules had new alpha or beta releases ready. For most modules it is not what you want to use. For some, it is unfortunately the only release. Some did not have even beta releases ready for Drupal 9.</p><p>In the end, result of upgrading from Drupal 8.8 to 9.0 was upgrade to 8.9. Without any problems. It’s also something. Upgrading to Drupal core .0 versions is usually not without problems in bigger systems.</p><p>We have to wait for modules to be ready for Drupal 9 and maybe we will be forced to replace some of them one day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29a2db5f72e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/upgrading-drupal-8-to-drupal-9-the-real-world-experience-29a2db5f72e3">Upgrading Drupal 8 to Drupal 9: The real-world experience</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drupal 9 is coming!]]></title>
            <link>https://medium.com/touch4it/drupal-9-is-coming-76e2807a5761?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/76e2807a5761</guid>
            <category><![CDATA[drupal]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[drupal-8]]></category>
            <category><![CDATA[drupal-9]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 18:41:01 GMT</pubDate>
            <atom:updated>2020-06-17T18:33:46.580Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>It won’t be a revolution like Drupal 8, but evolution of it. It should be released on June 3rd, 2020, so save the date. Drupal 8.9, the last major update of Drupal 8 line will be also released in June.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fx6YGYfEqXPDdd6nUpTw_g.png" /></figure><h3>What is new in Drupal 9?</h3><p>Not much and a lot of it. Compared to Drupal 8.9, just updated underlaying framework and other dependencies. Compared to Drupal 8.8, all the new features of Drupal 8.9 were added.</p><p>Drupal 9 wants to look like modern CMS, it is under the hood. It will bring new theme <a href="https://www.drupal.org/project/olivero">Olivero</a>, but probably in Drupal 9.1 or later. It also has new admin theme <a href="https://www.drupal.org/project/claro">Claro</a> that is already experimental in Drupal 8.8.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-RHHCwpzgrVTc8WcebKKg.png" /><figcaption>Drupal 8.9 and 9.0 comparison</figcaption></figure><h3>What is not in Drupal 9 anymore?</h3><p>That is one of the reasons why Drupal 9 is the new major release. Drupal contributors make cleanup towards Drupal 9 and get rid of <a href="https://github.com/drupal/drupal/search?q=%22will+be+removed+before+Drupal+9%22+path%3A%2Fcore%2Flib+language%3APHP&amp;unscoped_q=%22will+be+removed+before+Drupal+9%22+path%3A%2Fcore%2Flib+language%3APHP">deprecated code</a>.</p><p>List of deprecated core APIs with their replacements can be found in <a href="https://www.qed42.com/blog/preview-breaking-changes-drupal-9">this article</a>. Most of these deprecations just unify old APIs and make transition of Drupal development further towards modern PHP. Magic functions are no longer necessary, and developers have to use either standard PHP functions or load namespaced classes and use their methods. This makes Drupal 9 feel more like modern PHP framework, which is good for developers.</p><p>There are also some <a href="https://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/which-modules-will-be-removed-from-drupal-9">deprecated core modules</a>, that are removed in Drupal 9. Namely block_place, entityreference, field_layout and simpletest. Place Blocks module is removed completely. Entity Reference module is deprecated and should be removed completely in Drupal 10. Field Layout module is removed and replaced with <a href="https://www.drupal.org/docs/8/core/modules/layout-builder">Layout Builder</a>. SimpleTest is moved from core to be contrib module once again.</p><h3>How do I upgrade to Drupal 9 from Drupal 8?</h3><p>It’s pretty much like updating to any minor version of Drupal 8. It is built to be compatible with Drupal 8 as much as possible. These basic steps are stated in <a href="https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/upgrading-a-drupal-8-site-to-drupal-9">official guide</a>:</p><ol><li>Ensure your hosting environment matches the <a href="https://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/environment-requirements-of-drupal-9">platform requirements of Drupal 9</a></li><li>Update to Drupal 8.8x or 8.9.x (if not already on that version)</li><li>Update all contributed projects and ensure they are Drupal 9 compatible</li><li>Make custom code Drupal 9 compatible</li><li>Update core codebase to Drupal 9</li><li>Run update.php</li></ol><p>To be sure, you can use <a href="https://www.drupal.org/project/upgrade_status">Upgrade Status</a> module.</p><p>But there is still one thing that you have to be aware of. <a href="https://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/environment-requirements-of-drupal-9">System requirement</a> are different in Drupal 9 than in Drupal 8.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96ab6ef856fdfcc1fce255417712cd2b/href">https://medium.com/media/96ab6ef856fdfcc1fce255417712cd2b/href</a></iframe><h3>Will the transition be smooth?</h3><p>Yes, it should be. If you are already running Drupal 8.8, you have little to worry about. But it is always good to wait for 9.0.3 and let early adopters debug some issues of the new version.</p><h3>How do I upgrade to Drupal 9 from Drupal 7?</h3><p>I would suggest developing new site from scratch but there are some cases where it is not an option. Drupal <a href="https://www.drupal.org/docs/9/drupal-9-release-date-and-what-it-means/what-happens-to-drupal-7-after-drupal-9-is-released#s-upgrading-from-drupal-7-to-8and-then9">has your back</a> even in this, but it won’t be that straightforward as migration from 8 to 9. Drupal has Migrate Drupal module in its core to migrate from older versions of Drupal. <a href="https://www.drupal.org/project/upgrade_status">Upgrade Status</a> module can point out code problems before upgrading. <a href="https://www.drupal.org/project/drupalmoduleupgrader">Drupal Module Upgrader</a> can help modify module to be compatible with Drupal 8 and 9. You can also analyze your code using <a href="https://github.com/mglaman/drupal-check">Drupal Check</a> static code analysis tool.</p><h3>What will happen to older versions of Drupal?</h3><p>They will follow <a href="https://www.drupal.org/core/release-cycle-overview">planned lifecycle</a>. Drupal 8.7 will receive security updates until June 2020. Drupal 8.8 will receive security updates until December 2020. Drupal 8.9 will receive security updates until November 2021 or shorter. Drupal 7 will receive security updates until November 2021. This means that November 2021 will mean end of life for both Drupal 8 and Drupal 7. Vendor Extended Support should be available even longer, until year 2024. But if will not be major concern of Drupal core team anymore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_jVl2w73-cmKk9MEHwgP2g.png" /><figcaption>Drupal lifecycle 2019–2022</figcaption></figure><h3>What happens next?</h3><p>Well, development of Drupal is planned for coming years so you should not worry. Drupal 10 is planned for middle of 2022 and Drupal 9 should be supported until middle of 2022.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76e2807a5761" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/drupal-9-is-coming-76e2807a5761">Drupal 9 is coming!</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drupal 8 configuration management using Drupal Console]]></title>
            <link>https://medium.com/touch4it/drupal-8-configuration-management-using-drupal-console-cf429aab82bc?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf429aab82bc</guid>
            <category><![CDATA[drupal]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[drupal-8]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 11:01:01 GMT</pubDate>
            <atom:updated>2020-04-14T11:01:01.045Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you have a website where you need to synchronize configuration of development and production environment? That’s exactly the purpose of <a href="https://www.drupal.org/docs/8/configuration-management">Drupal configuration management</a>. It is possible to use it using UI, Drush, or Drupal Console. We focus on Drupal Console since if is a great tool for automation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPQFhtTPhT48itCjCq34vQ.jpeg" /></figure><h3>What configuration does this manage?</h3><p>Installed modules, module settings, content types, basically everything you change using admin UI. Everything except content.</p><h3>How does this configuration look like?</h3><p>All the small pieces of configuration are exported into separate YAML files. Their respective names refer to their module, field, block, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*faoYq4mQfSHnk2Y4YJDr6A.png" /><figcaption>Example of several YAML configuration files</figcaption></figure><h3>Why do I want this?</h3><p>If you are working with versioning software like Git, it is easier to keep track of changes. It is easy to maintain website for enterprise client without having their real data. You don’t have to repeat changes using UI or send a database to someone. It is also great to synchronize configuration changes between developers.</p><h3>How do I do this?</h3><p>Well, you have two options we will cover. First is to do it using <a href="https://www.drupal.org/docs/8/configuration-management/workflow-using-the-drupal-ui">Admin UI</a>. You go to <em>Manage &gt; Configuration &gt; Development &gt; Configuration Synchronization (admin/config/development/configuration)</em> and you will see configuration synchronization page. You will see differences between database and active configuration. You can export and import whole configuration. Import and export is in form of tarred archive.</p><p>Our favourite option is to use <a href="https://hechoendrupal.gitbooks.io/drupal-console/en/commands/available-commands.html">Drupal Console</a>. drupal config:export and drupal config:import is all you need. We can export local changes of several developers and merge them using git. Then it is all deployed and imported to development, then pre-production and then production environment.</p><p>It is good practise to make a database dump before you import configuration. Just in case. But if you are able to import configuration on your local machine (with clean installation of vendors if using Composer), it is almost sure that you will be able to import it also on server.</p><h3>Is it safe to use?</h3><p>Well, we suggest that you move configuration folder outside of project web root and put there .htaccess file rejecting all connections. To do this, we will need to set configuration sync directory in <em>sites/default/settings.php</em> and create the folder relative to web root (relative to <em>index.php</em>).</p><pre>$config_directories[CONFIG_SYNC_DIRECTORY] = ‘../config’;</pre><p>Using this, we tell Drupal to put configuration one level up from <em>index.php</em> and into folder config. If it is not possible to put it in this structure because of your hosting, just use the web root for configuration folder</p><pre>$config_directories[CONFIG_SYNC_DIRECTORY] = ‘./config’;</pre><p>To make things more secure on Apache, you have to put .htaccess file into this folder. If you use other web server than Apache, you will have to disable it in host configuration.</p><pre># Deny all requests from Apache 2.4+<br>&lt;IfModule mod_authz_core.c&gt;<br>  Require all denied<br>&lt;/IfModule&gt;</pre><pre># Deny all requests from Apache 2.0–2.2<br>&lt;IfModule !mod_authz_core.c&gt;<br>  Deny from all<br>&lt;/IfModule&gt;</pre><pre># Turn off all options we don’t need<br>Options -Indexes -ExecCGI -Includes -MultiViews</pre><pre># Set the catch-all handler to prevent scripts from being executed<br>SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006</pre><pre>&lt;Files *&gt;<br>  # Override the handler again if we’re run later in the evaluation list<br>  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003<br>&lt;/Files&gt;</pre><pre># Disable the PHP engine<br>&lt;IfModule mod_php5.c&gt;<br>  php_flag engine off<br>&lt;/IfModule&gt;</pre><h3>Conclusion</h3><p>You want it. Seriously. It is good to synchronize data between environments and to track your changes so you will be able to return to them if needed. And it can be used to save a lot of time if you use CI/CD pipelines to deliver your Drupal site.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf429aab82bc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/drupal-8-configuration-management-using-drupal-console-cf429aab82bc">Drupal 8 configuration management using Drupal Console</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disable cache for local development in Drupal 8]]></title>
            <link>https://medium.com/touch4it/disable-cache-for-local-development-in-drupal-8-43f1c98a69c4?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/43f1c98a69c4</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[drupal-8]]></category>
            <category><![CDATA[drupal]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Sun, 12 Apr 2020 08:14:15 GMT</pubDate>
            <atom:updated>2020-04-12T09:12:56.726Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you tired of constant clearing of render caches during Drupal development? Well, there is a solution that might save you some time. You can completely disable render cache for your local development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzE-1Sq52UqlY2EHANPPXQ.jpeg" /></figure><p>To do this, you will need local settings file settings.local.php that can be found or created in sites/default folder. There is already example file out-of-the-box when you install a Drupal 8 site. This file must be included from settings.php by uncommenting following lines:</p><p>sites/default/settings.php</p><pre>…</pre><pre>if (file_exists($app_root . ‘/’ . $site_path . ‘/settings.local.php’)) {<br>  include $app_root . ‘/’ . $site_path . ‘/settings.local.php’;<br>}</pre><p>You must also include development.services.yml inside local file to enable development services of underlaying Symfony framework. One without another is unusable. Comments in the settings.local.php file below explain basic local development perks.</p><p>sites/default/settings.local.php</p><pre>&lt;?php</pre><pre>// Include development services file<br>$settings[‘container_yamls’][] = DRUPAL_ROOT . ‘/sites/development.services.yml’;</pre><pre>// Make error logging more verbose<br>$config[‘system.logging’][‘error_level’] = ‘verbose’;</pre><pre>// Disable minification of CSS and JS<br>$config[‘system.performance’][‘css’][‘preprocess’] = FALSE;<br>$config[‘system.performance’][‘js’][‘preprocess’] = FALSE;</pre><pre>// Disable caches<br>$settings[‘cache’][‘bins’][‘render’] = ‘cache.backend.null’;<br>$settings[‘cache’][‘bins’][‘page’] = ‘cache.backend.null’;<br>$settings[‘cache’][‘bins’][‘dynamic_page_cache’] = ‘cache.backend.null’;<br>$settings[‘cache’][‘default’] = ‘cache.backend.null’;</pre><pre>// Allow access to rebuild.php<br>$settings[‘rebuild_access’] = TRUE;</pre><pre>// Do not let Drupal change permissions on files<br>$settings[‘skip_permissions_hardening’] = TRUE;</pre><pre>// Allow localhost to be trusted host<br>$settings[‘trusted_host_patterns’] = [<br>  ‘^localhost$’,<br>  ‘^localhost:.*$’<br>];</pre><p>If you use null cache without including this services file, you will get a nasty error. You will also get an error if you will use —-no-dev flag when installing Drupal using Composer and try to use development services.</p><p>sites/development.services.yml</p><pre>parameters:</pre><pre>  # Allow debugging of cache headers<br>  http.response.debug_cacheability_headers: true</pre><pre>  twig.config:</pre><pre>    # Add twig debug comments into rendered html<br>    debug: true</pre><pre>    # Live reload twig files on change<br>    auto_reload: true</pre><pre>    # Disable twig cache<br>    cache: false</pre><pre>services:</pre><pre>  # Include null cache used in settings.local.php<br>  cache.backend.null:<br>    class: Drupal\Core\Cache\NullBackendFactory</pre><p>When you have applied these local settings and cleared render caches, you won’t need to clear them anymore. Page load will be significantly slower than loading cached pages, but it is quicker comparing to deleting render cache and waiting for the first page load.</p><p><strong>Warning: do not use this in production!!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43f1c98a69c4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/disable-cache-for-local-development-in-drupal-8-43f1c98a69c4">Disable cache for local development in Drupal 8</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enabling NTFS write in macOS 10.15 Catalina the Open source way]]></title>
            <link>https://medium.com/macoclock/enabling-ntfs-write-in-macos-10-15-catalina-the-open-source-way-a5fd0d1cb32e?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5fd0d1cb32e</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[macos-catalina]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Sun, 10 Nov 2019 14:59:16 GMT</pubDate>
            <atom:updated>2022-01-23T09:44:28.776Z</atom:updated>
            <content:encoded><![CDATA[<h3>Enabling NTFS write in macOS the Open source way</h3><h4>How to access Windows disks from Mac</h4><p>Do you have an old Windows external HDD or do you share your data with Windows computers and your macOS is unable to write NTFS file system? You can change it in several ways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgrGxzKd-FmMIC96rcNi0A.png" /><figcaption>NTFS drive in Disk Utility</figcaption></figure><h3>Why can’t macOS just write NTFS?</h3><p>NTFS is a proprietary file system standard from Microsoft used in Windows since the early 90s. It was first used in Windows NT 3.1 and is present since.</p><p>Microsoft is not providing a full specification of NTFS as open source standards and it is quite possible that Apple would need to pay pricey licenses in order to fully use it in their systems. And why would they support the protocol of their main competitor?</p><h3>How can macOS write NTFS?</h3><p>There are several ways to do so. You can use paid software like <a href="https://www.paragon-software.com/ufsdhome/ntfs-mac/">Paragon NTFS for Mac</a> or <a href="https://www.tuxera.com/products/tuxera-ntfs-for-mac/">Microsoft NTFS for Mac by Tuxera</a>. There is also freeware <a href="https://iboysoft.com/ntfs-for-mac/">iBoyosft NTFS for Mac</a>. Or you can use open source software. But open source solution requires some messing in terminal. Let’s have a look at this option.</p><h3>Enabling NTFS write in macOS</h3><p>Make sure you have <a href="https://developer.apple.com/download/more/">Command Line Tools for Xcode</a> and <a href="https://brew.sh/">Homebrew package manager</a> installed.</p><p>Then you will need to download and install the latest version of <a href="https://osxfuse.github.io/">macFUSE (osxFUSE)</a> either using installer from <a href="https://github.com/osxfuse/osxfuse/releases">GitHub releases page</a>.</p><pre>brew install --cask macfuse</pre><p>Reboot your macOS. After that, install package ntfs-3g-mac from Terminal. You can find detailed install manual also on <a href="https://github.com/osxfuse/osxfuse/wiki/NTFS-3G">macFUSE GitHub wiki</a>.</p><pre>brew tap gromgit/homebrew-fuse<br>brew install ntfs-3g-mac</pre><p>Since OS X 10.11 El Capitan you need to disable System Integrity Protection for a while. Restart or shut down your Mac. While starting on Intel hardware, press Command + R key combination. This will get you to Recovery mode. For Apple Silicon hardware, you can can boot to Recovery mode by long pressing power button until you see “Options” button, which will lead you to Recovery mode.</p><p>In Recovery mode, open Terminal application from Utilities in the top menu. Disable System Integrity Protection with command:</p><pre>csrutil disable</pre><p>On Mac with T2 security chip, you will have to disable security in <a href="https://support.apple.com/en-us/HT208198">Startup Security Utility</a> while in Recovery mode.</p><p>Restart your Mac and go to your normal macOS.</p><p>Since macOS 10.15 Catalina, you have to do one extra step. Apple is trying to protect you more by making some crucial parts of the file system read-only and we have to make it writable again. Until next restart. Enter this command into your Terminal:</p><pre>sudo mount -uw /</pre><p>You can find new mount in search in Terminal:</p><pre>which mount_ntfs</pre><pre>/opt/homebrew/sbin/mount_ntfs</pre><p>After that, we can just back up the old NTFS handler and replace it with the new one.</p><pre>sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.original</pre><pre>sudo ln -s /opt/homebrew/sbin/mount_ntfs /sbin/mount_ntfs</pre><p>If NTFS write doesn’t work yet, you can try to add one additional parameter to NTFS mount script. Open it in your favourite console editor, for example nano.</p><pre>sudo nano /usr/local/sbin/mount_ntfs</pre><p>Find flag “-o allow_other \” and add “-o auto_xattr \” as next flag. Save using “ctrl+x” and “yes”.</p><p>After that, you have to go to Recovery mode again and enable System Integrity Protection again. You will also have your read-only parts of system protected again.</p><pre>csrutil enable</pre><p>That’s it. Enjoy writing to NTFS.</p><p>Unfortunately, you have to repeat this procedure every time you update to a new major release of macOS. So you’re good until next October.</p><h3>Are there alternatives to NTFS?</h3><p>Yes, if you want to share external HDD between Mac and PC, you can format your HDD to exFAT file system. You will lose all the data on disk during format but otherwise, it’s usable.</p><p>If you want to stick with the Apple ecosystem, you are free to use Apple APFS or HFS+.</p><p>If you want to be compatible with everybody and everything, use old FAT32. But you will be able to place there files of maximum size ~4GB.</p><h3>Which macOS does it work on?</h3><p>This article was originally written for macOS 10.15 Catalina. Now I am running macOS 11.0 Big Sur and things are still working well. According to macFUSE, this should work for 10.12+.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5fd0d1cb32e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/macoclock/enabling-ntfs-write-in-macos-10-15-catalina-the-open-source-way-a5fd0d1cb32e">Enabling NTFS write in macOS 10.15 Catalina the Open source way</a> was originally published in <a href="https://medium.com/macoclock">Mac O’Clock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to replace MacBook SSD with Samsung 970 EVO M.2 NVMe on macOS Mojave]]></title>
            <link>https://medium.com/macoclock/how-to-replace-macbook-ssd-with-samsung-970-evo-m-2-nvme-on-macos-mojave-945684e79daa?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/945684e79daa</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[samsung]]></category>
            <category><![CDATA[ssd]]></category>
            <category><![CDATA[macbook]]></category>
            <category><![CDATA[macbook-pro]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Thu, 27 Dec 2018 13:02:14 GMT</pubDate>
            <atom:updated>2020-04-13T06:51:27.066Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to replace MacBook SSD with Samsung 970 EVO M.2 NVMe on macOS Catalina</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jcLfFppTyBGeLdBp" /><figcaption>Photo by <a href="https://unsplash.com/@karishea?utm_source=medium&amp;utm_medium=referral">Kari Shea</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Originally written for macOS 10.14 Mojave, but it still works the same way on macOS 10.15 Catalina.</p><p>If you know what you are doing, it’s pretty straightforward and takes a few hours to set up everything. For me, it took almost two months since I always had to wait for something.</p><p>The waiting was worth it. If I wanted to replace my 250GB disk with official 500GB replacement drive, it would take 600–700$. This way it cost me less than 200$.</p><h3>What you will need</h3><ul><li>Pentalobe P5 (1.2mm) screwdriver for MacBook bottom cover</li><li>Torx T5 screwdriver for flash drive</li><li>M.2 to Apple proprietary adapter (Sintech ST-NGFF2013)</li><li>External HDD for Time Machine backup</li><li>Flash drive 4GB+</li><li>Small dry brush to remove dust (optional)</li></ul><h3>Adapter choice</h3><p>The part that took me the most time was the selection of correct adapter and waiting for it to be delivered. First, I have ordered 3$ adapter from AliExpress. When I have put my new disk into my mid-2015 MacBook Pro 15”, nothing happened, and the disk did not show in the recovery console. After consulting with the seller, he told me it’s not supposed to work with NVMe drives.</p><p>My second choice was more expensive Sintech ST-NGFF2013 adapter (16$) from eBay. I have installed it into my MacBook and … nothing happened. I had to do some research to make it work but the seller assured me it should definitely work.</p><h3>Preparation</h3><p>To save time and transfer all the data and applications directly to the new disk, you should start with creating Time Machine backup.</p><p><a href="https://support.apple.com/en-us/HT201250">Back up your Mac with Time Machine</a></p><p>If you want to be a little bit geeky and be happy that your disk is now blazing fast, then you should install a <a href="https://itunes.apple.com/sk/app/blackmagic-disk-speed-test/id425264550?mt=12">disk speed benchmark tool</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*gYoaaSrCV6XxcRemXzDJXA.png" /><figcaption>Disk speed with original SSD drive</figcaption></figure><h3>Linux boot drive</h3><p>Maybe you will need it and maybe not. It is better to be prepared. I needed to boot a Linux and type in few commands to format my drive. You need to insert the flash drive and follow <a href="https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-macos">this simple guide</a>.</p><h3>Disk swap</h3><p>WARNING — this step voids your warranty!</p><p>After you have finished your backup, you can turn off your MacBook. Gently unscrew 10 screws using P5 screwdriver from the bottom of your MacBook. Do not apply excessive force and take your time. After that, grab the cover at the display side of MacBook near the fan ribs. Gently tear it off so you will see internal parts.</p><p>After that, you need to gently unscrew former SSD using Torx T5 screwdriver. Next, you need to insert new SSD into adapter. Make sure the connector has slid all the way inside the adapter. After that, you insert new SSD with adapter into the slot or former one and refit the screw.</p><p>You replace the bottom cover and push it gently in the middle until you will hear two clicks. Now the cover holds tight and you can put screws into their places. You can also replace screws after successful installation of the system.</p><p>If you need to have a look at the replacement of your drive, find a video on YouTube. For my model, it is <a href="https://www.youtube.com/watch?v=wfu-mZCIlYk">this one</a>.</p><h3>Recovery mode</h3><p>To boot into recovery mode, you will need to press cmd + option (alt) + r right after you turn on the MacBook. You can also use cmd + r, but you will miss one important option in Disk Utility on Mojave.</p><p>After you boot into recovery mode, you enter<strong> Disk Utility</strong>. On the left side, you see physical hard drives and their respective logical volumes. If you don’t see your new drive there, don’t panic yet. Press “View” button on the top left corner above drives and press “Show All Devices” (top menu View in older systems). You should see your new drive here. If not, you have to boot Linux just like me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sU_8w20Sa1lV5kxg1kto4Q.png" /><figcaption>Disk Utility — View button</figcaption></figure><h3>Partitioning using Linux</h3><p>You need to shut down your MacBook, insert Linux bootable flash drive and start while pressing option (alt) key. You should see available bootable devices. Flash drive should be the one on the right.</p><p>First, you need to open the Terminal application. Then you need to type <strong>lsblk</strong> to find disk label. You should see something like <strong>nvme0n1</strong> in there. That means your hardware is recognized as device nvme0 and we’re good to proceed.</p><pre>lsblk</pre><p>After that, you need to create a partition. We will use fdisk utility. Just enter sudo fdisk /dev/nvme0n1. Type “n” to create a new partition. Leave all options to default values by pressing enter. Write changes by typing “w”.</p><pre>sudo fdisk /dev/nvme0n1</pre><pre>- n .. Add a new partition<br>  - p .. Primary partition<br>  - 1 .. Partition number 1<br>  - default .. First sector<br>  - default .. Last sector</pre><pre>- w .. Write</pre><p>After that, you can enter lsblk again to check it has a partition now.</p><pre>lsblk</pre><p>Turn off your MacBook.</p><h3>Recovery mode (continued)</h3><p>Again, you have to start MacBook and immediately press cmd + option (alt) + r to access Recovery mode and Disk Utility there. Now you should definitely have your new hard drive available when you press “Show All Devices” in “View” dropdown list.</p><p>Click on your physical drive, press <strong>Erase</strong> icon on top in the middle. Select <strong>Mac OS extended journaled format</strong> and <strong>GUID partition map</strong> and press <strong>Erase</strong>.</p><p>Click on the logical drive under physical one and press <strong>Erase</strong> again. Select <strong>APFS</strong> format and press <strong>Erase</strong>.</p><p>Now you have your disk set up and you just need to install your system. Exit the Disk Utility and enter <a href="https://support.apple.com/en-us/HT203981">Recover From Time Machine Backup</a>. There you just select the most recent one and let the magic happen. For me, it took about 4 hours to recover. Time depends mainly on the number of files it has to recover and external drive speed.</p><h3>Check everything is OK</h3><p>Open <strong>About This Mac</strong> utility, press <strong>System Report</strong> button, and click on <strong>NVMExpress</strong> under Hardware. There you click on your will find your drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBLJKlF6_kwWXonqguNymg.jpeg" /><figcaption>NVMExpress in System Report</figcaption></figure><p>After that, you can test your drive speed again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*EuCGqHGBMK0AL_KOTDzwfw.png" /><figcaption>Disk speed with Samsung 970 Evo</figcaption></figure><h3>Final tweaks</h3><p>There is one more thing to tweak — sleep mode of your MacBook. There are several <a href="https://www.lifewire.com/change-mac-sleep-settings-2260804">available sleep modes</a> and there is a good chance you have mode 3. If you see that your MacBook consumes more battery than before during sleep, you can tell it to sleep deeper. This would result in a slightly longer time to go to sleep and wake up. You will probably notice it, but it still takes shorter than for you to wake up. It was maybe one second on my first try. Now I don’t even notice it any longer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*BIatYIgpdBUTMkQ16OXIyw.jpeg" /><figcaption>Sleep mode check using pmset</figcaption></figure><p>To check your current state, open your Terminal app and press pmset -g. Then you type in sudo pmset hibernatemode 25 to change your sleep mode to a deeper one. To go back to the previous setting, you just type in sudo pmset hibernatemode 3 in Terminal and everything is like before.</p><pre>pmset -g<br>sudo pmset hibernatemode 25<br>pmset sleepnow<br>sudo pmset hibernatemode 3</pre><h3>Enjoy</h3><p>It may sound like a long and difficult approach, but it is not if you know what you are doing, and you are gentle with a screwdriver. Backing up and restoring your MacBook are the only time-consuming parts. After fiddling with these drives and adapters, I am able to swap SSDs in my MacBook in 5 minutes now.</p><h3>Further reading</h3><p><a href="https://medium.com/@vsulak.svk/enabling-ntfs-write-in-macos-10-15-catalina-the-open-source-way-a5fd0d1cb32e">Enabling NTFS write in macOS 10.15 Catalina the Open source way</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=945684e79daa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/macoclock/how-to-replace-macbook-ssd-with-samsung-970-evo-m-2-nvme-on-macos-mojave-945684e79daa">How to replace MacBook SSD with Samsung 970 EVO M.2 NVMe on macOS Mojave</a> was originally published in <a href="https://medium.com/macoclock">Mac O’Clock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UI testing using Puppeteer and Gitlab CI]]></title>
            <link>https://medium.com/touch4it/ui-testing-using-puppeteer-and-gitlab-ci-9dcf8527dc65?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dcf8527dc65</guid>
            <category><![CDATA[ui-testing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Wed, 05 Sep 2018 19:46:01 GMT</pubDate>
            <atom:updated>2018-09-05T19:46:01.606Z</atom:updated>
            <content:encoded><![CDATA[<p>As Bill Gates once mentioned, developers should be lazy so that they find an easy solution for a hard task. Does checking of a website with 3 languages and multiple subpages in 8 resolutions sound hard enough for you?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-mDe_2yd_c7yk4GOfSsHxw.png" /></figure><p>During one of our regular knowledge exchange meetings at Touch4IT, we had a topic of UI testing of web applications. One of my colleagues came with the overview of currently available solutions. Another colleague (<a href="https://medium.com/u/1cca92a77102">Tomáš Tibenský</a>) got interested when he heard about <a href="https://pptr.dev/"><strong>Puppeteer</strong></a><strong>, headless Chrome browser</strong> (Chromium actually) from the creators of Chrome and started experimenting. But since Puppeteer has its own myriad of issues, first attempt was unsuccessful. Puppeteer resisted to be installed from Dockerfile, kept crashing, getting stuck. Then I came up with lazy idea — is there any Docker image already on Docker Hub? Of course, it was there.</p><p>After some fiddling with <a href="https://hub.docker.com/r/alekzonder/puppeteer/">Docker image</a>, I managed to launch it from our Gitlab CI after building of “Hello world” application. Just to have two step pipeline, first step of which I nonchalantly skipped after first success by inserting manual launch line. You know, 30 seconds of life wasted during every build.</p><pre><strong>stages:<br> </strong>- build<br> - test<br><br><strong>build:<br>  stage: </strong>build<br>  <strong>image: </strong>node:carbon<br>  <strong>when</strong>: manual<br>  <strong>script:<br>   </strong>- cd app<br>   - npm install<br>  <strong>tags:<br>    </strong>- docker<br><br><strong>test:<br>  stage: </strong>test<br>  <strong>image: </strong>alekzonder/puppeteer:1.5.0-0<br>  <strong>script:<br>   </strong>- cd test<br>   - yarn install<br>   - npm start<br>  <strong>artifacts:<br>    paths:<br>     </strong>- test/screenshots/*/*<br>    <strong>expire_in: </strong>3 days<br>  <strong>tags:<br>    </strong>- docker</pre><p>To break down this pipeline in <strong>gitlab-ci.yml</strong> file — build step “build” installs Node application packages and “test” launches Puppeteer UI test written in JavaScript.</p><p>“script” contains commands to be executed: “test” is the directory containing our JS file, third-party dependencies are installed by Yarn and then we launch the test itself.</p><p>Artifacts are files preserved by CI, in our case screenshots. You can set them to stay alive for a certain time, let’s say 3 days so anybody can see them after the weekend.</p><p>“docker” tag launches our <a href="https://docs.gitlab.com/runner/install/docker.html">Docker-enabled Gitlab Runner</a>.</p><pre>{<br>  &quot;name&quot;: &quot;hello-test&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;start&quot;: &quot;node screenshot-test.js&quot;<br>  },<br>  &quot;private&quot;: <strong>true</strong>,<br>  &quot;dependencies&quot;: {<br>    &quot;chromeless&quot;: &quot;^1.5.0&quot;,<br>    &quot;puppeteer&quot;: &quot;1.5.0&quot;<br>  }<br>}</pre><p><strong>package.json</strong> file above provides us with launch script using “npm start” and includes <a href="https://www.npmjs.com/package/puppeteer">puppeteer</a> package as a dependency that also downloads and installs Chromium.</p><p>Since version 1.7.0, you can also use <a href="https://www.npmjs.com/package/puppeteer-core">puppeteer-core</a> package with your own local or remote installation of Chromium.</p><pre><strong>const </strong>puppeteer = require(&#39;puppeteer&#39;);<br><strong>const </strong>fs = require(&#39;fs&#39;);</pre><pre><em>/**<br> * Launcher<br> */<br></em>(<strong>async </strong>() =&gt; {<br>  //<br>  // set up Puppeteer<br>  //<br>  <strong>let </strong>browser;<br>  <strong>try </strong>{<br>    browser = <strong>await </strong>puppeteer.<em>launch</em>({<br>      args: [<br>        &#39;--no-sandbox&#39;,<br>        &#39;--disable-setuid-sandbox&#39;,<br>        &#39;--disable-dev-shm-usage&#39;<br>      ]<br>    });<br>  } <strong>catch </strong>(err) {<br>    console.log(&#39;Error launching browser&#39;);<br>    <strong>throw </strong>err;<br>  }<br><br>  // launch browser<br>  <strong>try </strong>{<br>    fs.mkdirSync(&#39;screenshots/&#39; + name);</pre><pre>    // Web page<br>    <strong>const </strong>page = <strong>await </strong>browser.newPage();</pre><pre>    <strong>await </strong>page.setViewport({<br>      width: 1920,<br>      height: 1080<br>    });</pre><pre><strong>    await </strong>page.goto(&#39;https://example.com/&#39;, {<br>      timeout: 10000,<br>      waitUntil: &#39;networkidle0&#39;<br>    });<br><br>    // full page screenshot<br>    <strong>const </strong>bodyHandle = <strong>await </strong>page.$(&#39;body&#39;);<br>    <strong>const </strong>boundingBox = <strong>await </strong>bodyHandle.boundingBox();<br><br>    <strong>await </strong>page.screenshot({<br>      path: &#39;screenshots/example-com-fullpage.jpg&#39;,<br>      clip: {<br>        x: 0,<br>        y: 0,<br>        width: parseInt(boundingBox.width),<br>        height: parseInt(boundingBox.height)<br>      },<br>      type: &#39;jpeg&#39;<br>    });<br><br>    <strong>await </strong>bodyHandle.dispose();</pre><p>The simple script we are launching in <strong>screenshot-test.js</strong> file makes screenshot out of loaded web page.</p><p>First, we have to open a browser like in your PC. To prevent memory limits on tall pages, we present “disable-dev-shm-usage” flag.</p><p>Next we have to open web page like opening a new browser tab. We have to set target resolution and we are free to navigate to desired page. To be sure it loads properly, we set a wait timeout to 10 000 ms and we wait until there is idle network with zero open connections.</p><p>Since we want to make screenshot out of whole web page, we have to hack a little and extract its dimensions and present them as height and width of screenshot. There are some <a href="https://github.com/GoogleChrome/puppeteer/issues/359">issues</a> with extremely tall web pages but at least it gives you an idea how does it look.</p><p>After this, we can freely close the browser. But what if we want to test more web pages or resolutions? Do we have to close pages or even browser? Of course not. But you want to reload page after changing resolution to ensure all the CSS applied is correct.</p><pre><strong>await</strong> page.reload({ timeout: 10000, waitUntil: &#39;networkidle0&#39; });</pre><p>What else can you do using Puppeteer? Well, it’s up to you. You have a browser with proper API that can be used from Node.js. Sounds good to you?</p><p>Let’s have a look at how you would test status code</p><pre><strong>const</strong> assert = require(&#39;assert&#39;);<br><strong>const</strong> STATUS_OK = 200;</pre><pre><strong>try</strong> {<br>  <strong>let</strong> response = <strong>await</strong> page.goto(url, {<br>    timeout: 10000,<br>    waitUntil: &#39;networkidle0&#39;<br>  });<br>} <strong>catch</strong> (err) {<br>  <strong>return</strong> Promise.reject(err);<br>}</pre><pre><strong>if</strong> (!response) {<br>  <strong>return</strong> Promise.reject(new Error(&#39;Response empty&#39;));<br>}</pre><pre>assert.equal(response.status(), STATUS_OK, &#39;Wrong status code&#39;);</pre><p>Maybe you want to test elements on a web page.</p><pre>// Link hostname only</pre><pre><strong>let</strong> result = <strong>await</strong> page.$eval(&#39;a#sk&#39;, link =&gt; link.hostname);<br>assert.equal(result, &#39;example.sk&#39;);</pre><pre>// Link full URL</pre><pre>result = <strong>await</strong> page.$eval(&#39;a#sk&#39;, link =&gt; link.href);<br>assert.equal(result, &#39;https://example.sk/link&#39;);</pre><pre>// Element content</pre><pre>result = <strong>await</strong> page.$eval(&#39;h1&#39;, link =&gt; link.innerHTML);<br>assert.equal(result, &#39;Main header&#39;);</pre><p><strong>You can use this kind of testing as a part of your TDD or DevOps pipeline. To know more about our usage of tools in DevOps pipeline, read this article </strong>➡</p><p><a href="https://medium.com/touch4it/devops-tools-at-touch4it-9a35b4ae8df3">DevOps tools at Touch4IT - Viktor Šulák - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dcf8527dc65" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/ui-testing-using-puppeteer-and-gitlab-ci-9dcf8527dc65">UI testing using Puppeteer and Gitlab CI</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps tools at Touch4IT]]></title>
            <link>https://medium.com/touch4it/devops-tools-at-touch4it-9a35b4ae8df3?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a35b4ae8df3</guid>
            <category><![CDATA[operations]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devops-practice]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Mon, 20 Aug 2018 19:31:01 GMT</pubDate>
            <atom:updated>2018-08-20T19:31:01.049Z</atom:updated>
            <content:encoded><![CDATA[<p>We, the folk of Touch4IT, use a lot of tools helping us with development and deployment process. We have tried a lot more but the less tools we have to maintain the more time we have for customer projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLx9vCdDUGBiQNv5bg0UhA.png" /></figure><p>As we can see in the famous DevOps infinity loop, there are several parts of the process of product creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNWxiN_bC4FBFBqCFYWo1A.png" /><figcaption>DevOps toolchain</figcaption></figure><p>First, there is <strong>planning</strong>. For that we use our customized Redmine. All the work that should be done is identified into issues, estimated and assigned. Each employee of the company can see tasks that he has to do on his homepage and is notified about any changes and comments in these issues.</p><p>Part of initial planning of a project and planning of visual is the creation of mockups, moodboards, clickable visual prototypes for the customers and later assets for programmers.</p><p>At the very beginning of a project, there is a meeting of several technological leaders with project manager of the project and technology to be used in the project is selected. From there, programmers use it to <strong>create</strong> the project. We mostly use Node.js for API backends, Symfony framework for CRMs, Drupal CMS for presentation websites, SPAs for more interactive web applications, Ionic for quick mobile prototypes, and native mobile development in Android and iOS. Over the time we also had projects on other PHP frameworks, Ruby, Java, C++, desktop applications, embedded systems, server platforms, just name it. I will focus more on backend since it’s my primary area of expertise.</p><p>After an issue is finished, it should be <strong>verified</strong>. Is the proper verification “works on my machine” status? Absolutely not. Since we use Docker on both local machines and servers, there should not be major differences in behaviour between local environment, development server, preproduction server, and production server. But every project is like a living organism and any malfunctioning organ is the problem at global scale. Therefore, the system should be tested by a set of automatic tests of different types. There are unit tests that should cover parts of logic, integration tests to see how well units are playing along, UI tests to see how it all looks, and much more.</p><p>Unit and integration tests can be written in several frameworks. For Node.js, the most popular are Mocha, Jest, and Jasmine. We have used all of them, but most often we choose Mocha. It is also helpful to create coverage tests while using running these tests. To do so, built-in features come handy or Istanbul is to be used when they are not available.</p><p>UI tests can automatically run the application in the pre-defined behaviour and produce some screenshots for developer or tester to evaluate. We have used Selenium and Puppeteer on our projects. For example, our own website is tested using Puppeteer on 8 resolutions, both desktop and mobile, landscape and portrait.</p><p>To maintain code quality, linters are set up to pop warnings and errors both in IDE and later in CI/CD pipeline. For Node.js we have used ESLint, XO or Prettier. ESLint is supported in most of IDEs out-of-the-box but it is relatively easy to upgrade IDE settings to work with other two.</p><p>To <strong>build</strong>, <strong>test</strong> and <strong>deploy</strong> the code, we use Gitlab CI. Gitlab claims to serve all steps of DevOps lifecycle and truth is we use it for some of them. Builds and deployments are parametrized in it, so we can fully use configuration as a code and create infrastructure on demand using just one configuration file. Each complete application environment is running as a Docker stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfnd77HdmkO0egxCYcI0iA.png" /><figcaption>Gitlab CI pipeline</figcaption></figure><p><strong>Monitoring</strong> of running services is performed by Icinga2 with email notifications every time something fails or recovers. Plus, we monitor our infrastructure to see if everything is all right and nobody is mining crypto on our CPUs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*am1vw0A5tOB976K8l7Nkeg.png" /><figcaption>Icinga2 service grid</figcaption></figure><p>After each release, we continually work on another one.</p><p>But wait, where is the finished product? Well, after every release. But it is never really finished until client want to withdraw the product from market since there are always ways to improve the product and surpass rivals.</p><h3>← Read the previous article about DevOps:</h3><p><a href="https://medium.com/touch4it/the-three-ways-of-devops-b90abe6168ac">The Three Ways of DevOps - Viktor Šulák - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a35b4ae8df3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/devops-tools-at-touch4it-9a35b4ae8df3">DevOps tools at Touch4IT</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Three Ways of DevOps]]></title>
            <link>https://medium.com/touch4it/the-three-ways-of-devops-b90abe6168ac?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/b90abe6168ac</guid>
            <category><![CDATA[operations]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Wed, 18 Jul 2018 16:31:01 GMT</pubDate>
            <atom:updated>2018-07-18T16:31:01.461Z</atom:updated>
            <content:encoded><![CDATA[<p>The book “The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win” that popularized DevOps and transformed complex IT management and business problems into a novel, outlined DevOps principles called “The Three Ways” of DevOps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pqRCR8SaHLzP2bt8u84rw.jpeg" /></figure><h3>The First Way: Left to Right</h3><p>The fundamental principle of fast development of a product is that all departments involved have to perform as good as possible and they pass finished work from one to another. To gain this, each department (single contributor or a division) has to minimize amount of WIP (work in progress) and focus on tasks one after another. Also, each of them has to <strong>pass work down the pipeline without known defects</strong>. No local optimization should create global degradation. Each department should <strong>pass the knowledge</strong> to downstream department, so everybody involved knows what is going on in the system.</p><p>The DevOps enabled business value stream as seen in the picture is that Business identify requirements for a product, Development builds them, and Operations deliver them to a Customer as a service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*wk2siKWtogwg7j_8HObpHg.png" /><figcaption>The First Way</figcaption></figure><h3>The Second Way: Right to Left</h3><p>To build high quality product that meets customer needs, it is crucial to have a lot of <strong>feedback as fast as possible</strong>. In DevOps enabled business stream value from The First Way, each of department involved need to give feedback to its upstream colleagues. Development needs to provide time estimates, technology constraints and possible risks to Business. Operations need to provide Development detected issues and Customer needs to provide Operations feedback on the quality of service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*O5Auwosof_3NQf05Yeo38Q.png" /><figcaption>The Second Way</figcaption></figure><p>At the point of Dev to Ops handover, a lot can be automated. This is the exact spot where <strong>Continuous Integration (CI) and Continuous Delivery (CD)</strong> take place.</p><p><strong>Continuous Integration</strong> can be provided with <strong>automatic tests</strong> that run every time a code is deployed into version control system (VCS) like Git or when it is merged into (pre)production branch. Developer can see result of a test in minutes and know if his new code breaks anything covered by tests. These tests can cover many aspects of programming. There can be code quality analysis, unit testing for parts of logic, integration testing to expose faults in integration between integrated units, automatic UI testing and other types of automated tests. They can happen before or after a software is built, depends on character of a test.</p><p>Imagine if you wanted to have several changes integrated during a single day and every time a developer sends built program to a testing department and he had to run tests all over again and then had to test the whole integrated system. This all is automated in CI and the main job of QA is to write tests and manually test systems only after they are successfully deployed to development or (pre)production environment.</p><p>Another great feature of continuous integration is <strong>automatic building</strong>. Software builds are generated automatically after push to a branch or at specified time of day. If build fails, it is detected as soon as the bug is introduced and not at the D-day of major release.</p><p>The result of complete <strong>CI pipeline</strong> is that either developer gets his feedback on things he should fix or there is a new build ready to be deployed. After that, <strong>CD pipeline</strong> comes in to process the build and deliver it to real environments to be tested and used.</p><p>There are two types of CD pipelines, <strong>Continuous Delivery</strong> and <strong>Continuous Deployment</strong>. They are very similar with just one fundamental difference. Production deployment has to be manually triggered or even manually deployed in the case of continuous delivery. In the case of Continuous Deployment, even deployment to production is fully automatized and can be prevented only by failing test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATi0YLHu4jjEs6Q0GNQCcg.png" /><figcaption>CI/CD</figcaption></figure><p>Both CD types are meant to deliver small iterative changes into production that can be easily troubleshooted or reverted if necessary. Each of these changes has already passed a series of automated tests that ensures that there will be less trouble after they are deployed.</p><p>A great benefit of using CI/CD is that there are no more “release days” because each day is a release day. This is a great stress relief for development and operations teams and they tend to make less last-minute changes that often end up in broken releases.</p><p>The CI/CD process depends heavily on testing, integration and deployment tools. A lot of infrastructure work is even distributed to developers since virtual containers are used to simulate production environment on local computer, in development environment and in pre-production environment. This also prevents system-specific errors to happen that often.</p><p>Using these techniques, Facebook is able to <a href="https://www.infoq.com/news/2017/09/facebook-release-scale">make thousands of builds every single day</a>, test them, spread them to its employees, roll out to a handful of customers and ultimately to all customers. These changes can be stopped at any moment by automated tests or by feedback from people already using them.</p><h3>The Third Way</h3><p>The Third Way is about the cultural shift in an organization. People don’t have to be afraid to <strong>take risks</strong> and <strong>experiment</strong>. If it doesn’t work, automated tests should stop the deployment. If it works, team tried and learnt something new. In either way, team learns something from either success or failure. Team also must have a recovery plan that can also be useful in the future in production.</p><p>Experimentation and risk-taking are the only way to push innovations forward and reach new frontiers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*h9d28MCSgr_pwTqkbfnIsg.png" /><figcaption>The Third Way</figcaption></figure><h3>← Read the previous article about DevOps:</h3><p><a href="https://medium.com/touch4it/a-road-to-devops-dc33c89df27b">A road to DevOps</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b90abe6168ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/the-three-ways-of-devops-b90abe6168ac">The Three Ways of DevOps</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A road to DevOps]]></title>
            <link>https://medium.com/touch4it/a-road-to-devops-dc33c89df27b?source=rss-6cec550b3318------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc33c89df27b</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[operations]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <dc:creator><![CDATA[Viktor Šulák]]></dc:creator>
            <pubDate>Wed, 27 Jun 2018 21:41:01 GMT</pubDate>
            <atom:updated>2018-07-22T08:11:31.199Z</atom:updated>
            <content:encoded><![CDATA[<p>DevOps is more than just a bunch of tools used to gain better efficiency. It is a cultural movement affecting every aspect of product creation. It embraces change in organizations and encourage them to experiment and innovate.</p><p>There are three main things that have to be aligned for DevOps to be really implemented in an organization — people, processes and technology. These are three main pillars DevOps is built on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNGgiEM2IOEgJEtzp9yrZA.png" /><figcaption>Three pillars of DevOps</figcaption></figure><h3>People</h3><p>Every product is all about people creating it. In DevOps, there is a strong need for them to cooperate more than ever. There cannot be development team fighting with operations team that is fighting with networking team. All of them need to cooperate and share knowledge of the product as completed work is passed from team to team on the way to a client. The whole movement started after John Allspaw and Paul Hammond gave their famous speech “<a href="https://www.youtube.com/watch?v=LdOe18KhtT4">10 Deploys Per Day, Dev and Ops Cooperation at Flickr</a>” in 2009. They described how their teams worked closely together in order to create a product quickly, functional and successful.</p><p>Every team member has to understand why his organization is adopting DevOps and what it will mean for him. For Development it means more work since more of infrastructure is now virtualized and they can set up their environments programmatically. This does not mean that Operations are losing their jobs. Some people like to call DevOps a “No-Ops” but that is not correct. Operations department just has to work with Development more closely than ever.</p><p>Quality Assurance (QA) department also has to work closely with Development since there are automated tests ran after a code is pushed from developer into Version Control System (VCS). These tests can be written by either part, it depends on the test itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*vtl6ztEgmiUHC45GLkl-OQ.png" /><figcaption>DevOps</figcaption></figure><h3>Processes</h3><p>Old processes in an organization have to be modified or replaced by new ones in order to work DevOps style. Processes can’t stand in the way of people trying to make things move faster.</p><p>Waterfall model is the great example of things that are being replaced. In the past, at the kick off meeting with client, product was defined, and months of development passed before a client had his finished “release v1.0” that met specification from a long time ago. Nowadays the market is moving too fast to let this happen.</p><p>To shorten these extremely long release cycles, <strong>Agile methodology</strong> started to be used. It cuts release cycles to mere weeks and client should see results at the end of every sprint. These shortened cycles also help planning. Also, the product can be shaped along the way and cheaper compared to changing of complete product.</p><p><strong>Lean methodology</strong> working hand-in-hand with Agile methodology also helps to speed up software development since it tells developers to add features as late as possible and to skip everything unnecessary in order to prevent wasting of resources.</p><p>Some say that DevOps replaces Agile but that is not exactly true. DevOps builds on top of some Agile ideas but pushed them to extreme. There are no releases every two weeks but tens of releases every single day, hundreds, thousands, …</p><p>We can still place Agile before the DevOps process as the interface between Business and Development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*0kcDO-x4jOcpQNupK4EOdg.png" /><figcaption>Agile and DevOps</figcaption></figure><h3>Technology</h3><p>DevOps depends heavily on technology used as it tries to automatize everything as much as possible. Each step of the automation process has plenty of tools available and they have to fulfil their respective job but ultimately, they have to work together as one pipeline. These technologies include build automation tools, automatic testing suites, virtualization and containerization technologies, deployment tools, monitoring tools, and much more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSO1sc__liRIIXAiseBHKA.png" /><figcaption>Automation for DevOps</figcaption></figure><h3>Read the next article about DevOps →</h3><p><a href="https://medium.com/touch4it/the-three-ways-of-devops-b90abe6168ac">The Three Ways of DevOps - Viktor Šulák - Medium</a></p><h3>← Read the previous article about DevOps:</h3><p><a href="https://medium.com/touch4it/what-is-devops-832d680879a5">What is DevOps?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc33c89df27b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/touch4it/a-road-to-devops-dc33c89df27b">A road to DevOps</a> was originally published in <a href="https://medium.com/touch4it">Touch4IT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>