<?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"><channel><title><![CDATA[Samuelsson]]></title><description><![CDATA[Erik Samuelsson is a web developer from Sweden who has a huge interest in software development, IT and technology. He documents the new stuff he learns in this fast paced industry as he goes along.]]></description><link>https://samuelsson.dev</link><generator>GatsbyJS</generator><lastBuildDate>Sun, 04 Aug 2024 14:19:04 GMT</lastBuildDate><item><title><![CDATA[Install AdGuard Home on an OPNsense router]]></title><description><![CDATA[I recently decided to upgrade my old Asus router to something more modern and fun. Since going the self-hosted and open-source path recently, the choice was easy. A small, dedicated hardware running OPNsense. One of the most important…]]></description><link>https://samuelsson.dev/install-adguard-home-on-an-opnsense-router/</link><guid isPermaLink="false">https://samuelsson.dev/install-adguard-home-on-an-opnsense-router/</guid><pubDate>Sun, 13 Feb 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I recently decided to upgrade my old Asus router to something more modern and fun. Since going the self-hosted and open-source path recently, the choice was easy. A small, dedicated hardware running OPNsense.&lt;/p&gt;&lt;p&gt;One of the most important services I host is AdGuard Home, which I&amp;#x27;ve been running on either a dedicated Raspberry Pi or in Proxmox. With this new router I think it&amp;#x27;s a good idea to combine router and DNS since they should work together as much as possible. So let&amp;#x27;s install AdGuard Home on the same device as OPNsense.&lt;/p&gt;&lt;h2&gt;Make AdGuard Home installable as a plugin&lt;/h2&gt;&lt;p&gt;First we need to add mimugmail community repo, so we can install AdGuard Home as a plugin. That is easiest done over ssh. If you don&amp;#x27;t need to have ssh activated all the time (especially not for root) we can temporarily activate it just for this occasion. If you already have set up SSH you can ignore this.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In OPNsense WebUI, navigate to &lt;code class=&quot;language-text&quot;&gt;System: Settings: Administration&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Scroll down to &lt;em&gt;Secure Shell&lt;/em&gt; and check&lt;ul&gt;&lt;li&gt;Enable Secure Shell&lt;/li&gt;&lt;li&gt;Permit root user login&lt;/li&gt;&lt;li&gt;Permit password login&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Save the settings&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Now connect to OPNsense over ssh and run this command &lt;code class=&quot;language-text&quot;&gt;fetch -o /usr/local/etc/pkg/repos/mimugmail.conf https://www.routerperformance.net/mimugmail.conf
  pkg update&lt;/code&gt; to add the repo.&lt;/p&gt;&lt;p&gt;Reverse the steps above to disable SSH again.&lt;/p&gt;&lt;h2&gt;Install and set up AdGuard Home&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Head over to &lt;code class=&quot;language-text&quot;&gt;System: Firmware: Plugins&lt;/code&gt; and search for AdGuard and install it.&lt;/li&gt;&lt;li&gt;Go to &lt;code class=&quot;language-text&quot;&gt;Services: Adguardhome: General&lt;/code&gt; and enable the plugin, then save.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Since DNS as default is listening on port 53 we also want AdGuard Home to listen on this port to make or life easier. Out of the box OPNsense is already running Unbound on this port. We need to change this so they don&amp;#x27;t conflict with each other.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Navigate to &lt;code class=&quot;language-text&quot;&gt;Services: Unbound DNS: General&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Change Listen Port to &lt;code class=&quot;language-text&quot;&gt;5353&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check &lt;code class=&quot;language-text&quot;&gt;Register DHCP leases&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;Register DHCP static mappings&lt;/code&gt;, this will resolve hostnames for us in AdGuard Home.&lt;/li&gt;&lt;li&gt;Save the settings.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Now we are ready to configure AdGuard Home itself. I will not go in to all configuration here but some things are needed to make this work optimal with OPNsense.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Navigate to &lt;code class=&quot;language-text&quot;&gt;http://*opnsense-ip*:3000/&lt;/code&gt; in your browser and follow the wizard.&lt;/li&gt;&lt;li&gt;Set the Admin interface to listen on your router IP only (often 192.168.1.1), the same you use when configuring OPNsense itself. Also set the port to be &lt;code class=&quot;language-text&quot;&gt;8080&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;The DNS Server can listen on all interface and use the default port &lt;code class=&quot;language-text&quot;&gt;53&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;In the next step pick a username and password.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;When the wizard is complete we can login to AdGuard Home with the credentials you entered.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In AdGuard Home navigate to &lt;code class=&quot;language-text&quot;&gt;Settings -&amp;gt; DNS settings&lt;/code&gt; and scroll down to &lt;code class=&quot;language-text&quot;&gt;Upstream DNS servers -&amp;gt; Private reverse DNS servers&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Here we enter the Unbound server we  changed earlier in OPNsense settings, &lt;code class=&quot;language-text&quot;&gt;192.168.1.1:5353&lt;/code&gt;, or with other port pointing to you OPNsense instance if you have another one.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Resolve local domains&lt;/h2&gt;&lt;p&gt;If you use a domain name to resolve local hosts by name instead of IP you might need to tweak that in AdGuard Home as well. Let&amp;#x27;s say you&amp;#x27;ve entered a domain under &lt;code class=&quot;language-text&quot;&gt;System: Settings: General&lt;/code&gt; that is &lt;code class=&quot;language-text&quot;&gt;home.mydomain.xyz&lt;/code&gt;, and you want that to take precedence over the public DNS, if that also exists, when you are at home.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In AdGuard Home navigate to &lt;code class=&quot;language-text&quot;&gt;Settings -&amp;gt; DNS settings&lt;/code&gt; and go to top section under &lt;code class=&quot;language-text&quot;&gt;Upstream DNS servers&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Add &lt;code class=&quot;language-text&quot;&gt;[/home.mydomain.xyz/]192.168.1.1:5353&lt;/code&gt; at the top of that list.&lt;/li&gt;&lt;li&gt;Now you will resolve local machines when connected to your LAN, and if connecting over the internet the public DNS record will be used instead.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;That&amp;#x27;s the only settings you need to do to make this work. You should, of course, tweak the other settings and add some filter rules, but that is standard AdGuard Home configuration.&lt;/p&gt;&lt;p&gt;Under OPNsense you can navigate to &lt;code class=&quot;language-text&quot;&gt;System: Settings: General&lt;/code&gt; and add backup DNS servers under &lt;code class=&quot;language-text&quot;&gt;Networking -&amp;gt; DNS servers&lt;/code&gt;, but if you leave them empty only AdGuard Home will be used. I usually leave them empty.&lt;/p&gt;&lt;p&gt;Information gathered from OPNsense forum. Thanks to &lt;a href=&quot;https://forum.opnsense.org/index.php?action=profile;u=21474&quot;&gt;yeraycito&lt;/a&gt;, &lt;a href=&quot;https://forum.opnsense.org/index.php?action=profile;u=21059&quot;&gt;N0_Klu3&lt;/a&gt; and &lt;a href=&quot;https://forum.opnsense.org/index.php?action=profile;u=25076&quot;&gt;pmhausen&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to set a static IP on Ubuntu Server 20.04]]></title><description><![CDATA[Previous versions of Ubuntu Server used a file under  /etc/network  to configure static IP addresses, but this has been changed in later versions of Ubuntu. When installing Ubuntu Server, a tool called NetPlan will probably configure your…]]></description><link>https://samuelsson.dev/how-to-set-a-static-ip-on-ubuntu-server-20-04/</link><guid isPermaLink="false">https://samuelsson.dev/how-to-set-a-static-ip-on-ubuntu-server-20-04/</guid><pubDate>Thu, 30 Dec 2021 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Previous versions of Ubuntu Server used a file under &lt;code class=&quot;language-text&quot;&gt;/etc/network&lt;/code&gt; to configure static IP addresses, but this has been changed in later versions of Ubuntu. When installing Ubuntu Server, a tool called NetPlan will probably configure your address with DHCP during the cloud-init step. To set a static IP we will need to keep using NetPlan to change from using DHCP, fortunately it is still easy to do.&lt;/p&gt;&lt;p&gt;First we need to find out the name of the ethernet device we want to set a static IP for, we can list them by typing &lt;code class=&quot;language-text&quot;&gt;ip add&lt;/code&gt;. This is what it could look like after I&amp;#x27;ve stripped some of the lines for readability.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt;
    [...]
2: ens18: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt;
    link/ether 82:84:27:bc:81:e2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.193/24
    [...]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here we only have two interfaces, and the first one is the loopback which we can ignore. That means the one we want to set a static IP address for is &lt;code class=&quot;language-text&quot;&gt;ens18&lt;/code&gt;. If you do have more interfaces you need to find out which one is the correct one. You can check the MAC address or  &lt;code class=&quot;language-text&quot;&gt;inet&lt;/code&gt; if that is the currently used IP address.&lt;/p&gt;&lt;p&gt;Next step is to add the configuration to the file &lt;code class=&quot;language-text&quot;&gt;/etc/netplan/01-netcfg.yaml&lt;/code&gt; with sudo privileges. If it doesn&amp;#x27;t already exist you can create it. Change the values to match your needs and make sure the indentation is correct since this is a yaml file.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token key atrule&quot;&gt;network&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;renderer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; networkd
  &lt;span class=&quot;token key atrule&quot;&gt;ethernets&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;ens18&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# change to your interface&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;dhcp4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; no
      &lt;span class=&quot;token key atrule&quot;&gt;addresses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;192.168.1.175/24&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# The static IP for this device&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;gateway4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.1.1 &lt;span class=&quot;token comment&quot;&gt;# The IP of your router&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;nameservers&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Comma separated DNS server(s)&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;addresses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;192.168.1.128&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;9.9.9.9&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;dhcp6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; no&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you&amp;#x27;re not running your own DNS server (which I recommend you do if you are tech savvy enough reading this) you can enter your router&amp;#x27;s, ISP&amp;#x27;s or even better &lt;code class=&quot;language-text&quot;&gt;9.9.9.9&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;In case you are wondering, the &lt;code class=&quot;language-text&quot;&gt;/24&lt;/code&gt; at the end of the address is called &amp;quot;CIDR notation&amp;quot; and is specifying what subnet we are using. Unless you know what you want you can keep it at &lt;code class=&quot;language-text&quot;&gt;/24&lt;/code&gt;. It means the addresses in this subnet range from 192.168.1.0 to 192.168.1.255.&lt;/p&gt;&lt;p&gt;When you are done with the configuration you can apply the settings with &lt;code class=&quot;language-text&quot;&gt;netplan apply&lt;/code&gt; and you should be good to go.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to use domain names for servers in a home environment]]></title><description><![CDATA[Naming stuff is difficult, especially in the digital world. It's one of the things that you want to get right the first time. So it is scalable and descriptive without having to redo it after a year when you buy a new NAS or move to another…]]></description><link>https://samuelsson.dev/how-to-use-domain-names-for-servers-in-a-home-environment/</link><guid isPermaLink="false">https://samuelsson.dev/how-to-use-domain-names-for-servers-in-a-home-environment/</guid><pubDate>Wed, 04 Aug 2021 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Naming stuff is difficult, especially in the digital world. It&amp;#x27;s one of the things that you want to get right the first time. So it is scalable and descriptive without having to redo it after a year when you buy a new NAS or move to another home. Naming your pets is probably easy since you don&amp;#x27;t have that many but if you have up to a hundred different ones you might need a technique.&lt;/p&gt;&lt;p&gt;Many of the existing guides for naming server setups are for enterprises where you have multiple physical locations and different environments like production and development. Even though many naming conventions have similarities, there are some differences for home use I think are worth mentioning.&lt;/p&gt;&lt;h2&gt;Get a real domain name&lt;/h2&gt;&lt;p&gt;First step is to buy a real domain name if you don&amp;#x27;t have one already. It doesn&amp;#x27;t need to be a completely new one since we will use subdomains (&lt;em&gt;sub.example.com&lt;/em&gt;), but it needs to be a &lt;a href=&quot;https://en.wikipedia.org/wiki/Fully_qualified_domain_name&quot;&gt;FQDN&lt;/a&gt; you own. You can still use the domain as normal, for email with &lt;a href=&quot;mailto:bob@example.com&quot;&gt;bob@example.com&lt;/a&gt; or a homepage at example.com. It would also be good to use one that doesn&amp;#x27;t enforce SSL since not all your services may support it, so no &lt;em&gt;.dev&lt;/em&gt; domains.&lt;/p&gt;&lt;p&gt;Making up your own TLD in your DNS server is also not recommended since ICANN could register that any time in the future if you&amp;#x27;re unlucky. I will be using &lt;code class=&quot;language-text&quot;&gt;example.com&lt;/code&gt; throughout this post, and it will be the base for everything in our network.&lt;/p&gt;&lt;p&gt;Try to pick a domain name registrar that is in your own country. EU based registrars are recommended if you live in the EU, and try to avoid US based services as much as possible.&lt;/p&gt;&lt;h2&gt;Name your physical devices&lt;/h2&gt;&lt;p&gt;Before even setting up network and services you need to have the hardware. All devices will have a hostname that should point to the actual machine, and it should be a neutral name. That means you should not name a device for what it is doing (like backup or storage) since that could change in the future. Also you might buy two of the same unit so naming a device &amp;quot;raspberrypi&amp;quot; is not recommended.&lt;/p&gt;&lt;p&gt;Since device names should not be reused if it breaks or is replaced you could use a name followed by incrementing, padded numbers. &lt;code class=&quot;language-text&quot;&gt;raspberrypi01&lt;/code&gt; will work and is descriptive if you want to now what the device is by name but it will look too similar to other devices of the same type. The most popular approach is to use a &lt;a href=&quot;https://namingschemes.com/&quot;&gt;naming scheme&lt;/a&gt;. Here you can use your favorite food dishes or cartoon characters as device names. Just ensure they are easy to remember, easy to type and aren&amp;#x27;t limited by number. It&amp;#x27;s also a good idea to skip geographical and technical categories, it will be confusing if you name your router &amp;quot;xbox&amp;quot;, just because you like video games.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s say you name your physical devices by color, &lt;code class=&quot;language-text&quot;&gt;purple&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;silver&lt;/code&gt;. You don&amp;#x27;t need to name your client devices like phones and laptops since they&amp;#x27;re not part of your network infrastructure (well, they are, but you know what I mean 😄).&lt;/p&gt;&lt;h3&gt;Add DNS A Records for the hosts&lt;/h3&gt;&lt;p&gt;When you add these as your hostnames they will sometimes automatically be available as &lt;code class=&quot;language-text&quot;&gt;purple.local&lt;/code&gt; or similar depending on operating systems. It could be tempting to use them, as they are already available. This is not recommended as these automatic domain names are often reserved for other tasks and is not reliable in the long run. What we need to do is connect the IP address of the device to our own (as in we &lt;em&gt;own&lt;/em&gt; it) domain name. For a home network this is usually an internal IP you need to make static/reserved and set in your own DNS server. You can also set this as a public record directly on your registrar if you don&amp;#x27;t have your own set up.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;purple.example.com. -&amp;gt; (A record) 192.168.1.10
silver.example.com. -&amp;gt; (A record) 192.168.1.11
yellow.example.com. -&amp;gt; (A record) 192.168.1.12&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This way it&amp;#x27;s easier to move the devices between networks/subnets and to point to what machine a service is running on. You can also do something like &lt;code class=&quot;language-text&quot;&gt;purple.device.example.com&lt;/code&gt; if you use your domain name for many other things and feel there&amp;#x27;s a need to group devices. As a rule of thumb it&amp;#x27;s recommended to keep it as simple as possible unless you are 100% sure you need to add an extra layer.&lt;/p&gt;&lt;h2&gt;Decide on subdomains for each location&lt;/h2&gt;&lt;p&gt;To be able to connect to services at both home and remote locations we need a way to assign a place to that specific service. Since DNS is working hierarchically, that is actually pretty simple, just like the example above with devices. If you set records with &lt;code class=&quot;language-text&quot;&gt;*.device.example.com&lt;/code&gt; they will all be categorized under &lt;code class=&quot;language-text&quot;&gt;device&lt;/code&gt; and we will do the same here but with a location instead. The tricky part here is what name to set as the location.&lt;/p&gt;&lt;p&gt;At first, it might seem easy to choose &lt;code class=&quot;language-text&quot;&gt;home.example.com&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;remote.example.com&lt;/code&gt; but as mentioned earlier you could have multiple remotes and homes. If you let your family connect to this network, &lt;code class=&quot;language-text&quot;&gt;home&lt;/code&gt; may not work since it&amp;#x27;s relative, so maybe we need something more specific. On an enterprise level with servers all across the world, a &lt;a href=&quot;https://unece.org/trade/cefact/unlocode-code-list-country-and-territory&quot;&gt;UN/LOCODE&lt;/a&gt; is often used to describe country and city. Stockholm, Sweden would then be &lt;code class=&quot;language-text&quot;&gt;se-sto.example.com&lt;/code&gt; (or only &lt;code class=&quot;language-text&quot;&gt;sto&lt;/code&gt; since it&amp;#x27;s usually unique enough) but this may not work for smaller home usage. All locations could actually be in the same city. So if you move to a new place you don&amp;#x27;t want to rename everything just because you are living across the street with the exact same equipment.&lt;/p&gt;&lt;p&gt;You can also have multiple locations in your own home with different subnets if you feel the need to separate them. Maybe you run your own company and want to have that separate from normal home use.&lt;/p&gt;&lt;p&gt;With these possible caveats mentioned spend some time to reflect how you may use it but in this case I will actually use &lt;code class=&quot;language-text&quot;&gt;home&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;work&lt;/code&gt; in this post. The first is where I live, the main location, and the other one is where I keep a backup.&lt;/p&gt;&lt;h3&gt;Set public DNS records for the locations&lt;/h3&gt;&lt;p&gt;&lt;em&gt;If you will never access anything from outside your local network, and you generate SSL certificates with wildcard support you can skip this step.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Next step is to create the DNS records to point to these locations. If you have a static IP it&amp;#x27;s easy with an &lt;em&gt;A Record&lt;/em&gt;, otherwise you&amp;#x27;ll need to set up a Dynamic DNS and point your domain to that with a CNAME. You should also use a wildcard so all your services for that location will get the same record. It could look like this on your registrar for the public records:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;work.example.com. -&amp;gt; (A) 123.123.456.456
*.work.example.com. -&amp;gt; (A) 123.123.456.456
home.example.com. -&amp;gt; (CNAME) home.ddns.tld
*.home.example.com. -&amp;gt; (CNAME) home.ddns.tld&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This way you will always be able to connect to the location with one single domain name. With the wildcard you can also reach all the services (as long as they are open to the public). Another reason to point the domains to the public address is that you can now generate SSL certificates with Let&amp;#x27;s Encrypt for each of your services.&lt;/p&gt;&lt;p&gt;We will discuss the setup of services and how to configure this locally (so you are not using the external address when at home) in the next steps. Also exposing service to the internet can be a security issue and if you don&amp;#x27;t know if it&amp;#x27;s needed you should skip this.&lt;/p&gt;&lt;h2&gt;Add services to your domains&lt;/h2&gt;&lt;p&gt;Now to the fun part that will actually make all this work, adding all your services. Let&amp;#x27;s say we have &lt;em&gt;Jellyfin&lt;/em&gt; and &lt;em&gt;Paperless&lt;/em&gt; on the &amp;quot;purple&amp;quot; named machine, a reverse proxy on the &amp;quot;silver&amp;quot; named one and a database on &amp;quot;yellow&amp;quot;.&lt;/p&gt;&lt;p&gt;There are two ways to assign all services a domain name and point them to the correct place. Either you can do it with a reverse proxy or add all services, one-by-one, in your own DNS server. Using a reverse proxy is usually much better since you get an extra layer of security, you can add SSL certificates in one place and can ignore ports. We will mainly go that route but still need some DNS records added for those services we don&amp;#x27;t want to go through the proxy.&lt;/p&gt;&lt;p&gt;So with the previous additions it can look like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;purple.example.com. -&amp;gt; (A) 192.168.1.10
silver.example.com. -&amp;gt; (A) 192.168.1.11
yellow.example.com. -&amp;gt; (A) 192.168.1.12

postgres.home.example.com -&amp;gt; (CNAME) yellow.example.com
*.home.example.com. -&amp;gt; (CNAME) silver.example.com

// and if you didn&amp;#x27;t add them as public records, add the remote locations:
work.example.com. -&amp;gt; (A/CNAME) 123.123.456.456 / ddns
*.work.example.com. -&amp;gt; (A/CNAME) 123.123.456.456 / ddns&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;With the reverse proxy set up you don&amp;#x27;t need to add much more here since the wildcard is taking care of it all and routing the requests. For a reverse proxy you can use &lt;a href=&quot;https://github.com/linuxserver/docker-swag&quot;&gt;SWAG&lt;/a&gt; or &lt;a href=&quot;https://github.com/jc21/nginx-proxy-manager&quot;&gt;NPM&lt;/a&gt; but how to configure them will not be discussed here. This is what some of your services will look like.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;jellyfin.home.example.com
paperless.home.example.com
postgres.home.example.com
backup-app.work.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;#x27;s the basic part of setting up domain names for your self-hosting needs. If you believe this was enough you can stop reading here and grab a cup of coffee instead.&lt;/p&gt;&lt;h3&gt;Going even deeper&lt;/h3&gt;&lt;p&gt;This will also support sub-services if those exist on a virtual machine or similar. Either set on DNS level or in the reverse proxy. Let&amp;#x27;s say you have virtual machines where you deploy both dev and test environments of your home project. On each environment you have both back-end and front-end as well as a database.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;app.dev.project01.home.example.com
web.dev.project01.home.example.com
sql.dev.project01.home.example.com

app.test.project01.home.example.com
web.test.project01.home.example.com
sql.test.project01.home.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here you really notice the hierarchy of a DNS structure, where it gets smaller the more to the left you go. You can also have different services on the same host depending on how you run them. All depending on how you want to run things.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;app01.dev.projects.home.example.com
web01.dev.projects.home.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Keeping track of all domains&lt;/h2&gt;&lt;p&gt;As you&amp;#x27;ve noticed, these have become quite long and at the same time you&amp;#x27;ve probably have quite a few different domains by now. Even if it&amp;#x27;s tempting to cut some parts of (like &lt;code class=&quot;language-text&quot;&gt;home&lt;/code&gt; in the above example), you should always keep the same structure for all domains. Even if you only have one location now, you never know what will happen in the future.&lt;/p&gt;&lt;p&gt;About the amount of domains you could of course write everything down in a markdown file but there are many tools created just for solving these problems. If you mostly want to keep track of and access your services you can use tools like &lt;a href=&quot;https://github.com/bastienwirtz/homer&quot;&gt;Homer&lt;/a&gt; or &lt;a href=&quot;https://github.com/linuxserver/Heimdall&quot;&gt;Heimdall&lt;/a&gt;, which will give you a nice overview in your browser.&lt;/p&gt;&lt;p&gt;If you completely fell down the rabbit hole you need a configuration management database, &lt;em&gt;CMDB&lt;/em&gt;, like &lt;a href=&quot;https://github.com/allegro/ralph&quot;&gt;Ralph&lt;/a&gt;. These tools will keep track of everything you need to know, about all your servers and services (and a thousand more things). Just try not getting lost in the basement where you keep all your server racks formed as a maze.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Install AdGuard Home with Docker on a Raspberry Pi 4]]></title><description><![CDATA[The Raspberry Pi is a great little computer you can use for many different things. Unless you need a lot of processing power it’s good enough to run as a small home server. I’ve decided to use mine for some network related stuff since the…]]></description><link>https://samuelsson.dev/install-adguard-home-with-docker-on-a-raspberry-pi-4/</link><guid isPermaLink="false">https://samuelsson.dev/install-adguard-home-with-docker-on-a-raspberry-pi-4/</guid><pubDate>Sun, 13 Jun 2021 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The Raspberry Pi is a great little computer you can use for many different things. Unless you need a lot of processing power it’s good enough to run as a small home server. I’ve decided to use mine for some network related stuff since the fourth version has gigabit Ethernet. My Synology NAS will then take care of pure file related tasks like backups and media management. Separating physical devices this way can increase security and portability, even though containers and virtual machines makes the difference smaller.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:81.5%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;AdGuard Home Dashboard interface&quot; title=&quot;AdGuard Home Dashboard interface&quot; src=&quot;/static/de1fecf509736de59898edb688e47288/5a190/adguard-home.png&quot; srcSet=&quot;/static/de1fecf509736de59898edb688e47288/772e8/adguard-home.png 200w,/static/de1fecf509736de59898edb688e47288/e17e5/adguard-home.png 400w,/static/de1fecf509736de59898edb688e47288/5a190/adguard-home.png 800w,/static/de1fecf509736de59898edb688e47288/ae77d/adguard-home.png 1111w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;The first service we will add to the Raspberry Pi is a DNS server, AdGuard Home, running in its own docker container. Blocking trackers, analytics and privacy infringing ads on a DNS level is a great way to make it network wide since ad blockers like uBlock Origin only blocks this kind of stuff in the browser. This solution will work for all devices like your TV and smart home devices… if you really need them connected at all. Just remember that this is not a replacement of uBlock Origin, you need both.&lt;/p&gt;&lt;p&gt;The reason I’m not going with PiHole is the better interface and out-of-the-box solutions like encrypted DNS upstream servers you get with AdGuard Home. There is a company behind it, but the software is completely free and open source so not really much to complain about.&lt;/p&gt;&lt;h2&gt;Set up the Raspberry pi with Ubuntu&lt;/h2&gt;&lt;p&gt;Since this is a server without a GUI I decided to go with Ubuntu instead of Raspberry Pi OS, but it really doesn’t matter what you choose. For this guide it’s Ubuntu though.&lt;/p&gt;&lt;p&gt;Navigate to the &lt;a href=&quot;https://ubuntu.com/download/raspberry-pi&quot;&gt;Ubuntu download page&lt;/a&gt; and download the latest LTS 64-bit release. The installation steps are pretty much default for installing an OS on a removal drive, but the official guide is &lt;a href=&quot;https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;When the OS is installed and you have logged in over ssh for the first time it&amp;#x27;s a good idea to update all the packages. &lt;code class=&quot;language-text&quot;&gt;sudo apt update&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;sudo apt upgrade&lt;/code&gt;, then we can reboot and head over to the next step. &lt;/p&gt;&lt;h2&gt;Install Docker and Docker Compose&lt;/h2&gt;&lt;p&gt;To be able to install AdGuard Home as a Docker container we first need to set up Docker itself. As well as Docker Compose for easier configuring of the container and network, especially when we add more containers later on.&lt;/p&gt;&lt;h3&gt;Set up the Docker repository&lt;/h3&gt;&lt;p&gt;First step is to add the Docker repository because it&amp;#x27;s the most up to date. We pick &lt;code class=&quot;language-text&quot;&gt;arm64&lt;/code&gt; since that is the architecture of the Raspberry Pi 4.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;echo &amp;quot;deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Install Docker Engine&lt;/h3&gt;&lt;p&gt;Installing the latest version of Docker Engine is only one command now.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo apt install docker-ce docker-ce-cli containerd.io&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can test if everything is working by pulling and running a hello-world container.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo docker run hello-world&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That should print some text that it’s running and then stop itself. Hopefully it&amp;#x27;s working 😉&lt;/p&gt;&lt;h3&gt;Install Docker Compose&lt;/h3&gt;&lt;p&gt;Docker Compose will make it easier for us managing the containers, especially when we need network configuration, since it’s all in on file. We need to install Docker Compose through &lt;code class=&quot;language-text&quot;&gt;pip&lt;/code&gt; because of the architecture Raspberry Pi is using. First we start with the dependencies&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo apt install python3-pip libffi-dev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And then the actual package.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo pip3 install docker-compose&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If everything went well you should be able to check the version with &lt;code class=&quot;language-text&quot;&gt;docker-compose --version&lt;/code&gt;.&lt;/p&gt;&lt;h2&gt;Install Adguard Home&lt;/h2&gt;&lt;p&gt;Now to the fun part, creating a Docker Compose file containing everything we need for running the service.&lt;/p&gt;&lt;p&gt;Create a new file called &lt;code class=&quot;language-text&quot;&gt;docker-compse.yml&lt;/code&gt; somewhere handy. Your home directory would probably be fine as this file will have the configuration for all your docker containers in it. Because &lt;code class=&quot;language-text&quot;&gt;~/&lt;/code&gt; usually is the default when login in through ssh you don&amp;#x27;t need to change location when managing containers.&lt;/p&gt;&lt;h3&gt;Setting up the network parts&lt;/h3&gt;&lt;p&gt;One important thing which actually needs some manual work from you is setting up the static IPs for AdGuard and the (future) other containers. So no copy/paste of commands as you did above 😄 but don&amp;#x27;t worry, I&amp;#x27;ll tell you how.&lt;/p&gt;&lt;p&gt;AdGuard Home needs a static IP assigned to it which accessible from all your devices so they can use that address as the DNS server. Since we are running AdGuard inside a container we need to connect the internal container network with the normal one you have at home, from your router. We&amp;#x27;ll do that with something called &lt;em&gt;macvlan&lt;/em&gt;, so your router sees AdGuard Home as a physical device with its own MAC address.&lt;/p&gt;&lt;p&gt;First we need to decide what IP ranges our devices and services will have on our network. Unless you know differently I&amp;#x27;d say you have some devices that have fixed IP addresses (either static or reserved in your DHCP server) and some that you just connect on the fly. I will assume your router (DHCP server) is assigning addresses with a format of &lt;code class=&quot;language-text&quot;&gt;192.168.1.XXX&lt;/code&gt;, with the router itself on &lt;code class=&quot;language-text&quot;&gt;192.168.1.1&lt;/code&gt;, the &lt;code class=&quot;language-text&quot;&gt;192.168.1.0/24&lt;/code&gt; subnet. If not, change accordingly.&lt;/p&gt;&lt;p&gt;We will then need to decide on three ranges. One range where you have your physical devices with fixed IPs, one with all the dynamic devices being assigned with DHCP and the third one which is you docker containers. Something like this:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;192.168.1.0 -&amp;gt; 192.168.1.63&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;192.168.1.0/26&lt;/code&gt;): Fixed IPs of physical devices you assign yourself (including router default).&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;192.168.1.64 -&amp;gt; 192.168.1.191&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;192.168.1.64/25&lt;/code&gt;): Dynamic addresses assigned by your DHCP server.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;192.168.1.192 -&amp;gt; 192.168.1.223&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;192.168.1.192/27&lt;/code&gt;): Ip range of all docker containers on your Raspberry PI that should be accessible on router level.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;You can organize this however you like but the most important thing is that you set the range of addresses your router is assigning devices with DHCP. This is so it doesn&amp;#x27;t interfere with the range of addresses we give our Docker containers on the Raspberry Pi. Keep in mind that the Raspberry Pi itself is not within the containers range as it is a physical device with an IP already. This is what it could look like in the DHCP settings of the router with the above example.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:18.999999999999996%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAABYlAAAWJQFJUiTwAAAA1UlEQVQY023PXU+CYADFcb6QdtOLBCWCvDwIJFERkmMtsKY4o+lMXX71f+tp64Yuzs7OzW87ima7aEMXzfZQLUf2aX9Ap6fRVXW66m//bDfNma7W5MtGJpktiKs5YVFipzl2+oRiiAArHOMnDwyjMSK5x/BDCZxIUP8DxaSg3B542ex5Xu/I6oa0ficu3yTmZFMUM7hhMIpkzCDCi+84N6x/QT8veN0dmX1+UW0PZMuPNtgzbXRHcOUKrj2fvhhxZph0Li5bl500Z1I3PC5WMrfVvHX5G2ZmmL8mGKVEAAAAAElFTkSuQmCC&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Settings of DHCP address pool&quot; title=&quot;Settings of DHCP address pool&quot; src=&quot;/static/464296075e4a82c7e73bc84cfb15acea/5a190/dhcp-address-pool.png&quot; srcSet=&quot;/static/464296075e4a82c7e73bc84cfb15acea/772e8/dhcp-address-pool.png 200w,/static/464296075e4a82c7e73bc84cfb15acea/e17e5/dhcp-address-pool.png 400w,/static/464296075e4a82c7e73bc84cfb15acea/5a190/dhcp-address-pool.png 800w,/static/464296075e4a82c7e73bc84cfb15acea/e0885/dhcp-address-pool.png 918w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;We will also create a network called &lt;em&gt;vlan_bridge&lt;/em&gt; which simply put is for bunching together all the containers on the Raspberry Pi on the same subnet, so they can get internet access from the host and talk to each other. I’ve picked the subnet &lt;code class=&quot;language-text&quot;&gt;192.168.10.0/24&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;192.168.10.XXX&lt;/code&gt;) in this example.&lt;/p&gt;&lt;p&gt;Here is the finished docker-compose file for the examples above. &lt;strong&gt;Please read above before just copy pasting.&lt;/strong&gt; The rest of the properties can be left as-is, if you want you can check them out &lt;a href=&quot;https://docs.docker.com/compose/compose-file/compose-file-v2/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;2.1&amp;quot;&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;adguard&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; adguard
    &lt;span class=&quot;token key atrule&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; adguard/adguardhome
    &lt;span class=&quot;token key atrule&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 53/tcp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 53/udp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 80/tcp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 3000/tcp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 67/udp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 68/tcp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 68/udp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 443/tcp
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 853/tcp
    &lt;span class=&quot;token key atrule&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; adguard_work&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;/opt/adguardhome/work
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; adguard_conf&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;/opt/adguardhome/conf
    &lt;span class=&quot;token key atrule&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;macvlan&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;ipv4_address&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.1.192 &lt;span class=&quot;token comment&quot;&gt;# this IP will show as a device on your router&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;vlan_bridge&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;ipv4_address&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.10.192 &lt;span class=&quot;token comment&quot;&gt;# Pick same last numbers as macvlan and use &amp;quot;vlan bridge subnet&amp;quot; (10)&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; unless&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;stopped

&lt;span class=&quot;token comment&quot;&gt;# Here we define what networks are available to use by the services above&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Make sure to set the config of both macvlan and vlan_bridge as described in the guide.&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;macvlan&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; docker_macvlan
    &lt;span class=&quot;token key atrule&quot;&gt;driver&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; macvlan
    &lt;span class=&quot;token key atrule&quot;&gt;enable_ipv6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean important&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;driver_opts&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; eth0
    &lt;span class=&quot;token key atrule&quot;&gt;ipam&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;subnet&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.1.0/24 &lt;span class=&quot;token comment&quot;&gt;# Set to same subnet as your router and other devices&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;ip_range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.1.192/27 &lt;span class=&quot;token comment&quot;&gt;# Available range from 192 to 224.&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;gateway&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.1.1 &lt;span class=&quot;token comment&quot;&gt;# This is your router IP&lt;/span&gt;

  &lt;span class=&quot;token key atrule&quot;&gt;vlan_bridge&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; docker_vlan_bridge
    &lt;span class=&quot;token key atrule&quot;&gt;driver&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bridge
    &lt;span class=&quot;token key atrule&quot;&gt;enable_ipv6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean important&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;ipam&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;subnet&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.10.0/24 &lt;span class=&quot;token comment&quot;&gt;# subnet for all containers &lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;ip_range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.10.192/27 &lt;span class=&quot;token comment&quot;&gt;# for easier use, set to same range as under macvlan (192 to 224 here)&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;gateway&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192.168.10.1 &lt;span class=&quot;token comment&quot;&gt;# for easier use, set to same last number as your router&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Here we define where to save the files that live outside the container&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Located under /var/lib/docker/volumes&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;adguard_work&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; adguard_work
  &lt;span class=&quot;token key atrule&quot;&gt;adguard_conf&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; adguard_conf&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then inside your home folder, you should then be able to start AdGuard Home with this command. It will first pull the image and then start the service.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo docker-compose up -d adguard&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can tail the logs to check if everything is going well with:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo docker-compose logs -f adguard&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Set up and configure AdGuard Home&lt;/h2&gt;&lt;p&gt;If everything is running smoothly we are almost done, just some final tweaks. Navigate to &lt;code class=&quot;language-text&quot;&gt;&amp;lt;adguard-macvlan-ip&amp;gt;:3000&lt;/code&gt;, in our case it was &lt;code class=&quot;language-text&quot;&gt;192.168.1.192:3000&lt;/code&gt;, and we&amp;#x27;ll set the final configuration.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Admin interface listens on only the &lt;em&gt;macvlan&lt;/em&gt; address, 192.168.1.192 in our example.&lt;/li&gt;&lt;li&gt;DNS Server can listen on all interfaces.&lt;/li&gt;&lt;li&gt;Set up a username and a strong password, then save it in your password manager 😎&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;On the last page you see a short guide of how to configure your router to tell all devices that your new AdGuard Home DNS Server should be used as default. This differs a lot between routers but this is what it could look like. Just make sure the second one is a fallback so every request still goes to your AdGuard Home, otherwise only put one DNS server.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:23%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAABYlAAAWJQFJUiTwAAABLUlEQVQY01XM2UoCAQCF4XmZNigzJqRxKy3N3ErUchk31NxmSkcdLEMTF4xuKiyql/2jQaQuPv6rc4SnxReTlwXPH9/MF59MX9+Nzt4+6I7nK53RjNZgvKINJ4b245TOaEp7SSg3uxRv2xSUJulKg9R1HbmqkKmpRLJFw0WmQLKqUrsbGqq9AaVun2L3nnxLR1Y0ZLWNrGoIh2cBXP4QouOQNbPIxt4+60ubooUt0cK6WcTqD1HU+5R7D5T0PgmlSax2QzBXwhVL4I6nDILTF8B+eoZ07MVsdfyz+1ubk50DG0fnUXItnaTSIlKuE60oxGs3hPNlPAkZbzKLN5lBcAfDeMIR7F6fMTRJdkyS7Q872xYJZyhCTtNJqRrRSsM4jFVVQrkSJ5dpPFey4QcBGs/vXjnNLgAAAABJRU5ErkJggg==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Configured DHCP server in router&quot; title=&quot;Configured DHCP server in router&quot; src=&quot;/static/f4b3ad4d4f20f5545185993cd8c6e1e5/5a190/dhcp-server-router.png&quot; srcSet=&quot;/static/f4b3ad4d4f20f5545185993cd8c6e1e5/772e8/dhcp-server-router.png 200w,/static/f4b3ad4d4f20f5545185993cd8c6e1e5/e17e5/dhcp-server-router.png 400w,/static/f4b3ad4d4f20f5545185993cd8c6e1e5/5a190/dhcp-server-router.png 800w,/static/f4b3ad4d4f20f5545185993cd8c6e1e5/2bef9/dhcp-server-router.png 1024w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;When that is done your DNS Server is up and running and hopefully can start blocking some trackers and ads. The default settings can be improved some, so let&amp;#x27;s do that.&lt;/p&gt;&lt;h3&gt;Tweak the default settings of AdGuard Home&lt;/h3&gt;&lt;p&gt;Navigate to the IP (macvlan) in your browser and login in with the credentials you entered in the previous step. Go to &lt;em&gt;Settings&lt;/em&gt; and we&amp;#x27;ll change these values:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;General Settings&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Logs configuration&lt;/strong&gt;: 7 days (unless you really want more)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Statistics configuration&lt;/strong&gt;: 7 days (unless you really want more)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;DNS Settings&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Upstream DNS servers&lt;/strong&gt;: You can add pretty much anyone that you feel is safe/fast. I picked two that works well for me.&lt;ul&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;https://doh.mullvad.net/dns-query&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;https://dns10.quad9.net/dns-query&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Private DNS servers&lt;/strong&gt;: Pick your real router (DHCP server), with this example it&amp;#x27;s &lt;code class=&quot;language-text&quot;&gt;192.168.1.1&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Enable reverse resolving of clients&amp;#x27; IP addresses&lt;/strong&gt;: Checked&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Add blocklists&lt;/h4&gt;&lt;p&gt;Go to &lt;code class=&quot;language-text&quot;&gt;Filters -&amp;gt; DNS blocklist&lt;/code&gt; and add those you want, like a local blocklist if you find one in the presets. I&amp;#x27;d also recommend adding the &lt;em&gt;oisd&lt;/em&gt; list, it is aiming to be a one-list-block-all and it&amp;#x27;s working really well. The URL is &lt;code class=&quot;language-text&quot;&gt;https://abp.oisd.nl/&lt;/code&gt;, and it contains a couple of hundred thousand entries 🤤&lt;/p&gt;&lt;h2&gt;Set AdGuard Home as the DNS server on the Raspberry Pi itself&lt;/h2&gt;&lt;p&gt;All devices in your network will use this new DNS server when it&amp;#x27;s configured to do so in the router, but for the host device itself, it&amp;#x27;s a bit different. With macvlan, client interfaces can&amp;#x27;t communicate directly with the host, so we need to use our bridge network. Login to your Raspberry Pi and open the file &lt;code class=&quot;language-text&quot;&gt;/etc/systemd/resolved.conf&lt;/code&gt; with sudo. There you will need to uncomment &lt;code class=&quot;language-text&quot;&gt;DNS&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;FallbackDNS&lt;/code&gt; and add your own values. The DNS value should be the bridge address to AdGuard Home, &lt;code class=&quot;language-text&quot;&gt;192.168.10.192&lt;/code&gt; in our case.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Resolve&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
DNS=192.168.10.192
FallbackDNS=9.9.9.9
&lt;span class=&quot;token comment&quot;&gt;#Domains=&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#LLMNR=no&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#MulticastDNS=no&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#DNSSEC=no&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#DNSOverTLS=no&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#Cache=no-negative&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#DNSStubListener=yes&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#ReadEtcHosts=yes&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enjoy 🥳&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Log in with ssh key authorization on a Synology NAS]]></title><description><![CDATA[The operating system of a Synology NAS,  DiskStation Manager , is a great web-based GUI making it easy for everyone to manage their NAS. However, sometimes it's preferable to access the NAS through SSH instead of the GUI. Logging in with…]]></description><link>https://samuelsson.dev/log-in-with-ssh-key-authorization-on-a-synology-nas/</link><guid isPermaLink="false">https://samuelsson.dev/log-in-with-ssh-key-authorization-on-a-synology-nas/</guid><pubDate>Wed, 31 Mar 2021 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The operating system of a Synology NAS, &lt;em&gt;DiskStation Manager&lt;/em&gt;, is a great web-based GUI making it easy for everyone to manage their NAS. However, sometimes it&amp;#x27;s preferable to access the NAS through SSH instead of the GUI. Logging in with password is fairly simple to activate but in the long run it&amp;#x27;s often better to use key authorization instead of having to type your (long and secure) password each time.&lt;/p&gt;&lt;p&gt;If you haven&amp;#x27;t already, we need to activate the SSH service from within DSM. In the screenshot below I am using DSM 7 and the SSH settings can be found under &lt;code class=&quot;language-text&quot;&gt;Control Panel &amp;gt; Terminal &amp;amp; SNMP &amp;gt; Terminal&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:50%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAABSklEQVQoz5VS2W7DIBDk/z+wrfrWKE1iA764MTDRbmwrbV/SlQbYQQzLLOLjbHHpNIwxaA1orWGtDaVUlFJAQVzjecO23oP287oyxGQCQkwsUEmsFChXMdoIay0frrUeaLUca7pw3VDr4wbRvISUPebFMBFTgtYaXdej6yVunUQvFa9pPkmDqxw518MI5zyMtUgpPwS7wUNq2nBM0MZsHKTSjBAjP4mqIaSCzZLC/HNQLk6m4CoHzPPCZM4Z3keu2PuAnFf4EB8HnsYnmR+ZUL5AjROMsYegjYkv+b5JTItFypkNX/+gIK7UkMo5V+hzg3Wen0ZBczfP7A95E0KE8+STY7+scwyyyDgPaStmlzinRolhirjeeizGMEEVNupm+/2010JcQoCaloOgLu9i/P/+CfF+mfD2pfB51jjpgMVn/rX7J9+FX63wDoc3Dn6WvQpfAAAAAElFTkSuQmCC&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;activate_ssh_service&quot; title=&quot;activate_ssh_service&quot; src=&quot;/static/51f6952a869a810cadb2964bf4723eb1/5a190/activate_ssh.png&quot; srcSet=&quot;/static/51f6952a869a810cadb2964bf4723eb1/772e8/activate_ssh.png 200w,/static/51f6952a869a810cadb2964bf4723eb1/e17e5/activate_ssh.png 400w,/static/51f6952a869a810cadb2964bf4723eb1/5a190/activate_ssh.png 800w,/static/51f6952a869a810cadb2964bf4723eb1/3dde1/activate_ssh.png 1018w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Just check the checkbox and also it&amp;#x27;s good practice changing the default port to something other than the default one, even if you only accessing it locally.&lt;/p&gt;&lt;p&gt;You can now log in through SSH with &lt;code class=&quot;language-text&quot;&gt;ssh username@192.168.1.123 -p 23456&lt;/code&gt;, if you change the values to match your username, IP and port of course 😉 Also you must be a user of the administrator group (not the actual admin user) but that should be the default in DSM 7.&lt;/p&gt;&lt;h2&gt;Generate a new ssh key on your computer&lt;/h2&gt;&lt;p&gt;On the device you will be using to access the NAS you need to create a new pair of public and private keys. You can read all about it &lt;a href=&quot;/generate-and-organize-ssh-keys-on-mac/&quot;&gt;here&lt;/a&gt; but if you want the short version it is just this command.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;ssh-keygen -t rsa -b 4096 -C &amp;quot;An optional comment about the key&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The public part of they key will then be saved under &lt;code class=&quot;language-text&quot;&gt;~/.ssh/id_rsa.pub&lt;/code&gt; if nothing else is specified by you.&lt;/p&gt;&lt;h2&gt;Enable key authorization on the NAS&lt;/h2&gt;&lt;p&gt;Because we are using our self-created user(s) for accessing the NAS instead of the admin we need to enable a way to connect the generated key to a user. One way of doing this is enabling the &lt;em&gt;homes&lt;/em&gt; for our DSM users, this way each one will have their own &amp;quot;personal space&amp;quot; where we can save user specific files, just like in a normal Linux installation. Enable them under &lt;code class=&quot;language-text&quot;&gt;Control Panel &amp;gt; User &amp;amp; Group &amp;gt; User Home&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:41%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/klEQVQoz5WS607EIBBG+/4PqH80aVzNbrdlS8udAsfANupqvE3yBQLzHRiGrj8pLnLFOUcphZwLMUa2GHAxY2OBUtred6qelFJTZ6xFG0uMG7lcYVI7xsVyXDaOKl1Nu8qPgi7pE9M4sK6KGjEGhM30c+ZBJC42A7+B3tX1YuPlLJmVwW/g/BX4eMk8rxldS/4P8E4E7p9G+tPcQMoGVhsZpENbj/ehvdGfgSZmVqXxzu0lR4x1TNOIEAKtTVPNmeWC2uc+1INyg9R4A0qbWperqd4khNASpnnhcBw4C9ma8dH0WTfAZXUM5wm7f5sKrKMPEWUsxvkb09coN+uvRndzC4s6sswAAAAASUVORK5CYII=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;enable_homes directory&quot; title=&quot;enable_homes directory&quot; src=&quot;/static/8748d3a290f884c4947aa548242fb30b/5a190/enable_homes.png&quot; srcSet=&quot;/static/8748d3a290f884c4947aa548242fb30b/772e8/enable_homes.png 200w,/static/8748d3a290f884c4947aa548242fb30b/e17e5/enable_homes.png 400w,/static/8748d3a290f884c4947aa548242fb30b/5a190/enable_homes.png 800w,/static/8748d3a290f884c4947aa548242fb30b/3dde1/enable_homes.png 1018w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;This will create new shared folders for each of the users in DSM (except the guest user). As default the permissions of the home directories are way too open for storing and managing ssh keys, so we need to restrict them to only allow access for their respective owners.&lt;/p&gt;&lt;p&gt;Don&amp;#x27;t change any other permissions than your own home folder to avoid breaking things.&lt;/p&gt;&lt;p&gt;Log in to the NAS through SSH with the user you want to add key authorization for and make the home directory of this user only visible to the one you are logged in as.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;chmod 700 ~&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then let&amp;#x27;s create a new directory for storing our ssh related files.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;mkdir ~/.ssh&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And also making sure the permissions are correct here.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;chmod 700 ~/.ssh/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next step is creating a file containing public keys for those allowed to connect without password, like &amp;quot;if you are on the list to access the club&amp;quot;. This list is called &lt;code class=&quot;language-text&quot;&gt;authorized_keys&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s open an editor to edit this file.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;vim ~/.ssh/authorized_keys&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now you need to paste the &lt;strong&gt;public&lt;/strong&gt; key you generated on your own computer before. If you are on a Mac you can open a new terminal window and copy the public key, &lt;code class=&quot;language-text&quot;&gt;cat ~/.ssh/id_rsa.pub | pbcopy&lt;/code&gt;, then paste it into &lt;code class=&quot;language-text&quot;&gt;authorized_keys&lt;/code&gt; on the NAS. You can also use tools like &lt;code class=&quot;language-text&quot;&gt;scp&lt;/code&gt; to transfer the public key to the NAS. Save the file and make sure it has the correct permissions.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;chmod 600 ~/.ssh/authorized_keys&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you disconnect from the NAS and try to connect again you should be able to connect without having to enter your password. We will not disable the possibility to use passwords all together in this article.&lt;/p&gt;&lt;h2&gt;If it doesn&amp;#x27;t work&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Make sure the permissions of the home folder content on the NAS are correct. They should be &lt;code class=&quot;language-text&quot;&gt;700&lt;/code&gt; for folders and &lt;code class=&quot;language-text&quot;&gt;600&lt;/code&gt; for files.&lt;/li&gt;&lt;li&gt;Make sure you copied the &lt;em&gt;public&lt;/em&gt; key from your computer to the &lt;code class=&quot;language-text&quot;&gt;authorized_keys&lt;/code&gt; on the NAS.&lt;/li&gt;&lt;li&gt;When you are connecting you need to specify the port with the &lt;code class=&quot;language-text&quot;&gt;-p&lt;/code&gt; flag, &lt;code class=&quot;language-text&quot;&gt;ssh username@ip -p 23456&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title><![CDATA[Sign git commits on GitHub with GPG in macOS]]></title><description><![CDATA[When you are pushing commits to your repositories you are authenticating with either HTTPS or SSH. Telling GitHub that it is really you. That only ensures that it's the correct user doing the pushing. You could also add an extra level of…]]></description><link>https://samuelsson.dev/sign-git-commits-on-github-with-gpg-in-macos/</link><guid isPermaLink="false">https://samuelsson.dev/sign-git-commits-on-github-with-gpg-in-macos/</guid><pubDate>Mon, 18 Jan 2021 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When you are pushing commits to your repositories you are authenticating with either HTTPS or SSH. Telling GitHub that it is really you. That only ensures that it&amp;#x27;s the correct user doing the pushing. You could also add an extra level of verification by signing the actual commits before pushing.&lt;/p&gt;&lt;p&gt;This will give you a cool badge on each commit as in the screenshot below and also other users can trust that they are actually coming from you.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:23.5%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA0UlEQVQY06WQ207DMBQE8/9fiIA2TVJoobnajm/nuIMSJKDPrDRvq5F2qxgT1jpW7/E+EELgP6lyFoZxph8nbsNIP4wsxjIvBh8iooUs+oBPkZTzTkiCT8LmySJUosrrqePp+cDLoebYnDk2HYe6ZVosPmbWkH5wIXJdeha3YuzKYCKfc8CtAecjlZbCqe2oTw1td+Zy/eD89r6z3bCllDv3+y9bRBS3eiaXGExiuy6m/C3cZt76nmmaMdayGLPPVtUH0V9KKYgISZSUde+qFr4ALvWD5oVuPTsAAAAASUVORK5CYII=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;A commit that is verified&quot; title=&quot;A commit that is verified&quot; src=&quot;/static/124ca5b5425d54ffb2260a8e67393b0e/5a190/a_verfied_commit.png&quot; srcSet=&quot;/static/124ca5b5425d54ffb2260a8e67393b0e/772e8/a_verfied_commit.png 200w,/static/124ca5b5425d54ffb2260a8e67393b0e/e17e5/a_verfied_commit.png 400w,/static/124ca5b5425d54ffb2260a8e67393b0e/5a190/a_verfied_commit.png 800w,/static/124ca5b5425d54ffb2260a8e67393b0e/b2cef/a_verfied_commit.png 847w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;There is a proprietary tool called &lt;a href=&quot;https://gpgtools.org/&quot;&gt;GPG Suite&lt;/a&gt; that contains some tools that will help you manage your gpg keys in a GUI and integrate with Apple Mail for encrypting email. For now we&amp;#x27;ll be focusing on doing it manually with the standalone tools to avoid bloating our system.&lt;/p&gt;&lt;h2&gt;Generating GPG keys&lt;/h2&gt;&lt;p&gt;I assume you don&amp;#x27;t already have GPG installed but if you do you probably know what you are doing and can skip ahead. The first step is to install GnuPG, a free implementation of the OpenPGP standard.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;brew install gnupg&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;GnuPG has multiple dependencies and when all are installed we can generate a new key pair.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpg --full-generate-key&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Pick &lt;code class=&quot;language-text&quot;&gt;RSA and RSA&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Enter a key size of &lt;code class=&quot;language-text&quot;&gt;4096&lt;/code&gt;&lt;/li&gt;&lt;li&gt;No expiration (unless you want it to be invalid after a certain time of course)&lt;/li&gt;&lt;li&gt;Enter your real name or your GitHub user name&lt;/li&gt;&lt;li&gt;Enter your commit email address (find out with &lt;code class=&quot;language-text&quot;&gt;git config --global user.email&lt;/code&gt;). If you aren&amp;#x27;t using a &lt;a href=&quot;https://docs.github.com/en/free-pro-team@latest/articles/setting-your-commit-email-address&quot;&gt;private address&lt;/a&gt; you really should.&lt;/li&gt;&lt;li&gt;You can enter &lt;code class=&quot;language-text&quot;&gt;GitHub&lt;/code&gt; as comment.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;It may take a while (or not if you have a fast computer) and when done it will be saved under &lt;code class=&quot;language-text&quot;&gt;~/.gnupg&lt;/code&gt;. Both the private key and the public key are saved here. The private key should never be sent to others or be lost.&lt;/p&gt;&lt;h2&gt;Add the key to GitHub&lt;/h2&gt;&lt;p&gt;To connect you (with your private key) to GitHub we can upload the public key to your profile. First we need to find out which key to copy, you might have multiple.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpg --list-secret-keys --keyid-format LONG&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will output something similar like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;/Users/name/.gnupg/pubring.kbx
------------------------------------
sec   rsa4096/EE05XXXXXXXXXXXX 2021-01-14 [SC]
      215556521B98225XXXXXXXXXXXXXXXXXXXXXXXXX
uid                 [ultimate] Name Nameson (GitHub) &amp;lt;1234567+user@users.noreply.github.com&amp;gt;
ssb   rsa4096/A226A4XXXXXXXXXX 2021-01-14 [E]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What we want here is the GPG key ID, it&amp;#x27;s the part after &lt;code class=&quot;language-text&quot;&gt;sec   rsa4096/&lt;/code&gt;, so in this case it&amp;#x27;s &lt;code class=&quot;language-text&quot;&gt;EE05XXXXXXXXXXXX&lt;/code&gt;. And to copy the public key we do that with this command.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpg --armor --export EE05XXXXXXXXXXXX | pbcopy&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will copy the long public key to your clipboard. If you rather want it to be printed in the terminal you can omit the &lt;code class=&quot;language-text&quot;&gt;| pbcopy&lt;/code&gt; part and then copy it manually. It will be a long string inside a block, the whole content should be copied including start and end parts.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;-----BEGIN PGP PUBLIC KEY BLOCK-----

SUPER+LONG+STRING+IS+HERE+ABC123+ETC
-----END PGP PUBLIC KEY BLOCK-----&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we head over to GitHub and navigate to &lt;code class=&quot;language-text&quot;&gt;Settings -&amp;gt; SSH and GPG keys&lt;/code&gt; and click on &lt;code class=&quot;language-text&quot;&gt;New GPG key&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:21.999999999999996%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAs0lEQVQY02WPa0rEQBCEc/9TeAPxAF5CBFlY8YdEk3nFjJnXJj2fTJaF3fWDooqCpru7GALGWrQ2eP9LrRXv/Z7XdaPRumtduosf3Acv+oAKlm6ZZ76GAWMspZzYRPYF46goJXOm3uh+wdPxmYfXR97sO11MCaU0McZ9dNsE5ya0nejVRD86PgfLt/6hVw43LzdX39OllNDG0LwhIpRSSPnEkoVQhJCFWM45r/LvZamyq+U/mO02GZ2MwikAAAAASUVORK5CYII=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Add a new GPG key on GitHub&quot; title=&quot;Add a new GPG key on GitHub&quot; src=&quot;/static/fe936e01d38dcac0f8e7be1066b1de4d/5a190/add_new_gpg_key_on_gihub.png&quot; srcSet=&quot;/static/fe936e01d38dcac0f8e7be1066b1de4d/772e8/add_new_gpg_key_on_gihub.png 200w,/static/fe936e01d38dcac0f8e7be1066b1de4d/e17e5/add_new_gpg_key_on_gihub.png 400w,/static/fe936e01d38dcac0f8e7be1066b1de4d/5a190/add_new_gpg_key_on_gihub.png 800w,/static/fe936e01d38dcac0f8e7be1066b1de4d/4c42d/add_new_gpg_key_on_gihub.png 896w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Paste the public key and then save it. You&amp;#x27;ll probably need to enter you password.&lt;/p&gt;&lt;h2&gt;Sign commits with your key&lt;/h2&gt;&lt;p&gt;Next we need to tell git to use your newly created key when signing the commits. That is easily done by adding a property to your git config. Change the key to match your ID.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;git config --global user.signingkey EE05XXXXXXXXXXXX&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is saved in &lt;code class=&quot;language-text&quot;&gt;~/.gitconfig&lt;/code&gt; if you want to manually organize it. Please keep in mind that if you are using dotfiles synced across multiple devices this will also require the same key to be synced. You can skip the &lt;code class=&quot;language-text&quot;&gt;--global&lt;/code&gt; flag to add it to a specific repository instead. Using the same keys across multiple devices is described at the end.&lt;/p&gt;&lt;p&gt;When using gpg there is a deamon (&lt;code class=&quot;language-text&quot;&gt;gpg-agent&lt;/code&gt;) running in the background managing the keys regardless of what protocol you are using, but we need to add an environmental variable to let it know the current shell. Add this to your &lt;code class=&quot;language-text&quot;&gt;~/.zshrc&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;.bashrc&lt;/code&gt; or whatever shell you are using.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;GPG_TTY&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;tty&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After restarting your terminal you should be able to sign your commits by adding &lt;code class=&quot;language-text&quot;&gt;-S&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;--gpg-sign&lt;/code&gt; to the commit command, &lt;code class=&quot;language-text&quot;&gt;git commit -S&lt;/code&gt;. &lt;em&gt;gpg-agent&lt;/em&gt; should now show you a prompt to enter your private key password. If entered correctly and you push this commit, GitHub will validate the signing with the provided public key and then mark it as a verified one, congratulations 🥳&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:23%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAApklEQVQY051Q0Q6DIBDj/79yU7NNXRSYHDsEunBodMme1qQJAdprTxF5OCLElLAj5/wnAaWNQT+M8P6NGKPwbPwL9T5v58odijnAWAtrX5i1hjFWTFNKIvmV5NyiGh9vqlRtug6Xa4O27XC7P4T9MIjptxiymnGZ4JlBRBgt42kZzIUBqqSZtcE0zZLOOULZ67I4+VArHQnKEF6DGBcthwhe47auhA9rqYiIfAJ96AAAAABJRU5ErkJggg==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;A verified commit on GitHub&quot; title=&quot;A verified commit on GitHub&quot; src=&quot;/static/8f8a5ffa3afab5cc1453a0124bba92b0/5a190/verified_commit_on_github.png&quot; srcSet=&quot;/static/8f8a5ffa3afab5cc1453a0124bba92b0/772e8/verified_commit_on_github.png 200w,/static/8f8a5ffa3afab5cc1453a0124bba92b0/e17e5/verified_commit_on_github.png 400w,/static/8f8a5ffa3afab5cc1453a0124bba92b0/5a190/verified_commit_on_github.png 800w,/static/8f8a5ffa3afab5cc1453a0124bba92b0/5b481/verified_commit_on_github.png 846w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;This is all you have to do to make commit signing work. If you want to boost the process a bit more you can continue reading.&lt;/p&gt;&lt;h2&gt;Sign commits automatically&lt;/h2&gt;&lt;p&gt;To avoid entering the &lt;code class=&quot;language-text&quot;&gt;-S&lt;/code&gt; flag on each commit you can make signing the default behavior by adding the property to your git config.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;git config --global commit.gpgsign true&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you commit often it will probably be a bit tiring after a while to enter your password every time. This can be solved by saving the password in macOS keychain, like we easily can do with ssh key passwords with the ´ssh-agent´. Unfortunately &lt;code class=&quot;language-text&quot;&gt;gpg-agent&lt;/code&gt; has no built-in support for this so we need add a separate tool.&lt;/p&gt;&lt;p&gt;The tool mainly used for this is called &lt;code class=&quot;language-text&quot;&gt;pinentry-mac&lt;/code&gt; which is now part of the &lt;em&gt;GPG Suite&lt;/em&gt; mentioned in the beginning. Luckily for us it is still open-source and recently updated (compared to the initial one that was last updated 2015).&lt;/p&gt;&lt;p&gt;You can install the tool with brew:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;brew install pinentry-mac&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If not existing already create the file &lt;code class=&quot;language-text&quot;&gt;~/.gnupg/gpg-agent.conf&lt;/code&gt; and add the following line:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;pinentry-program /usr/local/bin/pinentry-mac&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then just stop the currently running &lt;em&gt;gpg-agent&lt;/em&gt; and next time you try to sign a commit you&amp;#x27;ll be prompted to save it to the macOS Keychain.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpgconf --kill gpg-agent&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Use signing with keys on multiple devices&lt;/h2&gt;&lt;p&gt;In short you have two choices here, either you generate a new key on each of your devices or you use the same key across all of them. If you generate new ones you also need to add them to GitHub but if you lose one device it&amp;#x27;s easy to just remove the public one on GitHub. So it&amp;#x27;s safer but also adds a bit more work and currently GitHub doesn&amp;#x27;t distinguish keys in a good way in my opinion. The latter is easier but if one device is compromised so are all of the other private keys you use, because they are the same.&lt;/p&gt;&lt;p&gt;When it comes to ssh keys I always generate one for each device but I don&amp;#x27;t do it for my GPG keys, even though it is a bit more secure. The reason is with an example for encrypting/decprypting email. If I receive an email that has been encrypted with my public key I need the private key to be able to decrypt and read the email. If I do this locally I need the same private key connected to the public key, different keys won&amp;#x27;t work. So I organize my gpg keys by what they are used for instead. One for each GitHub account and one for each email address.&lt;/p&gt;&lt;h3&gt;Export your keys&lt;/h3&gt;&lt;p&gt;We export the key the same way as we did when adding it to GitHub but we also add a flag for saving it to a file. We  use the same ID as in the above example.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpg --output my_public_key.gpg --armor --export EE05XXXXXXXXXXXX&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And for the private key it&amp;#x27;s another command where you also need to enter your password.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpg --output my_private_key.gpg --armor --export-secret-key EE05XXXXXXXXXXXX&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;They will be saved in your current folder when just writing the file names like this.&lt;/p&gt;&lt;h3&gt;Transfer and import your keys on another device&lt;/h3&gt;&lt;p&gt;Now we need to transfer them to the new device. It&amp;#x27;s very important to do this in a secure way when you include the private key, this means &lt;strong&gt;no email&lt;/strong&gt;. You can use a USB flash drive or transfer them with &lt;code class=&quot;language-text&quot;&gt;scp&lt;/code&gt; for example. On the new device you need to install everything mentioned above and then you can import the keys.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpg --import my_public_key.gpg&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And another command for the private key when importing as well, combined with the password.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gpg --allow-secret-key-import --import my_private_key.gpg&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And last but not least, remember to clean up all the exported keys from USB flash drives and other places. It can also be a good idea to backup your keys in a safe or password manager.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Enable Keyboard Setup Assistant if Change keyboard type is hidden]]></title><description><![CDATA[When plugging in a new keyboard to the Mac you need to set what kind of layout it has if not detected automatically. The  Keyboard Setup Assistant  usually pops up the first time you plug the keyboard in and you can choose if it's ISO or…]]></description><link>https://samuelsson.dev/enable-keyboard-setup-assistant-if-change-keyboard-type-is-hidden/</link><guid isPermaLink="false">https://samuelsson.dev/enable-keyboard-setup-assistant-if-change-keyboard-type-is-hidden/</guid><pubDate>Sun, 10 Jan 2021 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When plugging in a new keyboard to the Mac you need to set what kind of layout it has if not detected automatically. The &lt;em&gt;Keyboard Setup Assistant&lt;/em&gt; usually pops up the first time you plug the keyboard in and you can choose if it&amp;#x27;s ISO or ANSI. Sometimes the type can be reset for some reason and you need to run the assistant again to select the layout. Like in this case when my Swedish keyboard was reset to an ANSI layout.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:780px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:90.99999999999999%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;swedish-keyboard-with-ansi-layout&quot; title=&quot;swedish-keyboard-with-ansi-layout&quot; src=&quot;/static/b06127a12cab20f2666df060a37567e1/a1792/swedish-keyboard-with-ansi-layout.png&quot; srcSet=&quot;/static/b06127a12cab20f2666df060a37567e1/772e8/swedish-keyboard-with-ansi-layout.png 200w,/static/b06127a12cab20f2666df060a37567e1/e17e5/swedish-keyboard-with-ansi-layout.png 400w,/static/b06127a12cab20f2666df060a37567e1/a1792/swedish-keyboard-with-ansi-layout.png 780w&quot; sizes=&quot;(max-width: 780px) 100vw, 780px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;This can be solved by running the assistant again but if you&amp;#x27;re unlucky macOS has decided that you don&amp;#x27;t need to change the layout if you&amp;#x27;ve used the keyboard long enough. The button to trigger the assistant is missing.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:780px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:90.99999999999999%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;change-keyboard-type-is-missing&quot; title=&quot;change-keyboard-type-is-missing&quot; src=&quot;/static/46fad39aae08e322bb73d7deef5a54bd/a1792/change-keyboard-type-is-missing.png&quot; srcSet=&quot;/static/46fad39aae08e322bb73d7deef5a54bd/772e8/change-keyboard-type-is-missing.png 200w,/static/46fad39aae08e322bb73d7deef5a54bd/e17e5/change-keyboard-type-is-missing.png 400w,/static/46fad39aae08e322bb73d7deef5a54bd/a1792/change-keyboard-type-is-missing.png 780w&quot; sizes=&quot;(max-width: 780px) 100vw, 780px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;To remove the saved layout for the current keyboard just run this command to remove the keyboard preference plist.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; /Library/Preferences/com.apple.keyboardtype.plist&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After this you need to restart the computer and when logging back in you should be greeted by the &lt;em&gt;Keyboard Setup Assistant&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:728px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75.99999999999999%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;keyboards-setup-assistant&quot; title=&quot;keyboards-setup-assistant&quot; src=&quot;/static/2e66e3144c7abd6d60b0978facf70165/cecac/keyboards-setup-assistant.png&quot; srcSet=&quot;/static/2e66e3144c7abd6d60b0978facf70165/772e8/keyboards-setup-assistant.png 200w,/static/2e66e3144c7abd6d60b0978facf70165/e17e5/keyboards-setup-assistant.png 400w,/static/2e66e3144c7abd6d60b0978facf70165/cecac/keyboards-setup-assistant.png 728w&quot; sizes=&quot;(max-width: 728px) 100vw, 728px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;If not you should be able to see the button for triggering the setup manually under &lt;code class=&quot;language-text&quot;&gt;Settings -&amp;gt; Keyboard -&amp;gt; Keyboard&lt;/code&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Concatenate multiple optional items with separators]]></title><description><![CDATA[Concatenating strings is a pretty straight forward task in JavaScript and with the introduction of template literals with string interpolation things got even simpler. Let's say that we want to concat a couple of inputs of a form that is…]]></description><link>https://samuelsson.dev/concatenate-multiple-optional-items-with-separators/</link><guid isPermaLink="false">https://samuelsson.dev/concatenate-multiple-optional-items-with-separators/</guid><pubDate>Tue, 22 Sep 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Concatenating strings is a pretty straight forward task in JavaScript and with the introduction of template literals with string interpolation things got even simpler. Let&amp;#x27;s say that we want to concat a couple of inputs of a form that is connected to the address of the user.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; address1&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; address2&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; address3&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; city &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; user&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; location &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;address1&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;address2&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;address3&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;city&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That would work perfectly fine if all the properties exist but if &lt;code class=&quot;language-text&quot;&gt;address3&lt;/code&gt; is optional and empty on the &lt;code class=&quot;language-text&quot;&gt;user&lt;/code&gt; object it would look pretty bad.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Large Street 12, Second floor, , London&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or if &lt;code class=&quot;language-text&quot;&gt;address3&lt;/code&gt; is undefined it would look even worse.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Large Street 12, Second floor, undefined, London&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Instead of using template literals we could use a small trick putting all the properties in an array and filter out all those that are falsy (i.e. &lt;code class=&quot;language-text&quot;&gt;undefined&lt;/code&gt; and empty strings). Then just joining the remaining items together with a string of our choice, like a comma.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; address1&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; address2&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; address3&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; city &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; user&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; location &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;address1&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; address2&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; address3&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; city&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Boolean&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;#x27;, &amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we don&amp;#x27;t need to check if each property exists and it&amp;#x27;s dynamic regardless of number of items in the array. This would then look like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Large Street 12, Second floor, London&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Access private submodules in GitHub Actions]]></title><description><![CDATA[Using submodules can be a simple solution to make some parts of a public repo private. For example I have separated the actual content of this blog to a private repo. Not because it's something secret (you are reading it now anyway) but it…]]></description><link>https://samuelsson.dev/access-private-submodules-in-github-actions/</link><guid isPermaLink="false">https://samuelsson.dev/access-private-submodules-in-github-actions/</guid><pubDate>Thu, 09 Jul 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Using submodules can be a simple solution to make some parts of a public repo private. For example I have separated the actual content of this blog to a private repo. Not because it&amp;#x27;s something secret (you are reading it now anyway) but it&amp;#x27;s fun to play around with and also if someone forks this blog the content is probably something they should write themselves.&lt;/p&gt;&lt;p&gt;A problem I encountered is that my GitHub Actions flow didn&amp;#x27;t really play nice with fetching the private submodule during build. The parent (blog) repo didn&amp;#x27;t have access to other repos (like content), for good reasons. Here is my solution for accessing the private submodule during build.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The parent repo &lt;code class=&quot;language-text&quot;&gt;blog&lt;/code&gt; is public on GitHub&lt;/li&gt;&lt;li&gt;The submodule repo &lt;code class=&quot;language-text&quot;&gt;content&lt;/code&gt; is private on GitHub&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;First we need to generate a new key locally to be used on our CI/CD for read permissions to our submodule repository. &lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;ssh-keygen -t rsa -b &lt;span class=&quot;token number&quot;&gt;4096&lt;/span&gt; -C &lt;span class=&quot;token string&quot;&gt;&amp;quot;an optional comment&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Don&amp;#x27;t add a password and you can save it to a temporary place for now, let&amp;#x27;s say the desktop.&lt;/p&gt;&lt;p&gt;Then we need to add the public part of the key to our submodule repo. You do that under &lt;code class=&quot;language-text&quot;&gt;submodule repo -&amp;gt; Settings -&amp;gt; Deploy keys -&amp;gt; Add deploy key&lt;/code&gt;. Give it a descriptive title, paste the public part of the key and keep it read-only.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:52.5%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAABAElEQVQoz52Sy07DMBRE/f9fwZJNt/wDG8SWbkBIEZVIXCdp4tyHPShu2rgNKQ9LR17Ymjtjj9nuCO9W8FHWKIoCZWUxrhjjvzCu9WAFWBTEDBFBBM6iIfxR0FoL5xzsfqaye3yWFQ5dD9GQLv52GVfXOHQdeHSnCpEZ1YAQvkfTHhfPY+qmhasbDMQpdg7xiKwyDgVieqJTCjNG0hAnAckEZTHgctiK4EBy00XOQlB1ipwJkggkzC5/cnU94CQ0R24ZjW3S7xIRiHiCUo0SxCleqtEVC8G7pw0eX5/hO4+u7+GH4Yj38H44wyyrVclrZe5fHrB1b8cD3O7bWplzh18X/mCaCXsKsQAAAABJRU5ErkJggg==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Create a new deploy key on the submodule repo on GitHub&quot; title=&quot;Create a new deploy key on the submodule repo on GitHub&quot; src=&quot;/static/02e87ce4bbbc1df9aa5aef6f604b065c/5a190/deploy-key.png&quot; srcSet=&quot;/static/02e87ce4bbbc1df9aa5aef6f604b065c/772e8/deploy-key.png 200w,/static/02e87ce4bbbc1df9aa5aef6f604b065c/e17e5/deploy-key.png 400w,/static/02e87ce4bbbc1df9aa5aef6f604b065c/5a190/deploy-key.png 800w,/static/02e87ce4bbbc1df9aa5aef6f604b065c/eb2af/deploy-key.png 954w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Next step is to add the private part of the key to the repository using the submodule, the parent blog repo in our example. Navigate to &lt;code class=&quot;language-text&quot;&gt;parent repo -&amp;gt; Setting -&amp;gt; Settings -&amp;gt; Secrets -&amp;gt; New secrets&lt;/code&gt; and give it a name and paste the key.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:50%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA50lEQVQoz6WS3UoDMRBG8/5v0ktvvOsriFKkKopY7Y+77aa7SXeTTCafZOiyiBdtcODkuwmHmWHU3kasNKOqD9judqjqGmOllPIjeS3qoI/YNy2c8zDWou97BCIwJzDzmQKhcw6N1uiMRWeMZD8MiJFBMQqRGdeWypIsIIogIoRAktJZShN8GenQ2BPe3j/wud7ga7MVGt3CByrCeZKpVN5XlradPY99wuA8AsUislSEnggujyr7YmH84CUvQb+F042geMyRSRihFvULbl7nuK+W4uXCu/tzNg/VE2bPt7j7fpyO+R/1AzHWEDfrfeabAAAAAElFTkSuQmCC&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Add a new secret to the parent repo on GitHub&quot; title=&quot;Add a new secret to the parent repo on GitHub&quot; src=&quot;/static/0d4ffbe4bb693f83b1084ef87883ac9d/5a190/secret.png&quot; srcSet=&quot;/static/0d4ffbe4bb693f83b1084ef87883ac9d/772e8/secret.png 200w,/static/0d4ffbe4bb693f83b1084ef87883ac9d/e17e5/secret.png 400w,/static/0d4ffbe4bb693f83b1084ef87883ac9d/5a190/secret.png 800w,/static/0d4ffbe4bb693f83b1084ef87883ac9d/38124/secret.png 953w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;The last step is to use the secret to authorize against our submodule repo when checking out the project in an Action.&lt;/p&gt;&lt;p&gt;A simple workflow to build the blog could look like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# .github/workflows/deploy.yml&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Deploy

&lt;span class=&quot;token key atrule&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;branches&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; master &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; ubuntu&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;latest

    &lt;span class=&quot;token key atrule&quot;&gt;steps&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; actions/checkout@v2

      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Use Node.js
        &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; actions/setup&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;node@v1
        &lt;span class=&quot;token key atrule&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;node-version&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;14.x&amp;#x27;&lt;/span&gt;

      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Install dependencies
        &lt;span class=&quot;token key atrule&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; yarn &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;frozen&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;lockfile

      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Do stuff
        &lt;span class=&quot;token key atrule&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; yarn do&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;stuff&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The functionality already exists in the checkout action, you only need to enable it using the key by adding this to the checkout step:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token key atrule&quot;&gt;ssh-key&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; $&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; secrets.SUBMODULE_CONTENT_PULL_KEY &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot;&gt;submodules&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;recursive&amp;#x27;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is what the updated flow will look like&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# .github/workflows/deploy.yml&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Deploy

&lt;span class=&quot;token key atrule&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;branches&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; master &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; ubuntu&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;latest

    &lt;span class=&quot;token key atrule&quot;&gt;steps&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; actions/checkout@v2
        &lt;span class=&quot;token key atrule&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;ssh-key&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; $&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; secrets.SUBMODULE_CONTENT_PULL_KEY &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;submodules&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;recursive&amp;#x27;&lt;/span&gt;

      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Use Node.js
        &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; actions/setup&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;node@v1
        &lt;span class=&quot;token key atrule&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;node-version&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;14.x&amp;#x27;&lt;/span&gt;

      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Install dependencies
        &lt;span class=&quot;token key atrule&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; yarn &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;frozen&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;lockfile

      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Do stuff
        &lt;span class=&quot;token key atrule&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; yarn do&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;stuff&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The build will use the &lt;code class=&quot;language-text&quot;&gt;SUBMODULE_CONTENT_PULL_KEY&lt;/code&gt; for checking out both the parent and the submodule, but since the parent is a public repo that&amp;#x27;s no problem. If both are private the key needs to have access to both repos.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Upgrade all dependency versions in package.json with yarn]]></title><description><![CDATA[Updating dependencies in an npm project is pretty straight forward and easy to do with the command  yarn upgrade . It updates all packages to their latest  backwards-compatible  version. Something that those coming from using  npm update…]]></description><link>https://samuelsson.dev/upgrade-all-dependency-versions-in-package-json-with-yarn/</link><guid isPermaLink="false">https://samuelsson.dev/upgrade-all-dependency-versions-in-package-json-with-yarn/</guid><pubDate>Tue, 23 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Updating dependencies in an npm project is pretty straight forward and easy to do with the command &lt;code class=&quot;language-text&quot;&gt;yarn upgrade&lt;/code&gt;. It updates all packages to their latest &lt;em&gt;backwards-compatible&lt;/em&gt; version. Something that those coming from using &lt;code class=&quot;language-text&quot;&gt;npm update&lt;/code&gt; finds out is that the &lt;code class=&quot;language-text&quot;&gt;yarn&lt;/code&gt; equivalent doesn&amp;#x27;t update the &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt; with the new versions. This is usually not a big problem because you have a file called &lt;code class=&quot;language-text&quot;&gt;yarn.lock&lt;/code&gt; in your root directory that keeps track of all your installed versions but if you are a perfectionist like me, you also want the package.json file to reflect what versions used in the project. Before presenting a solution let&amp;#x27;s explain a bit why it works like this.&lt;/p&gt;&lt;p&gt;As default when you install an npm package with &lt;code class=&quot;language-text&quot;&gt;yarn add&lt;/code&gt; the version of that package in &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt; is prepended with a caret, like &lt;code class=&quot;language-text&quot;&gt;^7.2.0&lt;/code&gt;. This means that we can upgrade to all upcoming versions of that package as long as it is &lt;strong&gt;not&lt;/strong&gt; a &lt;em&gt;MAJOR&lt;/em&gt; update. Npm packages are using &lt;a href=&quot;https://semver.org/&quot;&gt;Semantic Versioning (semver)&lt;/a&gt; so a &lt;em&gt;MAJOR&lt;/em&gt; version is a bump that is changing the first number of the version. So in this case version &lt;code class=&quot;language-text&quot;&gt;^7.2.0&lt;/code&gt; can be upgraded to &lt;code class=&quot;language-text&quot;&gt;7.3.1&lt;/code&gt; but not to &lt;code class=&quot;language-text&quot;&gt;8.0.0&lt;/code&gt; for example. If you want to dig deeper into the prepending you can read more &lt;a href=&quot;https://docs.npmjs.com/misc/semver#versions&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:37.5%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Listing all outdated dependencies&quot; title=&quot;Listing all outdated dependencies&quot; src=&quot;/static/574fc4ec6b685161356e2fd45cb30160/5a190/outdated.png&quot; srcSet=&quot;/static/574fc4ec6b685161356e2fd45cb30160/772e8/outdated.png 200w,/static/574fc4ec6b685161356e2fd45cb30160/e17e5/outdated.png 400w,/static/574fc4ec6b685161356e2fd45cb30160/5a190/outdated.png 800w,/static/574fc4ec6b685161356e2fd45cb30160/c1b63/outdated.png 1200w,/static/574fc4ec6b685161356e2fd45cb30160/29007/outdated.png 1600w,/static/574fc4ec6b685161356e2fd45cb30160/26162/outdated.png 2020w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;As you see in the above image &lt;code class=&quot;language-text&quot;&gt;eslint&lt;/code&gt; is currently on &lt;code class=&quot;language-text&quot;&gt;7.2.0&lt;/code&gt; and the wanted version is &lt;code class=&quot;language-text&quot;&gt;7.3.1&lt;/code&gt;. On the other hand &lt;code class=&quot;language-text&quot;&gt;eslint-plugin-react-hooks&lt;/code&gt; is multiple versions behind the latest but the wanted version is still the current one. There are no higher versions for &lt;code class=&quot;language-text&quot;&gt;2.X&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;The &lt;code class=&quot;language-text&quot;&gt;yarn.lock&lt;/code&gt; is a huge file that contains the complete dependency tree of all currently installed packages in your project. This means that &lt;code class=&quot;language-text&quot;&gt;yarn.lock&lt;/code&gt; can actually have a version of &lt;code class=&quot;language-text&quot;&gt;7.3.1&lt;/code&gt; of a package while &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt; has it set to &lt;code class=&quot;language-text&quot;&gt;^7.2.0&lt;/code&gt;. As mentioned above this is all by design and okay because it&amp;#x27;s not a &lt;em&gt;MAJOR&lt;/em&gt; version bump, and they are both equivalent. It&amp;#x27;s actually what is set in the &lt;code class=&quot;language-text&quot;&gt;yarn.lock&lt;/code&gt; that is the &amp;quot;truth&amp;quot; because the project should be locked to these exact versions.&lt;/p&gt;&lt;p&gt;This is where &lt;code class=&quot;language-text&quot;&gt;yarn upgrade&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;npm update&lt;/code&gt; differ, the first only updates the lock file while the latter updates both the lock file and &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt;. Because the lock file is the only one that matters it doesn&amp;#x27;t make any difference in practice. So next time you install this project you will get version &lt;code class=&quot;language-text&quot;&gt;7.3.1&lt;/code&gt; because that is the &amp;quot;locked&amp;quot; one even though it has a lower version in the &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;There is a simple command to also update the &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt; when upgrading packages through the terminal with &lt;code class=&quot;language-text&quot;&gt;yarn&lt;/code&gt;. I can run an interactive upgrade tool that is bundled with yarn that gives me the option to pick all versions I want to bump to latest.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;yarn&lt;/span&gt; upgrade-interactive --latest&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will list all upgradeable versions, and you can select all those you want upgraded with &lt;code class=&quot;language-text&quot;&gt;space&lt;/code&gt;. When done you just press enter and all checked packages will be upgraded and also bumped in &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:37.5%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Select what dependencies to be updated&quot; title=&quot;Select what dependencies to be updated&quot; src=&quot;/static/a3777f0a26cb9b751179e982e7c9575c/5a190/upgrade.png&quot; srcSet=&quot;/static/a3777f0a26cb9b751179e982e7c9575c/772e8/upgrade.png 200w,/static/a3777f0a26cb9b751179e982e7c9575c/e17e5/upgrade.png 400w,/static/a3777f0a26cb9b751179e982e7c9575c/5a190/upgrade.png 800w,/static/a3777f0a26cb9b751179e982e7c9575c/c1b63/upgrade.png 1200w,/static/a3777f0a26cb9b751179e982e7c9575c/29007/upgrade.png 1600w,/static/a3777f0a26cb9b751179e982e7c9575c/26162/upgrade.png 2020w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;The trick here is that we are using the &lt;code class=&quot;language-text&quot;&gt;--latest&lt;/code&gt; flag which bypasses the default upgrade rule about &lt;em&gt;MAJOR&lt;/em&gt; versions. Because this can bump versions way above the standard &lt;em&gt;backwards-compatibility&lt;/em&gt; the &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt; is also updated to reflect that we really make some hardcore updates here 👊🏻&lt;/p&gt;&lt;p&gt;Just be aware bumping a &lt;em&gt;MAJOR&lt;/em&gt; version usually has breaking changes so read the CHANGELOG for that specific package before continuing.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Automate versioning and publication of npm packages]]></title><description><![CDATA[A while ago I wrote a post about  always writing perfect commit messages  by using commit linting tools and conventional templates. This makes the commit messages look great and formatted the same way regardless of who is committing but…]]></description><link>https://samuelsson.dev/automate-versioning-and-publication-of-npm-packages/</link><guid isPermaLink="false">https://samuelsson.dev/automate-versioning-and-publication-of-npm-packages/</guid><pubDate>Sat, 06 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A while ago I wrote a post about &lt;a href=&quot;/always-write-perfect-commit-messages-with-git-commitizen-and-husky&quot;&gt;always writing perfect commit messages&lt;/a&gt; by using commit linting tools and conventional templates. This makes the commit messages look great and formatted the same way regardless of who is committing but what is the next step you may ask. Wouldn&amp;#x27;t it be fun to be able to use these standardized commits to automate more steps in our project? Well, of course! How about automating the whole release flow with generating versions, changelogs, tags and publication?&lt;/p&gt;&lt;h2&gt;Tools to automate versioning&lt;/h2&gt;&lt;p&gt;There are two popular tools for automatic versioning packages. They are &lt;a href=&quot;https://github.com/conventional-changelog/standard-version&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/semantic-release/semantic-release&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;semantic-release&lt;/code&gt;&lt;/a&gt;, and in short they do pretty much the same thing.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Using the commit messages to determine what changes have been made.&lt;/li&gt;&lt;li&gt;Setting a new &lt;a href=&quot;https://semver.org/&quot;&gt;semantic version&lt;/a&gt; of the package based on the changes.&lt;/li&gt;&lt;li&gt;Generating a &lt;code class=&quot;language-text&quot;&gt;CHANGELOG.md&lt;/code&gt; containing everything changed from last version.&lt;/li&gt;&lt;li&gt;Committing these additions.&lt;/li&gt;&lt;li&gt;Creating a new &lt;code class=&quot;language-text&quot;&gt;tag&lt;/code&gt; with the updated version number.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The difference between these two tools is when all these steps are happening and with what level of automation. With &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt; this is &lt;em&gt;usually&lt;/em&gt; triggered manually when we want to release a new version and with &lt;code class=&quot;language-text&quot;&gt;semantic-release&lt;/code&gt; this is &lt;em&gt;usually&lt;/em&gt; happening automatically on a CI/CD server together with pushing and publishing. So, to make a generalization of this, you can use &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt; for smaller packages that you can publish when you want and &lt;code class=&quot;language-text&quot;&gt;semantic-release&lt;/code&gt; is used for larger project with multiple contributors and with everything automated. An example is a small CLI tool that you develop yourself is using &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt; and a large monorepo with multiple packages and contributors can use &lt;code class=&quot;language-text&quot;&gt;semantic-release&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;When starting with automatic versioning of packages it is in my opinion a good idea to start with a less automated approach to get a better understanding of what is happening. So I will describe how to set up &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt; in an existing npm project.  &lt;/p&gt;&lt;h2&gt;Using &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt;&lt;/h2&gt;&lt;p&gt;The only requirement for &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt; to work is that all commits are following the &lt;a href=&quot;https://www.conventionalcommits.org/&quot;&gt;Conventional Commits Specification&lt;/a&gt;, but that should already be set up with &lt;code class=&quot;language-text&quot;&gt;commitlint&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;husky&lt;/code&gt; mentioned in the beginning.&lt;/p&gt;&lt;p&gt;The first thing we need to do is adding the tool to our project.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;yarn&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;add&lt;/span&gt; --dev standard-version&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After that we can add a new script which we can run when we want to release, add this to your &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt;:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;scripts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;release&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;standard-version&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This way we only need to run &lt;code class=&quot;language-text&quot;&gt;yarn release&lt;/code&gt; every time we want a new version, and we can release whenever we want. After each new feature/fix, a specific day of the month or just when we feel the changes are plenty enough. But before running this script and releasing we should make an initial release.&lt;/p&gt;&lt;p&gt;We want to make a &lt;em&gt;first release&lt;/em&gt; which sets the initial version of the project. Let&amp;#x27;s try it with the &lt;code class=&quot;language-text&quot;&gt;--dry-run&lt;/code&gt; flag to just see what happens without actually doing any real changes.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;yarn&lt;/span&gt; release --first-release --dry-run&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will output something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;$ standard-version --first-release --dry-run
✖ skip version bump on first release
✔ created CHANGELOG.md
✔ outputting changes to CHANGELOG.md

---
### 0.1.0 (2020-01-02)
---

✔ committing CHANGELOG.md
✔ tagging release v0.1.1
ℹ Run `git push --follow-tags origin master` to publish&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Looks good! We also noticed that it will not be pushed nor published, but we&amp;#x27;ll take care of that in a bit.&lt;/p&gt;&lt;p&gt;Now, let&amp;#x27;s run it without the &lt;code class=&quot;language-text&quot;&gt;--dry-run&lt;/code&gt; flag to make this the real deal.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;yarn&lt;/span&gt; release --first-release&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That was really simple! Next release you simply skip the &lt;code class=&quot;language-text&quot;&gt;--first-release&lt;/code&gt; flag. As you noticed in the output we still need to push it to origin, let&amp;#x27;s do that.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; push --follow-tags origin master&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We need the &lt;code class=&quot;language-text&quot;&gt;--follow-tags&lt;/code&gt; flag to ensure the new tag gets pushed as well, it can be set in your git config if you want it as default. If you now visit your project on GitHub (or equivalent) you can now see a new release has been made.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:16%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAxElEQVQI1zWLvU7CUABG+64kbo7EydlATSClUG1vb1vAi/evRgdWSvF1HMAA4zEtcTjJ953kBM5anLN473DuRre9c3zUNfum4dC2fB9amt2u9/90rbUG6yzGaLTRBGu1QZYVmSxYvinK5YpXIUlSgfE1p8uVn+Mvx/OV0/nCSm1Ic4koSrr2XRmqYo1WFqMtQRgvGEdzJklKlOVEqWD6kvU/FgXqa0vlPxHaI01NGCc8TWd9M5rNuZ88cvf8wCAcMs4j/gBporG2Q2YIXQAAAABJRU5ErkJggg==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;First release on GitHub&quot; title=&quot;First release on GitHub&quot; src=&quot;/static/4d4696cbccca9cf5e23e52a2322c3d9b/5a190/release.png&quot; srcSet=&quot;/static/4d4696cbccca9cf5e23e52a2322c3d9b/772e8/release.png 200w,/static/4d4696cbccca9cf5e23e52a2322c3d9b/e17e5/release.png 400w,/static/4d4696cbccca9cf5e23e52a2322c3d9b/5a190/release.png 800w,/static/4d4696cbccca9cf5e23e52a2322c3d9b/c1b63/release.png 1200w,/static/4d4696cbccca9cf5e23e52a2322c3d9b/29007/release.png 1600w,/static/4d4696cbccca9cf5e23e52a2322c3d9b/d3b46/release.png 1690w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;As long as the name of your package is available on the npm registry we can also publish it.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;npm&lt;/span&gt; publish&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;#x27;s all you need to do from now on, &lt;code class=&quot;language-text&quot;&gt;release&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;push&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;publish&lt;/code&gt;. Super easy!&lt;/p&gt;&lt;h3&gt;Improve the process a bit more&lt;/h3&gt;&lt;p&gt;Even though it&amp;#x27;s only three commands we can improve this a bit more by adding code quality checks and put everything in one single command.&lt;/p&gt;&lt;p&gt;It can be a good idea to check for errors in the code before releasing (especially when publishing) and for that we can use lifecycle scripts.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s lint and test our code before we actually do any of the release steps in &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt; by adding some scripts. In this example we are using &lt;code class=&quot;language-text&quot;&gt;jest&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;eslint&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;TypeScript&lt;/code&gt;. &lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;scripts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;release&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;standard-version&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;lint&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;tsc --noEmit &amp;amp;&amp;amp; eslint ./ --ext .ts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;jest --ci&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;standard-version&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;scripts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;token property&quot;&gt;&amp;quot;prerelease&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;yarn lint &amp;amp;&amp;amp; yarn test&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Every time we run &lt;code class=&quot;language-text&quot;&gt;yarn release&lt;/code&gt; the &lt;code class=&quot;language-text&quot;&gt;prerelease&lt;/code&gt; script will trigger and lint and test our code before anything else. If everything goes well, &lt;code class=&quot;language-text&quot;&gt;standard-version&lt;/code&gt; will proceed with the release. If you have any linting errors or failing tests you can&amp;#x27;t release a new version. These checks should probably run even before being able to merge to master (so all releasable code is already checked) but that&amp;#x27;s another topic we won&amp;#x27;t discuss now 🤓&lt;/p&gt;&lt;p&gt;If you want to run a single command for everything, with compiling the TypeScript code before publishing for example, you can add something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;scripts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;prepublishOnly&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;tsc&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;mega-super-release&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;yarn release &amp;amp;&amp;amp; git push --follow-tags origin master &amp;amp;&amp;amp; npm publish&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But at this point you have automated so much it&amp;#x27;s almost like &lt;code class=&quot;language-text&quot;&gt;semantic-release&lt;/code&gt;, so maybe you should look into that now instead 😉&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Manage plugins natively in vim]]></title><description><![CDATA[There are many useful plugins for vim and I've always used a plugin manager to handle them all. Recently I found out that vim has had support for package management out of the box a long time now. It was actually really simple to switch…]]></description><link>https://samuelsson.dev/manage-plugins-natively-in-vim/</link><guid isPermaLink="false">https://samuelsson.dev/manage-plugins-natively-in-vim/</guid><pubDate>Wed, 04 Mar 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;There are many useful plugins for vim and I&amp;#x27;ve always used a plugin manager to handle them all. Recently I found out that vim has had support for package management out of the box a long time now. It was actually really simple to switch.&lt;/p&gt;&lt;p&gt;First we need to create a package directory where we will place all our plugins.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; -p ~/.vim/pack/plugins/start&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code class=&quot;language-text&quot;&gt;plugins&lt;/code&gt; directory can be named anything but because we are using this for plugins it&amp;#x27;s a fitting name. If you have many plugins you can organize them by category or similar. The &lt;code class=&quot;language-text&quot;&gt;start&lt;/code&gt; folder tells vim to load the packages when vim starts.&lt;/p&gt;&lt;p&gt;After that we can put all plugins into that directory and they will be loaded automatically every time. You can find a list of all cool plugins at &lt;a href=&quot;https://vimawesome.com/&quot;&gt;Vim Awesome&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;To install a plugin we simply type this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; clone https://github.com/itchyny/lightline.vim ~/.vim/pack/plugins/start/lightline&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next time you open vim the plugin(s) will be loaded.&lt;/p&gt;&lt;h2&gt;Load plugins manually&lt;/h2&gt;&lt;p&gt;Maybe not all plugins should be loaded automatically each time we open vim and thus we want to be able to load them manually. It&amp;#x27;s as simple as the first step, we just create a directory like this.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; -p ~/.vim/pack/plugins/opt&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All plugins put in that folder are not loaded automatically and can be opt-in by typing this inside vim:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;:packadd plugin-name&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That will load the plugin called &lt;code class=&quot;language-text&quot;&gt;plugin-name&lt;/code&gt; in &lt;code class=&quot;language-text&quot;&gt;~/.vim/pack/plugins/opt/plugin-name&lt;/code&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Update state with useReducer synchronously]]></title><description><![CDATA[Hooks in Reacts are wonderful to work with and managing local state is one of the most common ones. For more complex states the  useState()  hook could be changed to a  useReducer()  instead. A problem we might encounter is that state isn't…]]></description><link>https://samuelsson.dev/update-state-with-usereducer-synchronously/</link><guid isPermaLink="false">https://samuelsson.dev/update-state-with-usereducer-synchronously/</guid><pubDate>Fri, 24 Jan 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Hooks in Reacts are wonderful to work with and managing local state is one of the most common ones. For more complex states the &lt;code class=&quot;language-text&quot;&gt;useState()&lt;/code&gt; hook could be changed to a &lt;code class=&quot;language-text&quot;&gt;useReducer()&lt;/code&gt; instead. A problem we might encounter is that state isn&amp;#x27;t updated synchronously after we&amp;#x27;ve updated it.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s say we have this simplified &lt;code class=&quot;language-text&quot;&gt;useReducer&lt;/code&gt; just updating either first name or last name in a state object.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;typescript&quot;&gt;&lt;pre class=&quot;language-typescript&quot;&gt;&lt;code class=&quot;language-typescript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; initialValue &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  firstName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;Bobby&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  lastName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;Andersson&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; reducer &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;state&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; State&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; action&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; Action&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; State &lt;span class=&quot;token operator&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;action&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;type&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;firstName&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;...&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; firstName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; action&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;payload &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;lastName&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;...&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; lastName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; action&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;payload &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; state&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; dispatch&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;useReducer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;reducer&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; initialValue&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So every time we call the dispatch function with a type of either &lt;code class=&quot;language-text&quot;&gt;firstName&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;lastName&lt;/code&gt; the &lt;code class=&quot;language-text&quot;&gt;state&lt;/code&gt; object get&amp;#x27;s updated.&lt;/p&gt;&lt;p&gt;So if we would do the following the the output in the console would be &lt;code class=&quot;language-text&quot;&gt;Erik&lt;/code&gt;, right?&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;typescript&quot;&gt;&lt;pre class=&quot;language-typescript&quot;&gt;&lt;code class=&quot;language-typescript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;dispatch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; type&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;firstName&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; payload&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;Erik&amp;#x27;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token builtin&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;firstName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Wrong! It would still be &lt;code class=&quot;language-text&quot;&gt;Bobby&lt;/code&gt; output on &lt;code class=&quot;language-text&quot;&gt;state.firstName&lt;/code&gt; even though we changed first name to Erik at the previous line. How strange 🤔&lt;/p&gt;&lt;p&gt;The reason is that this is an asynchronous function that is returning a new state instead of mutating the existing one. So when we are logging to console, which is a side effect, the new state actually hasn&amp;#x27;t been updated yet. If we do another dispatch with a new name it will output &lt;code class=&quot;language-text&quot;&gt;Erik&lt;/code&gt; that time, it will always be one behind.&lt;/p&gt;&lt;p&gt;A simple solution to this is using &lt;code class=&quot;language-text&quot;&gt;useEffect&lt;/code&gt; for whenever &lt;code class=&quot;language-text&quot;&gt;state&lt;/code&gt; is updated and put our logic in that function instead.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;typescript&quot;&gt;&lt;pre class=&quot;language-typescript&quot;&gt;&lt;code class=&quot;language-typescript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;dispatch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; type&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;firstName&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; payload&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;Erik&amp;#x27;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token function&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token builtin&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;firstName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This way we will always get the correct state logged to our console.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Partial types in TypeScript]]></title><description><![CDATA[TypeScript is great for many reasons and when getting past the first few steps it really makes developing a joy. With that said there may come a time when objects keep growing in size and maybe not all properties will exist all the time…]]></description><link>https://samuelsson.dev/partial-types-in-typescript/</link><guid isPermaLink="false">https://samuelsson.dev/partial-types-in-typescript/</guid><pubDate>Thu, 21 Nov 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;TypeScript is great for many reasons and when getting past the first few steps it really makes developing a joy. With that said there may come a time when objects keep growing in size and maybe not all properties will exist all the time.&lt;/p&gt;&lt;p&gt;Say we have a user interface that looks like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;typescript&quot;&gt;&lt;pre class=&quot;language-typescript&quot;&gt;&lt;code class=&quot;language-typescript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  firstName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  lastName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  dateCreated&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; Date&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All users have a first and last name but also a date when it was created. The date should always exist on the user object so it&amp;#x27;s not optional (by putting a question mark after the property name like &lt;code class=&quot;language-text&quot;&gt;dateCreated?:&lt;/code&gt;).&lt;/p&gt;&lt;p&gt;We then have a simple function that creates a new user by posting to our API. The user doesn&amp;#x27;t have a &lt;code class=&quot;language-text&quot;&gt;dateCreated&lt;/code&gt; yet because it will be set when saved to the database.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;typescript&quot;&gt;&lt;pre class=&quot;language-typescript&quot;&gt;&lt;code class=&quot;language-typescript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; createUser &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;user&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; User&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// Here we call our API&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; newUser &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  firstName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;Erik&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  lastName&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;Samuelsson&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token function&quot;&gt;createUser&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;newUser&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unfortunately we will get an error when invoking &lt;code class=&quot;language-text&quot;&gt;createUser&lt;/code&gt; telling us that &lt;code class=&quot;language-text&quot;&gt;newUser&lt;/code&gt; parameter is missing &lt;code class=&quot;language-text&quot;&gt;dateCreated&lt;/code&gt;. But as we said we don&amp;#x27;t know when it will actually be created and we can&amp;#x27;t just set it ourselves in the payload. Oh no, this really sucks hard time... or does it?&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;Partial&lt;/code&gt; to the rescue 💪🏻&lt;/p&gt;&lt;p&gt;If we change our &lt;code class=&quot;language-text&quot;&gt;createUser&lt;/code&gt; function to this instead we can send a partial part of the user object.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;typescript&quot;&gt;&lt;pre class=&quot;language-typescript&quot;&gt;&lt;code class=&quot;language-typescript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; createUser &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;user&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; Partial&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;User&lt;span class=&quot;token operator&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// Here we call our API&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will tell our function that it&amp;#x27;s okay to not have every property on the argument, the user object. This way we don&amp;#x27;t have to modify the actual interface just for this occurrence and we still know that &lt;code class=&quot;language-text&quot;&gt;dateCreated&lt;/code&gt; should exist on the user.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Difference between dependencies, devDependencies and peerDependencies in npm]]></title><description><![CDATA[When creating a new npm project, all those with a  package.json  in the root directory, we usually don't create everything from scratch but need some dependencies. There are different type of dependencies that can be somewhat difficult to…]]></description><link>https://samuelsson.dev/difference-between-npm-dependencies/</link><guid isPermaLink="false">https://samuelsson.dev/difference-between-npm-dependencies/</guid><pubDate>Mon, 30 Sep 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When creating a new npm project, all those with a &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt; in the root directory, we usually don&amp;#x27;t create everything from scratch but need some dependencies. There are different type of dependencies that can be somewhat difficult to keep apart. I&amp;#x27;ll explain the differences between the three most common with a real world example.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s say we are developing a simple react component that will display the current date in text, like &amp;quot;Today is November 21st&amp;quot;. We want to be able to import and use that component in a React app by installing it with &lt;code class=&quot;language-text&quot;&gt;yarn add cool-date-text-component&lt;/code&gt; (or whatever we call it).&lt;/p&gt;&lt;h2&gt;Dependencies&lt;/h2&gt;&lt;p&gt;This is a list of third-party packages that our package/project directly depend on to be able to work at all.&lt;/p&gt;&lt;p&gt;In our example we need a package to get day and month of a Date object. &lt;code class=&quot;language-text&quot;&gt;date-fns&lt;/code&gt; can do that for us. We use it as &lt;code class=&quot;language-text&quot;&gt;import { getDate } from &amp;#x27;date-fns&amp;#x27;&lt;/code&gt; and without this package our code wouldn&amp;#x27;t work.&lt;/p&gt;&lt;p&gt;We add it with any of:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;yarn add date-fns&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;npm install date-fns&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;And it will look like this in our &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt;:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token property&quot;&gt;&amp;quot;dependencies&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;date-fns&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;^2.0.1&amp;quot;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;devDependencies&lt;/h2&gt;&lt;p&gt;These dependencies are required only when developing our package and will not be necessary when only using it. These can be packages for linting, compiling and running the dev environment.&lt;/p&gt;&lt;p&gt;In our example we want to ensure the code is correct with no errors so we want linting with &lt;code class=&quot;language-text&quot;&gt;eslint&lt;/code&gt;. This package is only used in our IDE and is never imported in our code. &lt;code class=&quot;language-text&quot;&gt;devDependencies&lt;/code&gt; could be used when building/compiling the package, like &lt;code class=&quot;language-text&quot;&gt;TypeScript&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;babel&lt;/code&gt;, but they are never used in the published package.&lt;/p&gt;&lt;p&gt;We add it with any of:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;yarn add eslint --dev&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;npm install eslint --save-dev&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;And it will look like this in our &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt;:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token property&quot;&gt;&amp;quot;devDependencies&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;eslint&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;^6.2.2&amp;quot;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;peerDependencies&lt;/h2&gt;&lt;p&gt;This is usually the trickier one to grasp when first working with dependencies. &lt;code class=&quot;language-text&quot;&gt;peerDependencies&lt;/code&gt; are packages required to be installed in the application using your package, it expresses compatibility. That means if someone wants to use your package they also need to install these dependencies.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;peerDependencies are packages required to be installed in the application using your package.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;In our example we have created a React component and if someone wants to use it they need React to be installed, it can&amp;#x27;t be used in a Vue project for example. So React is simply a peer dependency.&lt;/p&gt;&lt;p&gt;You may ask why React isn&amp;#x27;t a normal dependency under &lt;code class=&quot;language-text&quot;&gt;dependencies&lt;/code&gt; instead when it is required for the code to work. That is true but in this case the component we&amp;#x27;ve developed is made for being used in an existing React application. If we&amp;#x27;d rather added it as a normal dependency it would mean our package is a self-contained React application which maybe could be used in a Vue or Angular app.&lt;/p&gt;&lt;p&gt;If adding it as a normal dependency in this case it would probably result in multiple version of React being installed, one for our package and one for the application using it. That can be a problem itself but also really unnecessary.&lt;/p&gt;&lt;p&gt;When adding peer dependencies you don&amp;#x27;t need to add an exact version if you want greater compatibility. I usually add them as lowest required version to make future versions work without errors. This works for less complex packages.&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;peerDependencies&lt;/code&gt; are better added manually and it will look like this in our &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt;:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token property&quot;&gt;&amp;quot;peerDependencies&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;react&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;&amp;gt;=16&amp;quot;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Bonus dependencies&lt;/h2&gt;&lt;p&gt;There are two more dependencies 🤯 I won&amp;#x27;t cover them in detail here but in short they are: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;optionalDependencies&lt;/code&gt; - Are exactly that, optional, and can be dependencies that doesn&amp;#x27;t work on all machines/browsers and in that case have a fallback.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;bundledDependencies&lt;/code&gt; - Are like normal dependencies but are rather bundled with the package instead of fetched from the npm registry.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title><![CDATA[Quiet Keyboard Build - KBD67 with Zilents v2]]></title><description><![CDATA[Time for another build. For this one I wanted it quiet and small but still with nice, tactile switches. My current board had Zealios v2 67g but they were slightly too heavy and way too loud to be my daily driver. The tactility was great…]]></description><link>https://samuelsson.dev/quiet-keyboard-build-kbd67-with-zilents-v2/</link><guid isPermaLink="false">https://samuelsson.dev/quiet-keyboard-build-kbd67-with-zilents-v2/</guid><pubDate>Fri, 16 Aug 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Time for another build. For this one I wanted it quiet and small but still with nice, tactile switches. My current board had Zealios v2 67g but they were slightly too heavy and way too loud to be my daily driver. The tactility was great though so there being an option for similar switches but much more quiet and a little lighter was an easy choice. The Zilents v2 62g by the same manufacturer, &lt;a href=&quot;https://zealpc.net/&quot;&gt;ZealPC&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For the case I wanted something small like a 60% but with arrow keys and a default bottom row layout. The choice here was also quite easy. The KBD67, a 65%-ish keyboard with a brass plate and extra brass weight underneath, making it heavy and robust. The extra weight and solid build quality should be great for a quiet build.&lt;/p&gt;&lt;p&gt;Before we start though, here&amp;#x27;s what we will build:&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAECAwT/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAABlfmSIYf/xAAaEAADAAMBAAAAAAAAAAAAAAAAAQIDEBEh/9oACAEBAAEFAphsWNIpexbk661//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGhAAAgIDAAAAAAAAAAAAAAAAAAECIRARMf/aAAgBAQAGPwI3Irg0i3j/xAAcEAEAAgEFAAAAAAAAAAAAAAABABEhEEFhgaH/2gAIAQEAAT8hJsO5ki/CUO67JgNS2cRTkdP/2gAMAwEAAgADAAAAEFwf/8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQMBAT8Qp//EABURAQEAAAAAAAAAAAAAAAAAABAh/9oACAECAQE/EIf/xAAcEAACAgIDAAAAAAAAAAAAAAABEQAhQVExYZH/2gAIAQEAAT8QHhE0xqBiQA5uA9rQ46i+X8XZXXkfRg3C8Gp//9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;KBD67 with Zilents v2 build - Finished keyboard&quot; title=&quot;KBD67 with Zilents v2 build - Finished keyboard&quot; src=&quot;/static/3be71581a21cc7690a735b82bfab5679/4b190/kbd67-cyan-iso-zilents-v2-0.jpg&quot; srcSet=&quot;/static/3be71581a21cc7690a735b82bfab5679/e07e9/kbd67-cyan-iso-zilents-v2-0.jpg 200w,/static/3be71581a21cc7690a735b82bfab5679/066f9/kbd67-cyan-iso-zilents-v2-0.jpg 400w,/static/3be71581a21cc7690a735b82bfab5679/4b190/kbd67-cyan-iso-zilents-v2-0.jpg 800w,/static/3be71581a21cc7690a735b82bfab5679/e5166/kbd67-cyan-iso-zilents-v2-0.jpg 1200w,/static/3be71581a21cc7690a735b82bfab5679/b17f8/kbd67-cyan-iso-zilents-v2-0.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Parts:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Case:&lt;/strong&gt; KBD67 Cyan&lt;/li&gt;&lt;li&gt;&lt;strong&gt;PCB:&lt;/strong&gt; KBD67 rev1&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Plate:&lt;/strong&gt; KBD67 Brass Plate&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Switches:&lt;/strong&gt; Zilents v2 62g&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Stabilizers:&lt;/strong&gt; Zeal Gold Plated PCB Mounted V2 &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Keycaps:&lt;/strong&gt; GMK Minimal BoW&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Artisan:&lt;/strong&gt; Clackeys Genkey White&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAIEAQX/xAAVAQEBAAAAAAAAAAAAAAAAAAACA//aAAwDAQACEAMQAAABVK9K5xWTX//EABkQAAIDAQAAAAAAAAAAAAAAAAABAgMRE//aAAgBAQABBQJc8koZgqRwFWz/xAAWEQEBAQAAAAAAAAAAAAAAAAABECH/2gAIAQMBAT8B0Z//xAAWEQEBAQAAAAAAAAAAAAAAAAARARD/2gAIAQIBAT8BYZ//xAAYEAADAQEAAAAAAAAAAAAAAAAAECEigf/aAAgBAQAGPwIyuqw//8QAGhAAAgMBAQAAAAAAAAAAAAAAAREAITFBUf/aAAgBAQABPyGm9w7sGIuk2XL2hPY9GHQLz2aCY8E//9oADAMBAAIAAwAAABBA/wD/xAAYEQEBAAMAAAAAAAAAAAAAAAABABEhQf/aAAgBAwEBPxAM3kGr/8QAGBEBAQADAAAAAAAAAAAAAAAAAQARIUH/2gAIAQIBAT8QHw7Lu//EAB0QAQACAgIDAAAAAAAAAAAAAAEAESExQVFhgcH/2gAIAQEAAT8QOtbtnA51GBoa0n3FPkBYaGogLkpUuluYYvS6PiZCl2oIYr5P/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Parts overview&quot; title=&quot;Parts overview&quot; src=&quot;/static/873c76b089b6a9a1cff353f157a84fc2/4b190/kbd67-cyan-iso-zilents-v2-1.jpg&quot; srcSet=&quot;/static/873c76b089b6a9a1cff353f157a84fc2/e07e9/kbd67-cyan-iso-zilents-v2-1.jpg 200w,/static/873c76b089b6a9a1cff353f157a84fc2/066f9/kbd67-cyan-iso-zilents-v2-1.jpg 400w,/static/873c76b089b6a9a1cff353f157a84fc2/4b190/kbd67-cyan-iso-zilents-v2-1.jpg 800w,/static/873c76b089b6a9a1cff353f157a84fc2/e5166/kbd67-cyan-iso-zilents-v2-1.jpg 1200w,/static/873c76b089b6a9a1cff353f157a84fc2/b17f8/kbd67-cyan-iso-zilents-v2-1.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;An overview of some of the parts before building.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAMBBAX/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAABZW1FxAC//8QAGRABAAIDAAAAAAAAAAAAAAAAAQIDERIg/9oACAEBAAEFAp17hRETPH//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAVEQEBAAAAAAAAAAAAAAAAAAAQEf/aAAgBAgEBPwGn/8QAGxAAAgEFAAAAAAAAAAAAAAAAAREQAAIhQWH/2gAIAQEABj8CVxKrco57H//EABkQAAMBAQEAAAAAAAAAAAAAAAABESExQf/aAAgBAQABPyGVCeFI4nMGRTGMVxPAcR//2gAMAwEAAgADAAAAEI/v/8QAFREBAQAAAAAAAAAAAAAAAAAAARD/2gAIAQMBAT8QSf/EABYRAQEBAAAAAAAAAAAAAAAAAAABEf/aAAgBAgEBPxCGv//EABsQAQACAwEBAAAAAAAAAAAAAAEAESExUUFh/9oACAEBAAE/EEWHMX8ubR7QWsGDFtXLAWoZ7Ff1BABd8iap/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Preparing lubing the switches&quot; title=&quot;Preparing lubing the switches&quot; src=&quot;/static/77051ae62bc19f36ed430eebabd78d3f/4b190/kbd67-cyan-iso-zilents-v2-2.jpg&quot; srcSet=&quot;/static/77051ae62bc19f36ed430eebabd78d3f/e07e9/kbd67-cyan-iso-zilents-v2-2.jpg 200w,/static/77051ae62bc19f36ed430eebabd78d3f/066f9/kbd67-cyan-iso-zilents-v2-2.jpg 400w,/static/77051ae62bc19f36ed430eebabd78d3f/4b190/kbd67-cyan-iso-zilents-v2-2.jpg 800w,/static/77051ae62bc19f36ed430eebabd78d3f/e5166/kbd67-cyan-iso-zilents-v2-2.jpg 1200w,/static/77051ae62bc19f36ed430eebabd78d3f/b17f8/kbd67-cyan-iso-zilents-v2-2.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;For best sound all the switches were lubed. My back still hurts.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAABAAC/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAXGWSXcqP//EABkQAQADAQEAAAAAAAAAAAAAAAEAAgMRE//aAAgBAQABBQJABzXpNc/SueFqXn//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAbEAACAgMBAAAAAAAAAAAAAAAAEQECEDGBMv/aAAgBAQAGPwJzo9M1aeCaItNuY//EABsQAQABBQEAAAAAAAAAAAAAAAEAEBEhQVEx/9oACAEBAAE/IWSWG4jUo8vgJyJ0gLhQYHGlP//aAAwDAQACAAMAAAAQ8A//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAdEAEAAgICAwAAAAAAAAAAAAABABEhQTFhgZGh/9oACAEBAAE/EBLEtXBMh0R6A29yzzA19gKoNiZvG5SUXwLY9xLZ/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Lubing the switch house&quot; title=&quot;Lubing the switch house&quot; src=&quot;/static/dcc8970aeb8b1d97c477ac5c655d536d/4b190/kbd67-cyan-iso-zilents-v2-3.jpg&quot; srcSet=&quot;/static/dcc8970aeb8b1d97c477ac5c655d536d/e07e9/kbd67-cyan-iso-zilents-v2-3.jpg 200w,/static/dcc8970aeb8b1d97c477ac5c655d536d/066f9/kbd67-cyan-iso-zilents-v2-3.jpg 400w,/static/dcc8970aeb8b1d97c477ac5c655d536d/4b190/kbd67-cyan-iso-zilents-v2-3.jpg 800w,/static/dcc8970aeb8b1d97c477ac5c655d536d/e5166/kbd67-cyan-iso-zilents-v2-3.jpg 1200w,/static/dcc8970aeb8b1d97c477ac5c655d536d/b17f8/kbd67-cyan-iso-zilents-v2-3.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Ths inside of the housing was lubed where the stem slides against the walls.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEAf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAG6GnISND//xAAbEAACAQUAAAAAAAAAAAAAAAABAgADEBITIf/aAAgBAQABBQIrKuQgHNoeBQtv/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGxAAAgEFAAAAAAAAAAAAAAAAABABESEiI1H/2gAIAQEABj8CNdJ6sCy//8QAGxABAQADAAMAAAAAAAAAAAAAAREAITEQQVH/2gAIAQEAAT8hHDwR495UKRm8QG0WfLgrBXr4/9oADAMBAAIAAwAAABB3/wD/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPxBn/8QAFREBAQAAAAAAAAAAAAAAAAAAARD/2gAIAQIBAT8QJ//EABoQAQACAwEAAAAAAAAAAAAAAAEAESExUUH/2gAIAQEAAT8QR5CiwePI5GvpCOMJUlBckZQ4Vt3yUUHsirY7n//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Lubing the switch stem&quot; title=&quot;Lubing the switch stem&quot; src=&quot;/static/46015bd6b82eb30b2d8309f5254acc62/4b190/kbd67-cyan-iso-zilents-v2-4.jpg&quot; srcSet=&quot;/static/46015bd6b82eb30b2d8309f5254acc62/e07e9/kbd67-cyan-iso-zilents-v2-4.jpg 200w,/static/46015bd6b82eb30b2d8309f5254acc62/066f9/kbd67-cyan-iso-zilents-v2-4.jpg 400w,/static/46015bd6b82eb30b2d8309f5254acc62/4b190/kbd67-cyan-iso-zilents-v2-4.jpg 800w,/static/46015bd6b82eb30b2d8309f5254acc62/e5166/kbd67-cyan-iso-zilents-v2-4.jpg 1200w,/static/46015bd6b82eb30b2d8309f5254acc62/b17f8/kbd67-cyan-iso-zilents-v2-4.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;The back and sides were lightly lubed.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABAACA//EABUBAQEAAAAAAAAAAAAAAAAAAAEA/9oADAMBAAIQAxAAAAF/BRBZai//xAAaEAEBAAIDAAAAAAAAAAAAAAACAQARAwQS/9oACAEBAAEFArow8x9axGKHrSPP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAHBAAAgICAwAAAAAAAAAAAAAAAREAEAISMUFR/9oACAEBAAY/AnkVEe+KRmxL8r//xAAZEAACAwEAAAAAAAAAAAAAAAABEQAQMWH/2gAIAQEAAT8hJQB2EZmVC/sTPhT/2gAMAwEAAgADAAAAEKD/AP/EABURAQEAAAAAAAAAAAAAAAAAABAR/9oACAEDAQE/EIf/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAgEBPxAn/8QAGxAAAgMAAwAAAAAAAAAAAAAAAREAIVFBgbH/2gAIAQEAAT8Qu8KZc5AYRJoqiZCu2saDojAwVGXXnUIn/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Finished lubing a switch&quot; title=&quot;Finished lubing a switch&quot; src=&quot;/static/e7d8b4a8e17cc91dd9cc7523f271d77c/4b190/kbd67-cyan-iso-zilents-v2-5.jpg&quot; srcSet=&quot;/static/e7d8b4a8e17cc91dd9cc7523f271d77c/e07e9/kbd67-cyan-iso-zilents-v2-5.jpg 200w,/static/e7d8b4a8e17cc91dd9cc7523f271d77c/066f9/kbd67-cyan-iso-zilents-v2-5.jpg 400w,/static/e7d8b4a8e17cc91dd9cc7523f271d77c/4b190/kbd67-cyan-iso-zilents-v2-5.jpg 800w,/static/e7d8b4a8e17cc91dd9cc7523f271d77c/e5166/kbd67-cyan-iso-zilents-v2-5.jpg 1200w,/static/e7d8b4a8e17cc91dd9cc7523f271d77c/b17f8/kbd67-cyan-iso-zilents-v2-5.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;All the springs were bag lubed. I put them all in a zip lock bag with some lube and then shaking for a couple of minutes.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAME/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAclcZJBf/8QAHBAAAQUAAwAAAAAAAAAAAAAAAQACAxESEyEy/9oACAEBAAEFAosYJjT/AFy9CakX2v/EABYRAAMAAAAAAAAAAAAAAAAAAAEQEf/aAAgBAwEBPwGBf//EABYRAAMAAAAAAAAAAAAAAAAAAAEQEf/aAAgBAgEBPwGlf//EAB0QAAEDBQEAAAAAAAAAAAAAAAABETICISIzcaH/2gAIAQEABj8CypVV4a/CwzEXIn//xAAaEAADAAMBAAAAAAAAAAAAAAAAAREhMWGB/9oACAEBAAE/IYIIKrYRURGtNejGeHDYp7C9P//aAAwDAQACAAMAAAAQBM//xAAWEQADAAAAAAAAAAAAAAAAAAAAARH/2gAIAQMBAT8QbiQ//8QAFhEBAQEAAAAAAAAAAAAAAAAAABFh/9oACAECAQE/EMFf/8QAGxABAQEBAAMBAAAAAAAAAAAAAREAITFBodH/2gAIAQEAAT8Q6lXaV9yxBA9n9zuZegkmUAAiY6Il8iYqpiQU3//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Comparing brass and aluminum plate&quot; title=&quot;Comparing brass and aluminum plate&quot; src=&quot;/static/9306c7d6230042f1ea7ea314ad3f68d5/4b190/kbd67-cyan-iso-zilents-v2-6.jpg&quot; srcSet=&quot;/static/9306c7d6230042f1ea7ea314ad3f68d5/e07e9/kbd67-cyan-iso-zilents-v2-6.jpg 200w,/static/9306c7d6230042f1ea7ea314ad3f68d5/066f9/kbd67-cyan-iso-zilents-v2-6.jpg 400w,/static/9306c7d6230042f1ea7ea314ad3f68d5/4b190/kbd67-cyan-iso-zilents-v2-6.jpg 800w,/static/9306c7d6230042f1ea7ea314ad3f68d5/e5166/kbd67-cyan-iso-zilents-v2-6.jpg 1200w,/static/9306c7d6230042f1ea7ea314ad3f68d5/b17f8/kbd67-cyan-iso-zilents-v2-6.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;The default plate was made of aluminum but a brass plate is much more sturdy (and way heavier).&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAQBAgX/xAAVAQEBAAAAAAAAAAAAAAAAAAACA//aAAwDAQACEAMQAAABiiTqjmgGv//EABsQAAICAwEAAAAAAAAAAAAAAAERAgMABBIT/9oACAEBAAEFAuIHPHLhxONobK2C7f/EABcRAQEBAQAAAAAAAAAAAAAAAAEAETH/2gAIAQMBAT8BXOxf/8QAFREBAQAAAAAAAAAAAAAAAAAAEBH/2gAIAQIBAT8Bh//EABwQAAICAgMAAAAAAAAAAAAAAAABESEQMUFRYf/aAAgBAQAGPwLQ9qF3yR4TaZdrH//EABsQAQACAwEBAAAAAAAAAAAAABEAASExQVFh/9oACAEBAAE/IfCUOw3arZCYM3wuZ8rvJW6TL7Gr+VP/2gAMAwEAAgADAAAAEBgv/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAEx/9oACAEDAQE/EKjL/8QAFxEAAwEAAAAAAAAAAAAAAAAAAAExEf/aAAgBAgEBPxBag6f/xAAcEAEBAAIDAQEAAAAAAAAAAAABEQAhMUFRsdH/2gAIAQEAAT8QmEXhSLziwXvwxJg8Q80Cw/MAxqhk2lwj8SK19weoYS5X3vNPzRLZrP/Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Mounted brass plate&quot; title=&quot;Mounted brass plate&quot; src=&quot;/static/e956d18e426e656d0ef75a18bf5789e2/4b190/kbd67-cyan-iso-zilents-v2-7.jpg&quot; srcSet=&quot;/static/e956d18e426e656d0ef75a18bf5789e2/e07e9/kbd67-cyan-iso-zilents-v2-7.jpg 200w,/static/e956d18e426e656d0ef75a18bf5789e2/066f9/kbd67-cyan-iso-zilents-v2-7.jpg 400w,/static/e956d18e426e656d0ef75a18bf5789e2/4b190/kbd67-cyan-iso-zilents-v2-7.jpg 800w,/static/e956d18e426e656d0ef75a18bf5789e2/e5166/kbd67-cyan-iso-zilents-v2-7.jpg 1200w,/static/e956d18e426e656d0ef75a18bf5789e2/b17f8/kbd67-cyan-iso-zilents-v2-7.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;The color works good with the cyan in my opinion.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAIEAwX/xAAVAQEBAAAAAAAAAAAAAAAAAAABAP/aAAwDAQACEAMQAAABaZ7S5puJ/8QAGhABAAIDAQAAAAAAAAAAAAAAAgEDABESBP/aAAgBAQABBQKb7MslIx3pKCjvmfXUc//EABURAQEAAAAAAAAAAAAAAAAAABAR/9oACAEDAQE/AYf/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAgEBPwFZ/8QAHhAAAgEEAwEAAAAAAAAAAAAAAAECAxEhIhJBUaH/2gAIAQEABj8Cu6lkYlJmKn0bfbN9YloUeS9Z/8QAGhAAAwEBAQEAAAAAAAAAAAAAAAERITFhcf/aAAgBAQABPyGTEdSRmX+4P2p7IroKM5jqlcGUqQ//2gAMAwEAAgADAAAAEGsf/8QAFxEBAQEBAAAAAAAAAAAAAAAAAQARMf/aAAgBAwEBPxAD1sL/xAAXEQEBAQEAAAAAAAAAAAAAAAABABEx/9oACAECAQE/EEOFrf/EAB4QAQEAAgICAwAAAAAAAAAAAAERADEhUUGBkaGx/9oACAEBAAE/EOM3cweqG8uTLaMjxbxvJcfSs9LgS6DAoutYAVljV+D7zRkIoL8i5//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Overview of desk when cutting foam&quot; title=&quot;Overview of desk when cutting foam&quot; src=&quot;/static/e5096ea1d26dd4ef7e9f162824048956/4b190/kbd67-cyan-iso-zilents-v2-8.jpg&quot; srcSet=&quot;/static/e5096ea1d26dd4ef7e9f162824048956/e07e9/kbd67-cyan-iso-zilents-v2-8.jpg 200w,/static/e5096ea1d26dd4ef7e9f162824048956/066f9/kbd67-cyan-iso-zilents-v2-8.jpg 400w,/static/e5096ea1d26dd4ef7e9f162824048956/4b190/kbd67-cyan-iso-zilents-v2-8.jpg 800w,/static/e5096ea1d26dd4ef7e9f162824048956/e5166/kbd67-cyan-iso-zilents-v2-8.jpg 1200w,/static/e5096ea1d26dd4ef7e9f162824048956/b17f8/kbd67-cyan-iso-zilents-v2-8.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;A messy desk while cutting the foam to be placed between the PCB and mounting plate.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAMBBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAACAAH/2gAMAwEAAhADEAAAAarcx20jAr//xAAcEAACAgIDAAAAAAAAAAAAAAABAgADERITFCH/2gAIAQEAAQUCqFPEOsZYq7o5WK/ucz//xAAWEQEBAQAAAAAAAAAAAAAAAAAAARH/2gAIAQMBAT8BjH//xAAWEQEBAQAAAAAAAAAAAAAAAAAAARH/2gAIAQIBAT8Bra//xAAcEAACAgIDAAAAAAAAAAAAAAAAAQIhESIxMpH/2gAIAQEABj8CTlFtnV+GnBRlqyz/xAAbEAACAgMBAAAAAAAAAAAAAAAAIQERMUFRkf/aAAgBAQABPyHumEaHuLSk82S7LgzYlvEl3aT/2gAMAwEAAgADAAAAEKPP/8QAFhEBAQEAAAAAAAAAAAAAAAAAABFh/9oACAEDAQE/ENIf/8QAGBEAAgMAAAAAAAAAAAAAAAAAABEBIUH/2gAIAQIBAT8QfCEWf//EAB4QAQACAgEFAAAAAAAAAAAAAAEAESFBMVFhcZHB/9oACAEBAAE/EOcZ3E71niUvGwn2GrCqgRMZMwurTbJ6ipZA1aHqJFF/cZ//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Preparing for band aid mod&quot; title=&quot;Preparing for band aid mod&quot; src=&quot;/static/603a34c9f915ff237dbf9cfffd4d85da/4b190/kbd67-cyan-iso-zilents-v2-9.jpg&quot; srcSet=&quot;/static/603a34c9f915ff237dbf9cfffd4d85da/e07e9/kbd67-cyan-iso-zilents-v2-9.jpg 200w,/static/603a34c9f915ff237dbf9cfffd4d85da/066f9/kbd67-cyan-iso-zilents-v2-9.jpg 400w,/static/603a34c9f915ff237dbf9cfffd4d85da/4b190/kbd67-cyan-iso-zilents-v2-9.jpg 800w,/static/603a34c9f915ff237dbf9cfffd4d85da/e5166/kbd67-cyan-iso-zilents-v2-9.jpg 1200w,/static/603a34c9f915ff237dbf9cfffd4d85da/b17f8/kbd67-cyan-iso-zilents-v2-9.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Stabilizers hitting the PCB isn&amp;#x27;t that great for a quiet keyboard. Easily fixed with the &amp;quot;band-aid mod&amp;quot; (even though any brand works of course).&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAABAAD/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAED/9oADAMBAAIQAxAAAAEeg0CI9lf/xAAbEAACAgMBAAAAAAAAAAAAAAAAAgEDBBESE//aAAgBAQABBQL2sk6ZjjIINpFa5FiR/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFhEBAQEAAAAAAAAAAAAAAAAAAAET/9oACAECAQE/AV0f/8QAIBAAAQMCBwAAAAAAAAAAAAAAAAECIQMyEBFRYYGhov/aAAgBAQAGPwK5xFbhYLvWGrndGSLG5//EABsQAAMAAgMAAAAAAAAAAAAAAAABESFRMXHx/9oACAEBAAE/IU9l3Qt42+DdAaDxakzUJWtOIp//2gAMAwEAAgADAAAAEJQf/8QAGBEBAQADAAAAAAAAAAAAAAAAAQARQVH/2gAIAQMBAT8QFd2Trf/EABgRAAMBAQAAAAAAAAAAAAAAAAABIRFB/9oACAECAQE/EHOFYlh//8QAHBABAAICAwEAAAAAAAAAAAAAAQARIVExQZHB/9oACAEBAAE/EMUY3yR4HHwp+uXsS7Wkn2W3F2JzUwxrOENEK7YAGrep/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Cutting small pieces of band aid&quot; title=&quot;Cutting small pieces of band aid&quot; src=&quot;/static/bfef442bceb8ec0d3d81d7197f9c1fce/4b190/kbd67-cyan-iso-zilents-v2-10.jpg&quot; srcSet=&quot;/static/bfef442bceb8ec0d3d81d7197f9c1fce/e07e9/kbd67-cyan-iso-zilents-v2-10.jpg 200w,/static/bfef442bceb8ec0d3d81d7197f9c1fce/066f9/kbd67-cyan-iso-zilents-v2-10.jpg 400w,/static/bfef442bceb8ec0d3d81d7197f9c1fce/4b190/kbd67-cyan-iso-zilents-v2-10.jpg 800w,/static/bfef442bceb8ec0d3d81d7197f9c1fce/e5166/kbd67-cyan-iso-zilents-v2-10.jpg 1200w,/static/bfef442bceb8ec0d3d81d7197f9c1fce/b17f8/kbd67-cyan-iso-zilents-v2-10.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Cutting small pieces of adhesive bandage to be placed on the PCB.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAQFAf/EABUBAQEAAAAAAAAAAAAAAAAAAAEC/9oADAMBAAIQAxAAAAFOi9gwy4Ff/8QAHBABAAIBBQAAAAAAAAAAAAAAAQIDAAQREiEx/9oACAEBAAEFAq6Jyw08dk4vQPrWSz//xAAVEQEBAAAAAAAAAAAAAAAAAAAAIf/aAAgBAwEBPwFH/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGhAAAwADAQAAAAAAAAAAAAAAAAERECExQf/aAAgBAQAGPwKyIa9I+m8WI//EABsQAAICAwEAAAAAAAAAAAAAAAERAEEhMWFx/9oACAEBAAE/IQbdRl6rgw5RoIS3gFq4BKPxXFZa7E//2gAMAwEAAgADAAAAEGQP/8QAFREBAQAAAAAAAAAAAAAAAAAAARD/2gAIAQMBAT8QGP/EABcRAQADAAAAAAAAAAAAAAAAAAABESH/2gAIAQIBAT8Qm2v/xAAcEAEBAAICAwAAAAAAAAAAAAABEQAhQVExYdH/2gAIAQEAAT8QMaDeVOw8uXJYGtR40aPmX0GJhhHWRul7wmiIpCITvjVMXtoAqnq3P//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Putting band aid on the PCB&quot; title=&quot;Putting band aid on the PCB&quot; src=&quot;/static/ba752e2bb078e12e48c167f6ad20c9a7/4b190/kbd67-cyan-iso-zilents-v2-11.jpg&quot; srcSet=&quot;/static/ba752e2bb078e12e48c167f6ad20c9a7/e07e9/kbd67-cyan-iso-zilents-v2-11.jpg 200w,/static/ba752e2bb078e12e48c167f6ad20c9a7/066f9/kbd67-cyan-iso-zilents-v2-11.jpg 400w,/static/ba752e2bb078e12e48c167f6ad20c9a7/4b190/kbd67-cyan-iso-zilents-v2-11.jpg 800w,/static/ba752e2bb078e12e48c167f6ad20c9a7/e5166/kbd67-cyan-iso-zilents-v2-11.jpg 1200w,/static/ba752e2bb078e12e48c167f6ad20c9a7/b17f8/kbd67-cyan-iso-zilents-v2-11.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Place the adhesive bandages on the PCB.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAc25QCD/xAAYEAACAwAAAAAAAAAAAAAAAAAAAhIgMf/aAAgBAQABBQLRljX/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAWEAADAAAAAAAAAAAAAAAAAAAAIHH/2gAIAQEABj8CKv8A/8QAGhABAQACAwAAAAAAAAAAAAAAAREAECExQf/aAAgBAQABPyEFQxIvimhnJ3l1/9oADAMBAAIAAwAAABCU3//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABoQAQEBAQEBAQAAAAAAAAAAAAERADEhcYH/2gAIAQEAAT8QkGvZvahAQsT9yox7rQGGiMyjnnzTf//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Stabilizer for the space bar&quot; title=&quot;Stabilizer for the space bar&quot; src=&quot;/static/99e82b96df5dce2759e5d1bd56d38947/4b190/kbd67-cyan-iso-zilents-v2-12.jpg&quot; srcSet=&quot;/static/99e82b96df5dce2759e5d1bd56d38947/e07e9/kbd67-cyan-iso-zilents-v2-12.jpg 200w,/static/99e82b96df5dce2759e5d1bd56d38947/066f9/kbd67-cyan-iso-zilents-v2-12.jpg 400w,/static/99e82b96df5dce2759e5d1bd56d38947/4b190/kbd67-cyan-iso-zilents-v2-12.jpg 800w,/static/99e82b96df5dce2759e5d1bd56d38947/e5166/kbd67-cyan-iso-zilents-v2-12.jpg 1200w,/static/99e82b96df5dce2759e5d1bd56d38947/b17f8/kbd67-cyan-iso-zilents-v2-12.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Then it was time to lube the stabilizers with dialectric grease. Lubed inside the housing and the parts where metal meets plastic.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAABQAE/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAASk9emUWdiv/xAAcEAABAwUAAAAAAAAAAAAAAAABAgMRAAQQEiH/2gAIAQEAAQUCT0i3OkRTDKW0kY//xAAWEQEBAQAAAAAAAAAAAAAAAAAAASH/2gAIAQMBAT8BjH//xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAgEBPwFn/8QAGhAAAgMBAQAAAAAAAAAAAAAAAAERIVECMf/aAAgBAQAGPwKESnZZvTJw8TP/xAAbEAEAAgIDAAAAAAAAAAAAAAABABEhMUFRYf/aAAgBAQABPyEIBa6JhAnZFOhT0wgnoYN4QF3qcs//2gAMAwEAAgADAAAAEDzP/8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQMBAT8Qgf/EABYRAQEBAAAAAAAAAAAAAAAAAAEAEf/aAAgBAgEBPxBNrf/EABsQAQEAAwEBAQAAAAAAAAAAAAERACExgWFx/9oACAEBAAE/EH5ugdchdIejxxA8+hHIal2Us6fDACzuFh7+YuqhECrn/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Mounted stabilizers for enter and backspace&quot; title=&quot;Mounted stabilizers for enter and backspace&quot; src=&quot;/static/9786aae97f410a1a3558f689b90c30f8/4b190/kbd67-cyan-iso-zilents-v2-13.jpg&quot; srcSet=&quot;/static/9786aae97f410a1a3558f689b90c30f8/e07e9/kbd67-cyan-iso-zilents-v2-13.jpg 200w,/static/9786aae97f410a1a3558f689b90c30f8/066f9/kbd67-cyan-iso-zilents-v2-13.jpg 400w,/static/9786aae97f410a1a3558f689b90c30f8/4b190/kbd67-cyan-iso-zilents-v2-13.jpg 800w,/static/9786aae97f410a1a3558f689b90c30f8/e5166/kbd67-cyan-iso-zilents-v2-13.jpg 1200w,/static/9786aae97f410a1a3558f689b90c30f8/b17f8/kbd67-cyan-iso-zilents-v2-13.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;All put together. Will dampen the sound of the larger keys.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQFAQP/xAAVAQEBAAAAAAAAAAAAAAAAAAABAP/aAAwDAQACEAMQAAABkVV9FI7Bf//EABoQAQEAAwEBAAAAAAAAAAAAAAIBAAMSBBT/2gAIAQEAAQUChVzVxNTNCHoJP0zG+7//xAAWEQEBAQAAAAAAAAAAAAAAAAAAARH/2gAIAQMBAT8BjH//xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAgEBPwFX/8QAHRABAAIBBQEAAAAAAAAAAAAAAQACEQMSITJyof/aAAgBAQAGPwLqwL6bnzEYG1cTin2Zaz//xAAbEAEBAQACAwAAAAAAAAAAAAABEQAxUSFhcf/aAAgBAQABPyESinYb2ADglIne8H0nMzOOfdGYsnO//9oADAMBAAIAAwAAABAw/wD/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPxAEf//EABYRAQEBAAAAAAAAAAAAAAAAAAEAEf/aAAgBAgEBPxBW1f/EAB0QAQADAAEFAAAAAAAAAAAAAAEAETFBIVFhocH/2gAIAQEAAT8QDKWJSFvyIVuWm3xFDLmq49RD9UqFmMrTvd8gyqDXDJ//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Testing the stabilizers&quot; title=&quot;Testing the stabilizers&quot; src=&quot;/static/d8f0c02e2d8fbbce1b31269eb0ebba1c/4b190/kbd67-cyan-iso-zilents-v2-14.jpg&quot; srcSet=&quot;/static/d8f0c02e2d8fbbce1b31269eb0ebba1c/e07e9/kbd67-cyan-iso-zilents-v2-14.jpg 200w,/static/d8f0c02e2d8fbbce1b31269eb0ebba1c/066f9/kbd67-cyan-iso-zilents-v2-14.jpg 400w,/static/d8f0c02e2d8fbbce1b31269eb0ebba1c/4b190/kbd67-cyan-iso-zilents-v2-14.jpg 800w,/static/d8f0c02e2d8fbbce1b31269eb0ebba1c/e5166/kbd67-cyan-iso-zilents-v2-14.jpg 1200w,/static/d8f0c02e2d8fbbce1b31269eb0ebba1c/b17f8/kbd67-cyan-iso-zilents-v2-14.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;To make sure they are lubed and screwed in properly it&amp;#x27;s a good idea to test them before soldering.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAEDBP/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHBpbiBYj//xAAZEAADAQEBAAAAAAAAAAAAAAAAAhEBEhP/2gAIAQEAAQUC8uREU1ZrFuWH/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAHRAAAgIBBQAAAAAAAAAAAAAAAAERIUEQIjFRof/aAAgBAQAGPwK34Zcc6X0bcWyGkf/EABwQAAIDAAMBAAAAAAAAAAAAAAERACExQVFhcf/aAAgBAQABPyE9HCeGuPkcBfIh2OdDfIDa6qk9mELgsn//2gAMAwEAAgADAAAAEITf/8QAFxEBAQEBAAAAAAAAAAAAAAAAAQARUf/aAAgBAwEBPxAe2t//xAAXEQEAAwAAAAAAAAAAAAAAAAAAASFh/9oACAECAQE/EJxb/8QAHRABAAMBAAIDAAAAAAAAAAAAAREhMQBBUWFxof/aAAgBAQABPxAHDUWnhjfh5cmMYIhLHJOA2R4c/OLF+mRskL6OXBehE/Jt5yfuYDmnf//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Double shot return key&quot; title=&quot;Double shot return key&quot; src=&quot;/static/ec08e9e364b9d09e9f61ba7d30a95c0d/4b190/kbd67-cyan-iso-zilents-v2-15.jpg&quot; srcSet=&quot;/static/ec08e9e364b9d09e9f61ba7d30a95c0d/e07e9/kbd67-cyan-iso-zilents-v2-15.jpg 200w,/static/ec08e9e364b9d09e9f61ba7d30a95c0d/066f9/kbd67-cyan-iso-zilents-v2-15.jpg 400w,/static/ec08e9e364b9d09e9f61ba7d30a95c0d/4b190/kbd67-cyan-iso-zilents-v2-15.jpg 800w,/static/ec08e9e364b9d09e9f61ba7d30a95c0d/e5166/kbd67-cyan-iso-zilents-v2-15.jpg 1200w,/static/ec08e9e364b9d09e9f61ba7d30a95c0d/b17f8/kbd67-cyan-iso-zilents-v2-15.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;The keycaps are made of double shot plastic for better wear and tear.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEAv/EABYBAQEBAAAAAAAAAAAAAAAAAAIBA//aAAwDAQACEAMQAAABxKiw6pKyj//EABsQAAICAwEAAAAAAAAAAAAAAAECAAMREhMx/9oACAEBAAEFAjSsNYzzWD1XKjef/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAEh/9oACAEDAQE/Aax//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGRABAAMBAQAAAAAAAAAAAAAAAQARIRCC/9oACAEBAAY/ArCNnXZiHmf/xAAcEAEAAwADAQEAAAAAAAAAAAABABEhQVFhobH/2gAIAQEAAT8hSNDFzfyGAMauef2LukshPXkHxXN22f/aAAwDAQACAAMAAAAQc8//xAAYEQEAAwEAAAAAAAAAAAAAAAABABEhMf/aAAgBAwEBPxC52LbSf//EABcRAQEBAQAAAAAAAAAAAAAAAAEAEVH/2gAIAQIBAT8QDljf/8QAGhABAQADAQEAAAAAAAAAAAAAAREAIWExQf/aAAgBAQABPxBKHhhBGBs7xmiS2PfDIau9xHkxu8In5tbVtB+/L3NhbSCTBW9d5//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Testing if the PCB works before soldering&quot; title=&quot;Testing if the PCB works before soldering&quot; src=&quot;/static/a71e796937283b8c365e798e74ad3b86/4b190/kbd67-cyan-iso-zilents-v2-16.jpg&quot; srcSet=&quot;/static/a71e796937283b8c365e798e74ad3b86/e07e9/kbd67-cyan-iso-zilents-v2-16.jpg 200w,/static/a71e796937283b8c365e798e74ad3b86/066f9/kbd67-cyan-iso-zilents-v2-16.jpg 400w,/static/a71e796937283b8c365e798e74ad3b86/4b190/kbd67-cyan-iso-zilents-v2-16.jpg 800w,/static/a71e796937283b8c365e798e74ad3b86/e5166/kbd67-cyan-iso-zilents-v2-16.jpg 1200w,/static/a71e796937283b8c365e798e74ad3b86/b17f8/kbd67-cyan-iso-zilents-v2-16.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;This should probably have been done earlier but testing the PCB so everything works. Easily done with Karabiner-EventViewer. The PCB had red under glow on by default but was disabled when flashing the PCB.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEAv/EABUBAQEAAAAAAAAAAAAAAAAAAAAC/9oADAMBAAIQAxAAAAGTCqBZUTX/xAAYEAADAQEAAAAAAAAAAAAAAAAAAQIRA//aAAgBAQABBQLXfKedIcYR1aF003T/xAAWEQEBAQAAAAAAAAAAAAAAAAAAARH/2gAIAQMBAT8BjH//xAAWEQEBAQAAAAAAAAAAAAAAAAAAARH/2gAIAQIBAT8BrX//xAAZEAACAwEAAAAAAAAAAAAAAAAAEAERMjH/2gAIAQEABj8CwZVVBxf/xAAZEAEBAQEBAQAAAAAAAAAAAAABEQBBITH/2gAIAQEAAT8hZVt6OtW6T3mVRI4E8Bn4Gfrv/9oADAMBAAIAAwAAABCL7//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/ECX/xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAgEBPxClv//EABwQAQEBAAMAAwAAAAAAAAAAAAERACExYVGBkf/aAAgBAQABPxAUEWhAG/u9yBH2Pc1UHY4OsELdxyj5FwOyL3zbv//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Preparing to solder the board&quot; title=&quot;Preparing to solder the board&quot; src=&quot;/static/7aa3a3e38ad87a98f213575e598821a6/4b190/kbd67-cyan-iso-zilents-v2-17.jpg&quot; srcSet=&quot;/static/7aa3a3e38ad87a98f213575e598821a6/e07e9/kbd67-cyan-iso-zilents-v2-17.jpg 200w,/static/7aa3a3e38ad87a98f213575e598821a6/066f9/kbd67-cyan-iso-zilents-v2-17.jpg 400w,/static/7aa3a3e38ad87a98f213575e598821a6/4b190/kbd67-cyan-iso-zilents-v2-17.jpg 800w,/static/7aa3a3e38ad87a98f213575e598821a6/e5166/kbd67-cyan-iso-zilents-v2-17.jpg 1200w,/static/7aa3a3e38ad87a98f213575e598821a6/b17f8/kbd67-cyan-iso-zilents-v2-17.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Time for soldering. Starting with the corners to keep it all in place before doing the rest.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAECAwT/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/9oADAMBAAIQAxAAAAFFucSIE6f/xAAcEAACAQUBAAAAAAAAAAAAAAABAgADERITIUL/2gAIAQEAAQUCx4SFmwz3UCWKs8//xAAXEQADAQAAAAAAAAAAAAAAAAAAARES/9oACAEDAQE/AVDDP//EABYRAQEBAAAAAAAAAAAAAAAAAAABEf/aAAgBAgEBPwGtf//EABoQAAICAwAAAAAAAAAAAAAAAAABEYECECH/2gAIAQEABj8CvXIJToWSJP/EABoQAAMBAQEBAAAAAAAAAAAAAAERIQAxgWH/2gAIAQEAAT8hBEYgYPzWTa5zN5XGclesE6C66sUkD3f/2gAMAwEAAgADAAAAEFcP/8QAFxEBAQEBAAAAAAAAAAAAAAAAAQARMf/aAAgBAwEBPxBJteF//8QAFhEBAQEAAAAAAAAAAAAAAAAAAQAR/9oACAECAQE/EAhZv//EABwQAQACAgMBAAAAAAAAAAAAAAERIQAxQWFxof/aAAgBAQABPxBqIg8B4xaCKhIIe73iIQxqQvu7wBILWE7bcVwmwAFNkc4KuTTb5n//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Half of the switches soldered to the board&quot; title=&quot;Half of the switches soldered to the board&quot; src=&quot;/static/fca6502d02b9f3b3cd20dc18af80bf11/4b190/kbd67-cyan-iso-zilents-v2-18.jpg&quot; srcSet=&quot;/static/fca6502d02b9f3b3cd20dc18af80bf11/e07e9/kbd67-cyan-iso-zilents-v2-18.jpg 200w,/static/fca6502d02b9f3b3cd20dc18af80bf11/066f9/kbd67-cyan-iso-zilents-v2-18.jpg 400w,/static/fca6502d02b9f3b3cd20dc18af80bf11/4b190/kbd67-cyan-iso-zilents-v2-18.jpg 800w,/static/fca6502d02b9f3b3cd20dc18af80bf11/e5166/kbd67-cyan-iso-zilents-v2-18.jpg 1200w,/static/fca6502d02b9f3b3cd20dc18af80bf11/b17f8/kbd67-cyan-iso-zilents-v2-18.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Going row-by-row from the top.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAQFAf/EABYBAQEBAAAAAAAAAAAAAAAAAAECA//aAAwDAQACEAMQAAABntTsGmKkaf/EABoQAAIDAQEAAAAAAAAAAAAAAAABAgMREhP/2gAIAQEAAQUChRsVRBHFJ6zzWxM//8QAFhEBAQEAAAAAAAAAAAAAAAAAAAEh/9oACAEDAQE/AYx//8QAFREBAQAAAAAAAAAAAAAAAAAAACH/2gAIAQIBAT8BV//EABkQAAIDAQAAAAAAAAAAAAAAAAERABAhEv/aAAgBAQAGPwIHqa6XWTS6/8QAGhABAAIDAQAAAAAAAAAAAAAAAQARITFxgf/aAAgBAQABPyE2di6CbB6ZwgJKBjEGWnTME//aAAwDAQACAAMAAAAQ1z//xAAWEQADAAAAAAAAAAAAAAAAAAABEBH/2gAIAQMBAT8QgJ//xAAXEQEBAQEAAAAAAAAAAAAAAAABABFR/9oACAECAQE/EEWzq//EABoQAQEBAQEBAQAAAAAAAAAAAAERADEhUYH/2gAIAQEAAT8QR2S6gOIaJ2BkpH9q43yQAPJO65V9RwJ83//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;All the switches soldered to the board&quot; title=&quot;All the switches soldered to the board&quot; src=&quot;/static/f9c14d55f26319c85ca777139f5d7496/4b190/kbd67-cyan-iso-zilents-v2-19.jpg&quot; srcSet=&quot;/static/f9c14d55f26319c85ca777139f5d7496/e07e9/kbd67-cyan-iso-zilents-v2-19.jpg 200w,/static/f9c14d55f26319c85ca777139f5d7496/066f9/kbd67-cyan-iso-zilents-v2-19.jpg 400w,/static/f9c14d55f26319c85ca777139f5d7496/4b190/kbd67-cyan-iso-zilents-v2-19.jpg 800w,/static/f9c14d55f26319c85ca777139f5d7496/e5166/kbd67-cyan-iso-zilents-v2-19.jpg 1200w,/static/f9c14d55f26319c85ca777139f5d7496/b17f8/kbd67-cyan-iso-zilents-v2-19.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Everything soldered together and it still works when testing, great success!&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAEDBP/EABUBAQEAAAAAAAAAAAAAAAAAAAEC/9oADAMBAAIQAxAAAAHHSDYkIL//xAAZEAEBAQEBAQAAAAAAAAAAAAACAQMAExT/2gAIAQEAAQUCGCR+V85Qpo5PbTlar//EABURAQEAAAAAAAAAAAAAAAAAABAi/9oACAEDAQE/AaP/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAYEAADAQEAAAAAAAAAAAAAAAAAARExof/aAAgBAQAGPwKqGojImbwrP//EABoQAQEAAwEBAAAAAAAAAAAAAAEAMVFhEfH/2gAIAQEAAT8hHN4dt9Gd5jUKABy4ZlS3/9oADAMBAAIAAwAAABBAD//EABgRAQEAAwAAAAAAAAAAAAAAABEAASEx/9oACAEDAQE/EB9sJu//xAAVEQEBAAAAAAAAAAAAAAAAAAAQIf/aAAgBAgEBPxCH/8QAGBABAQEBAQAAAAAAAAAAAAAAAREAMeH/2gAIAQEAAT8QBTGhB0yp6oQwbxjgRAlz4zWoRlCb/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Putting dampening material around the case&quot; title=&quot;Putting dampening material around the case&quot; src=&quot;/static/099737e7d969546e7c1d86dcb6429699/4b190/kbd67-cyan-iso-zilents-v2-20.jpg&quot; srcSet=&quot;/static/099737e7d969546e7c1d86dcb6429699/e07e9/kbd67-cyan-iso-zilents-v2-20.jpg 200w,/static/099737e7d969546e7c1d86dcb6429699/066f9/kbd67-cyan-iso-zilents-v2-20.jpg 400w,/static/099737e7d969546e7c1d86dcb6429699/4b190/kbd67-cyan-iso-zilents-v2-20.jpg 800w,/static/099737e7d969546e7c1d86dcb6429699/e5166/kbd67-cyan-iso-zilents-v2-20.jpg 1200w,/static/099737e7d969546e7c1d86dcb6429699/b17f8/kbd67-cyan-iso-zilents-v2-20.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;To minimize resonance I try to isolate the plate from the case as much as possible. Cut small strips from thin foam rubber.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:74%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAIDBP/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHJbI0SFK//xAAZEAADAQEBAAAAAAAAAAAAAAABAgMAFAT/2gAIAQEAAQUCl5jReJtVDJxeijorndnP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGhAAAgMBAQAAAAAAAAAAAAAAAAECESEyEv/aAAgBAQAGPwK1JI7ieXpSlh2XJ2z/xAAdEAACAgEFAAAAAAAAAAAAAAAAAREhEDFRYYGR/9oACAEBAAE/IezwwUoFSZQqxU0o53iNhoP/2gAMAwEAAgADAAAAEAjP/8QAFhEAAwAAAAAAAAAAAAAAAAAAARBh/9oACAEDAQE/EBV//8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQIBAT8Qp//EABwQAQACAgMBAAAAAAAAAAAAAAEAESFBkcHR8P/aAAgBAQABPxAYSdXlPixg0pooxpQaFMHE+a6gCoGVBif/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Putting dampening material inside the case&quot; title=&quot;Putting dampening material inside the case&quot; src=&quot;/static/e1b01cc86c6ac8b5f95581c62d774f87/4b190/kbd67-cyan-iso-zilents-v2-21.jpg&quot; srcSet=&quot;/static/e1b01cc86c6ac8b5f95581c62d774f87/e07e9/kbd67-cyan-iso-zilents-v2-21.jpg 200w,/static/e1b01cc86c6ac8b5f95581c62d774f87/066f9/kbd67-cyan-iso-zilents-v2-21.jpg 400w,/static/e1b01cc86c6ac8b5f95581c62d774f87/4b190/kbd67-cyan-iso-zilents-v2-21.jpg 800w,/static/e1b01cc86c6ac8b5f95581c62d774f87/e5166/kbd67-cyan-iso-zilents-v2-21.jpg 1200w,/static/e1b01cc86c6ac8b5f95581c62d774f87/b17f8/kbd67-cyan-iso-zilents-v2-21.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;By adding some dampening material inside the case I hope to make the sound a little better.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAMEAQL/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAetUpi0mF//EABkQAQEAAwEAAAAAAAAAAAAAAAECAAMREv/aAAgBAQABBQJ4UvBy9gyUp4c//8QAFhEBAQEAAAAAAAAAAAAAAAAAACGB/9oACAEDAQE/AYx//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGRABAAIDAAAAAAAAAAAAAAAAAAERMTJB/9oACAEBAAY/ArlbjCobv//EABsQAQADAQADAAAAAAAAAAAAAAEAESExQVFx/9oACAEBAAE/IdKoSpa6S+y14m5RPM2Dj57YKaj5P//aAAwDAQACAAMAAAAQD9//xAAYEQEBAAMAAAAAAAAAAAAAAAABABEhMf/aAAgBAwEBPxAdDrGQn//EABcRAQEBAQAAAAAAAAAAAAAAAAEAEWH/2gAIAQIBAT8Qxk7f/8QAHRABAAICAgMAAAAAAAAAAAAAAREhAFExQXGRsf/aAAgBAQABPxBjZwQYGO9zWVk+UIIN+/uKyGCi4wqDJXxrHBJQag8ZNGNCs//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Close up of screw mounting the plate to case&quot; title=&quot;Close up of screw mounting the plate to case&quot; src=&quot;/static/2b711b2166fe367cc719d38a6cf1ecba/4b190/kbd67-cyan-iso-zilents-v2-22.jpg&quot; srcSet=&quot;/static/2b711b2166fe367cc719d38a6cf1ecba/e07e9/kbd67-cyan-iso-zilents-v2-22.jpg 200w,/static/2b711b2166fe367cc719d38a6cf1ecba/066f9/kbd67-cyan-iso-zilents-v2-22.jpg 400w,/static/2b711b2166fe367cc719d38a6cf1ecba/4b190/kbd67-cyan-iso-zilents-v2-22.jpg 800w,/static/2b711b2166fe367cc719d38a6cf1ecba/e5166/kbd67-cyan-iso-zilents-v2-22.jpg 1200w,/static/2b711b2166fe367cc719d38a6cf1ecba/b17f8/kbd67-cyan-iso-zilents-v2-22.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Mounting the plate to the case.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAwAE/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAXMqGsUv/8QAGRABAAIDAAAAAAAAAAAAAAAAAQARAhAS/9oACAEBAAEFAsku0ncG46//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAbEAADAAIDAAAAAAAAAAAAAAAAAREhQTFhcf/aAAgBAQABPyHrjQdPRwBJmjbruz//2gAMAwEAAgADAAAAEKvv/8QAFhEBAQEAAAAAAAAAAAAAAAAAABEh/9oACAEDAQE/ENV//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAHBABAAICAwEAAAAAAAAAAAAAAQARIUExUWGR/9oACAEBAAE/ELwx7SrmakNzq0fWUt6vmHiQ62fJZkKrZ//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Overview of plate mounted to case&quot; title=&quot;Overview of plate mounted to case&quot; src=&quot;/static/d6008529ff85b78052274a724d14720a/4b190/kbd67-cyan-iso-zilents-v2-23.jpg&quot; srcSet=&quot;/static/d6008529ff85b78052274a724d14720a/e07e9/kbd67-cyan-iso-zilents-v2-23.jpg 200w,/static/d6008529ff85b78052274a724d14720a/066f9/kbd67-cyan-iso-zilents-v2-23.jpg 400w,/static/d6008529ff85b78052274a724d14720a/4b190/kbd67-cyan-iso-zilents-v2-23.jpg 800w,/static/d6008529ff85b78052274a724d14720a/e5166/kbd67-cyan-iso-zilents-v2-23.jpg 1200w,/static/d6008529ff85b78052274a724d14720a/b17f8/kbd67-cyan-iso-zilents-v2-23.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Looks pretty good with the brass plate.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAMEAQL/xAAUAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHWTdBUJB//xAAaEAACAgMAAAAAAAAAAAAAAAAAARESAhMx/9oACAEBAAEFArMsyZH2cU9h/8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQMBAT8Bp//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABcQAAMBAAAAAAAAAAAAAAAAAAABICH/2gAIAQEABj8CNc//xAAaEAEAAwEBAQAAAAAAAAAAAAABABEhUUGh/9oACAEBAAE/ITxgRZkHqvkS4aGHQesM5P/aAAwDAQACAAMAAAAQ/P8A/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAEh/9oACAEDAQE/ENI//8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQIBAT8Qh//EABwQAQACAwADAAAAAAAAAAAAAAEAESFBUTFhcf/aAAgBAQABPxAnheuESAvlwDrtpcSpqu6z7l6LEpyMLACG2f/Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Overview of plate and top case put together&quot; title=&quot;Overview of plate and top case put together&quot; src=&quot;/static/3d9e20ca90ca2b7dd67d2df6604530c5/4b190/kbd67-cyan-iso-zilents-v2-25.jpg&quot; srcSet=&quot;/static/3d9e20ca90ca2b7dd67d2df6604530c5/e07e9/kbd67-cyan-iso-zilents-v2-25.jpg 200w,/static/3d9e20ca90ca2b7dd67d2df6604530c5/066f9/kbd67-cyan-iso-zilents-v2-25.jpg 400w,/static/3d9e20ca90ca2b7dd67d2df6604530c5/4b190/kbd67-cyan-iso-zilents-v2-25.jpg 800w,/static/3d9e20ca90ca2b7dd67d2df6604530c5/e5166/kbd67-cyan-iso-zilents-v2-25.jpg 1200w,/static/3d9e20ca90ca2b7dd67d2df6604530c5/b17f8/kbd67-cyan-iso-zilents-v2-25.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;The top case put on. Making it even more compact and solid.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAIBAwQF/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/9oADAMBAAIQAxAAAAF4oVnomAj/xAAZEAEBAAMBAAAAAAAAAAAAAAABAAIREiH/2gAIAQEAAQUC2l0xmIt3eN//xAAXEQADAQAAAAAAAAAAAAAAAAAAARFR/9oACAEDAQE/AUV4f//EABURAQEAAAAAAAAAAAAAAAAAAAAh/9oACAECAQE/AUf/xAAaEAEAAwADAAAAAAAAAAAAAAABABEhEEGB/9oACAEBAAY/AtQljfG9wDyWz//EAB0QAAMAAQUBAAAAAAAAAAAAAAABEVEhMUFhccH/2gAIAQEAAT8hqXbUSqxHD+FgMs2Z6nhJ0XKn/9oADAMBAAIAAwAAABDnP//EABcRAQADAAAAAAAAAAAAAAAAAAEQESH/2gAIAQMBAT8QC7cL/8QAGBEAAgMAAAAAAAAAAAAAAAAAAAERQXH/2gAIAQIBAT8QbijR/8QAHRABAAICAwEBAAAAAAAAAAAAAQARITFBUXFh8P/aAAgBAQABPxBI2peRTfLjiIACbMLLK+vIICdN8McjtqXIWfvIZJ2hM31Cxss//9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Close-up of top case mounted to the board&quot; title=&quot;Close-up of top case mounted to the board&quot; src=&quot;/static/c0b737a14c48f28a9feb48edcb281238/4b190/kbd67-cyan-iso-zilents-v2-26.jpg&quot; srcSet=&quot;/static/c0b737a14c48f28a9feb48edcb281238/e07e9/kbd67-cyan-iso-zilents-v2-26.jpg 200w,/static/c0b737a14c48f28a9feb48edcb281238/066f9/kbd67-cyan-iso-zilents-v2-26.jpg 400w,/static/c0b737a14c48f28a9feb48edcb281238/4b190/kbd67-cyan-iso-zilents-v2-26.jpg 800w,/static/c0b737a14c48f28a9feb48edcb281238/e5166/kbd67-cyan-iso-zilents-v2-26.jpg 1200w,/static/c0b737a14c48f28a9feb48edcb281238/b17f8/kbd67-cyan-iso-zilents-v2-26.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;The top case also got a couple of dampening foam strips between it and the plate.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAEDBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAACAAH/2gAMAwEAAhADEAAAAXXnXijIY//EABkQAQEBAAMAAAAAAAAAAAAAAAIDAQARFP/aAAgBAQABBQKamZ659UOPZ2BPpnyixL//xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPwEZ/8QAFREBAQAAAAAAAAAAAAAAAAAAARD/2gAIAQIBAT8BZ//EABsQAAICAwEAAAAAAAAAAAAAAAABESESMUFh/9oACAEBAAY/AksloqGT4JWdJR//xAAbEAEAAgIDAAAAAAAAAAAAAAABABEhMVFh8f/aAAgBAQABPyFpW7Q2ROiF2g4MXuhxDwRPfTP/2gAMAwEAAgADAAAAEIfP/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oACAEDAQE/EKNf/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oACAECAQE/EDK//8QAHBABAQACAgMAAAAAAAAAAAAAAREAITFBYaHw/9oACAEBAAE/EJ3QCl337wY2XG96wvDAaNnjFVqTO+QwTefrjkoC0m8//9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Before putting the keycaps on&quot; title=&quot;Before putting the keycaps on&quot; src=&quot;/static/e40ca958f3bfbc90e86e5989c2af7b6e/4b190/kbd67-cyan-iso-zilents-v2-27.jpg&quot; srcSet=&quot;/static/e40ca958f3bfbc90e86e5989c2af7b6e/e07e9/kbd67-cyan-iso-zilents-v2-27.jpg 200w,/static/e40ca958f3bfbc90e86e5989c2af7b6e/066f9/kbd67-cyan-iso-zilents-v2-27.jpg 400w,/static/e40ca958f3bfbc90e86e5989c2af7b6e/4b190/kbd67-cyan-iso-zilents-v2-27.jpg 800w,/static/e40ca958f3bfbc90e86e5989c2af7b6e/e5166/kbd67-cyan-iso-zilents-v2-27.jpg 1200w,/static/e40ca958f3bfbc90e86e5989c2af7b6e/b17f8/kbd67-cyan-iso-zilents-v2-27.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Time to put on the keycaps.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;And everything is done. It is really quiet... and heavy. Currently I&amp;#x27;m trying out the international ISO layout but have the nordic keys if I need to change. The nordic layout sucks for development but unfortunately we still have to use &lt;em&gt;Å&lt;/em&gt;, &lt;em&gt;Ä&lt;/em&gt; and &lt;em&gt;Ö&lt;/em&gt; when writing Swedish.&lt;/p&gt;&lt;p&gt;Here&amp;#x27;s some more picture of the finished board.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAIDBP/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAGl8ao4ov8A/8QAGhABAQACAwAAAAAAAAAAAAAAAQIAAxATMf/aAAgBAQABBQKNTR1xOPpaHH//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAaEAACAgMAAAAAAAAAAAAAAAAAEQEhECIx/9oACAEBAAY/AmbSVwTrP//EABoQAAMBAQEBAAAAAAAAAAAAAAABESExQYH/2gAIAQEAAT8h4JCG/Pgu7b8UdFdM7gnXWaf/2gAMAwEAAgADAAAAEFzP/8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQMBAT8Qp//EABURAQEAAAAAAAAAAAAAAAAAABAh/9oACAECAQE/EIf/xAAcEAEAAwEAAwEAAAAAAAAAAAABABEhMUFhcYH/2gAIAQEAAT8QAX3S1vk2IZltfDs+50KajacgINvdlkj7er+xfBn/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Finished board with all keycaps on&quot; title=&quot;Finished board with all keycaps on&quot; src=&quot;/static/c53c41478a9e8ede119bdde389d3cada/4b190/kbd67-cyan-iso-zilents-v2-28.jpg&quot; srcSet=&quot;/static/c53c41478a9e8ede119bdde389d3cada/e07e9/kbd67-cyan-iso-zilents-v2-28.jpg 200w,/static/c53c41478a9e8ede119bdde389d3cada/066f9/kbd67-cyan-iso-zilents-v2-28.jpg 400w,/static/c53c41478a9e8ede119bdde389d3cada/4b190/kbd67-cyan-iso-zilents-v2-28.jpg 800w,/static/c53c41478a9e8ede119bdde389d3cada/e5166/kbd67-cyan-iso-zilents-v2-28.jpg 1200w,/static/c53c41478a9e8ede119bdde389d3cada/b17f8/kbd67-cyan-iso-zilents-v2-28.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAMEAQX/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAABt3hPS4QH/8QAGxAAAgIDAQAAAAAAAAAAAAAAAAECEQMQEhP/2gAIAQEAAQUCXnM41bIZZp2f/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGhAAAgIDAAAAAAAAAAAAAAAAEBEAIQExcf/aAAgBAQAGPwKlKydvo//EABsQAQACAgMAAAAAAAAAAAAAAAEAIRExQVFx/9oACAEBAAE/IdjJ5E9EUFHiWW3KFgYtuf/aAAwDAQACAAMAAAAQj9//xAAVEQEBAAAAAAAAAAAAAAAAAAAQIf/aAAgBAwEBPxCn/8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQIBAT8Qh//EABwQAQADAAMBAQAAAAAAAAAAAAEAESExQYFxkf/aAAgBAQABPxAk2/fBPpF8gOkuMxaqaiocHCYnsJaS0W/vkNEa7P/Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Close-up of the right side of the board&quot; title=&quot;Close-up of the right side of the board&quot; src=&quot;/static/605530abcbc2e39bfb5e40bcde8a5702/4b190/kbd67-cyan-iso-zilents-v2-29.jpg&quot; srcSet=&quot;/static/605530abcbc2e39bfb5e40bcde8a5702/e07e9/kbd67-cyan-iso-zilents-v2-29.jpg 200w,/static/605530abcbc2e39bfb5e40bcde8a5702/066f9/kbd67-cyan-iso-zilents-v2-29.jpg 400w,/static/605530abcbc2e39bfb5e40bcde8a5702/4b190/kbd67-cyan-iso-zilents-v2-29.jpg 800w,/static/605530abcbc2e39bfb5e40bcde8a5702/e5166/kbd67-cyan-iso-zilents-v2-29.jpg 1200w,/static/605530abcbc2e39bfb5e40bcde8a5702/b17f8/kbd67-cyan-iso-zilents-v2-29.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAwACBP/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHoPYI0Ef/EABoQAAEFAQAAAAAAAAAAAAAAAAABAgMREiH/2gAIAQEAAQUCp96Vpo6SiH//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAXEAADAQAAAAAAAAAAAAAAAAABECAx/9oACAEBAAY/AsgL/8QAGhAAAgMBAQAAAAAAAAAAAAAAAAEhMVERwf/aAAgBAQABPyFsT2OxAl07pwSlrKH/2gAMAwEAAgADAAAAENw//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAHxAAAgIBBAMAAAAAAAAAAAAAAREAIUExUWFxocHw/9oACAEBAAE/EB0F7H7MMK4kjXY3EMopmixvl+4BIqIHmAFbc//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Close-up of the Genji artisan keycap&quot; title=&quot;Close-up of the Genji artisan keycap&quot; src=&quot;/static/330dc26f4906cfce91d517db89417aa4/4b190/kbd67-cyan-iso-zilents-v2-30.jpg&quot; srcSet=&quot;/static/330dc26f4906cfce91d517db89417aa4/e07e9/kbd67-cyan-iso-zilents-v2-30.jpg 200w,/static/330dc26f4906cfce91d517db89417aa4/066f9/kbd67-cyan-iso-zilents-v2-30.jpg 400w,/static/330dc26f4906cfce91d517db89417aa4/4b190/kbd67-cyan-iso-zilents-v2-30.jpg 800w,/static/330dc26f4906cfce91d517db89417aa4/e5166/kbd67-cyan-iso-zilents-v2-30.jpg 1200w,/static/330dc26f4906cfce91d517db89417aa4/b17f8/kbd67-cyan-iso-zilents-v2-30.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAIDBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAADAQL/2gAMAwEAAhADEAAAAaqZ82iQci//xAAaEAACAwEBAAAAAAAAAAAAAAABAgADEhAT/9oACAEBAAEFAqfAq9CzJHFsYRjo/wD/xAAXEQEAAwAAAAAAAAAAAAAAAAABEBEx/9oACAEDAQE/AaTI/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAHRAAAQMFAQAAAAAAAAAAAAAAAQAQIQISIjFhgf/aAAgBAQAGPwK0ierCrwrTTIb/xAAbEAACAwADAAAAAAAAAAAAAAAAAREhQRAxgf/aAAgBAQABPyHbHvRfcAN6HwSR6i0VLD//2gAMAwEAAgADAAAAEO8v/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREA/9oACAEDAQE/ELqrgZv/xAAXEQADAQAAAAAAAAAAAAAAAAAAAREx/9oACAECAQE/EKno4f/EAB0QAQADAAEFAAAAAAAAAAAAAAEAESExUWFxgZH/2gAIAQEAAT8Qx27cKezCKLNpv4y8D1sSAm6AtPDOZqKE/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;The bottom of the case with the extra brass weight&quot; title=&quot;The bottom of the case with the extra brass weight&quot; src=&quot;/static/f2daa615ddd1ab11ede27fecedcf5080/4b190/kbd67-cyan-iso-zilents-v2-24.jpg&quot; srcSet=&quot;/static/f2daa615ddd1ab11ede27fecedcf5080/e07e9/kbd67-cyan-iso-zilents-v2-24.jpg 200w,/static/f2daa615ddd1ab11ede27fecedcf5080/066f9/kbd67-cyan-iso-zilents-v2-24.jpg 400w,/static/f2daa615ddd1ab11ede27fecedcf5080/4b190/kbd67-cyan-iso-zilents-v2-24.jpg 800w,/static/f2daa615ddd1ab11ede27fecedcf5080/e5166/kbd67-cyan-iso-zilents-v2-24.jpg 1200w,/static/f2daa615ddd1ab11ede27fecedcf5080/b17f8/kbd67-cyan-iso-zilents-v2-24.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75.99999999999999%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABQADBP/EABUBAQEAAAAAAAAAAAAAAAAAAAEC/9oADAMBAAIQAxAAAAHXnPWkMkaX/8QAGhAAAgMBAQAAAAAAAAAAAAAAAQIAAxIhMv/aAAgBAQABBQL2mbAMmJYyzRh6f//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/AYj/xAAWEQEBAQAAAAAAAAAAAAAAAAAAASH/2gAIAQIBAT8BrH//xAAaEAACAwEBAAAAAAAAAAAAAAAAEQEhMUFR/9oACAEBAAY/At3wTcF0QpI67LR//8QAHBABAAICAwEAAAAAAAAAAAAAAQARIUExUWGR/9oACAEBAAE/IQbmr8IvCZNxt0x9YDUTamDlolERb0uf/9oADAMBAAIAAwAAABBP/wD/xAAXEQADAQAAAAAAAAAAAAAAAAAAARFR/9oACAEDAQE/EFSqI0//xAAYEQACAwAAAAAAAAAAAAAAAAAAEQFBUf/aAAgBAgEBPxBLkej/xAAcEAEBAAIDAQEAAAAAAAAAAAABEQBBITFRYXH/2gAIAQEAAT8QUspWhBomXGJQsk+Y0t6nMxOnTxgmzG0ycsFDq7cqKT6A/c//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Keyboard with a blurred nature background&quot; title=&quot;Keyboard with a blurred nature background&quot; src=&quot;/static/a7cecac5841a1c6bc4bc2eaa42b77383/4b190/kbd67-cyan-iso-zilents-v2-31.jpg&quot; srcSet=&quot;/static/a7cecac5841a1c6bc4bc2eaa42b77383/e07e9/kbd67-cyan-iso-zilents-v2-31.jpg 200w,/static/a7cecac5841a1c6bc4bc2eaa42b77383/066f9/kbd67-cyan-iso-zilents-v2-31.jpg 400w,/static/a7cecac5841a1c6bc4bc2eaa42b77383/4b190/kbd67-cyan-iso-zilents-v2-31.jpg 800w,/static/a7cecac5841a1c6bc4bc2eaa42b77383/e5166/kbd67-cyan-iso-zilents-v2-31.jpg 1200w,/static/a7cecac5841a1c6bc4bc2eaa42b77383/b17f8/kbd67-cyan-iso-zilents-v2-31.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Conditions in CSS with the :not pseudo class]]></title><description><![CDATA[When writing CSS we sometimes want some more logic to our styling. For example a navigation with multiple  <li>  elements in a horizontal layout probably needs some space between the elements. A  padding-right  could do it but we don't want…]]></description><link>https://samuelsson.dev/conditions-in-css-with-the-not-pseudo-class/</link><guid isPermaLink="false">https://samuelsson.dev/conditions-in-css-with-the-not-pseudo-class/</guid><pubDate>Mon, 05 Aug 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When writing CSS we sometimes want some more logic to our styling. For example a navigation with multiple &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&amp;gt;&lt;/code&gt; elements in a horizontal layout probably needs some space between the elements. A &lt;code class=&quot;language-text&quot;&gt;padding-right&lt;/code&gt; could do it but we don&amp;#x27;t want to apply it to the last element because that will mess up our layout.&lt;/p&gt;&lt;p&gt;Usually something like this is written:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;padding-right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;li:last-child&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;padding-right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That will of course be sufficient but we could make this look much better with the &lt;code class=&quot;language-text&quot;&gt;:not&lt;/code&gt; CSS pseudo class. It will match all elements except those we choose not to.&lt;/p&gt;&lt;p&gt;The above example re-written with &lt;code class=&quot;language-text&quot;&gt;:not&lt;/code&gt; will look like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;li:not(:last-child)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;padding-right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will match all &lt;code class=&quot;language-text&quot;&gt;li&lt;/code&gt; elements but not the &lt;code class=&quot;language-text&quot;&gt;:last-child&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;We can also chain multiple &lt;code class=&quot;language-text&quot;&gt;:not&lt;/code&gt; like this example where we want to style all links except those with certain classes.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;a:not(.ignored):not(.skipped)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There is currently an experimental feature where all selectors could be comma separated in one single &lt;code class=&quot;language-text&quot;&gt;:not(.ignored, .skipped)&lt;/code&gt; but browser support is very low so multiple &lt;code class=&quot;language-text&quot;&gt;:not&lt;/code&gt; is currently the preferred way to do it.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Put GraphQL fragments in their own files in Gatsby]]></title><description><![CDATA[Gatsby uses GraphQL under the hood for managing data and it does this really well. It usually doesn't take long before the queries grow big and some duplicated code will occur. This is where  fragments  come in handy. A way to break out…]]></description><link>https://samuelsson.dev/put-graphql-fragments-in-their-own-files-in-gatsby/</link><guid isPermaLink="false">https://samuelsson.dev/put-graphql-fragments-in-their-own-files-in-gatsby/</guid><pubDate>Mon, 15 Jul 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Gatsby uses GraphQL under the hood for managing data and it does this really well. It usually doesn&amp;#x27;t take long before the queries grow big and some duplicated code will occur. This is where &lt;em&gt;fragments&lt;/em&gt; come in handy. A way to break out some parts of the queries into... well, fragments, to be able to use it in other places.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s say we have a simple query like this for getting blog posts from markdown files:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// src/pages/blog.jsx&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; query &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graphql&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;
  query BlogPageQuery {
    allMarkdownRemark(sort: { limit: 5 }) {
      edges {
        node {
          frontmatter {
            title
            tags
          }
        }
      }
    }
  }
&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If we want to display these posts on multiple places the majority of the query will look exactly the same, only the &lt;code class=&quot;language-text&quot;&gt;limit&lt;/code&gt; may change.&lt;/p&gt;&lt;p&gt;What we want to do is to break out the duplicated code into a fragment. We can then use it in the query with three dots in front of it. You need to change &lt;code class=&quot;language-text&quot;&gt;MarkdownRemarkConnection&lt;/code&gt; to whatever type you want to use.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// src/pages/blog.jsx&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; query &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graphql&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;
  fragment PostListItem on MarkdownRemarkConnection {
    edges {
      node {
        frontmatter {
          title
          tags
        }
      }
    }
  }

  query BlogPageQuery {
    allMarkdownRemark(sort: { limit: 5 }) {
      ...PostListItem
    }
  }
&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But as you can see this doesn&amp;#x27;t make much difference if we can&amp;#x27;t put it somewhere else so we can use it in other queries. Gatsby actually has a built in solution that makes this really simple. We just need to put all fragments in a specially named directory and Gatsby does everything for us.&lt;/p&gt;&lt;p&gt;We create the folder &lt;code class=&quot;language-text&quot;&gt;/src/graphql-fragments&lt;/code&gt; and in here we add files and export all our fragments.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// src/graphql-fragments/PostListItem.js&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; graphql &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;gatsby&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; PostListItem &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graphql&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;
  fragment PostListItem on MarkdownRemarkConnection {
    edges {
      node {
        frontmatter {
          title
          tags
        }
      }
    }
  }
&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And just as before we can use it in our queries, but without having to import them or anything. They are globally accessible.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// src/pages/blog.jsx&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; query &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graphql&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;
  query BlogPageQuery {
    allMarkdownRemark(sort: { limit: 5 }) {
      ...PostListItem
    }
  }
&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can change arguments or even add more fields.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// src/pages/all-posts.jsx&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; query &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graphql&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;
  query BlogPageQuery {
    allMarkdownRemark(sort: { limit: 999 }) {
      totalCount
      ...PostListItem
    }
  }
&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Just don&amp;#x27;t overdo it 😎 not everything needs to be a fragment.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Update nvm installed node version and keep globally installed packages]]></title><description><![CDATA[Node Version Manager is great for managing and working with different node versions but can be a little tricky to update to a newer version the first times. Especially if you want to keep all the globally installed packages. It’s actually…]]></description><link>https://samuelsson.dev/update-nvm-installed-node-version-and-keep-globally-installed-packages/</link><guid isPermaLink="false">https://samuelsson.dev/update-nvm-installed-node-version-and-keep-globally-installed-packages/</guid><pubDate>Mon, 01 Jul 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Node Version Manager is great for managing and working with different node versions but can be a little tricky to update to a newer version the first times. Especially if you want to keep all the globally installed packages. It’s actually really simple and here I’ll show you how.&lt;/p&gt;&lt;p&gt;Typing &lt;code class=&quot;language-text&quot;&gt;nvm ls&lt;/code&gt; will list all our installed node versions. We can check if there is a newer version by typing &lt;code class=&quot;language-text&quot;&gt;nvm ls-remote&lt;/code&gt;. That will output a lot of rows because there are many node versions. We can actually &lt;code class=&quot;language-text&quot;&gt;grep&lt;/code&gt; to make it more readable.&lt;/p&gt;&lt;p&gt;This will list the latest LTS versions:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;nvm ls-remote --lts &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; Latest&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will list all v12.x versions:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;nvm ls-remote &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; v12&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If there is a newer version we can update to that one 💪🏻 We&amp;#x27;ll do it differently depending on if it&amp;#x27;s the absolute latest or an LTS version.&lt;/p&gt;&lt;h2&gt;Updating the latest version&lt;/h2&gt;&lt;p&gt;Let’s say that our currently installed version is &lt;code class=&quot;language-text&quot;&gt;v12.4.0&lt;/code&gt; and we want to install &lt;code class=&quot;language-text&quot;&gt;v12.5.0&lt;/code&gt;, which is the latest version in this example. Nvm has a nifty command that till do this for us, without keeping track of version numbers.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;nvm &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;node&lt;/span&gt; --reinstall-packages-from&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;node&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The nvm docs describes this pretty good:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;This will first use “nvm version node” to identify the current version you’re migrating packages from. Then it resolves the new version to install from the remote server and installs it. Lastly, it runs “nvm reinstall-packages” to reinstall the npm packages from your prior version of Node to the new one.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;You can then type &lt;code class=&quot;language-text&quot;&gt;npm list -g --depth=0&lt;/code&gt; to check it if everything was reinstalled correctly and &lt;code class=&quot;language-text&quot;&gt;npm update -g&lt;/code&gt; if you want to update all the packages. &lt;/p&gt;&lt;h2&gt;Updating the latest LTS version&lt;/h2&gt;&lt;p&gt;Updating to the latest LTS version is pretty much the same but we might need to enter the current version manually. So just in case we need to find out out currently installed LTS versions by typing &lt;code class=&quot;language-text&quot;&gt;nvm ls&lt;/code&gt;, let’s say it’s &lt;code class=&quot;language-text&quot;&gt;10.15.3&lt;/code&gt; (dubnium).&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;nvm &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; lts/* --reinstall-packages-from&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;lts/*&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the above doesn’t work because &lt;code class=&quot;language-text&quot;&gt;lts/*&lt;/code&gt; isn’t linked you might need to specify which LTS version to install, either by LTS name or number.&lt;/p&gt;&lt;p&gt;This will install the latest Dubnium (LTS version by name):&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;nvm &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; lts/dubnium --reinstall-packages-from&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;lts/dubnium&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or if &lt;code class=&quot;language-text&quot;&gt;dubnium&lt;/code&gt;hasn’t been linked before:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;nvm &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; lts/dubnium --reinstall-packages-from&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10.15&lt;/span&gt;.3&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Remove older versions not in use anymore&lt;/h2&gt;&lt;p&gt;There’s no need to keep old versions if you don’t need a specific version. List the currently installed versions by typing &lt;code class=&quot;language-text&quot;&gt;nvm ls&lt;/code&gt;. It looks something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;       v10.15.3
       v10.16.0
        v12.4.0
-&amp;gt;      v12.5.0
         system&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here we see that &lt;code class=&quot;language-text&quot;&gt;v10.15.3&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;v12.4.0&lt;/code&gt; have been updated and can be removed, one at a time currently.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;nvm uninstall &lt;span class=&quot;token number&quot;&gt;10.15&lt;/span&gt;.3
nvm uninstall &lt;span class=&quot;token number&quot;&gt;12.4&lt;/span&gt;.0&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;#x27;s it 🚀&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Update Drone CI to latest version]]></title><description><![CDATA[Drone is a great open source CI/CD running in a docker container that is both easy to use and install. Because it runs in a container and doesn’t require a lot of dependencies installed on your system it’s really easy to update to a new…]]></description><link>https://samuelsson.dev/update-drone-ci-to-latest-version/</link><guid isPermaLink="false">https://samuelsson.dev/update-drone-ci-to-latest-version/</guid><pubDate>Fri, 14 Jun 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Drone is a great open source CI/CD running in a docker container that is both easy to use and install. Because it runs in a container and doesn’t require a lot of dependencies installed on your system it’s really easy to update to a new version.&lt;/p&gt;&lt;p&gt;If you haven’t installed Drone yet you can do that by reading this &lt;a href=&quot;/how-to-install-and-configure-drone-ci-on-a-self-hosted-server&quot;&gt;post&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Navigate to &lt;a href=&quot;https://hub.docker.com/r/drone/drone/tags&quot;&gt;Docker Hub&lt;/a&gt; and check if there is a new version available. You can read the changelog at &lt;a href=&quot;https://github.com/drone/drone/blob/master/CHANGELOG.md&quot;&gt;GitHub&lt;/a&gt; to make sure there are no breaking changes. If you’d like to use the new version start by downloading it (we assume the latest version is 1.2.1 in this example but change accordingly).&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;docker&lt;/span&gt; pull drone/drone:1.2.1&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When the download is complete we need to tell our startup script to use the new container instead. Open the docker-compose file for Drone.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt; /etc/drone/docker-compose.yml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here we need to change what image to use, we change the image property to this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;image: drone/drone:1.2.1&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we simply restart Drone.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; systemctl stop drone
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; systemctl start drone&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can then validate that everything works by either navigate to the GUI in your browser or check the status by typing:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; systemctl status drone&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Cleaning up old docker images&lt;/h2&gt;&lt;p&gt;It can be a good idea to remove old, unused images when they are not used anymore. Drone itself doesn’t take up much disk space but because it uses all kind of images internally it can quickly grow in size. For example building a node project requires the node docker image which is around 1 GB in size. No need to save outdated images if your projects don’t need them.&lt;/p&gt;&lt;p&gt;You can see all images by typing:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;docker&lt;/span&gt; images -a&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If it doesn’t have an associated tag it usually isn’t needed and can be removed, but that is not always the case. Another application might use it as well so make sure it’s safe to remove it before you do.&lt;/p&gt;&lt;p&gt;To remove all danglig images (without a tag) you can do that with:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;docker&lt;/span&gt; images purge&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want to remove a single image, like the old Drone image we don’t use anymore, you can do that by removing it by the image ID. Let’s say our old Drone version, 1.2.0, we don’t use anymore has the image ID &lt;em&gt;4a2d1fc1233d&lt;/em&gt;. Then we can remove it by that ID.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;docker&lt;/span&gt; rmi 4a2d1fc1233d&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You are now running a new version of Drone and you have so much disk space left for other cool stuff 😍&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Different git config for different projects or clients]]></title><description><![CDATA[If only working on projects with one single git service you won’t have a problem with email addresses differ between accounts. All your commits will always use the same information. But say you are using one service for private projects…]]></description><link>https://samuelsson.dev/different-git-config-for-different-projects-or-clients/</link><guid isPermaLink="false">https://samuelsson.dev/different-git-config-for-different-projects-or-clients/</guid><pubDate>Mon, 20 May 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If only working on projects with one single git service you won’t have a problem with email addresses differ between accounts. All your commits will always use the same information. But say you are using one service for private projects, such as GitHub, and another service for work related projects, like GitHub Enterprise. If that’s the case you definitely don’t want to use the same configuration for both of them. One solution is to set these manually on every repository but that’s not very smooth in the long run. Fortunately we can set up conditional git configuration per directory.&lt;/p&gt;&lt;p&gt;Your current &lt;code class=&quot;language-text&quot;&gt;.gitconfig&lt;/code&gt; (or create one in your home dir if you don’t have one) might look something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;user&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Erik Samuelsson
    email &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;123123&lt;/span&gt;+username@users.noreply.github.com
&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;core&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    editor &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Your email will probably differ if you have one address for work and one for personal. Maybe even your name will be different if you lied about everything in your job application. The solution is to create one git config for each client or service you use.&lt;/p&gt;&lt;p&gt;First make sure you organize your personal and client directories in different locations. I organize them like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;~/Projects
├── work
│   ├── client_a
│   │   └── repo_a1
│   │   └── repo_a2
│   └── client_b
│       └── repo_b1
│       └── repo_b2
└── personal
    ├── repo_1
    └── repo_2&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we need to add some conditionals to our  &lt;code class=&quot;language-text&quot;&gt;~/.gitconfig&lt;/code&gt; so it looks similar to this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;user&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Erik Samuelsson
    email &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;123123&lt;/span&gt;+username@users.noreply.github.com
&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;core&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    editor &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt;

&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;includeIf &lt;span class=&quot;token string&quot;&gt;&amp;quot;gitdir:~/Projects/work/client_a/**&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; ~/.dotfiles/git/gitconfig-client_a
&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;includeIf &lt;span class=&quot;token string&quot;&gt;&amp;quot;gitdir:~/Projects/work/client_b/**&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; ~/.dotfiles/git/gitconfig-client_b&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By having our personal information set as default every time we can create repos anywhere without worrying about the &lt;em&gt;name&lt;/em&gt; and &lt;em&gt;email&lt;/em&gt;. In the above example the paths are located in my dotfiles directory but they can be saved anywhere. Let’s create them and add different values inside.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# ~/.dotfiles/git/gitconfig-client_a&lt;/span&gt;

&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;user&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Erik Samuelsson
    email &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; erik@client_a.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# ~/.dotfiles/git/gitconfig-client_b&lt;/span&gt;

&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;user&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Bob Anderson
    email &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; bob@client_b.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we need to test everything to see if it works.&lt;/p&gt;&lt;p&gt;Navigate to your personal folder and type this in the terminal:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; ~/Projects/personal/
&lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;test&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;test&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; init
&lt;span class=&quot;token function&quot;&gt;touch&lt;/span&gt; testfile
&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; config user.email&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last command should output the correct email address for the current directory. Repeat for all
directories and the addresses should be different.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Always write perfect commit messages with Git Commitizen and Husky]]></title><description><![CDATA[We’ve all been there, looking at a function and don’t understand a thing of what it does. The next step is of course look at the commit message, the git blame. That will explain everything for us. Or will it? We open it up and we see this…]]></description><link>https://samuelsson.dev/always-write-perfect-commit-messages-with-git-commitizen-and-husky/</link><guid isPermaLink="false">https://samuelsson.dev/always-write-perfect-commit-messages-with-git-commitizen-and-husky/</guid><pubDate>Mon, 13 May 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;We’ve all been there, looking at a function and don’t understand a thing of what it does. The next step is of course look at the commit message, the git blame. That will explain everything for us. Or will it?&lt;/p&gt;&lt;p&gt;We open it up and we see this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Fix an error&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What is that? What does it even mean? That is so bad and doesn’t tell us anything.&lt;/p&gt;&lt;p&gt;Fortunately there are tools that will help (or enforce) us to write better commit messages. We will look at two tools in this guide, &lt;em&gt;Git Commitizen&lt;/em&gt; and &lt;em&gt;Husky&lt;/em&gt;. We won’t install &lt;em&gt;Git Commitizen&lt;/em&gt; directly as a dependency but we need some linting rules.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;npm&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; --save-dev @commitlint/cli @commitlint/config-conventional husky&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Husky&lt;/em&gt; will hook into our git commands and check them with the linting config. Next we need some configuration files in our project root.&lt;/p&gt;&lt;p&gt;Create a &lt;code class=&quot;language-text&quot;&gt;.huskyrc&lt;/code&gt; used for telling husky to check commit messages.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;hooks&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;commit-msg&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;commitlint -E HUSKY_GIT_PARAMS&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we need to configure our commit linting with a &lt;code class=&quot;language-text&quot;&gt;commitlint.config.js&lt;/code&gt;. Here we use the default &lt;code class=&quot;language-text&quot;&gt;config-conventional&lt;/code&gt; but you can tweak it anyway you like to fit your style.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;module&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;exports &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;#x27;@commitlint/config-conventional&amp;#x27;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now when we try to write a commit message that isn&amp;#x27;t valid according to our linting we will get an error, or multiple.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:36.50000000000001%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Error when writing invalif commit msg&quot; title=&quot;Error when writing invalif commit msg&quot; src=&quot;/static/9975fb28570d26acdfa084885f4343c0/5a190/error.png&quot; srcSet=&quot;/static/9975fb28570d26acdfa084885f4343c0/772e8/error.png 200w,/static/9975fb28570d26acdfa084885f4343c0/e17e5/error.png 400w,/static/9975fb28570d26acdfa084885f4343c0/5a190/error.png 800w,/static/9975fb28570d26acdfa084885f4343c0/c1b63/error.png 1200w,/static/9975fb28570d26acdfa084885f4343c0/29007/error.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;To help us write valid messages we can type &lt;code class=&quot;language-text&quot;&gt;npx git-cz&lt;/code&gt;. By using &lt;code class=&quot;language-text&quot;&gt;npx&lt;/code&gt; we don’t have to install the package as mentioned before, but instead running the script directly.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:33%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Pick what kind of commit it is&quot; title=&quot;Pick what kind of commit it is&quot; src=&quot;/static/316c644e6c7608f68b9ea11fc5c50fe7/5a190/commiting.png&quot; srcSet=&quot;/static/316c644e6c7608f68b9ea11fc5c50fe7/772e8/commiting.png 200w,/static/316c644e6c7608f68b9ea11fc5c50fe7/e17e5/commiting.png 400w,/static/316c644e6c7608f68b9ea11fc5c50fe7/5a190/commiting.png 800w,/static/316c644e6c7608f68b9ea11fc5c50fe7/c1b63/commiting.png 1200w,/static/316c644e6c7608f68b9ea11fc5c50fe7/29007/commiting.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:33%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Help with writing good commit msg&quot; title=&quot;Help with writing good commit msg&quot; src=&quot;/static/aceac9c2d65c30ba3b48febd790747d2/5a190/help.png&quot; srcSet=&quot;/static/aceac9c2d65c30ba3b48febd790747d2/772e8/help.png 200w,/static/aceac9c2d65c30ba3b48febd790747d2/e17e5/help.png 400w,/static/aceac9c2d65c30ba3b48febd790747d2/5a190/help.png 800w,/static/aceac9c2d65c30ba3b48febd790747d2/c1b63/help.png 1200w,/static/aceac9c2d65c30ba3b48febd790747d2/29007/help.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Great! Now we’ll always have perfect commit messages for all team members. Just follow the step-by-step guide and if you want to know in more detail what to type &lt;a href=&quot;https://github.com/erlang/otp/wiki/writing-good-commit-messages&quot;&gt;here&lt;/a&gt; is a good guide.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Make a TypeScript Node server hot reload on changes with Nodemon]]></title><description><![CDATA[When building a front-end app today it is common to have the app hot reloading in the browser every time you make a change. This can also be done for your back-end app built with Node by using a package called Nodemon. This app watches all…]]></description><link>https://samuelsson.dev/make-a-typescript-node-server-hot-reload-on-changes-with-nodemon/</link><guid isPermaLink="false">https://samuelsson.dev/make-a-typescript-node-server-hot-reload-on-changes-with-nodemon/</guid><pubDate>Wed, 10 Apr 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When building a front-end app today it is common to have the app hot reloading in the browser every time you make a change. This can also be done for your back-end app built with Node by using a package called Nodemon. This app watches all your files for changes and, if it finds any, reloads the server. Nodemon is simple to use but needs some more configuration when you use TypeScript.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;In this guide I assume you already have a Node TypeScript project set up. Otherwise you&amp;#x27;ll easily find starter guides on Google and will be up and running in five minutes.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;First of all we need to install &lt;code class=&quot;language-text&quot;&gt;nodemon&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;ts-node&lt;/code&gt;. We only need them in development. &lt;em&gt;nodemon&lt;/em&gt; is used for watching our files and &lt;em&gt;ts-node&lt;/em&gt; is used to run TypeScript in Node.&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;npm install --save-dev nodemon ts-node&lt;/code&gt;&lt;/p&gt;&lt;p&gt;After that we&amp;#x27;ll create a new file in the root folder of the project named &lt;code class=&quot;language-text&quot;&gt;nodemon.json&lt;/code&gt;. This will be the content:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;ignore&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;quot;**/*.test.ts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;**/*.spec.ts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;node_modules&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;watch&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;quot;src&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;exec&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;npm start&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;ext&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;ts&amp;quot;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The properties are pretty much self explanatory.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;ignore&lt;/strong&gt;: What patterns to ignore from triggering a hot reload. Test files and node_modules for example.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;watch&lt;/strong&gt;: The folder (or folders) to watch, usually the &lt;code class=&quot;language-text&quot;&gt;src&lt;/code&gt; folder but can be anything.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;exec&lt;/strong&gt;: The npm script to run when a hot reload is triggered.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ext&lt;/strong&gt;: What file extensions to watch, &lt;code class=&quot;language-text&quot;&gt;ts&lt;/code&gt; is a no-brainer but can also be &lt;code class=&quot;language-text&quot;&gt;json&lt;/code&gt; for example.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Then we need to update our &lt;code class=&quot;language-text&quot;&gt;package.json&lt;/code&gt; with two new scripts.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;json&quot;&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&amp;quot;scripts&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;dev&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;nodemon&amp;quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&amp;quot;start&amp;quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;ts-node src/index.ts&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;dev&lt;/strong&gt;: This script is the main one we&amp;#x27;ll be using every time we develop locally. It will run nodemon which will check for our &lt;code class=&quot;language-text&quot;&gt;nodemon.json&lt;/code&gt; file we created earlier. Every time a change is made matching our criteria the script specified in the &lt;code class=&quot;language-text&quot;&gt;exec&lt;/code&gt; property is run.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;start&lt;/strong&gt;: This is a normal npm script starting our server. Should be pointing to the main server file.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;That&amp;#x27;s it, as easy as that. Every time you want to start the server with hot reloading you just run &lt;code class=&quot;language-text&quot;&gt;npm run dev&lt;/code&gt;. If you want to start the server without this you can just run &lt;code class=&quot;language-text&quot;&gt;npm run start&lt;/code&gt; directly and it will work exactly the same, except you need to stop and start the server manually. One reason to do this is to save battery power because nodemon watching and restarting all the time could consume more energy. &lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to install and configure Drone CI on a self-hosted server]]></title><description><![CDATA[Drone CI is an open source continues integration and delivery platform built on container technlogoy. It is a lightweight and easy to use solution for testing and deploying your projects. Drone is distributed and run in a Docker container…]]></description><link>https://samuelsson.dev/how-to-install-and-configure-drone-ci-on-a-self-hosted-server/</link><guid isPermaLink="false">https://samuelsson.dev/how-to-install-and-configure-drone-ci-on-a-self-hosted-server/</guid><pubDate>Wed, 27 Feb 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Drone CI is an open source continues integration and delivery platform built on container technlogoy. It is a lightweight and easy to use solution for testing and deploying your projects. Drone is distributed and run in a Docker container meaning it has no install dependencies at all (well, except for Docker itself) and it&amp;#x27;s very easy to set up and configure. In this guide we will install and configure Drone on a self-hosted server and then set up GitHub repositories to automatically test and build our projects.&lt;/p&gt;&lt;p&gt;In this guide we are using Ubuntu 18.04 and Drone version 1.0.0-rc.5.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:65.49999999999999%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Secrets in Drone CI&quot; title=&quot;Secrets in Drone CI&quot; src=&quot;/static/4f9f7a1df86a2681890f267d81e19b2b/5a190/drone_ci.png&quot; srcSet=&quot;/static/4f9f7a1df86a2681890f267d81e19b2b/772e8/drone_ci.png 200w,/static/4f9f7a1df86a2681890f267d81e19b2b/e17e5/drone_ci.png 400w,/static/4f9f7a1df86a2681890f267d81e19b2b/5a190/drone_ci.png 800w,/static/4f9f7a1df86a2681890f267d81e19b2b/c1b63/drone_ci.png 1200w,/static/4f9f7a1df86a2681890f267d81e19b2b/29007/drone_ci.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:65.49999999999999%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Secrets in Drone CI&quot; title=&quot;Secrets in Drone CI&quot; src=&quot;/static/878f482310e1dd56715b11255324c9e3/5a190/drone_ci2.png&quot; srcSet=&quot;/static/878f482310e1dd56715b11255324c9e3/772e8/drone_ci2.png 200w,/static/878f482310e1dd56715b11255324c9e3/e17e5/drone_ci2.png 400w,/static/878f482310e1dd56715b11255324c9e3/5a190/drone_ci2.png 800w,/static/878f482310e1dd56715b11255324c9e3/c1b63/drone_ci2.png 1200w,/static/878f482310e1dd56715b11255324c9e3/29007/drone_ci2.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;h2&gt;Install Docker&lt;/h2&gt;&lt;p&gt;First of all we need to install Docker.&lt;/p&gt;&lt;p&gt;We need to add the GPG for the Docker repository to ensure the downloads are valid.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; -fsSL https://download.docker.com/linux/ubuntu/gpg &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; apt-key &lt;span class=&quot;token function&quot;&gt;add&lt;/span&gt; -&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we need to add the Docker repository to our Ubuntu APT sources because the original sources are not always up to date.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; add-apt-repository &lt;span class=&quot;token string&quot;&gt;&amp;quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;lsb_release -cs&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; stable&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we install Docker Community Edition&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;apt-get&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; -y docker-ce&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Add our user to the Docker group&lt;/h3&gt;&lt;p&gt;Only root and the docker group are allowed to run docker commands so to make our lives easier we can add our normal user to the docker group. That is done with a simple command.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;usermod&lt;/span&gt; -aG &lt;span class=&quot;token function&quot;&gt;docker&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;${&lt;span class=&quot;token environment constant&quot;&gt;USER&lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After that you can logout and login again and then you should be able to see your user added to the docker group with this command:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;id&lt;/span&gt; -nG&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Install Docker Compose&lt;/h2&gt;&lt;p&gt;Visit &lt;a href=&quot;https://github.com/docker/compose/releases&quot;&gt;latest release page&lt;/a&gt; of Docker Compose to make sure you are downloading the latest version. Replace &lt;code class=&quot;language-text&quot;&gt;X.XX.X&lt;/code&gt; in the command below with the version, when writing this the latest version was &lt;code class=&quot;language-text&quot;&gt;1.23.2&lt;/code&gt;.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; -L &lt;span class=&quot;token string&quot;&gt;&amp;quot;https://github.com/docker/compose/releases/download/X.XX.X/docker-compose-&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;uname&lt;/span&gt; -s&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;-&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;uname&lt;/span&gt; -m&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&amp;quot;&lt;/span&gt; -o /usr/local/bin/docker-compose&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make sure it&amp;#x27;s executable.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;chmod&lt;/span&gt; +x /usr/local/bin/docker-compose&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If everything went well you should be able to print the version.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;docker-compose&lt;/span&gt; --version&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Add an application to your git service&lt;/h2&gt;&lt;p&gt;You can use most git service with Drone but in this guide we will use GitHub.&lt;/p&gt;&lt;p&gt;Visit GitHub and go to Settings. Then navigate to &lt;code class=&quot;language-text&quot;&gt;Developer settings -&amp;gt; OAuth Apps&lt;/code&gt; and click &lt;code class=&quot;language-text&quot;&gt;Register a new application&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:73.5%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Secrets in Drone CI&quot; title=&quot;Secrets in Drone CI&quot; src=&quot;/static/c7ab8d905bb7105bdf1836e62492d373/5a190/drone_github_app.png&quot; srcSet=&quot;/static/c7ab8d905bb7105bdf1836e62492d373/772e8/drone_github_app.png 200w,/static/c7ab8d905bb7105bdf1836e62492d373/e17e5/drone_github_app.png 400w,/static/c7ab8d905bb7105bdf1836e62492d373/5a190/drone_github_app.png 800w,/static/c7ab8d905bb7105bdf1836e62492d373/c1b63/drone_github_app.png 1200w,/static/c7ab8d905bb7105bdf1836e62492d373/29007/drone_github_app.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Fill out the form like this:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Application name&lt;/strong&gt;: Any name to identify the app, &amp;quot;Drone&amp;quot; will probably work fine.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Homepage URL&lt;/strong&gt;: The page pointing to Drone, for example &lt;code class=&quot;language-text&quot;&gt;https://ci.example.com/&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Application description&lt;/strong&gt;: Any descriptive text about your application and what it&amp;#x27;s for.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Authorization callback URL&lt;/strong&gt;: If using the same example as above, this should be &lt;code class=&quot;language-text&quot;&gt;https://ci.example.com/login&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Click &lt;code class=&quot;language-text&quot;&gt;Register application&lt;/code&gt; and your app is created. You will also be able to see the credentials of your app, a &lt;code class=&quot;language-text&quot;&gt;Client ID&lt;/code&gt; as well as a &lt;code class=&quot;language-text&quot;&gt;Client Secret&lt;/code&gt;.&lt;/p&gt;&lt;h2&gt;Install Drone&lt;/h2&gt;&lt;p&gt;Because Drone is self-contained it doesn&amp;#x27;t have any dependencies, how great is that? We can pull the image right now to save some time but make sure to use the latest version. You can se all available versions &lt;a href=&quot;https://hub.docker.com/r/drone/drone/tags&quot;&gt;here&lt;/a&gt;. Version &lt;code class=&quot;language-text&quot;&gt;1.0.0-rc.5&lt;/code&gt; is the latest in this example.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;docker&lt;/span&gt; pull drone/drone:1.0.0-rc.5&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We then need a local place to store all our configurations, because they can&amp;#x27;t be stored in the container.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; /etc/drone&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we&amp;#x27;ll create a couple of files, first the docker-compose file used for starting Drone in its container.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt; /etc/drone/docker-compose.yml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And then we add this. The file is YAML so make sure the indentation is correct.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yml&quot;&gt;&lt;pre class=&quot;language-yml&quot;&gt;&lt;code class=&quot;language-yml&quot;&gt;&lt;span class=&quot;token key atrule&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;#x27;3&amp;#x27;&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;drone&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; drone
    &lt;span class=&quot;token key atrule&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; drone/drone&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;1.0.0&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;rc.5
    &lt;span class=&quot;token key atrule&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; 127.0.0.1&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;8000&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;80&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; /var/run/docker.sock&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;/var/run/docker.sock
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; /var/lib/drone&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;/data
    &lt;span class=&quot;token key atrule&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; always
    &lt;span class=&quot;token key atrule&quot;&gt;env_file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; /etc/drone/server.env&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make sure you change the &lt;code class=&quot;language-text&quot;&gt;image&lt;/code&gt; line with the correct docker image version if you pulled a newer one. You can find out what version you&amp;#x27;ve pulled with this command:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;docker&lt;/span&gt; images&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This makes it incredible easy to upgrade Drone in the future.&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;/var/lib/drone&lt;/code&gt; is the local destination where Drone saves its database.&lt;/p&gt;&lt;h3&gt;Configure Drone environments&lt;/h3&gt;&lt;p&gt;We referenced an environments file in our docker-compose file, let&amp;#x27;s create it.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt; /etc/drone/server.env&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And then enter theses values:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Service settings&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;DRONE_SERVER_HOST&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;ci.example.com
&lt;span class=&quot;token assign-left variable&quot;&gt;DRONE_SERVER_PROTO&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;https

&lt;span class=&quot;token comment&quot;&gt;# GitHub Settings&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;DRONE_GITHUB_CLIENT_ID&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;XXXXXXXXX
&lt;span class=&quot;token assign-left variable&quot;&gt;DRONE_GITHUB_CLIENT_SECRET&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;XXXXXXXXXXXX

&lt;span class=&quot;token comment&quot;&gt;# User setings&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;DRONE_USER_CREATE&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;username:xxxxx,machine:false,admin:true
&lt;span class=&quot;token assign-left variable&quot;&gt;DRONE_USER_FILTER&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;xxxxx&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;DRONE_SERVER_HOST&lt;/strong&gt;: Where Nginx will point to our CI, in our example it&amp;#x27;s &lt;code class=&quot;language-text&quot;&gt;ci.example.com&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DRONE_SERVER_PROTO&lt;/strong&gt;: Set your server to use https.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DRONE_GITHUB_CLIENT_ID&lt;/strong&gt; &amp;amp; &lt;strong&gt;DRONE_GITHUB_CLIENT_SECRET&lt;/strong&gt;: Because we are using GitHub we set these to the credentials we generated on our newly created GitHub application.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DRONE_USER_CREATE&lt;/strong&gt;: Create an admin account from the start.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DRONE_USER_FILTER&lt;/strong&gt;: Registration is limited to users included in this list, or users that are members of organizations included in this list. Necessary if only you should be able to access Drone on a public site.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Configure Drone systemd&lt;/h3&gt;&lt;p&gt;Now we need to configure a systemd for managing the Drone service. We create a new service with &lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt; /etc/systemd/system/drone.service&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we paste this into the file:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Unit&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;Drone server
&lt;span class=&quot;token assign-left variable&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;docker.service nginx.service

&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Service&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;Restart&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;always
&lt;span class=&quot;token assign-left variable&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;/usr/local/bin/docker-compose -f /etc/drone/docker-compose.yml up
&lt;span class=&quot;token assign-left variable&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;/usr/local/bin/docker-compose -f /etc/drone/docker-compose.yml stop

&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Install&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;multi-user.target&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Summarized this tells Drone to start after Docker and Nginx and to restart the service if something fails.&lt;/p&gt;&lt;h2&gt;Configure Nginx&lt;/h2&gt;&lt;p&gt;Drone has a built in web server but because we (probably) are using an already installed one we can configure it to serve the Drone GUI. If you are hosting your web server on an other machine you can use the built in web server of Drone instead. You can read about setting up Nginx in my other blog posts.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;/how-to-install-Nginx-and-add-server-blocks&quot;&gt;Install Nginx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;/add-https-to-nginx-blocks-with-lets-encrypt&quot;&gt;Configure SSL with Let&amp;#x27;s Encrypt&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You should also lock down your server so unauthorized persons can&amp;#x27;t access it but GitHub hooks should be able to.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s create and enable a new block in Nginx and then add this configuration. When adding Let&amp;#x27;s Encrypt you&amp;#x27;ll get the choice of both port 443 and 80 so not that important in this step.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;nginx&quot;&gt;&lt;pre class=&quot;language-nginx&quot;&gt;&lt;code class=&quot;language-nginx&quot;&gt;&lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;upstream&lt;/span&gt; drone&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;server&lt;/span&gt; 127.0.0.1:8000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$http_upgrade&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$connection_upgrade&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;default&lt;/span&gt; upgrade&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &amp;#x27;&amp;#x27;      &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;close&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;server&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;443&lt;/span&gt; ssl&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;root&lt;/span&gt; /var/www/ci.example.com/html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;index&lt;/span&gt; index.html index.htm&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;server_name&lt;/span&gt; ci.example.com&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;location&lt;/span&gt; /&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;proxy_pass&lt;/span&gt; http://drone&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;include&lt;/span&gt; proxy_params&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;proxy_set_header&lt;/span&gt; Upgrade &lt;span class=&quot;token variable&quot;&gt;$http_upgrade&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;proxy_set_header&lt;/span&gt; Connection &lt;span class=&quot;token variable&quot;&gt;$connection_upgrade&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;proxy_redirect&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;off&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;proxy_http_version&lt;/span&gt; 1.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;proxy_buffering&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;off&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;chunked_transfer_encoding&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;off&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;proxy_read_timeout&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;86400&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then add Let&amp;#x27;s Encrypt and enable the block. After you&amp;#x27;ve applied the config for the new block and restarted the Nginx server we can start Drone.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; systemctl start drone&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To see if everything works we can check the status.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; systemctl status drone&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should print out something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;● drone.service - Drone server
   Loaded: loaded (/etc/systemd/system/drone.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-01-01 00:00:00 CET; 24h ago
 Main PID: 1258 (docker-compose)
    Tasks: 4 (limit: 2361)
   CGroup: /system.slice/drone.service
           ├─1258 /usr/local/bin/docker-compose -f /etc/drone/docker-compose.yml up
           └─1274 /usr/local/bin/docker-compose -f /etc/drone/docker-compose.yml up

Jan 01 00:00:00 server systemd[1]: Started Drone server.
Jan 01 00:00:00 server docker-compose[1258]: drone is up-to-date
[more logs...]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If it doesn&amp;#x27;t work we can see more of the logs with this command:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; journalctl -u drone&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And if it does work, awesome! Let&amp;#x27;s make Drone start everytime we boot.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; systemctl &lt;span class=&quot;token builtin class-name&quot;&gt;enable&lt;/span&gt; drone&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;#x27;s it. You should now be able to connect to the server when browsing to &lt;code class=&quot;language-text&quot;&gt;https://ci.example.com/&lt;/code&gt;. You simply log in with your GitHub credentials. You can browse and enable pipelines for your repositories.&lt;/p&gt;&lt;h2&gt;Configure Drone pipelines&lt;/h2&gt;&lt;p&gt;All project configuration needed for Drone is saved in a &lt;code class=&quot;language-text&quot;&gt;.drone.yml&lt;/code&gt; file but we don&amp;#x27;t want to write our sensitive credentials directly in that file and make it visible for everyone in our repositories. Even if it&amp;#x27;s a private repo this is bad habit and you should avoid pushing sensitive data.&lt;/p&gt;&lt;p&gt;Drone has an excellent system for storing these secrets and making them accessible when running the build scripts.&lt;/p&gt;&lt;h3&gt;Add secrets to Drone&lt;/h3&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:55.49999999999999%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Secrets in Drone CI&quot; title=&quot;Secrets in Drone CI&quot; src=&quot;/static/c68634a19a20e226f3719a07bcfdf15f/5a190/drone_ci3.png&quot; srcSet=&quot;/static/c68634a19a20e226f3719a07bcfdf15f/772e8/drone_ci3.png 200w,/static/c68634a19a20e226f3719a07bcfdf15f/e17e5/drone_ci3.png 400w,/static/c68634a19a20e226f3719a07bcfdf15f/5a190/drone_ci3.png 800w,/static/c68634a19a20e226f3719a07bcfdf15f/c1b63/drone_ci3.png 1200w,/static/c68634a19a20e226f3719a07bcfdf15f/29007/drone_ci3.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Navigate to your repository in Drone and go to settings. If you scroll down you&amp;#x27;ll find the secrets panel. We will be adding five secrets for our build.&lt;/p&gt;&lt;p&gt;The first four are quite simple, a name followed by the value. They are:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;deploy_host&lt;/strong&gt;: The address to the web server which we will rsync to, without prepended protocol. For example &lt;code class=&quot;language-text&quot;&gt;ci.example.com&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;deploy_port&lt;/strong&gt;: The port for rsync, this is usually &lt;code class=&quot;language-text&quot;&gt;22&lt;/code&gt;, but if you&amp;#x27;ve changed it you need to enter the correct one here.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;deploy_user&lt;/strong&gt;: The user we will be using when rsyncing to our deploy server. A separate user added to the system with limited permissions to the folder being deployed to is a good idea. This could be anything, like &lt;code class=&quot;language-text&quot;&gt;deploy_user&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;deploy_target&lt;/strong&gt;: This is the path on the remote server where you want to deploy to. For example &lt;code class=&quot;language-text&quot;&gt;/var/www/example.com/html/&lt;/code&gt;. Make sure your deploy user has write permissions.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The last one is the private key we will be using to connect to the server. &lt;/p&gt;&lt;h4&gt;Add a private key to Drone secrets&lt;/h4&gt;&lt;p&gt;First we need to generate a new key, you can place it somewhere temporary like in your home directory. Or you can add it the normal way to the &lt;code class=&quot;language-text&quot;&gt;deploy_user&lt;/code&gt; in the &lt;code class=&quot;language-text&quot;&gt;.ssh&lt;/code&gt; directory. You can read more about generating ssh keys &lt;a href=&quot;/generate-and-organize-ssh-keys-on-mac&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;deploy_key&lt;/strong&gt;: Save the whole content of the private key to a new secret.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If you are using &lt;em&gt;Drone CLI&lt;/em&gt; you can instead add the key with this command:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;drone secret &lt;span class=&quot;token function&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;
   --repository username/reponame &lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;
   --name deploy_key &lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;
   --data @/path/to/id_rsa&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You need read permissions to the key file and the &lt;code class=&quot;language-text&quot;&gt;@&lt;/code&gt; at the beginning is not a typo ;) You can read more about installing and configuring Drone CLI &lt;a href=&quot;https://docs.drone.io/cli/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;This is what it should look like afterwards:&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:72.5%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Secrets in Drone CI&quot; title=&quot;Secrets in Drone CI&quot; src=&quot;/static/69227a52eb39a7df83a775e388645563/5a190/drone_secrets.png&quot; srcSet=&quot;/static/69227a52eb39a7df83a775e388645563/772e8/drone_secrets.png 200w,/static/69227a52eb39a7df83a775e388645563/e17e5/drone_secrets.png 400w,/static/69227a52eb39a7df83a775e388645563/5a190/drone_secrets.png 800w,/static/69227a52eb39a7df83a775e388645563/c1b63/drone_secrets.png 1200w,/static/69227a52eb39a7df83a775e388645563/29007/drone_secrets.png 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;h2&gt;Add the Drone configuration to the project&lt;/h2&gt;&lt;p&gt;Now we need to create a &lt;code class=&quot;language-text&quot;&gt;.drone.yml&lt;/code&gt; file in the root of our git repository. This is the &amp;quot;recipe&amp;quot; used by Drone when running the build and deploy pipelines. It can do a lot but we will keep it simple with the basic stuff.&lt;/p&gt;&lt;p&gt;This is an example used for building and deploying this blog with Jekyll:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token key atrule&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pipeline      &lt;span class=&quot;token comment&quot;&gt;# What kind of script - usually pipeline&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; production    &lt;span class=&quot;token comment&quot;&gt;# A descriptive name if the whole pipeline&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot;&gt;when&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;               &lt;span class=&quot;token comment&quot;&gt;# Only run the pipeline when it&amp;#x27;s a push to master&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; push &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; master &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# At the time of this writing there was an issue with latest commit not&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# being pulled correctly. This fixes it but you may not need it.&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot;&gt;clone&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; plugins/git
    &lt;span class=&quot;token key atrule&quot;&gt;pull&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean important&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;steps&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;              &lt;span class=&quot;token comment&quot;&gt;# Categorize each step&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; build     &lt;span class=&quot;token comment&quot;&gt;# Name of the categorized step&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; ruby     &lt;span class=&quot;token comment&quot;&gt;# Use an image for each language used&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;commands&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;       &lt;span class=&quot;token comment&quot;&gt;# Custom bash scripts used for building the project&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; gem install bundler
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; bundle install
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; export JEKYLL_ENV=production
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; bundle exec jekyll build

  &lt;span class=&quot;token comment&quot;&gt;# Deploy step using an Rsync plugin for updating files on remote server.&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;# &amp;quot;settings&amp;quot; property is for plugin specific config&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; deploy
    &lt;span class=&quot;token key atrule&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; drillster/drone&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;rsync
    &lt;span class=&quot;token key atrule&quot;&gt;settings&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;hosts&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;from_secret&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; deploy_host
      &lt;span class=&quot;token key atrule&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;from_secret&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; deploy_port
      &lt;span class=&quot;token key atrule&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;from_secret&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; deploy_user
      &lt;span class=&quot;token key atrule&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;from_secret&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; deploy_key
      &lt;span class=&quot;token key atrule&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token key atrule&quot;&gt;from_secret&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; deploy_target
      &lt;span class=&quot;token key atrule&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; /drone/src/_site/*
      &lt;span class=&quot;token key atrule&quot;&gt;exclude&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;          &lt;span class=&quot;token comment&quot;&gt;# Optional to exclude some files or directories&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;README.md&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;recursive&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean important&quot;&gt;true&lt;/span&gt;   &lt;span class=&quot;token comment&quot;&gt;# Update files recursively on remote, needed if directories&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean important&quot;&gt;true&lt;/span&gt;      &lt;span class=&quot;token comment&quot;&gt;# Remove remote files not present on client side&lt;/span&gt;
      &lt;span class=&quot;token key atrule&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;           &lt;span class=&quot;token comment&quot;&gt;# Run optional remote scripts after rsync is completed&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; cd ~/scripts
        &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; sh run_my_script.sh&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the last deploy step we are using a plugin where most of the properties are loaded from our secretes. This makes the file safe to commit to our repository because it doesn&amp;#x27;t contain any sensible data. &lt;code class=&quot;language-text&quot;&gt;source: /drone/src/&lt;/code&gt; is default path to where the script is running and placing built/compiled files. The following &lt;code class=&quot;language-text&quot;&gt;_site/&lt;/code&gt; is a directory Jekyll creates when building (so that will probably differ for you) and the asterisk means all files in that directory.&lt;/p&gt;&lt;p&gt;The script property is optional and all scripts will run on the remote after rsync is completed.&lt;/p&gt;&lt;p&gt;That&amp;#x27;s it! Commit and push the file and GitHub will automatically communicate with your build server and it will start the pipeline. You can then add other steps, like writing a message in a Slack channel when the build passes or fails.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Keeping a forked repository up to date with the original repository]]></title><description><![CDATA[If you fork an existing git repository and add that fork to your own repositories it will not be in sync automatically with the original repo. That could of course be a good thing if you want to develop the project in your own direction…]]></description><link>https://samuelsson.dev/keeping-a-forked-repository-up-to-date-with-the-original-repository/</link><guid isPermaLink="false">https://samuelsson.dev/keeping-a-forked-repository-up-to-date-with-the-original-repository/</guid><pubDate>Sat, 26 Jan 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you fork an existing git repository and add that fork to your own repositories it will not be in sync automatically with the original repo. That could of course be a good thing if you want to develop the project in your own direction without anyone &amp;quot;ruining&amp;quot; it for you. But sometimes you want the best from both worlds, have your own repo but also get all the updates of the original source. This can be achieved by setting an upstream remote.&lt;/p&gt;&lt;h2&gt;Setting a remote for the forked repo&lt;/h2&gt;&lt;p&gt;Navigate to the folder of your forked repository and type this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; remote -v&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will display all remote addresses used in your repository. If nothing is changed here it will just point to origin, i.e. GitHub/GitLab.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;origin  git@gitlab.com:user/forked_repo (fetch)
origin  git@gitlab.com:user/forked_repo (push)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What we need to do now is to link the upstream repository. This way we will have linked addresses for our own repo, origin, as well as the original source, upstream.&lt;/p&gt;&lt;p&gt;Still in your project folder, type this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; remote &lt;span class=&quot;token function&quot;&gt;add&lt;/span&gt; upstream git@gitlab.com:anotheruser/original_repo.git&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is the same address as the one used for cloning, so just visit the repo and copy the address. If you type &lt;code class=&quot;language-text&quot;&gt;git remote -v&lt;/code&gt; again you will now see something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;origin      git@gitlab.com:user/forked_repo (fetch)
origin      git@gitlab.com:user/forked_repo (push)
upstream    git@gitlab.com:anotheruser/original_repo.git (fetch)
upstream    git@gitlab.com:anotheruser/original_repo.git (push)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Sync your forked repository with upstream&lt;/h2&gt;&lt;p&gt;Now when the upstream branch is set we can easily update our own repository with all the new commits and branches existing on the original source.&lt;/p&gt;&lt;p&gt;First we check out our master branch, the one we want to keep in sync by simply typing:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; checkout master&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we need to fetch the branches and their commits of the upstream repo.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; fetch upstream&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And after that we just need to merge the updated upstream master branch with our current (master) local branch.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; merge upstream/master&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you got any conflicts you need to resolve them but other than that, your forked local master branch is now synced with the original upstream master branch. If you have local branches you can simply merge your local master instead of having to merge with upstream.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Working with multiple git services simultaneously]]></title><description><![CDATA[If you have your git repositories spread across multiple git services, like GitHub for work and GitLab for personal, you can run into problems with your git credentials. Especially if you are using different email addresses, such as the…]]></description><link>https://samuelsson.dev/working-with-multiple-git-services-simultaneously/</link><guid isPermaLink="false">https://samuelsson.dev/working-with-multiple-git-services-simultaneously/</guid><pubDate>Sun, 20 Jan 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you have your git repositories spread across multiple git services, like GitHub for work and GitLab for personal, you can run into problems with your git credentials. Especially if you are using different email addresses, such as the privacy addresses provided by the services. The solution is simple and doesn&amp;#x27;t require many lines in the terminal.&lt;/p&gt;&lt;p&gt;Cloning public repositories usually works out of the box but pushing and working with private repositories don&amp;#x27;t.&lt;/p&gt;&lt;p&gt;The solution is to set up your global git config with just one of your services, preferably your personal one so you don&amp;#x27;t accidentally push to work. Or the one you use most frequently. Then the repositories that differs will get a local config.&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s say that GitLab is our preferred service, so we put those credentials in our global config.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; config --global user.name &lt;span class=&quot;token string&quot;&gt;&amp;quot;Erik Samuelsson&amp;quot;&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; config --global user.email &lt;span class=&quot;token string&quot;&gt;&amp;quot;xxx@users.noreply.gitlab.com&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All repositories on your system will get these credentials as default.&lt;/p&gt;&lt;p&gt;When cloning a project from GitHub we simply need to change the credentials just for that repository.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; clone git@github.com:user/project.git&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then cd into the folder and type:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; config user.name &lt;span class=&quot;token string&quot;&gt;&amp;quot;Mr X&amp;quot;&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; config user.email &lt;span class=&quot;token string&quot;&gt;&amp;quot;yyy@users.noreply.github.com&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now you use GitLab like before with all your repos but this particular project will use the correct GitHub credentials. You can also set up and use different SSH keys for the different services, which you can read more about &lt;a href=&quot;/generate-and-organize-ssh-keys-on-mac&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Keyboard build - va69m with Zealios switches]]></title><description><![CDATA[I've always loved Varmilos keyboards and their amazing build quality. Unfortunately the firmware is often really bad and leave a lot to wish for, especially the lack of programmability. As with most mass produced keyboards the selection of…]]></description><link>https://samuelsson.dev/keyboard-build-va69m-with-zealios-switches/</link><guid isPermaLink="false">https://samuelsson.dev/keyboard-build-va69m-with-zealios-switches/</guid><pubDate>Tue, 18 Dec 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&amp;#x27;ve always loved Varmilos keyboards and their amazing build quality. Unfortunately the firmware is often really bad and leave a lot to wish for, especially the lack of programmability. As with most mass produced keyboards the selection of switches are also quite slim. As for me who like tactile switches the choice is often only between &lt;em&gt;brown&lt;/em&gt; and &lt;em&gt;clear&lt;/em&gt; switches. The solution is easy, a custom build with a Varmilo case but with better switches and support for programming.&lt;/p&gt;&lt;p&gt;Here&amp;#x27;s a teaser picture of the finished keyboard.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAQD/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAdyWW1GT/8QAGBABAQEBAQAAAAAAAAAAAAAAAQIAEiH/2gAIAQEAAQUCa9Wp3eoHVKkiH//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABsQAAICAwEAAAAAAAAAAAAAAAABESECEDFR/9oACAEBAAY/Amp4TlzVkLJx4W7P/8QAGhAAAwEBAQEAAAAAAAAAAAAAAAERIUFRcf/aAAgBAQABPyGsxNMXWKYfQqXDISk63o8ICnTP/9oADAMBAAIAAwAAABDYH//EABYRAQEBAAAAAAAAAAAAAAAAAAABEf/aAAgBAwEBPxCxj//EABYRAQEBAAAAAAAAAAAAAAAAAAABEf/aAAgBAgEBPxCVr//EABwQAQABBAMAAAAAAAAAAAAAAAEAESFRYTFB4f/aAAgBAQABPxABipQquA7lugUtankIlYJQjZNruDANXNkZ/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - finished keyboard&quot; title=&quot;Custom va69m black build - finished keyboard&quot; src=&quot;/static/42e8593eadcd58e013165ab9f623fb8c/4b190/va69m_black_25.jpg&quot; srcSet=&quot;/static/42e8593eadcd58e013165ab9f623fb8c/e07e9/va69m_black_25.jpg 200w,/static/42e8593eadcd58e013165ab9f623fb8c/066f9/va69m_black_25.jpg 400w,/static/42e8593eadcd58e013165ab9f623fb8c/4b190/va69m_black_25.jpg 800w,/static/42e8593eadcd58e013165ab9f623fb8c/e5166/va69m_black_25.jpg 1200w,/static/42e8593eadcd58e013165ab9f623fb8c/b17f8/va69m_black_25.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Here&amp;#x27;s the part list.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Case:&lt;/strong&gt; Varmilo va68m/va69m v2 black aluminum&lt;/li&gt;&lt;li&gt;&lt;strong&gt;PCB:&lt;/strong&gt; LFK78 - 68Key revK from LFKeyboards&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Plate:&lt;/strong&gt; VA68M ISO (which actually is a 69 key) from LFKeyboards&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Switches:&lt;/strong&gt; Zealios v1 65g&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Keycaps:&lt;/strong&gt; &lt;ul&gt;&lt;li&gt;Varmilo Mac White ISO &lt;/li&gt;&lt;li&gt;Varmilo Dark Gray ISO&lt;/li&gt;&lt;li&gt;Nordic layout PBT keycaps from KBDfans&lt;/li&gt;&lt;li&gt;Companion Cube artisan from Clackeys&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;LEDs:&lt;/strong&gt; Varm white 1.8 mm - Random China bulk&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Stabilizers:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;ZealPC clear PCB mounted&lt;/li&gt;&lt;li&gt;Cherry original Plate mounted&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Enough with the writing, let&amp;#x27;s look at some pictures 😍&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAME/8QAFAEBAAAAAAAAAAAAAAAAAAAAAv/aAAwDAQACEAMQAAABpCmMLWAv/8QAGRAAAwEBAQAAAAAAAAAAAAAAAQIDACES/9oACAEBAAEFAgxNzO3s6q8VHD83/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAHBAAAgEFAQAAAAAAAAAAAAAAAQIAEBESITGh/9oACAEBAAY/Asey5YY3oxXZaDXtP//EABsQAAIDAAMAAAAAAAAAAAAAAAABESExEEFh/9oACAEBAAE/IeiiToT8wSaH6AVZAxHBcH//2gAMAwEAAgADAAAAEGjf/8QAGBEAAgMAAAAAAAAAAAAAAAAAACEBETH/2gAIAQMBAT8QdojD/8QAGBEAAwEBAAAAAAAAAAAAAAAAAAERITH/2gAIAQIBAT8QUmj7h//EABsQAAICAwEAAAAAAAAAAAAAAAERACExQXHx/9oACAEBAAE/EC9xYtBoEewxEWK6DwlCB0FDAqNGXIsAGi+RVWNmyrsezc//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - build parts&quot; title=&quot;Custom va69m black build - build parts&quot; src=&quot;/static/144d93b3f4c0e383b3914c346aee1059/4b190/va69m_black_1.jpg&quot; srcSet=&quot;/static/144d93b3f4c0e383b3914c346aee1059/e07e9/va69m_black_1.jpg 200w,/static/144d93b3f4c0e383b3914c346aee1059/066f9/va69m_black_1.jpg 400w,/static/144d93b3f4c0e383b3914c346aee1059/4b190/va69m_black_1.jpg 800w,/static/144d93b3f4c0e383b3914c346aee1059/e5166/va69m_black_1.jpg 1200w,/static/144d93b3f4c0e383b3914c346aee1059/b17f8/va69m_black_1.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;The (almost) complete setup before the build.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEBf/EABUBAQEAAAAAAAAAAAAAAAAAAAEA/9oADAMBAAIQAxAAAAGiNWmKxZH/xAAYEAEBAQEBAAAAAAAAAAAAAAACAQMAEv/aAAgBAQABBQJ0npqqroZaU1mJB6F7/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGhABAAEFAAAAAAAAAAAAAAAAACECECIxYf/aAAgBAQAGPwJjpNuIof/EABoQAQACAwEAAAAAAAAAAAAAAAEAESExQVH/2gAIAQEAAT8hPy1DgLmubdjN2X1hr0ZYpu49n//aAAwDAQACAAMAAAAQlD//xAAYEQACAwAAAAAAAAAAAAAAAAABEBEhQf/aAAgBAwEBPxCTlL//xAAWEQEBAQAAAAAAAAAAAAAAAAAAESH/2gAIAQIBAT8QjH//xAAcEAACAgMBAQAAAAAAAAAAAAABEQAhQVFxMWH/2gAIAQEAAT8QAHICw7O5fOEXmVQP2SOqg/ZFFd3DoEfH28iHOC2Frs//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - plate painted black&quot; title=&quot;Custom va69m black build - plate painted black&quot; src=&quot;/static/56ef3946e6d2e837ab0a4abb3e242d2d/4b190/va69m_black_2.jpg&quot; srcSet=&quot;/static/56ef3946e6d2e837ab0a4abb3e242d2d/e07e9/va69m_black_2.jpg 200w,/static/56ef3946e6d2e837ab0a4abb3e242d2d/066f9/va69m_black_2.jpg 400w,/static/56ef3946e6d2e837ab0a4abb3e242d2d/4b190/va69m_black_2.jpg 800w,/static/56ef3946e6d2e837ab0a4abb3e242d2d/e5166/va69m_black_2.jpg 1200w,/static/56ef3946e6d2e837ab0a4abb3e242d2d/b17f8/va69m_black_2.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Sprayed the plate black to better match the case.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAwACBP/EABYBAQEBAAAAAAAAAAAAAAAAAAMAAf/aAAwDAQACEAMQAAABcccpIsVl/8QAGRABAQEAAwAAAAAAAAAAAAAAAQIAAxEh/9oACAEBAAEFAkzOrx5IpuorD0f/xAAVEQEBAAAAAAAAAAAAAAAAAAAQIf/aAAgBAwEBPwGn/8QAFREBAQAAAAAAAAAAAAAAAAAAECH/2gAIAQIBAT8Bh//EABkQAAIDAQAAAAAAAAAAAAAAAAAQARFBIf/aAAgBAQAGPwLTVNLp/8QAGxABAQADAAMAAAAAAAAAAAAAAQARMVEhYbH/2gAIAQEAAT8h996MGUGZdF7A39saeTf/2gAMAwEAAgADAAAAEEMf/8QAFREBAQAAAAAAAAAAAAAAAAAAAAH/2gAIAQMBAT8QI//EABURAQEAAAAAAAAAAAAAAAAAAAAB/9oACAECAQE/EI1//8QAGRABAQEBAQEAAAAAAAAAAAAAAREAITFB/9oACAEBAAE/EEgCCWCswqQ2esyLqDxvuWs6CshhXgfnbjJT9d//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - sound dampening&quot; title=&quot;Custom va69m black build - sound dampening&quot; src=&quot;/static/c59dc2469116f33392c70a5411245e63/4b190/va69m_black_3.jpg&quot; srcSet=&quot;/static/c59dc2469116f33392c70a5411245e63/e07e9/va69m_black_3.jpg 200w,/static/c59dc2469116f33392c70a5411245e63/066f9/va69m_black_3.jpg 400w,/static/c59dc2469116f33392c70a5411245e63/4b190/va69m_black_3.jpg 800w,/static/c59dc2469116f33392c70a5411245e63/e5166/va69m_black_3.jpg 1200w,/static/c59dc2469116f33392c70a5411245e63/b17f8/va69m_black_3.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;For a better sound dampening I cut foam rubber to be placed between the plate and PCB.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAECA//EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/aAAwDAQACEAMQAAABxm8gkIs//8QAGhAAAwADAQAAAAAAAAAAAAAAAAECAxETEv/aAAgBAQABBQKsj9dNHRlQqbSNn//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/AUf/xAAWEQEBAQAAAAAAAAAAAAAAAAAAESH/2gAIAQIBAT8BxX//xAAZEAACAwEAAAAAAAAAAAAAAAAAEQEQMUH/2gAIAQEABj8CmF1Vo2ZX/8QAGxAAAwACAwAAAAAAAAAAAAAAAAERIUExUZH/2gAIAQEAAT8hUVTGg3Ub80PjMrKp0L8eiEf/2gAMAwEAAgADAAAAELA//8QAFhEBAQEAAAAAAAAAAAAAAAAAAQBx/9oACAEDAQE/EEW1f//EABYRAQEBAAAAAAAAAAAAAAAAAAEAcf/aAAgBAgEBPxARZv/EAB0QAQADAAIDAQAAAAAAAAAAAAEAETEhcUFh4fD/2gAIAQEAAT8Q7wANLGWFiXgUftj9AHOYZiNDDhH5LXktXy5d9ECUAdE//9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - sound dampening&quot; title=&quot;Custom va69m black build - sound dampening&quot; src=&quot;/static/43501f945bc73a20aea3e226c1daa063/4b190/va69m_black_4.jpg&quot; srcSet=&quot;/static/43501f945bc73a20aea3e226c1daa063/e07e9/va69m_black_4.jpg 200w,/static/43501f945bc73a20aea3e226c1daa063/066f9/va69m_black_4.jpg 400w,/static/43501f945bc73a20aea3e226c1daa063/4b190/va69m_black_4.jpg 800w,/static/43501f945bc73a20aea3e226c1daa063/e5166/va69m_black_4.jpg 1200w,/static/43501f945bc73a20aea3e226c1daa063/b17f8/va69m_black_4.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;A perfect fit! Still some adjustments needed but overall it looks good.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQBAgMF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAehGKstxQT//xAAaEAEAAgMBAAAAAAAAAAAAAAACAAEDESES/9oACAEBAAEFAsmR0k+XfUq2nPU//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGRAAAwADAAAAAAAAAAAAAAAAAQIQEUGB/9oACAEBAAY/AgqAdud3/8QAGxABAAICAwAAAAAAAAAAAAAAEQABMUEQIWH/2gAIAQEAAT8hZRul38iVsHXCwjAY0vtP/9oADAMBAAIAAwAAABDY3//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABoQAQEBAQEBAQAAAAAAAAAAAAERACFhMUH/2gAIAQEAAT8QuGKjkfgO3XFQtETzEpHM559ctmT6zOf/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - lubing stabs&quot; title=&quot;Custom va69m black build - lubing stabs&quot; src=&quot;/static/041562ec4e36afc558ecea84e31a9a69/4b190/va69m_black_5.jpg&quot; srcSet=&quot;/static/041562ec4e36afc558ecea84e31a9a69/e07e9/va69m_black_5.jpg 200w,/static/041562ec4e36afc558ecea84e31a9a69/066f9/va69m_black_5.jpg 400w,/static/041562ec4e36afc558ecea84e31a9a69/4b190/va69m_black_5.jpg 800w,/static/041562ec4e36afc558ecea84e31a9a69/e5166/va69m_black_5.jpg 1200w,/static/041562ec4e36afc558ecea84e31a9a69/b17f8/va69m_black_5.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Putting together and lubing the stabs. Unfortunately the PCB didn&amp;#x27;t support PCB mounted stabs (only PCB mounted switches
for some reason) so I had to use parts from different sets.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMFBv/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAFq6meikRyv/8QAGxABAAICAwAAAAAAAAAAAAAAAgADAQQUISL/2gAIAQEAAQUC7weQ8Q7aUsHl1JVIVz//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAdEAADAAICAwAAAAAAAAAAAAAAARECIQMSM1Gh/9oACAEBAAY/AqLrlaeKji16FldWJCnJ8P/EABoQAQEAAwEBAAAAAAAAAAAAAAERACExQWH/2gAIAQEAAT8hPTNX6ZrQtJfMPUAGW5zp6eLkMk4otrZu8uf/2gAMAwEAAgADAAAAEGTv/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFxEAAwEAAAAAAAAAAAAAAAAAAAERUf/aAAgBAgEBPxBFWH//xAAeEAEAAQQCAwAAAAAAAAAAAAABEQAhMVFhoUGRwf/aAAgBAQABPxBJAF0WA3H3qlrUIQuM5iMgT7pfuQNKB8SiwgbMnFFdjxEyvG6lyQUJNwTqv//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - mounted stabs&quot; title=&quot;Custom va69m black build - mounted stabs&quot; src=&quot;/static/62be9ef5e58d965d209c3f28f63694a9/4b190/va69m_black_6.jpg&quot; srcSet=&quot;/static/62be9ef5e58d965d209c3f28f63694a9/e07e9/va69m_black_6.jpg 200w,/static/62be9ef5e58d965d209c3f28f63694a9/066f9/va69m_black_6.jpg 400w,/static/62be9ef5e58d965d209c3f28f63694a9/4b190/va69m_black_6.jpg 800w,/static/62be9ef5e58d965d209c3f28f63694a9/e5166/va69m_black_6.jpg 1200w,/static/62be9ef5e58d965d209c3f28f63694a9/b17f8/va69m_black_6.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;It worked out pretty good anyway. I needed to put some hot glue to keep the stabs in place but other than that they are
smooth as butter.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAIDBP/EABYBAQEBAAAAAAAAAAAAAAAAAAEAAv/aAAwDAQACEAMQAAAByTomXcKN/8QAGRAAAgMBAAAAAAAAAAAAAAAAAQIAAwQS/9oACAEBAAEFAjY5nZleirkrFqZwMTz/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAeEAACAQMFAAAAAAAAAAAAAAABEQACECEiI1GR4f/aAAgBAQAGPwLyBrqblLPKtpDmSJ//xAAbEAEAAgIDAAAAAAAAAAAAAAABABEhMVFxgf/aAAgBAQABPyHeI9iOdo5Ew5D6xFOUtubvL6lDA9n/2gAMAwEAAgADAAAAEFwf/8QAFxEBAAMAAAAAAAAAAAAAAAAAAAERIf/aAAgBAwEBPxDVS//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EAB0QAQACAgMBAQAAAAAAAAAAAAEAESFRMUFhcZH/2gAIAQEAAT8QSL52864ixVcRVZ8rqVyWSgw3DBAsiu/YUqtiKUr1YvJDgOv5P//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - protecting the plate&quot; title=&quot;Custom va69m black build - protecting the plate&quot; src=&quot;/static/e1e0512298e64f5a7b5ef0d41026e992/4b190/va69m_black_7.jpg&quot; srcSet=&quot;/static/e1e0512298e64f5a7b5ef0d41026e992/e07e9/va69m_black_7.jpg 200w,/static/e1e0512298e64f5a7b5ef0d41026e992/066f9/va69m_black_7.jpg 400w,/static/e1e0512298e64f5a7b5ef0d41026e992/4b190/va69m_black_7.jpg 800w,/static/e1e0512298e64f5a7b5ef0d41026e992/e5166/va69m_black_7.jpg 1200w,/static/e1e0512298e64f5a7b5ef0d41026e992/b17f8/va69m_black_7.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;To reduce noise and protect the PCB I put electric tape where the stabs hit the PCB.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAwACBf/EABUBAQEAAAAAAAAAAAAAAAAAAAID/9oADAMBAAIQAxAAAAEg6YCp24r/xAAaEAEAAwADAAAAAAAAAAAAAAACAAEDEBES/9oACAEBAAEFAtdD7TNwqkUTOjx//8QAFxEBAAMAAAAAAAAAAAAAAAAAAAECEf/aAAgBAwEBPwGaMf/EABURAQEAAAAAAAAAAAAAAAAAAAEQ/9oACAECAQE/ARn/xAAaEAACAgMAAAAAAAAAAAAAAAAAMQEQMpHR/9oACAEBAAY/AkhHTGBRqv/EABwQAQACAgMBAAAAAAAAAAAAAAEAESExQVFhgf/aAAgBAQABPyEdLOk6w/IUbjOyvpEjmjBoJ//aAAwDAQACAAMAAAAQUw//xAAWEQEBAQAAAAAAAAAAAAAAAAABABH/2gAIAQMBAT8QRdhX/8QAFhEBAQEAAAAAAAAAAAAAAAAAAQAR/9oACAECAQE/EADCQv/EABwQAQADAAIDAAAAAAAAAAAAAAEAESFBUTFhgf/aAAgBAQABPxBSQNDlO+4e7AvwKYQQcNdv5xGqe4tiJVTrQglQzoJ//9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - testing the PCB&quot; title=&quot;Custom va69m black build - testing the PCB&quot; src=&quot;/static/0b82dcb58179f34164ea3afb9a587de8/4b190/va69m_black_8.jpg&quot; srcSet=&quot;/static/0b82dcb58179f34164ea3afb9a587de8/e07e9/va69m_black_8.jpg 200w,/static/0b82dcb58179f34164ea3afb9a587de8/066f9/va69m_black_8.jpg 400w,/static/0b82dcb58179f34164ea3afb9a587de8/4b190/va69m_black_8.jpg 800w,/static/0b82dcb58179f34164ea3afb9a587de8/e5166/va69m_black_8.jpg 1200w,/static/0b82dcb58179f34164ea3afb9a587de8/b17f8/va69m_black_8.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Before soldering all the switches a good idea is to make sure the PCB works. That is easily done with a pair of
tweezers and an application showing activated keys.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAIFA//EABUBAQEAAAAAAAAAAAAAAAAAAAIB/9oADAMBAAIQAxAAAAFHn5BXCGRf/8QAGRAAAgMBAAAAAAAAAAAAAAAAAQIAAxES/9oACAEBAAEFAlqaxK8rbpI4macBn//EABYRAQEBAAAAAAAAAAAAAAAAAAAREv/aAAgBAwEBPwGxt//EABYRAQEBAAAAAAAAAAAAAAAAAAAREv/aAAgBAgEBPwGVh//EAB0QAAEEAgMAAAAAAAAAAAAAAAIAAREhEDJRcZH/2gAIAQEABj8Ckq4TgXbOth9zcr//xAAbEAEAAwEAAwAAAAAAAAAAAAABABEhMUFRYf/aAAgBAQABPyEY+Cr+olrHoyN8jd8EEN5DqW+E/9oADAMBAAIAAwAAABC/z//EABcRAQEBAQAAAAAAAAAAAAAAAAEAEVH/2gAIAQMBAT8QCtC3y//EABgRAQEAAwAAAAAAAAAAAAAAAAEAESFR/9oACAECAQE/EF6LY9v/xAAeEAEBAAICAgMAAAAAAAAAAAABEQAhQWExgVHR4f/aAAgBAQABPxCpdI0Xth0XaBpyPw4TwPTADSylaV5nH5gg4sGGl69mGrEZofrP/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - soldering&quot; title=&quot;Custom va69m black build - soldering&quot; src=&quot;/static/43543cc120ed54e81d0d4ced1a9b42d3/4b190/va69m_black_9.jpg&quot; srcSet=&quot;/static/43543cc120ed54e81d0d4ced1a9b42d3/e07e9/va69m_black_9.jpg 200w,/static/43543cc120ed54e81d0d4ced1a9b42d3/066f9/va69m_black_9.jpg 400w,/static/43543cc120ed54e81d0d4ced1a9b42d3/4b190/va69m_black_9.jpg 800w,/static/43543cc120ed54e81d0d4ced1a9b42d3/e5166/va69m_black_9.jpg 1200w,/static/43543cc120ed54e81d0d4ced1a9b42d3/b17f8/va69m_black_9.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;When all keys work it&amp;#x27;s time to pull out the soldering iron 👍🏻&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAIFAQT/xAAVAQEBAAAAAAAAAAAAAAAAAAABAv/aAAwDAQACEAMQAAABTOVJaJGE/8QAGhAAAgIDAAAAAAAAAAAAAAAAAAIBERITQf/aAAgBAQABBQLaZlwdZ2hbP//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/Aar/xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAgEBPwFH/8QAGxAAAQQDAAAAAAAAAAAAAAAAAQAQESESUWH/2gAIAQEABj8CprMI5G+IQIB03//EAB4QAAIBAwUAAAAAAAAAAAAAAAERACExQVFhcYGR/9oACAEBAAE/IUVh4qpekH7NzaMS7UAURSBCMLMyg7T/2gAMAwEAAgADAAAAECs//8QAFhEAAwAAAAAAAAAAAAAAAAAAEBFR/9oACAEDAQE/EGof/8QAFxEAAwEAAAAAAAAAAAAAAAAAARARQf/aAAgBAgEBPxCDE//EAB0QAQEAAgIDAQAAAAAAAAAAAAERACExcUFhgaH/2gAIAQEAAT8QrSFLzHacX24WUCmuX5SX3hxB5UCdlxbW0IRsuufk1lhuBAAaSefu8RLOzn//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - foam rubber fits&quot; title=&quot;Custom va69m black build - foam rubber fits&quot; src=&quot;/static/3a87a2eda35060c3d118af085858fe71/4b190/va69m_black_10.jpg&quot; srcSet=&quot;/static/3a87a2eda35060c3d118af085858fe71/e07e9/va69m_black_10.jpg 200w,/static/3a87a2eda35060c3d118af085858fe71/066f9/va69m_black_10.jpg 400w,/static/3a87a2eda35060c3d118af085858fe71/4b190/va69m_black_10.jpg 800w,/static/3a87a2eda35060c3d118af085858fe71/e5166/va69m_black_10.jpg 1200w,/static/3a87a2eda35060c3d118af085858fe71/b17f8/va69m_black_10.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;All corners and the top row done. The foam rubber still fits perfectly.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAwAE/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwEC/9oADAMBAAIQAxAAAAFAXISHHXP/xAAaEAADAQADAAAAAAAAAAAAAAAAAQIDEhMi/9oACAEBAAEFAqakrSTnLL67KnM8o//EABURAQEAAAAAAAAAAAAAAAAAAAAh/9oACAEDAQE/Aar/xAAWEQEBAQAAAAAAAAAAAAAAAAAAISL/2gAIAQIBAT8Byj//xAAZEAACAwEAAAAAAAAAAAAAAAAAMQECIRD/2gAIAQEABj8C2oubAhH/xAAaEAADAQADAAAAAAAAAAAAAAAAARExQWHx/9oACAEBAAE/IWsYRbNiRdX19s99nEh//9oADAMBAAIAAwAAABCo/wD/xAAVEQEBAAAAAAAAAAAAAAAAAAAQEf/aAAgBAwEBPxCF/8QAFhEAAwAAAAAAAAAAAAAAAAAAEBFR/9oACAECAQE/EHAf/8QAHRABAAICAgMAAAAAAAAAAAAAAQARMWEhQVFxsf/aAAgBAQABPxBrdGyXtcWyPmDq8QIZzNXyDWne2ipQA9z/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - almost done&quot; title=&quot;Custom va69m black build - almost done&quot; src=&quot;/static/3549dc714f825d6f86e98b45bf82fa4d/4b190/va69m_black_11.jpg&quot; srcSet=&quot;/static/3549dc714f825d6f86e98b45bf82fa4d/e07e9/va69m_black_11.jpg 200w,/static/3549dc714f825d6f86e98b45bf82fa4d/066f9/va69m_black_11.jpg 400w,/static/3549dc714f825d6f86e98b45bf82fa4d/4b190/va69m_black_11.jpg 800w,/static/3549dc714f825d6f86e98b45bf82fa4d/e5166/va69m_black_11.jpg 1200w,/static/3549dc714f825d6f86e98b45bf82fa4d/b17f8/va69m_black_11.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Almost done.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAwQA/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgAB/9oADAMBAAIQAxAAAAFpWIqfS6z/xAAaEAADAAMBAAAAAAAAAAAAAAAAAQIDERIx/9oACAEBAAEFAnaLcs0emROZ6P/EABURAQEAAAAAAAAAAAAAAAAAAAEQ/9oACAEDAQE/AQn/xAAVEQEBAAAAAAAAAAAAAAAAAAAQEf/aAAgBAgEBPwGn/8QAGxAAAQQDAAAAAAAAAAAAAAAAAQAQETECImH/2gAIAQEABj8C2KtokjoWU23/xAAYEAEBAQEBAAAAAAAAAAAAAAABABExQf/aAAgBAQABPyE7xluZPjYHWjkMy3gi/wD/2gAMAwEAAgADAAAAEHD/AP/EABYRAQEBAAAAAAAAAAAAAAAAAAEREP/aAAgBAwEBPxCpTP/EABYRAAMAAAAAAAAAAAAAAAAAAAEQIf/aAAgBAgEBPxA0v//EABsQAQADAQADAAAAAAAAAAAAAAEAESFBMVFh/9oACAEBAAE/EGqCdb7H+B2mDcqmllCjR++yJ5QG4D5qJW3c/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - recut foam rubber&quot; title=&quot;Custom va69m black build - recut foam rubber&quot; src=&quot;/static/adf61dc6cc165b64d8874b4a24c8ea87/4b190/va69m_black_12.jpg&quot; srcSet=&quot;/static/adf61dc6cc165b64d8874b4a24c8ea87/e07e9/va69m_black_12.jpg 200w,/static/adf61dc6cc165b64d8874b4a24c8ea87/066f9/va69m_black_12.jpg 400w,/static/adf61dc6cc165b64d8874b4a24c8ea87/4b190/va69m_black_12.jpg 800w,/static/adf61dc6cc165b64d8874b4a24c8ea87/e5166/va69m_black_12.jpg 1200w,/static/adf61dc6cc165b64d8874b4a24c8ea87/b17f8/va69m_black_12.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Had to cut the sides of the foam rubber between the plate and PCB to make it fit in the case but the size was just
perfect. This will contribute to a nice and deep sound inside the aluminium case.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAABAUA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAgH/2gAMAwEAAhADEAAAAaIFxTU6dkf/xAAaEAACAgMAAAAAAAAAAAAAAAABAgARAxMx/9oACAEBAAEFAqVQ+ZQdxj8dalz/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPwFn/8QAFREBAQAAAAAAAAAAAAAAAAAAARD/2gAIAQIBAT8BCf/EABsQAAEEAwAAAAAAAAAAAAAAAAABEBEhMUFR/9oACAEBAAY/AsQVam34f//EABsQAAMAAgMAAAAAAAAAAAAAAAABESExUaGx/9oACAEBAAE/IXDSIicXwKq9DNkWVasWdE8sf//aAAwDAQACAAMAAAAQhx//xAAXEQEBAQEAAAAAAAAAAAAAAAABACEx/9oACAEDAQE/EEnLb//EABcRAAMBAAAAAAAAAAAAAAAAAAABITH/2gAIAQIBAT8QQ9If/8QAGxABAQACAwEAAAAAAAAAAAAAAREAITFBgVH/2gAIAQEAAT8QnF25oMBPZ5sHuAUCnyHlxX+xMctKSOilj5w4ME1DUuf/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - installing LEDs&quot; title=&quot;Custom va69m black build - installing LEDs&quot; src=&quot;/static/89b2750cffdc83c38b8abd4db7378e45/4b190/va69m_black_13.jpg&quot; srcSet=&quot;/static/89b2750cffdc83c38b8abd4db7378e45/e07e9/va69m_black_13.jpg 200w,/static/89b2750cffdc83c38b8abd4db7378e45/066f9/va69m_black_13.jpg 400w,/static/89b2750cffdc83c38b8abd4db7378e45/4b190/va69m_black_13.jpg 800w,/static/89b2750cffdc83c38b8abd4db7378e45/e5166/va69m_black_13.jpg 1200w,/static/89b2750cffdc83c38b8abd4db7378e45/b17f8/va69m_black_13.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Now it&amp;#x27;s time for the LEDs.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAFg6CNUgD//xAAZEAEBAQEBAQAAAAAAAAAAAAACAQADBCH/2gAIAQEAAQUCaYU9WPWKX7unK3Awn//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABoQAAICAwAAAAAAAAAAAAAAAAABEBEhIjH/2gAIAQEABj8CtcMotONSj//EABwQAQACAQUAAAAAAAAAAAAAAAEAEUEQITFRgf/aAAgBAQABPyF3yMGJvV7EoyTQYuh3BAJ//9oADAMBAAIAAwAAABBIP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EAB0QAQACAgIDAAAAAAAAAAAAAAEAESExQWFx8PH/2gAIAQEAAT8QvqXvZ8Qw4HpiZABXhjHVcQBQr1hEMbXaz//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - all LEDs installed&quot; title=&quot;Custom va69m black build - all LEDs installed&quot; src=&quot;/static/99652da7279bc8d2df179be3a9cde3cf/4b190/va69m_black_14.jpg&quot; srcSet=&quot;/static/99652da7279bc8d2df179be3a9cde3cf/e07e9/va69m_black_14.jpg 200w,/static/99652da7279bc8d2df179be3a9cde3cf/066f9/va69m_black_14.jpg 400w,/static/99652da7279bc8d2df179be3a9cde3cf/4b190/va69m_black_14.jpg 800w,/static/99652da7279bc8d2df179be3a9cde3cf/e5166/va69m_black_14.jpg 1200w,/static/99652da7279bc8d2df179be3a9cde3cf/b17f8/va69m_black_14.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;A nice anode and cathode forest.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAQCBf/EABYBAQEBAAAAAAAAAAAAAAAAAAEAAv/aAAwDAQACEAMQAAABZs5GWpEL/8QAHRAAAgIBBQAAAAAAAAAAAAAAAAEDBBECEhMUIf/aAAgBAQABBQLkkjOxrFYaLUXjj2mcH//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/AVf/xAAXEQEAAwAAAAAAAAAAAAAAAAAAARIh/9oACAECAQE/AY1V/8QAGxAAAgIDAQAAAAAAAAAAAAAAAAEhMRESMuH/2gAIAQEABj8Cw5Ojw2RFFJn/xAAcEAEAAgIDAQAAAAAAAAAAAAABABEhQTFRcYH/2gAIAQEAAT8h5gg3crSn9gOUtztL2ld9xQOeiQ4fZP/aAAwDAQACAAMAAAAQA+//xAAXEQEAAwAAAAAAAAAAAAAAAAABEBEh/9oACAEDAQE/EErYf//EABcRAQEBAQAAAAAAAAAAAAAAAAEAMUH/2gAIAQIBAT8QWJDy/8QAGxABAQADAQEBAAAAAAAAAAAAAREAITFRgbH/2gAIAQEAAT8QAHMGxPuDcpLNjS03nehtlK+tzii1BI/HHHYbUW+jkVr7VHP/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - cutting of the LED legs&quot; title=&quot;Custom va69m black build - cutting of the LED legs&quot; src=&quot;/static/c104675a215ff6773db367d5acdb2193/4b190/va69m_black_15.jpg&quot; srcSet=&quot;/static/c104675a215ff6773db367d5acdb2193/e07e9/va69m_black_15.jpg 200w,/static/c104675a215ff6773db367d5acdb2193/066f9/va69m_black_15.jpg 400w,/static/c104675a215ff6773db367d5acdb2193/4b190/va69m_black_15.jpg 800w,/static/c104675a215ff6773db367d5acdb2193/e5166/va69m_black_15.jpg 1200w,/static/c104675a215ff6773db367d5acdb2193/b17f8/va69m_black_15.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Unfortunately it wouldn&amp;#x27;t fit nicely in the case without being cut off.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAQCAwX/xAAVAQEBAAAAAAAAAAAAAAAAAAACA//aAAwDAQACEAMQAAABmnprSpSMBX//xAAaEAEBAAIDAAAAAAAAAAAAAAACAREhAAMS/9oACAEBAAEFAk8Vt5m4R5nZtQSc/8QAFREBAQAAAAAAAAAAAAAAAAAAABH/2gAIAQMBAT8BiP/EABYRAQEBAAAAAAAAAAAAAAAAAAAREv/aAAgBAgEBPwHSv//EAB0QAAEEAgMAAAAAAAAAAAAAAAEAAhARQVESITL/2gAIAQEABj8Codu0ELziKC4t9bj/xAAaEAADAAMBAAAAAAAAAAAAAAAAAREhMWFB/9oACAEBAAE/IWMeyISr4LRvLImakjD0M8IRyXrP/9oADAMBAAIAAwAAABCTz//EABcRAQADAAAAAAAAAAAAAAAAAAABMVH/2gAIAQMBAT8Qqjb/xAAYEQACAwAAAAAAAAAAAAAAAAAAARExUf/aAAgBAgEBPxCFDyf/xAAbEAEAAgMBAQAAAAAAAAAAAAABADERIXFBUf/aAAgBAQABPxA0eKRTrRB+6ndHfZoN3iAbq0RL/G8q9u5+S962xfs//9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - more sound dampening&quot; title=&quot;Custom va69m black build - more sound dampening&quot; src=&quot;/static/65be74fa04a5711f2cfc6e0419f947ba/4b190/va69m_black_16.jpg&quot; srcSet=&quot;/static/65be74fa04a5711f2cfc6e0419f947ba/e07e9/va69m_black_16.jpg 200w,/static/65be74fa04a5711f2cfc6e0419f947ba/066f9/va69m_black_16.jpg 400w,/static/65be74fa04a5711f2cfc6e0419f947ba/4b190/va69m_black_16.jpg 800w,/static/65be74fa04a5711f2cfc6e0419f947ba/e5166/va69m_black_16.jpg 1200w,/static/65be74fa04a5711f2cfc6e0419f947ba/b17f8/va69m_black_16.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;It probably doesn&amp;#x27;t do much for the sound but I fill all cavities with dampening material.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAUBAwT/xAAWAQEBAQAAAAAAAAAAAAAAAAABAgP/2gAMAwEAAhADEAAAAYWO6c7XmkT/xAAaEAACAwEBAAAAAAAAAAAAAAAAAQIDEhET/9oACAEBAAEFAraNN9i1fYaJ5meUT//EABYRAQEBAAAAAAAAAAAAAAAAAAASIv/aAAgBAwEBPwGWn//EABYRAQEBAAAAAAAAAAAAAAAAAAASIv/aAAgBAgEBPwGmX//EABwQAAEDBQAAAAAAAAAAAAAAAAEAEBESITJBkf/aAAgBAQAGPwKoHq3Kya4b/8QAGxABAQACAwEAAAAAAAAAAAAAAQARUSExQYH/2gAIAQEAAT8hVl5fIHdBqCcOzxDZbvvf/9oADAMBAAIAAwAAABAoH//EABgRAAIDAAAAAAAAAAAAAAAAAAABESFx/9oACAEDAQE/EHK0aP/EABgRAAIDAAAAAAAAAAAAAAAAAAABQXGh/9oACAECAQE/EFBlcP/EAB0QAQACAgIDAAAAAAAAAAAAAAERIQBRMXGBscH/2gAIAQEAAT8QaAubHqcPNorj7gcSbYfeIAQmLd4dFTgUnnJorsluf//Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - reduce acoustic resonance in case&quot; title=&quot;Custom va69m black build - reduce acoustic resonance in case&quot; src=&quot;/static/fe52481804c13dc0ab3cb494f351ca8e/4b190/va69m_black_17.jpg&quot; srcSet=&quot;/static/fe52481804c13dc0ab3cb494f351ca8e/e07e9/va69m_black_17.jpg 200w,/static/fe52481804c13dc0ab3cb494f351ca8e/066f9/va69m_black_17.jpg 400w,/static/fe52481804c13dc0ab3cb494f351ca8e/4b190/va69m_black_17.jpg 800w,/static/fe52481804c13dc0ab3cb494f351ca8e/e5166/va69m_black_17.jpg 1200w,/static/fe52481804c13dc0ab3cb494f351ca8e/b17f8/va69m_black_17.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;I put electric tape where the plate is laying against the case for decreased acoustic resonance.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAABAAF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/2gAMAwEAAhADEAAAAYTgnWjCiX//xAAcEAACAQUBAAAAAAAAAAAAAAABAhEAAwQTIjL/2gAIAQEAAQUCyAwbuk8X5LPMbQB//8QAFREBAQAAAAAAAAAAAAAAAAAAABH/2gAIAQMBAT8BV//EABYRAQEBAAAAAAAAAAAAAAAAAAABEv/aAAgBAgEBPwFmv//EABwQAAICAgMAAAAAAAAAAAAAAAABAiEQERIzQf/aAAgBAQAGPwJKMtUdgvRcbLWP/8QAGRAAAwEBAQAAAAAAAAAAAAAAAAERITGR/9oACAEBAAE/IYmGoxtHqese11Ojvk4lI4SQlkR//9oADAMBAAIAAwAAABD7z//EABYRAQEBAAAAAAAAAAAAAAAAAAARAf/aAAgBAwEBPxC6l//EABcRAQEBAQAAAAAAAAAAAAAAAAEAQcH/2gAIAQIBAT8QA3kx/8QAHRABAAICAgMAAAAAAAAAAAAAAQARIUExUWHh8P/aAAgBAQABPxDmiBYZtzCwL46gKShUbhUGXJreN+WBD1ufcLjACgn/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - foam rubber in bottom of the case&quot; title=&quot;Custom va69m black build - foam rubber in bottom of the case&quot; src=&quot;/static/f1aaa6921f8d355ffe204a72baf7e7c3/4b190/va69m_black_18.jpg&quot; srcSet=&quot;/static/f1aaa6921f8d355ffe204a72baf7e7c3/e07e9/va69m_black_18.jpg 200w,/static/f1aaa6921f8d355ffe204a72baf7e7c3/066f9/va69m_black_18.jpg 400w,/static/f1aaa6921f8d355ffe204a72baf7e7c3/4b190/va69m_black_18.jpg 800w,/static/f1aaa6921f8d355ffe204a72baf7e7c3/e5166/va69m_black_18.jpg 1200w,/static/f1aaa6921f8d355ffe204a72baf7e7c3/b17f8/va69m_black_18.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;A piece of foam rubber was put in the bottom of the case for... you guessed it! Decreased acoustic resonance.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAMFAgT/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAABdl/DFIlh/8QAGxAAAgIDAQAAAAAAAAAAAAAAAQIAAwQREjH/2gAIAQEAAQUCsJUjI5gYNPZbRFTQ/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGhAAAgIDAAAAAAAAAAAAAAAAABABIREiYf/aAAgBAQAGPwLhdmYWq//EABwQAAMAAgMBAAAAAAAAAAAAAAABESExQVFhof/aAAgBAQABPyGvdrTRQlg8FdEzqbHGfg7lP//aAAwDAQACAAMAAAAQrC//xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPxBn/8QAFxEBAQEBAAAAAAAAAAAAAAAAAQARQf/aAAgBAgEBPxATtl//xAAeEAEAAgEEAwAAAAAAAAAAAAABABExIUFRcWGBwf/aAAgBAQABPxC+F6sM7PsLWM1eZ6lJJdOyPCR0uQ5viVg07F16PHiAC8rW8z//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - installed in case&quot; title=&quot;Custom va69m black build - installed in case&quot; src=&quot;/static/3a10687eb5a80bb2571c3bc8e7a51871/4b190/va69m_black_19.jpg&quot; srcSet=&quot;/static/3a10687eb5a80bb2571c3bc8e7a51871/e07e9/va69m_black_19.jpg 200w,/static/3a10687eb5a80bb2571c3bc8e7a51871/066f9/va69m_black_19.jpg 400w,/static/3a10687eb5a80bb2571c3bc8e7a51871/4b190/va69m_black_19.jpg 800w,/static/3a10687eb5a80bb2571c3bc8e7a51871/e5166/va69m_black_19.jpg 1200w,/static/3a10687eb5a80bb2571c3bc8e7a51871/b17f8/va69m_black_19.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Installed in the case, all nude without caps.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAwAC/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAWPYxmeX/8QAGRAAAgMBAAAAAAAAAAAAAAAAAAIBAxES/9oACAEBAAEFAnumGm3DZYuTsWrDT//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAECAQE/AVf/xAAcEAACAgIDAAAAAAAAAAAAAAAAAQIRECEiMlH/2gAIAQEABj8CcfC5SNKRa7I5u3j/xAAeEAEAAQQCAwAAAAAAAAAAAAABABEhMVEQQWGhsf/aAAgBAQABPyHHzZjiz9SuWl2OYwDPoQbvBdHH/9oADAMBAAIAAwAAABCcL//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/EEf/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAgEBPxAQJ//EABwQAQACAgMBAAAAAAAAAAAAAAEAESFBMWFxkf/aAAgBAQABPxAkAqK+nYGpfyb0ZfMsHG3osnYtnACJbhORghUMnwevbEHGPJ//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - another view installed in case&quot; title=&quot;Custom va69m black build - another view installed in case&quot; src=&quot;/static/8d65080d747aafceb3b2e342cbdc407f/4b190/va69m_black_20.jpg&quot; srcSet=&quot;/static/8d65080d747aafceb3b2e342cbdc407f/e07e9/va69m_black_20.jpg 200w,/static/8d65080d747aafceb3b2e342cbdc407f/066f9/va69m_black_20.jpg 400w,/static/8d65080d747aafceb3b2e342cbdc407f/4b190/va69m_black_20.jpg 800w,/static/8d65080d747aafceb3b2e342cbdc407f/e5166/va69m_black_20.jpg 1200w,/static/8d65080d747aafceb3b2e342cbdc407f/b17f8/va69m_black_20.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Another view.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQFAgP/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAFrE7kUBYP/xAAZEAADAQEBAAAAAAAAAAAAAAAAAQIRAxL/2gAIAQEAAQUCXS6HTNHTxuvT4af/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAgEBPwFX/8QAHxAAAgAFBQAAAAAAAAAAAAAAAAECAxEhIhJBUXGR/9oACAEBAAY/AsZb7ZeYq8Qm/pd41NMKuVbP/8QAHhABAAICAQUAAAAAAAAAAAAAAQARMVEhQWGBkaH/2gAIAQEAAT8hGxNtEONXQv7G+X2QDFrQNeJhZ3Szwl6E/9oADAMBAAIAAwAAABCkH//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABYRAAMAAAAAAAAAAAAAAAAAAAABEf/aAAgBAgEBPxCJEH//xAAdEAEAAgIDAQEAAAAAAAAAAAABESEAMUFRgXGR/9oACAEBAAE/EADM2Ai75xyGFb7pWsVSp7bMtEkxiRKcIV8yvgxaF1+GvuI+6m0PW8//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - adding keycaps&quot; title=&quot;Custom va69m black build - adding keycaps&quot; src=&quot;/static/fc9bdf005cd20b343ce8c71397f4f0d6/4b190/va69m_black_21.jpg&quot; srcSet=&quot;/static/fc9bdf005cd20b343ce8c71397f4f0d6/e07e9/va69m_black_21.jpg 200w,/static/fc9bdf005cd20b343ce8c71397f4f0d6/066f9/va69m_black_21.jpg 400w,/static/fc9bdf005cd20b343ce8c71397f4f0d6/4b190/va69m_black_21.jpg 800w,/static/fc9bdf005cd20b343ce8c71397f4f0d6/e5166/va69m_black_21.jpg 1200w,/static/fc9bdf005cd20b343ce8c71397f4f0d6/b17f8/va69m_black_21.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Start adding the keycaps. Also added some tape at the space bar to avoid dust getting in the case.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABAABAv/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAVYDofHj/8QAGRAAAgMBAAAAAAAAAAAAAAAAAQIAAxEh/9oACAEBAAEFAgxaOTWqWavdAE2f/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAHRABAAEDBQAAAAAAAAAAAAAAAQACEBESISJRcf/aAAgBAQAGPwLjvNSnkzFKkz1f/8QAGxABAAIDAQEAAAAAAAAAAAAAAQARITFRQWH/2gAIAQEAAT8hRTIb+TVU6zKYaewB7AaQ7dW9cwj/2gAMAwEAAgADAAAAEBPP/8QAFREBAQAAAAAAAAAAAAAAAAAAEBH/2gAIAQMBAT8Qh//EABURAQEAAAAAAAAAAAAAAAAAABAR/9oACAECAQE/EKf/xAAbEAEAAgMBAQAAAAAAAAAAAAABABEhYXFBkf/aAAgBAQABPxAMCiUSHeXB6ublrMFgMkGzkArNbgPqtvrFqf/Z&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - finished build&quot; title=&quot;Custom va69m black build - finished build&quot; src=&quot;/static/9e1dea14f118183e76811902f4a9fed6/4b190/va69m_black_22.jpg&quot; srcSet=&quot;/static/9e1dea14f118183e76811902f4a9fed6/e07e9/va69m_black_22.jpg 200w,/static/9e1dea14f118183e76811902f4a9fed6/066f9/va69m_black_22.jpg 400w,/static/9e1dea14f118183e76811902f4a9fed6/4b190/va69m_black_22.jpg 800w,/static/9e1dea14f118183e76811902f4a9fed6/e5166/va69m_black_22.jpg 1200w,/static/9e1dea14f118183e76811902f4a9fed6/b17f8/va69m_black_22.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;All done!&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAIBBAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAD/9oADAMBAAIQAxAAAAHOeA1sjhL/AP/EABcQAAMBAAAAAAAAAAAAAAAAAAABEQL/2gAIAQEAAQUCFIJqZxRI/8QAFxEAAwEAAAAAAAAAAAAAAAAAAAExEf/aAAgBAwEBPwF64KH/xAAXEQADAQAAAAAAAAAAAAAAAAAAASEx/9oACAECAQE/AVNGf//EABkQAAIDAQAAAAAAAAAAAAAAAAAhEDJhcf/aAAgBAQAGPwI2KvoxH//EABwQAAICAgMAAAAAAAAAAAAAAAABESExoUFRYf/aAAgBAQABPyF+Ig2WLCjZTuXaQiGRTwR//9oADAMBAAIAAwAAABAA7//EABYRAQEBAAAAAAAAAAAAAAAAAAEAEf/aAAgBAwEBPxAwOAv/xAAWEQEBAQAAAAAAAAAAAAAAAAABABH/2gAIAQIBAT8QRC1W/8QAHBABAQADAAMBAAAAAAAAAAAAAREAIUExUYGR/9oACAEBAAE/ELUKXt8Ywa066vr8wqxDRYu+/M0Mg+J9mNLd2KXIECOgthn/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - programming with QMK&quot; title=&quot;Custom va69m black build - programming with QMK&quot; src=&quot;/static/13cf875bd2f13c44aadbeb3a1e2727a0/4b190/va69m_black_27.jpg&quot; srcSet=&quot;/static/13cf875bd2f13c44aadbeb3a1e2727a0/e07e9/va69m_black_27.jpg 200w,/static/13cf875bd2f13c44aadbeb3a1e2727a0/066f9/va69m_black_27.jpg 400w,/static/13cf875bd2f13c44aadbeb3a1e2727a0/4b190/va69m_black_27.jpg 800w,/static/13cf875bd2f13c44aadbeb3a1e2727a0/e5166/va69m_black_27.jpg 1200w,/static/13cf875bd2f13c44aadbeb3a1e2727a0/b17f8/va69m_black_27.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;
&lt;em&gt;Programming the keyboard running QMK.&lt;/em&gt;&lt;/p&gt;&lt;h2&gt;Some more pictures&lt;/h2&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAQDBQb/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAABdjql00gmL//EABoQAQACAwEAAAAAAAAAAAAAAAECAwAREyL/2gAIAQEAAQUCLK5nQ6ZaaSSZB8//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAaEAACAgMAAAAAAAAAAAAAAAAAEQEhEBIx/9oACAEBAAY/AmzXDgovp//EABoQAQACAwEAAAAAAAAAAAAAAAEAESExUUH/2gAIAQEAAT8hAoF93KaVTss7OQekSF51cq9FlZ//2gAMAwEAAgADAAAAENwP/8QAFREBAQAAAAAAAAAAAAAAAAAAEBH/2gAIAQMBAT8Qh//EABYRAAMAAAAAAAAAAAAAAAAAAAEQEf/aAAgBAgEBPxChf//EABsQAQEAAgMBAAAAAAAAAAAAAAERADEhUWHR/9oACAEBAAE/EHNyCOBy+Yd6Cbv3BwQx9wW47occ9mO1K2b8nWLSG1G35n//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - finished build&quot; title=&quot;Custom va69m black build - finished build&quot; src=&quot;/static/d425102eba8a190d2fe05f295e08021e/4b190/va69m_black_24.jpg&quot; srcSet=&quot;/static/d425102eba8a190d2fe05f295e08021e/e07e9/va69m_black_24.jpg 200w,/static/d425102eba8a190d2fe05f295e08021e/066f9/va69m_black_24.jpg 400w,/static/d425102eba8a190d2fe05f295e08021e/4b190/va69m_black_24.jpg 800w,/static/d425102eba8a190d2fe05f295e08021e/e5166/va69m_black_24.jpg 1200w,/static/d425102eba8a190d2fe05f295e08021e/b17f8/va69m_black_24.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAF7IUpsE4f/xAAaEAEAAgMBAAAAAAAAAAAAAAABAAIDERIh/9oACAEBAAEFAnIFm3JubjjLSvh//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGxAAAQQDAAAAAAAAAAAAAAAAEQAQEiECIlH/2gAIAQEABj8C3MeoyOL1Tf/EABoQAAIDAQEAAAAAAAAAAAAAAAABESFBccH/2gAIAQEAAT8hYaIUnohMbNOxuWjSKKWH/9oADAMBAAIAAwAAABA8/wD/xAAVEQEBAAAAAAAAAAAAAAAAAAAQEf/aAAgBAwEBPxCH/8QAFREBAQAAAAAAAAAAAAAAAAAAEBH/2gAIAQIBAT8Qp//EABsQAQADAQEBAQAAAAAAAAAAAAEAESExUUGR/9oACAEBAAE/EA6yoGwffol2eADXecgEy0VizeTec/IxcoKt6z//2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - finished build&quot; title=&quot;Custom va69m black build - finished build&quot; src=&quot;/static/899823f64b6ab8f0a7c3a4e4a8b29e20/4b190/va69m_black_23.jpg&quot; srcSet=&quot;/static/899823f64b6ab8f0a7c3a4e4a8b29e20/e07e9/va69m_black_23.jpg 200w,/static/899823f64b6ab8f0a7c3a4e4a8b29e20/066f9/va69m_black_23.jpg 400w,/static/899823f64b6ab8f0a7c3a4e4a8b29e20/4b190/va69m_black_23.jpg 800w,/static/899823f64b6ab8f0a7c3a4e4a8b29e20/e5166/va69m_black_23.jpg 1200w,/static/899823f64b6ab8f0a7c3a4e4a8b29e20/b17f8/va69m_black_23.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAQFAf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAF/YjZWESP/xAAZEAEBAQEBAQAAAAAAAAAAAAACAQMAESL/2gAIAQEAAQUC20gR0lPvJ28NC7kvn//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABsQAAEEAwAAAAAAAAAAAAAAAAABESFREIGx/9oACAEBAAY/Ao2IuOlMPcn/xAAZEAEAAwEBAAAAAAAAAAAAAAABABExIUH/2gAIAQEAAT8hEhIySOQh1vb9bLBXPDyL21Wn/9oADAMBAAIAAwAAABDbP//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/EEf/xAAVEQEBAAAAAAAAAAAAAAAAAAAQIf/aAAgBAgEBPxCH/8QAHxAAAgEEAgMAAAAAAAAAAAAAAREAITFBUYGRYaHR/9oACAEBAAE/EDJSDTHyMaymLeowMEFxJSSZ+h+YaDhxWKp6oOdxKWu5LelP/9k=&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - finished build with companion cube artisan&quot; title=&quot;Custom va69m black build - finished build with companion cube artisan&quot; src=&quot;/static/c8afffb07cef7877b814fcef4a4f7299/4b190/va69m_black_28.jpg&quot; srcSet=&quot;/static/c8afffb07cef7877b814fcef4a4f7299/e07e9/va69m_black_28.jpg 200w,/static/c8afffb07cef7877b814fcef4a4f7299/066f9/va69m_black_28.jpg 400w,/static/c8afffb07cef7877b814fcef4a4f7299/4b190/va69m_black_28.jpg 800w,/static/c8afffb07cef7877b814fcef4a4f7299/e5166/va69m_black_28.jpg 1200w,/static/c8afffb07cef7877b814fcef4a4f7299/b17f8/va69m_black_28.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:75%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAUCAwT/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAAB1WJGESE5X//EABoQAQACAwEAAAAAAAAAAAAAAAIAAQMEEhH/2gAIAQEAAQUCqj5HsUUHys2Xg2p//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGxAAAgIDAQAAAAAAAAAAAAAAAREAEAIiQTH/2gAIAQEABj8CYpAOalL2LDva/8QAGxABAAMBAAMAAAAAAAAAAAAAAQARMSFRcZH/2gAIAQEAAT8hYKGz3DaPkZ8vW5U2BdQw2NnhAHGf/9oADAMBAAIAAwAAABBMD//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EAB0QAAMBAAIDAQAAAAAAAAAAAAERIQBBUTFhcaH/2gAIAQEAAT8QQ4sBNMfgwkAC+UqHsjccbiD5AxwxcTY7Oce5zRJ39yMaXvf/2Q==&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Custom va69m black build - finished build&quot; title=&quot;Custom va69m black build - finished build&quot; src=&quot;/static/e4d69de17088434f2c07e89ba5846b95/4b190/va69m_black_26.jpg&quot; srcSet=&quot;/static/e4d69de17088434f2c07e89ba5846b95/e07e9/va69m_black_26.jpg 200w,/static/e4d69de17088434f2c07e89ba5846b95/066f9/va69m_black_26.jpg 400w,/static/e4d69de17088434f2c07e89ba5846b95/4b190/va69m_black_26.jpg 800w,/static/e4d69de17088434f2c07e89ba5846b95/e5166/va69m_black_26.jpg 1200w,/static/e4d69de17088434f2c07e89ba5846b95/b17f8/va69m_black_26.jpg 1600w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Add HTTP/2 and HSTS to your Nginx site]]></title><description><![CDATA[HTTP/2 has only been out a for a few years but it is certainly time to activate it on your sites now. Compared to the old HTTP 1.1 there are many pros. Requests are downloaded parallel instead of in a queue, greatly improving speed and…]]></description><link>https://samuelsson.dev/add-http2-and-hsts-to-your-nginx-site/</link><guid isPermaLink="false">https://samuelsson.dev/add-http2-and-hsts-to-your-nginx-site/</guid><pubDate>Tue, 27 Nov 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;HTTP/2 has only been out a for a few years but it is certainly time to activate it on your sites now. Compared to the old HTTP 1.1 there are many pros. Requests are downloaded parallel instead of in a queue, greatly improving speed and performance for content heavy sites. As well as compressed headers and pages being transferred as binary instead of text, for example.&lt;/p&gt;&lt;p&gt;Open the server block config for your site:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt; /etc/nginx/sites-available/example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There you need to find the listen arguments that looks like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;[...]
    listen [::]:443 ssl ipv6only=on; 
    listen 443 ssl; 
[...]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add &lt;code class=&quot;language-text&quot;&gt;http2&lt;/code&gt; to these lines so it looks like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;[...]
    listen [::]:443 ssl http2 ipv6only=on; 
    listen 443 ssl http2; 
[...]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will tell the browser to use HTTP/2 instead of HTTP 1.1, as long as the client supports it.&lt;/p&gt;&lt;p&gt;After editing Nginx configuration files you should always check if they are valid and without errors. To do that we type &lt;code class=&quot;language-text&quot;&gt;sudo nginx -t&lt;/code&gt;.&lt;/p&gt;&lt;h2&gt;Update the ciphers&lt;/h2&gt;&lt;p&gt;The ciphers initially added by Certbot (located at &lt;code class=&quot;language-text&quot;&gt;/etc/letsencrypt/options-ssl-nginx.conf&lt;/code&gt;) are not secure enough for HTTP/2 and we need to add other ciphers.&lt;/p&gt;&lt;p&gt;Let’s stop using the one from Certbot and add a new one by editing our block config file.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt; /etc/nginx/sites-available/example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we need to comment out or remove the line including the Certbot ciphers and then define our own. We can do that in the same file at the moment&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# include /etc/letsencrypt/options-ssl-nginx.conf;&lt;/span&gt;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;MD5&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And once again we need test our config with &lt;code class=&quot;language-text&quot;&gt;sudo nginx -t&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;If everything went well and you didn’t get any errors you need to reload Nginx.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; systemctl reload nginx&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To test that everything is working correctly we can type &lt;code class=&quot;language-text&quot;&gt;curl -I -L https://example.com&lt;/code&gt; in any terminal. You should see something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;HTTP/2 200
server: nginx
date: Tue, 20 Nov 2018 12:10:00 GMT
content-type: text/html
content-length: 6704
last-modified: Tue, 20 Nov 2018 12:00:00 GMT
etag: &amp;quot;123aaa456-10ab&amp;quot;
accept-ranges: bytes&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first line indicates that the response returned a 200 (success) over HTTP/2.&lt;/p&gt;&lt;h2&gt;Enable HSTS&lt;/h2&gt;&lt;p&gt;Normally a first-time user would access your site with a normal HTTP request, just typing the URL in the address bar without specifying a protocol. That request will point to port 80 over HTTP and the web server will then redirect to HTTPS with a 301. This could potentially be vulnerable to a man-in-the-middle (MITM) attack. We can avoid those redirects by adding a &lt;em&gt;HTTP Strict Transport Security&lt;/em&gt; header. This will instead result in a 307, an &lt;em&gt;Internal Redirect&lt;/em&gt;, to HTTPS. Much safer 👊🏻&lt;/p&gt;&lt;p&gt;Open &lt;code class=&quot;language-text&quot;&gt;/etc/nginx/sites-available/example.com&lt;/code&gt; and add this inside the server block (the main block with the SSL config):&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;add_header Strict-Transport-Security &amp;quot;max-age=15768000; includeSubDomains&amp;quot; always;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;max-age&lt;/code&gt; tells the browser to cache this, in seconds. 6 months in this case.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;includeSubDomains&lt;/code&gt; tells  the browser that this also applies to all sub domains, such as &lt;code class=&quot;language-text&quot;&gt;www.example.com&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;always&lt;/code&gt; means the header is set for all responses, including errors.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;And by now you know the deal, &lt;code class=&quot;language-text&quot;&gt;sudo nginx -t&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;sudo systemctl reload nginx&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Visit your site and check if everything is working. Open the &lt;em&gt;dev tools&lt;/em&gt; and under the network tab you should now see that requests are sent over HTTP/2 instead.&lt;/p&gt;&lt;p&gt;You can also test your site over at &lt;a href=&quot;https://ssllabs.com/ssltest/&quot;&gt;SSL Server Test&lt;/a&gt;. You should get an A+ score now with HTTP/2 and HSTS.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:37.5%;position:relative;bottom:0;left:0;background-image:url(&amp;#x27;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAAAsTAAALEwEAmpwYAAABvElEQVQoz22Q22oTURSG58laCoXSCw+9KIgPIL6DIELQWgXR3iSQGLR6JSK2BrHtbS9sDiVt0UlmkpJJ0qRJmaNJ5rRnPpmpFIr94eOHvff691pL0np9huMxhm2h22aKYdv/oVsWF5bO+AaSO8txGOkG0mw6xXVdCIGA1MMgJAiCa8QihpibCUnfTGYzpPQkhmN9n53uByqjXUIREEURQgiiOEL4gr7VJ9/Pk+1myfVyZHu51De0DWRHJtHUc5HiKMYLPD52M7w+fcCb9kNsT4cIRCTwfA9HdzgaHrFUXWL+YJ6F8kLK3MEcy9VlFEdJAyfuDCmKBH7oUew84qlyj7XmfUzvguSjUIS4vosx1qmf1Vmtr3K7dou7tTusHK6wWF4ko2bSCQPhX3bIP52Y++yNNqkZe1xTDNEMBtY5L09f8az1nLXWOuvtFzxuPuHL4OvlHpNV+iA17DJNu4o2kTn706ZjNZD1KrJeuaJhVFGMQzTjF13zN5ol0zFVek6DjnOCbFZIctqWjPR9UGB3uMmPYZGSVmBbzfNNLVJSi6lfobxlSymw3cqz1X7HZ/UTpd77tC6pT3J+nu/wF4RRNMzbD4D9AAAAAElFTkSuQmCC&amp;#x27;);background-size:cover;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;SSL Server Test with A+ score&quot; title=&quot;SSL Server Test with A+ score&quot; src=&quot;/static/475849d951892dda27a6f8aec61f3c3c/5a190/ssl_server_test_a_plus.png&quot; srcSet=&quot;/static/475849d951892dda27a6f8aec61f3c3c/772e8/ssl_server_test_a_plus.png 200w,/static/475849d951892dda27a6f8aec61f3c3c/e17e5/ssl_server_test_a_plus.png 400w,/static/475849d951892dda27a6f8aec61f3c3c/5a190/ssl_server_test_a_plus.png 800w,/static/475849d951892dda27a6f8aec61f3c3c/e4900/ssl_server_test_a_plus.png 988w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Add HTTPS to Nginx blocks with Let's Encrypt]]></title><description><![CDATA[Browsing the web unencrypted with only HTTP is not recommended anymore and Google recently started to mark all sites without SSL as “not secure” in their browser Chrome. Adding a certificate to your site used to cost money and often meant a…]]></description><link>https://samuelsson.dev/add-https-to-nginx-blocks-with-lets-encrypt/</link><guid isPermaLink="false">https://samuelsson.dev/add-https-to-nginx-blocks-with-lets-encrypt/</guid><pubDate>Mon, 19 Nov 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Browsing the web unencrypted with only HTTP is not recommended anymore and Google recently started to mark all sites without SSL as “not secure” in their browser Chrome. Adding a certificate to your site used to cost money and often meant a lot of work setting up and renew it regularly. But with &lt;em&gt;Let’s Encrypt&lt;/em&gt; it’s the opposite and there really is no excuse for not using HTTPS on your sites anymore.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:29.500000000000004%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Logo of Let&amp;#x27;s Encrypt&quot; title=&quot;Logo of Let&amp;#x27;s Encrypt&quot; src=&quot;/static/fe49f801fad43dd0d417a14dfb00b087/5a190/lets_encrypt.png&quot; srcSet=&quot;/static/fe49f801fad43dd0d417a14dfb00b087/772e8/lets_encrypt.png 200w,/static/fe49f801fad43dd0d417a14dfb00b087/e17e5/lets_encrypt.png 400w,/static/fe49f801fad43dd0d417a14dfb00b087/5a190/lets_encrypt.png 800w,/static/fe49f801fad43dd0d417a14dfb00b087/c1b63/lets_encrypt.png 1200w,/static/fe49f801fad43dd0d417a14dfb00b087/4e814/lets_encrypt.png 1335w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;h2&gt;What is Let’s Encrypt?&lt;/h2&gt;&lt;p&gt;This is best described by Let’s Encrypt themselves on their homepage, specifically:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. It is a service provided by the &lt;a href=&quot;https://letsencrypt.org/isrg/&quot;&gt;Internet Security Research Group (ISRG)&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;We give people the digital certificates they need in order to enable HTTPS (SSL/TLS) for websites, for free, in the most user-friendly way we can. We do this because we want to create a more secure and privacy-respecting Web.
The secret to creativity is knowing how to hide your sources. &lt;/p&gt;&lt;p&gt;— &lt;cite&gt;&lt;a href=&quot;https://letsencrypt.org/about/&quot;&gt;Let&amp;#x27;s Encrypt&lt;/a&gt; 2018-11-19&lt;/cite&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;So instead of paying for your certificates and manage them yourself you can use Let’s Encrypt together with &lt;em&gt;Certbot&lt;/em&gt;, a client for fetching and deploying SSL certificate automatically.&lt;/p&gt;&lt;h2&gt;Install Certbot&lt;/h2&gt;&lt;p&gt;Here I’m using &lt;em&gt;Ubuntu 18.04&lt;/em&gt; and logged in with an account with root privileges. Certbot is available in the default Ubuntu repositories but the developers&amp;#x27; own repository tend to be more up-to-date.&lt;/p&gt;&lt;p&gt;We’ll add the new repository with:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; add-apt-repository ppa:certbot/certbot
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;apt-get&lt;/span&gt; update&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After that we can install Certbot and get the latest, stable version. This is for Nginx.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;apt-get&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; python-certbot-nginx &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Adding certificates to your sites&lt;/h2&gt;&lt;p&gt;Adding a new certificate to a block (site) in Nginx is very easy. It’s just one command for generating, adding to block and enabling auto renewal. Make sure the blocks enabled, otherwise Certbot won&amp;#x27;t find them.&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo certbot --nginx -d example.com -d www.example.com&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Here we are obtaining a certificate and adding it to &lt;code class=&quot;language-text&quot;&gt;example.com&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;www.example.com&lt;/code&gt; as well as automatically setting up everything behind the scenes. The command checks the Nginx blocks configurations for the &lt;code class=&quot;language-text&quot;&gt;server_name&lt;/code&gt; line so you need to make sure they’re the same before adding the cert, like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;[...]
    server_name example.com www.example.com;
[...]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If this is your first time running Certbot you will need to agree to the T&amp;amp;S and register an email address. You will then be asked if you want to redirect all HTTP traffic to HTTPS, which probably is the case if you don’t have an old site that doesn’t support encrypted traffic everywhere.&lt;/p&gt;&lt;p&gt;To see the configuration added to your site you can check out the Nginx block configuration by typing:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;vim&lt;/span&gt; /etc/nginx/sites-available/example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Test your certificates&lt;/h3&gt;&lt;p&gt;We need to make sure that everything is working properly before relaxing and forgetting about SSL certificates (that’s a
good thing, it works all by itself now):&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; certbot renew --dry-run&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will simulate a certificate renewal and hopefully you’ll get no errors. &lt;/p&gt;&lt;p&gt;When your site is live you can also test the certificates on &lt;a href=&quot;https://www.ssllabs.com/ssltest/&quot;&gt;SSL Labs&lt;/a&gt;.&lt;/p&gt;&lt;h2&gt;Remove issued certificates for a domain&lt;/h2&gt;&lt;p&gt;If you don’t want to use one of the issued certificates for a domain anymore it’s easy to remove it.&lt;/p&gt;&lt;p&gt;You can type &lt;code class=&quot;language-text&quot;&gt;sudo certbot delete&lt;/code&gt; and you’ll get a list of deletable certificates.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Which certificate(s) would you like to delete?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: example.com
2: about.example.com
3: blog.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter &amp;#x27;c&amp;#x27; to cancel):&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Just type the index number  and press enter. &lt;/p&gt;&lt;p&gt;You can also delete a certificate directly by typing it like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; certbot delete --cert-name about.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you still want to use the site you should make sure the configuration under &lt;code class=&quot;language-text&quot;&gt;/etc/nginx/sites-available&lt;/code&gt; is still valid and doesn&amp;#x27;t contain anything related to the certificate. &lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to install Nginx and add server blocks]]></title><description><![CDATA[If you’ve been working with web servers for a while you’ve probably heard about Apache. It was pretty much the default solution when setting up a new site on a self hosted server a while back. The classic  LAMP stack , an acronym for Linux…]]></description><link>https://samuelsson.dev/how-to-install-Nginx-and-add-server-blocks/</link><guid isPermaLink="false">https://samuelsson.dev/how-to-install-Nginx-and-add-server-blocks/</guid><pubDate>Sun, 11 Nov 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you’ve been working with web servers for a while you’ve probably heard about Apache. It was pretty much the default solution when setting up a new site on a self hosted server a while back. The classic &lt;em&gt;LAMP stack&lt;/em&gt;, an acronym for Linux, Apache, MySQL and PHP, were used everywhere. Even though Apache definitely has its place it is pretty exhausting to setup with a lot of configuration and for simpler projects Nginx is a nicer solution in my opinion. That doesn’t mean Nginx is only for simple projects, of course. Both have their pros and cons but in this guide we’ll install and setup Nginx on Ubuntu.&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position:relative;display:block;margin-left:auto;margin-right:auto;max-width:800px&quot;&gt;
      &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom:39.49999999999999%;position:relative;bottom:0;left:0;display:block&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Logo of Nginx&quot; title=&quot;Logo of Nginx&quot; src=&quot;/static/36a246c00bf350190c77635d4db81b91/5a190/nginx.png&quot; srcSet=&quot;/static/36a246c00bf350190c77635d4db81b91/772e8/nginx.png 200w,/static/36a246c00bf350190c77635d4db81b91/e17e5/nginx.png 400w,/static/36a246c00bf350190c77635d4db81b91/5a190/nginx.png 800w,/static/36a246c00bf350190c77635d4db81b91/c1b63/nginx.png 1200w,/static/36a246c00bf350190c77635d4db81b91/29007/nginx.png 1600w,/static/36a246c00bf350190c77635d4db81b91/e8950/nginx.png 2000w&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
    &lt;/span&gt;&lt;/p&gt;&lt;h2&gt;Install Nginx&lt;/h2&gt;&lt;p&gt;It only takes about a minute to install Nginx and the configuration is simple and easy to understand. You should be logged in as a non-root user with sudo privileges. Simply run these commands to install:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; update
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; nginx&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That’s it, Nginx is installed and running, you can see if it is active by running this command:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;systemctl status nginx&lt;/code&gt;&lt;/p&gt;&lt;p&gt;You should see something similar like this if everything went well:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;Active: active (running) since Thu 2018-11-02 22:30:00 CET; 2 days ago&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Press &lt;em&gt;Q&lt;/em&gt; to close the status.&lt;/p&gt;&lt;h2&gt;Allow Nginx traffic in the firewall&lt;/h2&gt;&lt;p&gt;Then we need to add a rule to UFW, the Ubuntu firewall, so our web server can receive incoming connections. We wouldn&amp;#x27;t get many visitors if we didn&amp;#x27;t 😉 &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Important!&lt;/strong&gt; If UFW isn’t enabled and you choose to do so it’s very important that you also enable OpenSSH if you are connected over SSH. Otherwise you will lock yourself out of your server.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;When we install Nginx it automatically registers itself with UFW app list so we don’t need to add ports manually. We simply type this:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo ufw allow &amp;#x27;Nginx Full&amp;#x27;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;The &lt;em&gt;Full&lt;/em&gt; keyword means we open up for both HTTP and HTTPS traffic. The reason we also open for HTTP and not only HTTPS is that we can redirect all non-encrypted traffic to our HTTPS page. You don’t need to reload UFW when adding new rules.&lt;/p&gt;&lt;p&gt;If you want to to see all available apps for UFW you can type &lt;code class=&quot;language-text&quot;&gt;sudo ufw app list&lt;/code&gt;. Here you’ll see commands for only HTTP or HTTPS if you want that instead, as well as OpenSSH mentioned above.&lt;/p&gt;&lt;p&gt;Now you should be able to navigate to the external IP of your server in your browser and see a default success page.&lt;/p&gt;&lt;h2&gt;Adding new Nginx blocks&lt;/h2&gt;&lt;p&gt;With Nginx blocks you can serve multiple sites on your server on the same IP address. Apache calls this &lt;em&gt;virtual hosts&lt;/em&gt; and is maybe a little more descriptive of what it is. The default block is the one you’ve already visited, the success page. We’ll add a couple of others and disable the default on.&lt;/p&gt;&lt;p&gt;We’ll set up two sites in this tutorial, example.com and blog.example.com.&lt;/p&gt;&lt;h3&gt;Directory structure for the new blocks&lt;/h3&gt;&lt;p&gt;You can place the files for your sites wherever you want but for simplictly we’ll use the default location, &lt;code class=&quot;language-text&quot;&gt;/var/www/&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Let’s create the new directories for our new blocks:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; -p /var/www/example.com/html
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; -p /var/www/blog.example.com/html&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we need to change the ownership of the directories so we can manage the files later on. You can create a user only for this but the currently logged in user is probably fine.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;chown&lt;/span&gt; -R &lt;span class=&quot;token environment constant&quot;&gt;$USER&lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token environment constant&quot;&gt;$USER&lt;/span&gt; /var/www/example.com
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;chown&lt;/span&gt; -R &lt;span class=&quot;token environment constant&quot;&gt;$USER&lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token environment constant&quot;&gt;$USER&lt;/span&gt; /var/www/blog.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we’ll create a placeholder index.html and fill it with some text.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;hello&amp;quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /var/www/example.com/html/index.html
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;quot;hello again&amp;quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /var/www/blog.example.com/html/index.html&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Enable the blocks in Nginx&lt;/h3&gt;&lt;p&gt;First navigate to &lt;code class=&quot;language-text&quot;&gt;/etc/nginx&lt;/code&gt; and type &lt;code class=&quot;language-text&quot;&gt;ls -l&lt;/code&gt; to se the content in that directory. There are two directories we are going to work with here.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;sites-available&lt;/code&gt; contains all the configurations for our blocks. A rule of thumb here is one file for each block. As the name sugests the configs placed here are not activated but rather available for us.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;sites-enabled&lt;/code&gt; are used when we want to enable a certain block and make it activated in Nginx. This directory only contains symlinks of the directories in &lt;em&gt;sites-available&lt;/em&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Lets add our first block to available-sites by typing:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo vim /etc/nginx/sites-available/example.com&lt;/code&gt;&lt;/p&gt;&lt;p&gt;And we&amp;#x27;ll add something like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;nginx&quot;&gt;&lt;pre class=&quot;language-nginx&quot;&gt;&lt;code class=&quot;language-nginx&quot;&gt;&lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;server&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;80&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;listen&lt;/span&gt; [::]:80&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;root&lt;/span&gt; /var/www/example.com/html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;index&lt;/span&gt; index.html index.htm&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;server_name&lt;/span&gt; example.com www.example.com&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;access_log&lt;/span&gt; /var/log/nginx/example.com/access.log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;error_log&lt;/span&gt; /var/log/nginx/example.com/error.log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;error_page&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;404&lt;/span&gt; /404.html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;location&lt;/span&gt; = /404.html&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;internal&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;location&lt;/span&gt; /&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token directive&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;try_files&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$uri&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$uri&lt;/span&gt;/ =404&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;listen&lt;/code&gt; is what port we want to use, 80 is default HTTP. We’ll add HTTPS in a later step so leave it at 80 for now.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;root&lt;/code&gt; is the location of the root directory of our site, where we created the &lt;em&gt;index.html&lt;/em&gt;.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;index&lt;/code&gt; is the full name of the index file used in the root directory.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;server_name&lt;/code&gt; is the domain names used for this block. This way Nginx knows which block to use when a user types a URL in their browser. &lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;access_log&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;error_log&lt;/code&gt; is used to separate the logs from the other blocks. This is optional but really recommended to keep the logs readable.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;error_page&lt;/code&gt; is also optional if you want to display a 404 page if the original page isn’t found. Create a 404.html file and place it in your root folder.&lt;/li&gt;&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;location&lt;/code&gt; telling Nginx to try to serve a request as a file, then a directory or if none is found a 404.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Repeat the procedure but for the other block:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo vim /etc/nginx/sites-available/blog.example.com&lt;/code&gt;&lt;/p&gt;&lt;h3&gt;Manage separate logs for each block&lt;/h3&gt;&lt;p&gt;Because we’ve changed the path for the logs we also need to create the new directories. &lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; -p /var/log/nginx/example.com/
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; -p /var/log/nginx/blog.example.com/

&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;chown&lt;/span&gt; -R www-data:adm /var/log/nginx/example.com/
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;chown&lt;/span&gt; -R www-data:adm /var/log/nginx/blog.example.com/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The default logs, located under &lt;code class=&quot;language-text&quot;&gt;/var/log/nginx&lt;/code&gt;, rotate once every day and only the latest 14 are kept. If we don&amp;#x27;t add a &lt;em&gt;logrotate&lt;/em&gt; to our new blocks they will grow in size until our disk is full. That will happen in no time because your sites will be very popular, right? 🤗&lt;/p&gt;&lt;p&gt;Let&amp;#x27;s open the logrotate config file for Nginx by typing:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo vim /etc/logrotate.d/nginx&lt;/code&gt;&lt;/p&gt;&lt;p&gt;You&amp;#x27;ll see something similar to this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;/var/log/nginx/*.log {
    daily
    missingok
    rotate 14
    compress
    delaycompress
    notifempty
    create 0640 www-data adm
    sharedscripts
    prerotate
        if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
            run-parts /etc/logrotate.d/httpd-prerotate; \
        fi \
    endscript
    postrotate
        invoke-rc.d nginx rotate &amp;gt;/dev/null 2&amp;gt;&amp;amp;1
    endscript
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first line is where the logs are located, the asterisk means all log files in the nginx folder. We added a sub folder here so we could create new blocks for each subfolder but if all the settings are the same we can extend the current one. We&amp;#x27;ll do that by changing the first line to this:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;/var/log/nginx/*.log /var/log/nginx/*/*.log {&lt;/code&gt;&lt;/p&gt;&lt;p&gt;That means all log files in the nginx folder as well as all log files in sufolders one level deep. We can also change &lt;code class=&quot;language-text&quot;&gt;rotate&lt;/code&gt; if we want to keep more or fewer logs and &lt;code class=&quot;language-text&quot;&gt;daily&lt;/code&gt; can be change to &lt;code class=&quot;language-text&quot;&gt;weekly&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;monthly&lt;/code&gt;, for example.&lt;/p&gt;&lt;p&gt;No reload is necessary because they are a scheduled work run daily with crontab. You can make sure your file pattern matches your subfolders by typing:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo logrotate /etc/logrotate.conf --debug&lt;/code&gt;&lt;/p&gt;&lt;h3&gt;Enable the blocks and restart&lt;/h3&gt;&lt;p&gt;Now we just need to enable our blocks by symlinking them into &lt;code class=&quot;language-text&quot;&gt;sites-enabled&lt;/code&gt;&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ln&lt;/span&gt; -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ln&lt;/span&gt; -s /etc/nginx/sites-available/blog.example.com /etc/nginx/sites-enabled/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To see if our config files are valid and don’t contain errors we can test them with:&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo nginx -t&lt;/code&gt;&lt;/p&gt;&lt;p&gt;If there are no errors we’ll restart Nginx and our sites should be up and running.&lt;/p&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;sudo systemctl restart nginx&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Next step is to enable HTTPS, which you can read about &lt;a href=&quot;/add-https-to-nginx-blocks-with-lets-encrypt&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Generate and organize SSH keys on Mac]]></title><description><![CDATA[If you've never heard about SSH keys and are still using passwords when logging in to your remote servers you're in for a treat. Or maybe you already know about SSH keys but aren't organizing them in a good way. Anyway this post will make…]]></description><link>https://samuelsson.dev/generate-and-organize-ssh-keys-on-mac/</link><guid isPermaLink="false">https://samuelsson.dev/generate-and-organize-ssh-keys-on-mac/</guid><pubDate>Thu, 08 Nov 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you&amp;#x27;ve never heard about SSH keys and are still using passwords when logging in to your remote servers you&amp;#x27;re in for a treat. Or maybe you already know about SSH keys but aren&amp;#x27;t organizing them in a good way. Anyway this post will make you an SSH key pro and you will have full control over all your keys.&lt;/p&gt;&lt;p&gt;If you want to know more about how SSH keys work there are plenty of guides out there. But a good and simple example I like is to think of the server as a locker. You can, and should, put a padlock on the locker to keep bad persons out of it. If you choose a padlock with a code it&amp;#x27;s very convenient and you can access it whenever you want, even if you don&amp;#x27;t have a key. Unfortunately someone can see the correct code when it&amp;#x27;s being entered or even guessed if given enough tries. If you instead use a real key it is much safer because only those with a correct key can open the locker. An SSH key is exactly that, but just a file on your computer, that will unlock and grant you access to different hosts.&lt;/p&gt;&lt;p&gt;It would be easy to only generate a single key and use it for all servers but if you lose the key you would put all the servers at risk. If using the same metaphor as above you then need to change the padlocks on all lockers. If only storing your keys in a single place (i.e. your laptop) it is not as important compared to storing them on many (phone, tablet, work computer and other laptops). That&amp;#x27;s an increased risk of losing one or many of your keys. For the sake of this guide we will generate and organize one for each host.&lt;/p&gt;&lt;p&gt;In this guide we will create separate keys for three different hosts/environments. We will be using a real world example so the hosts will be &lt;em&gt;GitLab&lt;/em&gt;, &lt;em&gt;VPS&lt;/em&gt; and your &lt;em&gt;LAN&lt;/em&gt;.&lt;/p&gt;&lt;h2&gt;Generating the keys&lt;/h2&gt;&lt;p&gt;We&amp;#x27;ll start with the key for GitLab. The only thing you need to do to generate a key is to open your terminal and type this command:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;ssh-keygen -t rsa -b &lt;span class=&quot;token number&quot;&gt;4096&lt;/span&gt; -C &lt;span class=&quot;token string&quot;&gt;&amp;quot;An optional comment&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This generates a new key and as a comment you can add something descriptive for what it&amp;#x27;s going to be used for or the account email for example.&lt;/p&gt;&lt;p&gt;You will be prompted to answer some question after entering the command, lets see with what.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;The first one is where you want to save the file and with what filename. We want to save it to the default location (home folder) but we want to change the name so we can identify it being used for GitLab. We&amp;#x27;ll do that by entering &lt;code class=&quot;language-text&quot;&gt;~/.ssh/id_rsa_gitlab&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The other one is an optional password when using the key, adding an extra layer of security if someone steals it. This is highly recommended so just do it 👍🏻. You will need to enter it twice and nothing will be displayed in the terminal while typing it.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To make sure your key was generated successfully type &lt;code class=&quot;language-text&quot;&gt;ls -l ~/.ssh&lt;/code&gt;. You should see something similar to this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;-rw-------   1 samuelsson  staff  3326 Jan  1 10:15 id_rsa_gitlab
-rw-r--r--   1 samuelsson  staff   751 Jan  1 10:15 id_rsa_gitlab.pub&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will now see two files. The first file, named &lt;code class=&quot;language-text&quot;&gt;id_rsa_gitlab&lt;/code&gt; is your private key. Protect it with your life, or at least keep it safe in your ssh folder and don&amp;#x27;t share it. The other file, &lt;code class=&quot;language-text&quot;&gt;id_rsa_gitlab.pub&lt;/code&gt; is your public key. The public key can be shared and uploaded to the host, so the host knows you can use your private key to connect to it. Like a key and a keyhole.&lt;/p&gt;&lt;p&gt;Now do the same thing again but for the other hosts, we&amp;#x27;ll call the new keys &lt;code class=&quot;language-text&quot;&gt;id_rsa_lan&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;id_rsa_do&lt;/code&gt; (do for DigitalOcean).&lt;/p&gt;&lt;p&gt;If you run &lt;code class=&quot;language-text&quot;&gt;ls -l ~/.ssh&lt;/code&gt; you should see six files:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;-rw-------   1 samuelsson  staff  3326 Jan  1 10:20 id_rsa_do
-rw-r--r--   1 samuelsson  staff   751 Jan  1 10:20 id_rsa_do.pub
-rw-------   1 samuelsson  staff  3326 Jan  1 10:15 id_rsa_gitlab
-rw-r--r--   1 samuelsson  staff   751 Jan  1 10:15 id_rsa_gitlab.pub
-rw-------   1 samuelsson  staff  3326 Jan  1 10:25 id_rsa_lan
-rw-r--r--   1 samuelsson  staff   751 Jan  1 10:25 id_rsa_lan.pub&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Organizing the keys&lt;/h2&gt;&lt;p&gt;To organize our keys and set what hosts they should be used for we need a config file in our SSH folder. We create and start editing the file by typing &lt;code class=&quot;language-text&quot;&gt;vim ~/.ssh/config&lt;/code&gt;. This will open an editor where we first will add the configuration for DigitalOcean.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Personal homepage on DigitalOcean&lt;/span&gt;
Host homepage &lt;span class=&quot;token number&quot;&gt;10.123&lt;/span&gt;.123.123 example.com
    User john
    Hostname &lt;span class=&quot;token number&quot;&gt;10.123&lt;/span&gt;.123.123
    Port &lt;span class=&quot;token number&quot;&gt;12312&lt;/span&gt;
    AddKeysToAgent &lt;span class=&quot;token function&quot;&gt;yes&lt;/span&gt;
    UseKeychain &lt;span class=&quot;token function&quot;&gt;yes&lt;/span&gt;
    IdentityFile ~/.ssh/id_rsa_do&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There are a lot of properties here, I&amp;#x27;ll desbribe each one of them.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;Host&lt;/code&gt; - This is what you will call your host when connecting to it over SSH, this can be anything actually but should be something that is unique for the host. Like a label and you can add as many you like, separated with a space.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;User&lt;/code&gt; is what remote user you want to authenticate as when connecting to the server. If left out you need to specify it when connecting instead.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;Hostname&lt;/code&gt; is the real address used for connecting to the host. Because we&amp;#x27;ve specified &amp;quot;homepage&amp;quot; as a custom host our client needs to know what it really should point to. This could be an IP address or a domain.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;Port&lt;/code&gt; is only needed if the SSH server is listening on another port than the default one, port 22. So normally you can leave this out unless you&amp;#x27;ve changed the port on the server.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;AddKeysToAgent&lt;/code&gt; - To be able to use the key when connecting to servers we need to add it to the SSH Agent. The agent keeps track of all our keys and their passphrases so we don&amp;#x27;t need to manually add the key every time we reboot.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;UseKeychain&lt;/code&gt; - For convenience we can save the key passphrase in the Mac OS keychain so we don&amp;#x27;t need to type it every time we want to use it. Not mandatory but it will make your life easier if connecting to many servers.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;IdentityFile&lt;/code&gt; is the path to the private key we want to use for this particular host. So we are using the correct key when connecting and not just the first one in the SSH folder.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Adding a Host for GitLab is pretty much the same expect the User is the same for everyone and the HostName is not an IP. This will be used when working with git and not connecting to a server directly.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# GitLab with all my cool repositories&lt;/span&gt;
Host gitlab.com
    User &lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt;
    Hostname gitlab.com
    AddKeysToAgent &lt;span class=&quot;token function&quot;&gt;yes&lt;/span&gt;
    UseKeychain &lt;span class=&quot;token function&quot;&gt;yes&lt;/span&gt;
    IdentityFile ~/.ssh/id_rsa_gitlab&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Lets add some configurations for the LAN now. This is a little more fun, some new stuff here.&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# My local servers and devices at home&lt;/span&gt;
Host homeserver.local &lt;span class=&quot;token number&quot;&gt;192.168&lt;/span&gt;.1.20
    User server
    HostName &lt;span class=&quot;token number&quot;&gt;192.168&lt;/span&gt;.1.20
    Port &lt;span class=&quot;token number&quot;&gt;22222&lt;/span&gt;

Host htpc.local &lt;span class=&quot;token number&quot;&gt;192.168&lt;/span&gt;.1.21
    User kodi
    HostName &lt;span class=&quot;token number&quot;&gt;192.168&lt;/span&gt;.1.21

Host *.local &lt;span class=&quot;token number&quot;&gt;192.168&lt;/span&gt;.1.*
    AddKeysToAgent &lt;span class=&quot;token function&quot;&gt;yes&lt;/span&gt;
    UseKeychain &lt;span class=&quot;token function&quot;&gt;yes&lt;/span&gt;
    IdentityFile ~/.ssh/id_rsa_local&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here we&amp;#x27;ve created three hosts. The first two are for actual hosts with specific properties like username and their IP addresses, nothing new. Instead of specifying properties that are the same for all hosts we now have a fallback one. When connecting to a certain host all configs that match the Host pattern will be loaded. That&amp;#x27;s why we need those wildcards, &lt;code class=&quot;language-text&quot;&gt;*&lt;/code&gt;.&lt;/p&gt;&lt;h2&gt;When connecting over SSH&lt;/h2&gt;&lt;p&gt;If connecting to a host without this set up you would need to type something like this to connect to your host:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; john@10.123.123.123 -i ~/.ssh/id_rsa_do -p &lt;span class=&quot;token number&quot;&gt;12312&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then followed by the password for your private key. Not easy to remember or type, right? After our configuration it is much easier to connect, we only need to type this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; homepage&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Everything is taken care of by our configuration. What hostname to use for &amp;quot;homepage&amp;quot; is resolved and username and port is set. We also save the password for the key so we don&amp;#x27;t need to type it every time.&lt;/p&gt;&lt;p&gt;When connecting to a local server in you network you can of course add and use a Host like we did with &lt;code class=&quot;language-text&quot;&gt;homeserver.local&lt;/code&gt; but because we have a wildcard you don&amp;#x27;t need to specify all hosts in your config. You still need to specify a User and a valid HostName such as the IP (or a .local address if setup in your DNS settings) when connecting though. Like this:&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; bob@192.168.1.22&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or&lt;/p&gt;&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; bob@toothbrush.local&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;Backing up the keys&lt;/h2&gt;&lt;p&gt;As I&amp;#x27;ve mentioned before you should keep those private keys protected and safe, they are called private for a reason. That means you &lt;strong&gt;should not&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Upload them to a git repository.&lt;/li&gt;&lt;li&gt;Store them on Google Drive or similar.&lt;/li&gt;&lt;li&gt;Put them in a password manager if you also save the passphrases there.&lt;/li&gt;&lt;li&gt;Send them to yourself in a way that stores them remotely (like e-mail).&lt;/li&gt;&lt;li&gt;Traditional backup solutions like external hard drives and USB flash drives.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;What you should do is put them on an encrypted flash drive and store it in a safe. If that&amp;#x27;s not possible you can store them in your password manager as long as you don&amp;#x27;t also store the passphrases there as well.&lt;/p&gt;</content:encoded></item></channel></rss>