<?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: Kostas Vrouvas</title>
    <description>The latest articles on DEV Community by Kostas Vrouvas (@kosvrouvas).</description>
    <link>https://dev.to/kosvrouvas</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%2F246101%2F29794908-65ce-4273-a9ff-dbaff0d10aea.jpg</url>
      <title>DEV Community: Kostas Vrouvas</title>
      <link>https://dev.to/kosvrouvas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kosvrouvas"/>
    <language>en</language>
    <item>
      <title>Local WordPress development with Laravel Valet (+ a GUI)</title>
      <dc:creator>Kostas Vrouvas</dc:creator>
      <pubDate>Thu, 28 Jul 2022 20:26:00 +0000</pubDate>
      <link>https://dev.to/kosvrouvas/local-wordpress-development-with-laravel-valet-w-a-gui-412n</link>
      <guid>https://dev.to/kosvrouvas/local-wordpress-development-with-laravel-valet-w-a-gui-412n</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/laravel/valet"&gt;Laravel Valet&lt;/a&gt; is a development environment for macOS and configures your Mac to always run &lt;a href="https://www.nginx.com/"&gt;Nginx&lt;/a&gt; in the background when your machine starts, and then, using &lt;a href="https://en.wikipedia.org/wiki/Dnsmasq"&gt;DnsMasq&lt;/a&gt;, proxies all requests on the &lt;code&gt;*.test&lt;/code&gt; domain to point to sites installed on your local machine.&lt;/p&gt;

&lt;p&gt;It is a blazing fast development environment that uses roughly 7 MB of RAM, it’s very minimalistic and without a GUI (although we will see at the of the article how to use a GUI).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Valet is a Laravel development environment for Mac minimalists. No Vagrant, No Apache, No Nginx, No &lt;code&gt;/etc/hosts&lt;/code&gt; file. You can even share your sites publicly using local tunnels. Yeah, we like it too.“&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So in order for this to work we need some tools installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Homebrew&lt;/li&gt;
&lt;li&gt;Composer&lt;/li&gt;
&lt;li&gt;WP-CLI (optional)&lt;/li&gt;
&lt;li&gt;MacOS (of course)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Installing HomeBrew&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://brew.sh/"&gt;Homebrew&lt;/a&gt; is a free and open-source software package management system that simplifies the installation of software on Apple’s operating system, macOS, as well as Linux. The name is intended to suggest the idea of building software on the Mac depending on the user’s taste.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Installing Valet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To get started, you first need to ensure that Homebrew is up to date using the update command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, you should use Homebrew to install PHP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing PHP, you are ready to install the Composer package manager. In addition, you should make sure the &lt;code&gt;~/.composer/vendor/bin&lt;/code&gt; directory is in your system’s “PATH”. After Composer has been installed, you may install Laravel Valet as a global Composer package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer global require laravel/valet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, you may execute Valet’s install command. This will configure and install Valet and DnsMasq. In addition, the daemons Valet depends on will be configured to launch when your system starts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;valet install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once Valet is installed, try pinging any &lt;code&gt;*.test&lt;/code&gt; domain on your terminal using a command such as ping &lt;code&gt;valet.test&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From now on, Valet will automatically start its required services each time your machine boots.&lt;br&gt;
How to serve websites&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;park&lt;/code&gt; command registers a directory on your machine that contains your applications. Once the directory has been “parked” with Valet, all of the directories within that directory will be accessible in your web browser at &lt;code&gt;http://&amp;lt;directory-name&amp;gt;.test&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~/Sitesvalet park
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s all there is to it. Now, any application you create within your “parked” directory will automatically be served using the &lt;code&gt;http://&amp;lt;directory-name&amp;gt;.test&lt;/code&gt; convention. So, if your parked directory contains a directory named “laravel”, the application within that directory will be accessible at &lt;code&gt;http://laravel.test&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So right now, you can download a WordPress install using &lt;a href="https://wp-cli.org/"&gt;WP-CLI&lt;/a&gt; (or download a copy from the download page) and navigate to &lt;code&gt;http://&amp;lt;directory-name&amp;gt;.test&lt;/code&gt; you will see the 5-min WordPress install.&lt;/p&gt;

&lt;p&gt;But there is one more thing you need to run your local website…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Databases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel Valet doesn’t come with a database service but you can easily run a mysql service with two ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;via Homebrew&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can install MySQL easily using Homebrew by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And start the MySQL server by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew services start mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can connect to your database with a GUI tool at &lt;code&gt;127.0.0.1&lt;/code&gt; using the &lt;code&gt;root&lt;/code&gt; username and an empty string for the password.&lt;/p&gt;

&lt;p&gt;From now on your Mac will re-start MySQL at reboot. In case you want to stop this behavior (and also stop MySQL) you can run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew services stop mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With DBngin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dbngin.com/"&gt;DBngin&lt;/a&gt; provides a free, all-in-one database management tool that includes MySQL, PostgreSQL, and Redis. After DBngin has been installed, you can connect to your database at &lt;code&gt;127.0.0.1&lt;/code&gt; using the &lt;code&gt;root&lt;/code&gt; username and an empty string for the password.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PHP Versions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Valet allows you to switch PHP versions using the valet use php@version command. Valet will install the specified PHP version via Homebrew if it is not already installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;valet use php@7.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, Valet uses your global PHP installation to serve your sites. However, if you need to support multiple PHP versions across various sites, you may use the &lt;code&gt;isolate&lt;/code&gt; command to specify which PHP version a particular site should use. The &lt;code&gt;isolate&lt;/code&gt; command configures Valet to use the specified PHP version for the site located in your current working directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~/Sites/example-sitevalet isolate php@8.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To revert a site back to Valet’s globally installed PHP version, you may invoke the &lt;code&gt;unisolate&lt;/code&gt; command from the site’s root directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;valet unisolate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Securing Sites With TLS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, Valet serves sites over HTTP. However, if you would like to serve a site over encrypted TLS using HTTP/2, you may use the &lt;code&gt;secure&lt;/code&gt; command. For example, if your site is being served by Valet on the &lt;code&gt;laravel.test&lt;/code&gt; domain, you should run the following command to secure it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;valet secure laravel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To “unsecure” a site and revert back to serving its traffic over plain HTTP, use the unsecure command. Like the secure command, this command accepts the hostname that you wish to unsecure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;valet unsecure laravel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Wait, I’m not a terminal type of user, is there a GUI?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, Valet doesn’t come with a GUI and all of the commands are given via a terminal, but I get, not everyone is comfortable with terminal commands or it’s just some times you need to do something fast.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/nicoverbruggen"&gt;Nico Verbruggen&lt;/a&gt; has created an amazing lightweight macOS menubar app called &lt;a href="https://github.com/nicoverbruggen/phpmon"&gt;PHP Monitor&lt;/a&gt; to effortlessly manage PHP and Valet services. It provides a GUI to manage PHP versions, locate config files, stop &amp;amp; start Valet services and shows helpful information about your setup.&lt;/p&gt;

&lt;p&gt;You can run the following commands to install PHP Monitor:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You have to install Valet first for PHP Monitor to work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap nicoverbruggen/homebrew-cask
brew install --cask phpmon
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that you can find the app at your MacOS Launchpad.&lt;/p&gt;

&lt;p&gt;If you get a message says that Brew has not not been added to sudoers.d, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo valet trust
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And voilà:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JkMyFDSR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27g5g9dwbpfj6u6ansvo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JkMyFDSR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27g5g9dwbpfj6u6ansvo.jpg" alt="PHP Monitor" width="880" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want PHP Monitor to start up when you boot your Mac, you can do it by dragging PHP Monitor.app into the &lt;strong&gt;Login Items&lt;/strong&gt; section in &lt;strong&gt;System Preferences &amp;gt; Users &amp;amp; Groups&lt;/strong&gt; for your account.&lt;/p&gt;

&lt;p&gt;So this is it! You can now start developing locally your next WordPress (or Lavarel) project. If you have any thoughts I will be glad to hear them in the comments bellow, or mention me at my Twitter handle &lt;a class="mentioned-user" href="https://dev.to/kosvrouvas"&gt;@kosvrouvas&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>valet</category>
      <category>laravel</category>
      <category>localdev</category>
    </item>
    <item>
      <title>Introducing the Gatsby and TailwindCSS starter</title>
      <dc:creator>Kostas Vrouvas</dc:creator>
      <pubDate>Wed, 16 Sep 2020 12:52:34 +0000</pubDate>
      <link>https://dev.to/kosvrouvas/introducing-the-gatsby-and-tailwindcss-starter-5ha0</link>
      <guid>https://dev.to/kosvrouvas/introducing-the-gatsby-and-tailwindcss-starter-5ha0</guid>
      <description>&lt;p&gt;This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React. It is bundled with Tailwind CSS, a utility-first, highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override.&lt;/p&gt;

&lt;p&gt;To clone this starter:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Create a Gatsby site.&lt;/em&gt; Use the Gatsby CLI to clone this repo, specifying the default starter.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;gatsby new my-default-starter https://github.com/kosvrouvas/gatsby-tailwindcss-starter&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Start developing.&lt;/em&gt; Navigate into your new site’s directory and start it up.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;cd my-default-starter/ gatsby develop&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Open the source code and start editing!&lt;/em&gt; Your site is now running at &lt;code&gt;http://localhost:8000&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to contribute or just report an issue, you can find the Github repo &lt;a href="https://github.com/kosvrouvas/gatsby-tailwindcss-starter"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>starters</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>Enabling DNS-over-HTTPS (DoH) in Firefox &amp; Chrome</title>
      <dc:creator>Kostas Vrouvas</dc:creator>
      <pubDate>Fri, 29 May 2020 13:05:31 +0000</pubDate>
      <link>https://dev.to/kosvrouvas/enabling-dns-over-https-doh-in-firefox-chrome-13ao</link>
      <guid>https://dev.to/kosvrouvas/enabling-dns-over-https-doh-in-firefox-chrome-13ao</guid>
      <description>&lt;h3&gt;
  
  
  What is DNS-over-HTTPS
&lt;/h3&gt;

&lt;p&gt;DNS-over-HTTPS (DoH) sends the domain name you typed to a DoH-compatible DNS server using an encrypted HTTPS connection instead of a plain text one. This prevents third-parties from seeing what websites you are trying to access, hiding domain name lookups from someone lurking on public WiFi, your ISP, or anyone else on your local network.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to enable it on Firefox
&lt;/h3&gt;

&lt;p&gt;You can manually enable DNS-over-HTTPS from the Firefox settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the menu button and select &lt;em&gt;Preferences&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;em&gt;General&lt;/em&gt; panel, scroll down to &lt;em&gt;Network Settings&lt;/em&gt; and click the &lt;em&gt;Settings…&lt;/em&gt; button.
-In the dialog box that opens, scroll down to &lt;em&gt;Enable&lt;/em&gt; DNS over HTTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also select providers, between Cloudflare and NextDNS and, in case you are afraid about your personal data sniffed by these providers, Mozilla states that &lt;em&gt;"...has a strong Trusted Recursive Resolver (TRR) policy in place that forbids CloudFlare or any other DoH partner from collecting personal identifying information. To mitigate this risk, our partners are contractually bound to adhere to this policy."&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to enable in Chrome
&lt;/h3&gt;

&lt;p&gt;To enable DNS-over-HTTPS in Chrome, paste “chrome://flags/#dns-over-https” into the address bar and press Enter.&lt;/p&gt;

&lt;p&gt;And then click relaunch. This will relaunch Chrome with your tabs.&lt;/p&gt;

&lt;p&gt;Keep in mind that in Chrome, there is no option to select a provider. You will have to do it yourself at your routers' settings.&lt;/p&gt;

</description>
      <category>security</category>
      <category>doh</category>
      <category>firefox</category>
      <category>chrome</category>
    </item>
  </channel>
</rss>
