<?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: Arturo Linares</title>
    <description>The latest articles on DEV Community by Arturo Linares (@arturolinares).</description>
    <link>https://dev.to/arturolinares</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%2F54939%2Fe971e10f-b5ac-4208-b33e-27b14e6120f1.jpeg</url>
      <title>DEV Community: Arturo Linares</title>
      <link>https://dev.to/arturolinares</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arturolinares"/>
    <language>en</language>
    <item>
      <title>Easy VRT testing</title>
      <dc:creator>Arturo Linares</dc:creator>
      <pubDate>Mon, 13 Apr 2020 04:09:08 +0000</pubDate>
      <link>https://dev.to/arturolinares/easy-vrt-testing-8ga</link>
      <guid>https://dev.to/arturolinares/easy-vrt-testing-8ga</guid>
      <description>&lt;p&gt;I normally work on different and very active projects in several testing environments. I needed a simple and fast way to generate visual regression tests between them, or even to just to compare my local environment to an integration server. However, it was cumbersome to edit backstop configuration files frequently just to change servers, thus I created a tool that simplifies the task a lot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/arturolinares/easy-vrt"&gt;https://github.com/arturolinares/easy-vrt&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is a Symfony console application that wraps Docker backstop containers to run the tests. The application reads a list of URLs from a CSV file to generate the JSON configuration files for BackstopJS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Once the project is installed you will want to compare two sites. Follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Generate the backstop scenarios using a CSV file containing the routes to visit.&lt;/li&gt;
&lt;li&gt;Run the tests.&lt;/li&gt;
&lt;li&gt;Browse the results to visualize the differences.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To &lt;strong&gt;generate the scenarios&lt;/strong&gt; use the command &lt;code&gt;vrt:gen&lt;/code&gt;. It will use a CSV file with the routes to generate them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/console vrt:gen path/to/routes.csv --ref-domain=http://prod.com --url=http://my-qa.com

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



&lt;p&gt;You can find a sample of the CSV file in the &lt;code&gt;sample&lt;/code&gt; directory. The file has two fields: the route and an optional label. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/,"The Homepage"
/category/tag,
"/about-us", "About US"

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



&lt;p&gt;You can set the reference domain using the flag &lt;code&gt;--ref-domain&lt;/code&gt;. This is normally production. Use the flag &lt;code&gt;--url&lt;/code&gt; to specify the domain you want to compare.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sometimes you need to create several scenarios for the same route but different prefix&lt;/strong&gt;. For example, when using multilingual sites. To specify the prefixes you can use the &lt;code&gt;--prefix&lt;/code&gt; (&lt;code&gt;-p&lt;/code&gt;) option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/console vrt:gen path/to/routes.csv -u [http://my-qa.com](http://my-qa.com) -r prod.com -p es -p en -p fr

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



&lt;p&gt;The above will generate scenarios for these urls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/es/
/en/
/fr/
/es/category/tag
/en/category/tag
/fr/category/tag
/es/about-us
/en/about-us
/fr/about-us

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



&lt;p&gt;Until now, you only have configured backstop. &lt;strong&gt;To actually run the tests use&lt;/strong&gt; &lt;code&gt;vrt:run&lt;/code&gt;. This command will run backstop using a Docker container. Also, if you want to see what the script is doing, you can change the verbosity with &lt;code&gt;-v&lt;/code&gt;, &lt;code&gt;-vv&lt;/code&gt; and &lt;code&gt;-vvv&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, &lt;strong&gt;to see the report&lt;/strong&gt; , use &lt;code&gt;vrt:server&lt;/code&gt; to browse the diffs.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Git log filtering and how to show a better history tree</title>
      <dc:creator>Arturo Linares</dc:creator>
      <pubDate>Mon, 04 Nov 2019 09:00:00 +0000</pubDate>
      <link>https://dev.to/arturolinares/git-log-filtering-and-how-to-show-a-better-history-tree-20k</link>
      <guid>https://dev.to/arturolinares/git-log-filtering-and-how-to-show-a-better-history-tree-20k</guid>
      <description>&lt;p&gt;Some useful commands to find commits using Git:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filter by content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Filter by the contents of a commit. Think of it as if you do a &lt;code&gt;git log -p&lt;/code&gt; (shows the diff of each commit) and then you search the output.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log -S var_dump&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filter by commit message&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --grep "FRB-666"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filter by author&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --author "Arturo"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can use emails and several values:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --author "outlook.com|hotmail.com"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filter by date&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Conveniently accepts &lt;code&gt;--before&lt;/code&gt; and &lt;code&gt;--after&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --before "2017-06-11"&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Git log format
&lt;/h2&gt;

&lt;p&gt;I've found that &lt;code&gt;git log&lt;/code&gt; is powerful, but sometimes difficult to read. Normally I use this git alias to show a nice tree in the console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git config --global alias.lg
log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' --abbrev-commit

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



&lt;p&gt;This will show a tree like this when you type &lt;code&gt;git lg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kqWa72NU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://arturo.linar.es/sites/default/files/2019-11/git-log.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kqWa72NU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://arturo.linar.es/sites/default/files/2019-11/git-log.png" alt="Terminal with git log tree"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Windows running on a Linux kernel?</title>
      <dc:creator>Arturo Linares</dc:creator>
      <pubDate>Mon, 07 Oct 2019 09:00:00 +0000</pubDate>
      <link>https://dev.to/arturolinares/windows-running-on-a-linux-kernel-3kon</link>
      <guid>https://dev.to/arturolinares/windows-running-on-a-linux-kernel-3kon</guid>
      <description>&lt;p&gt;Windows running on a Linux kernel?adminMon, 10/07/2019 - 04:00&lt;/p&gt;

&lt;p&gt;Body&lt;/p&gt;

&lt;p&gt;This week Microsoft unveiled their Surface Phone, called Surface Duo. It looks great and I think it puts the company back in the innovators list.&lt;/p&gt;

&lt;p&gt;But the fact that the Duo runs on Android is not easy to digest. Some people think that Microsoft soon will make a Windows version that runs on a Linux kernel. Although it might be nothing more than crazy theories, they make sense when Nadella says that the operative system &lt;a href="https://www.wired.com/story/microsoft-surface-duo-neo-phone/"&gt;is not that important for Microsoft any more&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The operating system is no longer the most important layer for us. What is most important for us is the app model and the experience.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To add more fuel to the conspiracy theory, Intel has been working on a highly optimized Linux distro (for Intel architecture of course) called &lt;a href="https://clearlinux.org/"&gt;Clear Linux&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember when I've said that my money is on Microsoft moving Windows to a Linux kernel? Well, Android is based on Linux so this might be testing the waters with a mobile device first. Remember, Microsoft wants unified architecture&lt;br&gt;&lt;br&gt;
🤔&lt;br&gt;&lt;br&gt;
-- &lt;a href="https://twitter.com/Barnacules/status/1179549169704304640?s=20"&gt;@Barnacules&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Intel has been focusing mainly in performance, and while you still run Gnome or other Desktop Environment on it, they have stated that their priority is performance and security.&lt;/p&gt;

&lt;p&gt;What if... they are waiting for a Windows that runs on a Linux kernel to finally integrate it in Clear Linux?&lt;/p&gt;

&lt;p&gt;Personally, a Windows that runs on a Linux kernel doesn't make sense to me. The main reasons why these rumors started was because Microsoft started opening source code, bought GitHub and, specially, WSL. But with the last case (WSL2), which allowed a Linux kernel to run on Windows, is a Windows technology, also used in Windows Sandbox. Why would they invest in this awesome technology that runs on Windows if you're about to jump off the boat.&lt;/p&gt;

&lt;p&gt;Another reason is that it would break backwards compatibility of many applications, something Windows has respected for many years. I know open source technologies like Wine have been making possible to run windows applications on Linux, but they are not perfect, and they certainly would have a limit. The same limit that Microsoft hit when trying to write their reversed Wine: WSL v1. Some issues like performance, networking and file system access are simply not easy to emulate.&lt;/p&gt;

&lt;p&gt;I guess only time will say, meanwhile it is worth to keep an eye on Clear Linux and, of course, the new foldable devices that are about to hit the market 😁&lt;/p&gt;

</description>
      <category>microsoft</category>
    </item>
    <item>
      <title>Drupal development on Windows</title>
      <dc:creator>Arturo Linares</dc:creator>
      <pubDate>Thu, 26 Sep 2019 13:00:00 +0000</pubDate>
      <link>https://dev.to/arturolinares/drupal-development-on-windows-2m1b</link>
      <guid>https://dev.to/arturolinares/drupal-development-on-windows-2m1b</guid>
      <description>&lt;p&gt;Recently I wrote on how I replaced my MacBook Pro with a PC and still being productive when developing on several Drupal environments.While &lt;a href="https://system76.com/pop"&gt;Pop_OS!&lt;/a&gt; is a wonderful Linux distro, I decided to give Windows a try. The primary reasons were the usual: hardware.&lt;/p&gt;

&lt;p&gt;The drivers are optimized to work on Windows and some small features that are nice-to-have only work on this controversial OS: Login with an infrared camera (&lt;em&gt;Windows Hello&lt;/em&gt;), a solid workspace with several monitors (maybe this is the most important reason), better Dolby sound from the speakers and battery optimizations. Nothing critical really, but things that improve the experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  What means to have a productive development environment?
&lt;/h2&gt;

&lt;p&gt;This:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Bash command line.&lt;/li&gt;
&lt;li&gt;Fast docker environment (without unison, I've had enough problems with it already).&lt;/li&gt;
&lt;li&gt;Working git&lt;/li&gt;
&lt;li&gt;Be able to launch several development environments, fast, from command line, and use custom domain names to access them and its related services.&lt;/li&gt;
&lt;li&gt;A good editor, like Sublime Text or Visual Studio Code. (I know, I don't use PHP Storm and don't want to).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Since I had tried WSL before (and failed), I decided to get rid of it and move directly to install a VM.&lt;/p&gt;

&lt;p&gt;An Ubuntu server checks first three items in the above list, but the next two can get messy. Sharing source code files with the Windows host as a Samba share defeats the purpose because its bad performance, symlinks weirdness, among other things. Sharing it using &lt;code&gt;sshfs&lt;/code&gt; could be an option, but then how could I control docker?&lt;/p&gt;

&lt;h2&gt;
  
  
  Editor
&lt;/h2&gt;

&lt;p&gt;The solution came on a recent iteration on Visual Studio Code: &lt;strong&gt;Remote code extensions&lt;/strong&gt; , specifically, &lt;strong&gt;Remote Coding via SSH&lt;/strong&gt;. This extension allowed me to open remote directories through SSH and work with them. This is not like running Dreamweaver to edit files on a server (remember?). &lt;strong&gt;It works splitting the editor in two pieces, a client (the UI) and a server&lt;/strong&gt;, where the indexing and language processing extensions run. The result is a very responsive editor, while working &lt;em&gt;remotely&lt;/em&gt; with all the extensions I would normally use. Even the integrated terminal in the editor opens automatically a bash prompt in the server, a really useful feature.&lt;/p&gt;

&lt;p&gt;This remote feature in Visual Studio Code gives me the full Linux experience right from the editor.&lt;/p&gt;

&lt;p&gt;However, I normally access docker websites using custom URLs, a pretty common practice. If using &lt;a href="http://docksal.io"&gt;docksal&lt;/a&gt;, for example: &lt;code&gt;super-awesome-client.docksal&lt;/code&gt;, &lt;code&gt;db.super-awesome-client.docksal&lt;/code&gt;, etc., you get the idea. I needed to find a way to re-route custom URLs to my VM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Networking
&lt;/h2&gt;

&lt;p&gt;On a Mac or on Linux this would work out of the box after installing docksal (or lando or whatever docker wrapper you use). I wanted this to work the same way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I didn't want to configure each custom website manually&lt;/li&gt;
&lt;li&gt;This had to work on new sites created with docksal&lt;/li&gt;
&lt;li&gt;Should work on any network&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To achieve this transparent routing, I needed a static IP for the VM, so I could always reference it if I was at home, at a coffee shop, or in an airport. I'm using Hyper-v, so I created a NAT using the instructions below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://anandthearchitect.com/2018/01/06/windows-10-how-to-setup-nat-network-for-hyper-v-guests/"&gt;Windows 10: How to setup NAT network for Hyper-V guests?&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Then in the VM, &lt;strong&gt;configured the static IP&lt;/strong&gt; address using &lt;code&gt;netplan&lt;/code&gt;, created file &lt;code&gt;/etc/netplan/01-netcfg.yaml&lt;/code&gt; (I used the same IP address as the guide to create the NAT above).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;network:
    ethernets:
        eth0:
            dhcp4: no
            dhcp6: no
            addresses: [192.168.200.11/24]
            gateway4: 192.168.200.1
            nameservers:
                addresses: [8.8.8.8]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After &lt;strong&gt;enabling the ssh server in the VM&lt;/strong&gt; , and configuring my ssh keys I was able to jump into the server from Windows very quickly, or even configure &lt;a href="https://conemu.github.io/"&gt;ConEmu&lt;/a&gt; or the new &lt;a href="https://github.com/microsoft/terminal"&gt;Windows Terminal&lt;/a&gt; to automatically connect to ssh.&lt;/p&gt;

&lt;p&gt;To access the web servers running in docker containers created with docksal, &lt;strong&gt;I installed a DNS proxy&lt;/strong&gt; : &lt;a href="http://mayakron.altervista.org/wikibase/show.php?id=AcrylicHome"&gt;Acrylic DNS Proxy&lt;/a&gt;, and used this &lt;code&gt;hosts&lt;/code&gt; configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.200.11 *.docksal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Visual Studio Code Configuration
&lt;/h2&gt;

&lt;p&gt;In Visual Studio Code I installed the &lt;a href="https://code.visualstudio.com/docs/remote/ssh"&gt;Remote Development extensions for SSH&lt;/a&gt;. The configuration was straight forward and worked really well (the extension guides you until you are successfully connected to a SSH server).&lt;/p&gt;

&lt;p&gt;Huge Drupal projects were indexed really fast and the performance when browsing them was like working on Linux. Debugging worked out of the box (this thanks to Docksal configs, but still, using &lt;code&gt;docker-compose&lt;/code&gt; shouldn't be a problem).&lt;/p&gt;

&lt;p&gt;The only downside I've found is that I can't commit, push or pull using the editor, which is not a big deal since I can use the integrated terminal. From the &lt;a href="https://code.visualstudio.com/docs/remote/ssh#_known-limitations"&gt;documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you clone a Git repository using SSH and your SSH key has a passphrase, VS Code's pull and sync features may hang when running remotely. Either use an SSH key without a passphrase, clone using HTTPS, or run git push from the command line to work around the issue.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I ended up creating an SSH key for my repos without a passphrase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;p&gt;Working on PHP natively on Windows it is still impossible, but using a VM and Visual Studio Code with Remote Code extensions works very well, with the price of more memory usage, but memory is cheap now, and that is one of the reasons I left Apple in the first place: to have an upgradable development computer.&lt;/p&gt;

&lt;p&gt;One unexpected bonus is that I can recover from suspend and the VM will load up with all services that were running, something that in Linux didn't happen; I had to to run &lt;code&gt;fin up&lt;/code&gt; or &lt;code&gt;docker-compose up&lt;/code&gt; again after the laptop woke.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aside: WSL2
&lt;/h2&gt;

&lt;p&gt;The Windows Subsystem for Linux v2 is &lt;em&gt;about&lt;/em&gt; to be released, which uses a custom Linux Kernel in a very lightweight VM (it is already in Windows Internals fast ring, but expected to reach public release until 2020).&lt;/p&gt;

&lt;p&gt;In theory, it has all the same good points of this setup with a VM, and seems so be a great setup for a &lt;a href="https://www.youtube.com/watch?v=A0eqZujVfYU"&gt;future development environment&lt;/a&gt; because of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The VM file system can be accessed directly from Windows using a p9 file system (that alone is awesome).&lt;/li&gt;
&lt;li&gt;The performance is very close to native one.&lt;/li&gt;
&lt;li&gt;Shared memory and processor cores.&lt;/li&gt;
&lt;li&gt;Much tighter integration, it is possible to run windows programs from within the VM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This technology can really change the development experience on Windows, lets see if it is up to the expectations when it is released (because I won't subscribe to the fast ring in my main development computer).&lt;/p&gt;

&lt;h2&gt;
  
  
  Stranger things
&lt;/h2&gt;

&lt;p&gt;While setting the environment &lt;a href="https://dev.to/arturolinares/git-errors-when-using-hyper-v-1ca9-temp-slug-583485"&gt;I found an error&lt;/a&gt; that didn't allow me to clone big repos or to push changes. It turned out to be a bug in my WiFi drivers. So if you find the error below and have an Intel WiFi card, update your drivers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone git@somrerepo-bla-bla.git
Cloning into 'somedir'...
error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received.
fatal: The remote end hung up unexpectedly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>drupal</category>
    </item>
    <item>
      <title>Git errors when using Hyper-V</title>
      <dc:creator>Arturo Linares</dc:creator>
      <pubDate>Wed, 18 Sep 2019 00:20:25 +0000</pubDate>
      <link>https://dev.to/arturolinares/git-errors-when-using-hyper-v-21fb</link>
      <guid>https://dev.to/arturolinares/git-errors-when-using-hyper-v-21fb</guid>
      <description>&lt;p&gt;&lt;strong&gt;I started having some issues when using git inside a Linux VM&lt;/strong&gt; while setting up an &lt;a href="https://arturo.linar.es/en/blog/drupal-development-windows"&gt;experimental Drupal development environment&lt;/a&gt;. I wasn't able to clone repositories because I was getting some errors saying the remote host hanged unexpectedly, or couldn't push changes. However I was able to clone shallow repos, but strangely Bitbucket and Gitlab seemed to be more prone to these errors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone git@....
Cloning into 'somedir'...
error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received.
fatal: The remote end hung up unexpectedly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;At some point, disabling offloading solved the issue: &lt;a href="https://michael.mulqueen.me.uk/2018/08/disable-offloading-netplan-ubuntu/"&gt;Disabling Offloading on Ubuntu 18.04 with Netplan and/or systemd-networkd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It apparently worked, but soon I found that only worked when using Github. Of course, that didn't make any sense. When I tried to push changes to Bitbucket or Gitlab I had again the same strange errors saying the remote host hung up unexpectedly.&lt;/p&gt;

&lt;p&gt;I tried to debug git using &lt;code&gt;GIT_SSH_COMMAND&lt;/code&gt;, tried using https and even recompiled git to use OpenSSL instead of GnuTLS. Nothing seemed to work... Until I found an answer from &lt;a href="https://stackoverflow.com/a/56946337/547972"&gt;this guy who found the solution&lt;/a&gt;): I needed to update my Wi-Fi drivers.&lt;/p&gt;

&lt;p&gt;Strange error indeed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TLDR&lt;/strong&gt; : A bug between Hyper-V and my Wi-Fi card (&lt;em&gt;Intel 5060&lt;/em&gt;) was causing this. Updating the drivers solved it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://downloadcenter.intel.com/download/28876/Windows-10-Wi-Fi-Drivers-for-Intel-Wireless-Adapters?v=t"&gt;https://downloadcenter.intel.com/download/28876/Windows-10-Wi-Fi-Drivers-for-Intel-Wireless-Adapters?v=t&lt;/a&gt;&lt;/p&gt;

</description>
      <category>microsoft</category>
      <category>git</category>
    </item>
    <item>
      <title>How to make a title block with a custom background</title>
      <dc:creator>Arturo Linares</dc:creator>
      <pubDate>Fri, 16 Mar 2018 06:00:00 +0000</pubDate>
      <link>https://dev.to/arturolinares/how-to-make-a-title-block-with-a-custom-background-41jc</link>
      <guid>https://dev.to/arturolinares/how-to-make-a-title-block-with-a-custom-background-41jc</guid>
      <description>&lt;h1&gt;
  
  
  How to make a title block with a custom background
&lt;/h1&gt;

&lt;p&gt;A common request I’ve received lately when building sites in Drupal is to make the background of the page title configurable to allow the user upload and change it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520443205424_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520443205424_image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, this could be solved with a new block type with two fields, one for the image and one for the title. But then we would need to add the block for each page where we want to show the title.&lt;/p&gt;

&lt;p&gt;How does Drupal handle page titles? Looking in the block admin page, I found that actually it is a block. Well, we need the same functionality of that block in our new one.&lt;/p&gt;

&lt;p&gt;So looking for the class that contains the block machine name &lt;em&gt;page_title_block&lt;/em&gt; I found &lt;code&gt;Drupal\Core\Block\Plugin\Block\PageTitleBlock&lt;/code&gt; which implements &lt;code&gt;TitleBlockPluginInterface&lt;/code&gt;. This is all the interface:&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="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;TitleBlockPluginInterface&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;BlockPluginInterface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

      &lt;span class="cd"&gt;/**
       * Sets the title.
       *
       * @param string|array $title
       *   The page title: either a string for plain titles or a render array for
       *   formatted titles.
       */&lt;/span&gt;
      &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;setTitle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$title&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Searching what uses that interface, I found that &lt;code&gt;BlockPageVariant&lt;/code&gt; uses it to assign it a title:&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="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;blockRepository&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getVisibleBlocksPerRegion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$cacheable_metadata_list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$region&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$blocks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="cd"&gt;/** @var $blocks \Drupal\block\BlockInterface[] */&lt;/span&gt;
          &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$blocks&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$key&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$block_plugin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getPlugin&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$block_plugin&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nc"&gt;MainContentBlockPluginInterface&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="nv"&gt;$block_plugin&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;setMainContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;mainContent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
              &lt;span class="nv"&gt;$main_content_block_displayed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;elseif&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$block_plugin&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nc"&gt;TitleBlockPluginInterface&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="nv"&gt;$block_plugin&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;setTitle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="c1"&gt;//...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means that if I create a custom block that implements &lt;code&gt;TitleBlockPluginInterface&lt;/code&gt; I will get the page title automatically (thanks to &lt;code&gt;BlockPageVariant&lt;/code&gt;)? Apparently, yes.&lt;/p&gt;

&lt;p&gt;Lets start writing the custom block extending &lt;code&gt;PageTitleBlock&lt;/code&gt; to use the title field implementation:&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="cd"&gt;/**
     * @Block(
     *   id = "my_image_title_block",
     *   admin_label = "Image title block"
     * )
     */&lt;/span&gt;
    &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ImageTitleBlock&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;PageTitleBlock&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

      &lt;span class="cd"&gt;/**
       * The image field.
       *
       * @var mixed
       */&lt;/span&gt;
      &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$image&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

      &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;defaultConfiguration&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="s1"&gt;'image'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'value'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="p"&gt;],&lt;/span&gt;
          &lt;span class="s1"&gt;'label_display'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;FALSE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;defaultConfiguration&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="cd"&gt;/**
       * {@inheritdoc}
       */&lt;/span&gt;
      &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$build&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;isset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
          &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

          &lt;span class="nv"&gt;$image_field&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
          &lt;span class="nv"&gt;$image_uri&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$image_field&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

          &lt;span class="nv"&gt;$build&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'uri'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;ImageStyle&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'title_bar'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;buildUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$image_uri&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getFileUri&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
          &lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nv"&gt;$build&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'#markup'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'['&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nf"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Picture'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;']'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;


        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$build&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="cd"&gt;/**
       * {@inheritdoc}
       */&lt;/span&gt;
      &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;blockForm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;FormStateInterface&lt;/span&gt; &lt;span class="nv"&gt;$form_state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="nv"&gt;$form&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="s1"&gt;'#type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'managed_file'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="s1"&gt;'#upload_location'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'public://images/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="s1"&gt;'#title'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Image'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="s1"&gt;'#description'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Background image"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="s1"&gt;'#default_value'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
          &lt;span class="s1"&gt;'#upload_validators'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s1"&gt;'file_validate_extensions'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'gif png jpg jpeg'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="s1"&gt;'file_validate_size'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25600000&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="s1"&gt;'#states'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s1"&gt;'visible'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="s1"&gt;':input[name="image_type"]'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'value'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Upload New Image'&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$form&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;validateConfigurationForm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;$form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;FormStateInterface&lt;/span&gt; &lt;span class="nv"&gt;$form_state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$form_state&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nv"&gt;$form_state&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$form&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Select an image'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="cd"&gt;/**
       * {@inheritdoc}
       */&lt;/span&gt;
      &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;blockSubmit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;FormStateInterface&lt;/span&gt; &lt;span class="nv"&gt;$form_state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="cm"&gt;/* Fetch the array of the file stored temporarily in database */&lt;/span&gt;
        &lt;span class="nv"&gt;$image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$form_state&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$image&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="cm"&gt;/* Load the object of the file by it's fid */&lt;/span&gt;
        &lt;span class="nv"&gt;$file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;\Drupal\file\Entity\File&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$image&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="cm"&gt;/* Set the status flag permanent of the file object */&lt;/span&gt;
        &lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;setPermanent&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="cm"&gt;/* Save the file in database */&lt;/span&gt;
        &lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After clearing Drupal cache, you will find your new shiny block waiting for you in the &lt;em&gt;Add block&lt;/em&gt; list. The build method returns the processed image URL (using &lt;em&gt;title_bar&lt;/em&gt; style) instead of the render array for an image so we can use it later.&lt;/p&gt;

&lt;p&gt;Let’s create &lt;em&gt;title_bar&lt;/em&gt; image style and configure it accordingly (in my case, resize and crop to a predefined size will do).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520464421443_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520464421443_image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, update your theme to make sure that image url shows in a &lt;code&gt;style&lt;/code&gt; attribute, or a &lt;code&gt;data-*&lt;/code&gt; if you’re using javascript to load the image.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;block—image-title-block.html.twig&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;attributes.setAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'style'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'background: #787c8a url('&lt;/span&gt; &lt;span class="err"&gt;~&lt;/span&gt; &lt;span class="nv"&gt;content.image.uri&lt;/span&gt; &lt;span class="err"&gt;~&lt;/span&gt; &lt;span class="s1"&gt;') no-repeat center;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;title_prefix&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;
      &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;label&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;title_attributes&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;label&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
      &lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;title_suffix&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;
      &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;block&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
        &lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;
      &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endblock&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets test it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520465614212_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520465614212_image.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520465649359_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520465649359_image.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520465716498_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd2mxuefqeaa7sj.cloudfront.net%2Fs_58B000CCEE244A0B10193C36972405EDDB99EDFC2E3CC8B2EF3D6B543327D95C_1520465716498_image.png"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>drupal</category>
    </item>
    <item>
      <title>Setup Solr and Drupal using Docker</title>
      <dc:creator>Arturo Linares</dc:creator>
      <pubDate>Wed, 07 Mar 2018 04:59:16 +0000</pubDate>
      <link>https://dev.to/arturolinares/setup-solr-and-drupal-using-docker-3nh6</link>
      <guid>https://dev.to/arturolinares/setup-solr-and-drupal-using-docker-3nh6</guid>
      <description>

&lt;h1&gt;
  
  
  Setup Solr and Drupal using Docker
&lt;/h1&gt;

&lt;p&gt;Last time I tried to create from scratch a Drupal instance that used a Solr server wasn’t as easy as I expected. Maybe command line tools for installing modules have spoiled me and I just expected that running something like &lt;code&gt;drupal module:install solr&lt;/code&gt; would configure everything for me.&lt;/p&gt;

&lt;p&gt;Here is how I made it work, but please consider I’m not a Solr expert. If you know a better way to do this please let me know.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Drupal
&lt;/h2&gt;

&lt;p&gt;Let’s suppose we want to create a blog that uses a Solr for searching its contents.&lt;/p&gt;

&lt;p&gt;First, to create a basic Drupal install we can use a recently released project from &lt;a href="http://weknowinc.com"&gt;WeKnow&lt;/a&gt; to quickly create a Drupal instance using Docker. Follow the README file keeping the default &lt;code&gt;.env&lt;/code&gt; values so we can install Drupal using this command:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker-compose exec --user=82 php drupal site:install standard --db-host=mariadb --db-name=drupal --db-user=drupal --db-pass=drupal --quiet
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Don’t forget to add the &lt;code&gt;hosts&lt;/code&gt; entry, as mentioned in the README file, or use a proxy like &lt;a href="https://github.com/typicode/hotel"&gt;hotel&lt;/a&gt;. The objective is to use a custom domain name that the web server can identify (if we use localhost and in the &lt;code&gt;.env&lt;/code&gt; file we used  &lt;code&gt;HOST_NAME=drupal.vm&lt;/code&gt; the web server won’t serve the request).&lt;/p&gt;

&lt;p&gt;You can verify it is working if you see a fresh Drupal install when you visit  &lt;code&gt;http://drupal.develop&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Solr
&lt;/h2&gt;

&lt;p&gt;Let’s install Solr now. We will need some config files found in the module to setup our Solr core, so lets download it inside the container:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker-compose exec --user=82 php composer req drupal/search_api_solr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We will create a sample core named &lt;em&gt;blog&lt;/em&gt;&lt;em&gt;.&lt;/em&gt; Copy the files located at &lt;code&gt;web/modules/contrib/search_api_solr/solr-conf/5.x/&lt;/code&gt; to &lt;code&gt;env/solr/blog/conf/&lt;/code&gt; and create this file in &lt;code&gt;env/solr/blog/core.properties&lt;/code&gt; (you will need to create the &lt;em&gt;env&lt;/em&gt; dir):&lt;/p&gt;

&lt;p&gt;&lt;em&gt;env/solr/blog/core.properties&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name=blog
config=solrconfig.xml
schema=schema.xml
dataDir=/var/lib/solr/books
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Update &lt;code&gt;docker-compose.yml&lt;/code&gt; to include the &lt;code&gt;solr&lt;/code&gt; container and config its port and a way to access it using traefik (using &lt;code&gt;http://solr.drupal.develop&lt;/code&gt; if using the defaults in &lt;code&gt;.env&lt;/code&gt;):&lt;/p&gt;

&lt;p&gt;&lt;em&gt;docker-compose.yml&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services:
  # ...
  solr:
    image: solr:5.5
    labels:
      - 'traefik.backend=solr'
      - 'traefik.port=8983'
      - 'traefik.frontend.rule=Host:solr.${HOST_NAME}'
    volumes:
      - ./env/solr/blog:/opt/solr/server/solr/blog
      - solrdata:/var/lib/solr

volumes:
  mysqldata:
    driver: "local"
  solrdata:
    driver: "local"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Don’t forget to add the &lt;code&gt;solr.drupal.develop&lt;/code&gt; to your hosts file).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After running &lt;code&gt;docker-compose up -d&lt;/code&gt; (and adding to your hosts file the entry for &lt;code&gt;solr.drupal.development&lt;/code&gt;) you will see this error in solr:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s_ylRGp5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_B9921B2B19B493AF2F7DA42223C9598F9068F4CEAFE3B4757DB813CAC4A9C716_1520144934510_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s_ylRGp5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_B9921B2B19B493AF2F7DA42223C9598F9068F4CEAFE3B4757DB813CAC4A9C716_1520144934510_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This happened because the user and the uid has to match with the user the solr process runs as in the solr container. To fix this we have to create another container that fixes the perms where the core will write the index.&lt;/p&gt;

&lt;p&gt;We will use &lt;code&gt;just-containers/base-alpine&lt;/code&gt; image, which has utilities to do this (&lt;a href="https://github.com/just-containers/s6-overlay"&gt;s6&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Add the docker file to update fix the perms and update docker-compose to use this new container:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;./dockerfiles/solr_data/Dockerfile&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM just-containers/base-alpine
VOLUME ["/var/lib/solr"]
ADD root /
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;./dockerfiles/solr_data/root/etc/fixattrs.d&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/var/lib/solr false solr,8983 0755
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And update the &lt;code&gt;docker-compose.yml&lt;/code&gt; to include this image:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services:
  solr:
    image: solr:5.5
    labels:
      - 'traefik.backend=solr'
      - 'traefik.port=8983'
      - 'traefik.frontend.rule=Host:solr.${HOST_NAME}'

    # add the volumes from the new container
    volumes_from:
      - solr_data
    # the core configs
    volumes:
      - ./env/solr/blog:/opt/solr/server/solr/books

  # added container to fix perms
  solr_data:
    build: ./dockerfiles/solr_data
    volumes:
      - real_solr_data:/var/lib/solr

volumes:
  mysqldata:
    driver: "local"
  real_solr_data:
    driver: "local"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if you run &lt;code&gt;docker-compose up -d&lt;/code&gt; and you visit the Solr page you should see your errors fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure Solr
&lt;/h2&gt;

&lt;p&gt;Now that we have the server running, lets configure Drupal so we can use it as a search engine. Fortunately, most of the hard work is solved by enabling &lt;code&gt;search_api_solr_default&lt;/code&gt; module.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker-compose exec --user=82 php drupal moi search_api_solr_defaults
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Go to the Search API configs (&lt;code&gt;/admin/config/search/search-api&lt;/code&gt;) and you will see a new Solr server entry, although with errors because it is missing the server name and the core it will use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sXONkfn0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_B9921B2B19B493AF2F7DA42223C9598F9068F4CEAFE3B4757DB813CAC4A9C716_1520146790065_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sXONkfn0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_B9921B2B19B493AF2F7DA42223C9598F9068F4CEAFE3B4757DB813CAC4A9C716_1520146790065_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click edit and set the host (ie. the solr container name, &lt;em&gt;solr&lt;/em&gt;) and the core we created before (&lt;em&gt;blog&lt;/em&gt;):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SC2Kif1l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_B9921B2B19B493AF2F7DA42223C9598F9068F4CEAFE3B4757DB813CAC4A9C716_1520147362408_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SC2Kif1l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://d2mxuefqeaa7sj.cloudfront.net/s_B9921B2B19B493AF2F7DA42223C9598F9068F4CEAFE3B4757DB813CAC4A9C716_1520147362408_image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click save and you should be able to to see all green when you go back to the Search API config page. You can now start using your solar server for searching.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The defaults module contains a sample search page to easily get you started in &lt;code&gt;/solr-search/content&lt;/code&gt;. It is implemented as a View.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;You might find this links useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/phase2/outrigger-examples"&gt;Outrigger examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://git@github.com:weknowinc/try-drupal.git"&gt;Try Drupal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Permalink: &lt;a href="arturolinar.es/blog/post/setup-solr-and-drupal-using-docker"&gt;Setup Solr and Drupal using Docker&lt;/a&gt;&lt;/p&gt;


</description>
      <category>drupal</category>
      <category>solr</category>
    </item>
  </channel>
</rss>
